This question is not answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 103 - Pages: 7 [ Previous | 1 2 3 4 5 6 | Next ] - Last Post: 23 Jul 19, 15:33 Last Post By: AndreWolff
RobM

Posts: 4,153
Registered: 4-Aug-2006
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 15 Jul 19, 23:38   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
I have updated my tool to fix the Google map link error and also to populate more variables, using your video as an example:
gpsLocation=+52.253,+6.1657
gpsLatitude=+52° 15 '10.8
gpsLongitude=+6° 9 '56.52
gMap=https://www.google.com/maps/?q=+52.253,+6.1657

Like any jAlbum variable you can use them as
${gpsLongitude} or <%=gpsLongitude%>
RobM

Posts: 4,153
Registered: 4-Aug-2006
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 15 Jul 19, 23:44   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
If there is some standard for embedding GPS coordinates within videos, post a feature request for the ability to extract these coordinates to the maintainers of the Metadata-extractor library (The Github page for Metadata-extractor)
There is already a post for GPS from mp4 videos:
https://github.com/drewnoakes/metadata-extractor/issues/127
No mention about any other video formats though.
AndreWolff

Posts: 2,349
Registered: 14-Dec-2007
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 09:37   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Attachment Test_2MB.mp4 (2.5 MB)
RobM wrote:
I have updated my tool to fix the Google map link error and also to populate more variables, using your video as an example:
Yes that works better!

I tested your tool with several videos, but I think there is a still a problem in case the video does not contains GPS coordinates:
If I use your tool with the attached video, which probably does not contain gps coordinates, the string in the clipboard shows the location of the last video which did contain gps coordinates.

So I think you should first remove the previous coordinates before you investigates a new video.

But I still can't use your code in automatic mode: I don't know how to call it like I said above:
<ja:if test="<%=fileCategory ==  Category.video %>
  Fill_gpsLatitude();
  </ja:if>
and the two pop-ups should be suppressed in automatic mode.
RobM

Posts: 4,153
Registered: 4-Aug-2006
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 10:28   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
I tested your tool with several videos, but I think there is a still a problem in case the video does not contains GPS coordinates:
If I use your tool with the attached video, which probably does not contain gps coordinates, the string in the clipboard shows the location of the last video which did contain gps coordinates.

So I think you should first remove the previous coordinates before you investigates a new video.

I’ll look at that tonight, maybe if no gps data set the clipboard to ‘No GPS’ instead of leaving it unchanged.
But I still can't use your code in automatic mode: I don't know how to call it like I said above:
<ja:if test="<%=fileCategory ==  Category.video %>
  Fill_gpsLatitude();
  </ja:if>
and the two pop-ups should be suppressed in automatic mode.
What do you mean by ‘Automatic mode’?
You can’t call the tool from within a skin, the jAlbum user has to select a video within a project and then run the tool. If a skin makes use of jAlbum variables for gps then the skin will use the extracted gps data.

If you want to incorporate the tool in to a skin then the code from the tool would need to go in init.bsh and be modified to process all videos. You can see how to do that with my images to video tool, but it is not something I want to do.
AndreWolff

Posts: 2,349
Registered: 14-Dec-2007
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 11:05   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
I’ll look at that tonight, maybe if no gps data set the clipboard to ‘No GPS’ instead of leaving it unchanged.
I think it should be compatible with camera data, so gpsLatitude should be void and the clipboard should be empty.

What do you mean by ‘Automatic mode’?
I want to incorporate the tool into my skins.

If you want to incorporate the tool in to a skin then the code from the tool would need to go in init.bsh and be modified to process all videos. You can see how to do that with my images to video tool, but it is not something I want to do.
It is a pity that you or David don't want to do that, because in that case the request of this thread was implemented!
davidekholm

Posts: 4,307
Registered: 18-Oct-2002
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 11:37   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
davidekholm wrote:
If there is some standard for embedding GPS coordinates within videos, post a feature request for the ability to extract these coordinates to the maintainers of the Metadata-extractor library (The Github page for Metadata-extractor)
Why do you need a standard if the code of Rob can already extract the gps coordinates from a video?

It's not particularly clean to have to rely on an external executable for this. Better to have the Metadata-extractor library updated to handle this.
AndreWolff

Posts: 2,349
Registered: 14-Dec-2007
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 12:18   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
It's not particularly clean to have to rely on an external executable for this. Better to have the Metadata-extractor library updated to handle this.
Sure, but if the Metadata-extractor library can’t be updated yet, why can’t you modify Robs code to use it internally in the jAlbum program?
davidekholm

Posts: 4,307
Registered: 18-Oct-2002
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 12:26   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
davidekholm wrote:
It's not particularly clean to have to rely on an external executable for this. Better to have the Metadata-extractor library updated to handle this.
Sure, but if the Metadata-extractor library can’t be updated yet, why can’t you modify Robs code to use it internally in the jAlbum program?
Because it uses exiftool under the hood which adds complexity and dependencies I wish to avoid. We have enough support cases anyway.
RobM

Posts: 4,153
Registered: 4-Aug-2006
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 15:00   in response to: AndreWolff in response to: AndreWolff
Helpful
  Click to reply to this thread Reply
AndreWolff wrote:
It is a pity that you or David don't want to do that, because in that case the request of this thread was implemented!
The tool can easily be run by the end user, if they want to have gps data/maps for their videos. A skin developer then just needs to access the metadata the same way they do for images, that is check for the gps variables existing. That seems a much easier way, currently, for skin developers to support video gps.
AndreWolff

Posts: 2,349
Registered: 14-Dec-2007
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 15:26   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Attachment NoLocation.PNG (347.7 KB)
RobM wrote:
The tool can easily be run by the end user, if they want to have gps data/maps for their videos. A skin developer then just needs to access the metadata the same way they do for images, that is check for the gps variables existing. That seems a much easier way, currently, for skin developers to support video gps.
Rob, I don't understand what you mean:

I use your tool for all the videos in the album, with as result that some user variables are added, see enclosed screenshot.
But you see too that the location window does not show the location.
Next I make the album and retrieve the GPS coordinates with code like this:
var gMap = [<ja:fileiterator start="0" >
 <ja:if exists="gpsLatitude">
  <%
  loc= getLocation();
  %>
'${loc}',
 </ja:if>
 <ja:else>'',</ja:else></ja:fileiterator>
];
and see that the gMap enties for videos are still empty. So it does not work.

Edit:

It works if I change the code into:
var gMap = [<ja:fileiterator start="0" >
'${gpsLocation}',
</ja:fileiterator>
];
See this video test album.

The video creation date is made with this code:
   bv= meta.get("Date/Time Original"); 
   if ((bv == void)||(bv == null))  bv= meta.get("Quicktime video.Creation Time");
   if ((bv == void)||(bv == null))  bv= meta.get("Mp4 video.Creation Time");
   if ((bv != void)&&(bv != null) && bv.startsWith("Fri Jan 01 00:00:00")) bv= meta.get("File.File Modified Date");
   if ((bv != void)&&(bv != null))  {
     DT= getText("expDate") + ": " + bv +", "; 
   }


Thanks for your help!

Edited by: AndreWolff on 16-Jul-2019 15:51
RobM

Posts: 4,153
Registered: 4-Aug-2006
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 16:42   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
I use your tool for all the videos in the album, with as result that some user variables are added, see enclosed screenshot.
That is correct, you get access to those four variables.
But you see too that the location window does not show the location.
It won’t, location tagging only works with images.
Edit:
It works if I change the code into:
var gMap = [<ja:fileiterator start="0" >
'${gpsLocation}',
</ja:fileiterator>
];
See this video test album.
That is correct, you just pick the gps variable(s) your skin uses and use it.
Thanks for your help!
There will be another update tonight to increase the accuracy, from two to four decimal places, for the decimal seconds value.
AndreWolff

Posts: 2,349
Registered: 14-Dec-2007
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 17:00   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
For the creation code I use now this code:
  bv= meta.get("Date/Time Original");
  if ((bv == void)||(bv == null)) {  /* Video? */
	bv= meta.get("Quicktime video.Creation Time");
	if ((bv == void)||(bv == null))  bv= meta.get("Mp4 video.Creation Time");
	if ((bv != void)&&(bv != null) && bv.startsWith("Fri Jan 01 00:00:00")) bv= meta.get("File.File Modified Date"); 
  }
  if ((bv != void)&&(bv != null))  {
     DT= getText("expDate") + ": " + bv +", "; 
   }
But this is still not correct because the 2nd video in this album reports as creation date 'Sun Sept 11', but the meta data contains these lines:
Quicktime sound.Creation Time=Mon May 06 10:41:09 CEST 2013, 
Quicktime video.Creation Time=Sun Sep 11 07:44:02 CEST 2011, 
So the sound is created 5 days earlier on 'Mon May 06 '!!

To solve this I changed the code into:
  bv= meta.get("Date/Time Original");
  if ((bv == void)||(bv == null)) {  /* Video? */
  	bv= meta.get("Quicktime.Creation Time");
	if ((bv == void)||(bv == null))  bv= meta.get("Quicktime video.Creation Time");
	if ((bv == void)||(bv == null))  bv= meta.get("Mp4 video.Creation Time");
	if ((bv != void)&&(bv != null) && bv.startsWith("Fri Jan 01 00:00:00")) bv= meta.get("File.File Modified Date"); 
  }
  if ((bv != void)&&(bv != null))  {
     DT= getText("expDate") + ": " + bv +", "; 
   }


Edited by: AndreWolff on 16-Jul-2019 17:17
JeffTucker

Posts: 8,237
Registered: 31-Jan-2006
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 17:32   in response to: AndreWolff in response to: AndreWolff
 
  Click to reply to this thread Reply
AndreWolff wrote:
But this is still not correct because the 2nd video in this album reports as creation date 'Sun Sept 11', but the meta data contains these lines:
Quicktime sound.Creation Time=Mon May 06 10:41:09 CEST 2013, 
Quicktime video.Creation Time=Sun Sep 11 07:44:02 CEST 2011, 
So the sound is created 5 days earlier on 'Mon May 06 '!!

Look at the year.
AndreWolff

Posts: 2,349
Registered: 14-Dec-2007
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 16 Jul 19, 18:37   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
jGromit wrote:
Look at the year.
Yes indeed, the difference is larger.

But something strange is going on:

The 2nd image IMG_0205.mp4 shows:
Quicktime sound.Creation Time=Mon May 06 10:41:09 CEST 2013, 
Quicktime video.Creation Time=Sun Sep 11 07:44:02 CEST 2011, 
Quicktime.Creation Time=Sun Sep 11 07:44:02 +02:00 2011,
But the preceding image IMG_0877.mp4 shows the same date:
Quicktime.Creation Time=Mon May 06 10:41:09 +02:00 2013, 
Quicktime sound.Modification Time=Mon May 06 10:41:21 CEST 2013,
So I wonder goes something wrong with fetching the meta data?
RobM

Posts: 4,153
Registered: 4-Aug-2006
Re: Make it possible to add GPS coordinates to movies and pictures in jAlbum
Posted: 17 Jul 19, 00:11   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
There will be another update tonight to increase the accuracy, from two to four decimal places, for the decimal seconds value.
New file uploaded, fixed accuracy, changed grep to properly remove any number of leading zeros from latitude or longitude.

After processing a dialogue shows the results of the extraction.

Clipboard will show 'No GPS data to extract' if there is no data, before it showed the previous contents of the clipboard.

Usage details here
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums