Video files and GPS/Location metadata

Started by Carlo Didier, January 05, 2015, 03:49:08 PM

Previous topic - Next topic

Carlo Didier

Does anyone have a solution to add GPS and location information to video files (.mov, .avi, .mp4)?

Mario

There is only GPS data (part of EXIF) and XMP.
Video files support neither EXIF nor GPS, but XMP. Did you try to map a video file in IMatch?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Carlo Didier

Hey, mapping them works in iMatch! I was using Geosetter and it won't even show the video files.

dcb

In GeoSetter you need to add the file extension from the preferences. It will then read/write from an xmp sidecar file. One entry is required for each file extension. I've been doing it that way for years.
Have you backed up your photos today?

Carlo Didier

Quote from: dcb on January 13, 2015, 02:35:53 AM
In GeoSetter you need to add the file extension from the preferences. It will then read/write from an xmp sidecar file. One entry is required for each file extension. I've been doing it that way for years.

Good tip!
Thanks!

rainforest1155

Quote from: Mario on January 05, 2015, 03:57:28 PM
There is only GPS data (part of EXIF) and XMP.
Video files support neither EXIF nor GPS, but XMP. Did you try to map a video file in IMatch?
For videos recorded with my iPad Air 2 IMatch does import metadata that also includes the GPS location. I've attached ExifTool Command Processor List Metadata dumps (-G1 -all {Files}) for a sample video.
I understand that this may not apply to other devices, but the structure seems to be at least the same across other Apple devices: I also looked at videos from my iPhone 4 and they're showing the same metadata for the GPS location. The videos I looked at were taken with different iOS versions (5.1.1 and 7.0.6 using iPhone 4, and 8.1 using iPad Air 2).

I'd be happy to provide more details if needed.

Sebastian

[attachment deleted by admin]

Mario

Do you mean the proprietary GPS coordinates in the Apple QuickTime namespace?
This cannot be used by IMatch. The Map Panel and all geo-related functionality in IMatch is currently based on the XMP/EXIF GPS standard coordinates.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rainforest1155

No worries. It would be a nice thing to have in a future update.

Mario

You can use a metadata template to copy the Apple GPS data into the 'real' XMP GPS data. IMatch then will automatically locate the file on the Map.

I have no documentation about what Apple stores in these tags and I have no sample files. Can you create some small videos with GPS data and upload them somewhere?

What happens if you move around while you film? Which coordinates are stored in the file? Or are there multiple sets of coordinates stored, like, waypoints?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rainforest1155

I tried a metadata template like this:
XMP::exif\GPSAltitude filled with {File.MD.Composite\GPSAltitude\GPSAltitude\0}
XMP::exif\GPSAltitudeRef filled with {File.MD.Composite\GPSAltitudeRef\GPSAltitudeRef\0}
XMP::exif\GPSLatitude filled with {File.MD.Composite\GPSLatitude\GPSLatitude\0}
XMP::exif\GPSLongitude filled with {File.MD.Composite\GPSLongitude\GPSLongitude\0}
and that did populate the appropriate fields in the XMP exif section of the metadata > browser, however in metadata > default > GPS, only the altitude shows - no latitude or longitude is populated.
I guess that may be because in the Apple composite metadata, there's no latitude / longitude REF field -  the N and E is part of the actual latidude / longitude. Is it possible to use RegExp in the "fill the tag from this data" field? In that case it might be possible filter the data as it is needed by IMatch.

Videos only contain a single position. While I did take a photo at the beginning and end of the video to determine what location it uses, that failed as the video location was off by a couple of hundred meters. I may have to retry that with a proper video.

I also recorded a shorter video, which you can download here

Mario

It looks like Apple did this again the "Apple Way"  instead of using one of the established metadata formats for GPS data.
The data like

51 deg 25' 41.00" N, 12 deg 37' 51.30" E, 75 m Above Sea Level

looks like text (it's even tagged with a language, so if you are not using a German iPad you may get other data!).

You will need to split this string up into the relevant parts using variable formatting functions like substr etc. Since it's variable length this will probably not work for all cases. What do you get when you look at the RAW values? Is there a difference? Or maybe Apple just writes a string and stuffs it all in...

<rant>
Sigh. How hard can it be for a company like Apple, who makes billions of dollars and makes their users pay a 50% premium on any product, to support a established and widely supported metadata format like EXIF or XMP? EXIF is around for 20 years and XMP for 10.
You pay 50% more for Apple products than for comparable products, and all you get is a proprietary, tightly closed environment which only exists to lock customers in forever. I cannot even simply copy MP3 files to my iPod (the only Apple product I will ever own). I need to use the despised iTunes software for it - because Apple in their wisdom decided to store MP3 files in a proprietary way, renaming the files as iTunes copy them. The rest of the world just copies the MP3 files...</rant>
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rainforest1155

Actually, it may not be that bad as IMatch displays these 5 composite fields for the videos:
[Composite]     GPS Altitude                    : 177 m
[Composite]     GPS Altitude Ref                : Above Sea Level
[Composite]     GPS Latitude                    : 51 deg 19' xx.xx" N
[Composite]     GPS Longitude                   : 12 deg 25' xx.xx" E
[Composite]     GPS Position                    : 51 deg 19' xx.xx" N, 12 deg 25' xx.xx" E
The latitude and longitude field is pretty close to the XMP / EXIF one, except for including the N and E instead of having separate "ref" fields for that.

In regards to the localized fields (like "Make (deu)" and "GPS Coordinates (deu-DE)"), I think you can safely ignore them as the just appear to be in addition to the regular ones "Make" and "GPS Coordinates". My devices are set to English and I guess the additional language in the metadata comes from having an English and German keyboard enabled.

Mario

#12
Well, then you can re-format the data using IMatch variable functions and copy them into the XMP GPS tags to make them available. Use replace to replace <blank>N (or <blank>E) with 'nothing' and then assign the result to the XMP lat/lng tag. This should do it.

Did you see my request about providing some small sample files for my test file collection? I like to have samples from all major RAW formats and also the proprietary Apple file formats - which change a bit with every Apple model and firmware update.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rainforest1155

Thanks, I'll give the variable functions a try.

Is the Dropbox download link I included in my first reply yesterday not working for you? I just checked it and it is working fine for me.

Mario

I overlooked that link. It's tiny in this sea of text ;)
Downloading just now.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rainforest1155

Hey Mario,

I happened to update to 5.3.8 today and was just playing around with copying the Apple GPS details when I noticed that after a metadata refresh, all my iPhone / iPad videos are already mapped without me having to apply my template. Thank you very much for implementing this already!

While not necessary anymore, I found out that using the value:raw filter, IMatch is able to make use of the Apple GPS longitude / latitude without manually replacing parts of the field. For reference, my template looked like this:

XMP::exif\GPSAltitude filled with {File.MD.Composite\GPSAltitude\GPSAltitude\0}
XMP::exif\GPSAltitudeRef filled with {File.MD.Composite\GPSAltitudeRef\GPSAltitudeRef\0}
XMP::exif\GPSLatitude filled with {File.MD.Composite\GPSLatitude\GPSLatitude\0|value:raw}
XMP::exif\GPSLongitude filled with {File.MD.Composite\GPSLongitude\GPSLongitude\0|value:raw}


In general, XMP metadata handling seems to be much snappier with the latest update.

Have a great Sunday,
Sebastian

Mario

I have not implemented anything or I would have mentioned this in the release notes.

I tried that with the sample image you have provided.
When the file is first imported, IMatch creates XMP data in the database. This metadata does not contain GPS data in XMP.
I then set a rating and write-back.
This procedure creates an XMP sidecar file for the QuickTime file, and this also creates XMP GPS data!

I suggest you do the same and see if this works. Probably ExifTool uses the Composite GPS data filled from the QuickTime GPS data to fill the XMP GPS data on write-back or re-import after write-back.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rainforest1155

Aha, that explains it. I had been working on a template to import the camera name into the xmp make / model field and with 5.3.6 I consistently ran into xmp write-back errors with some (mostly older) video files. I was about to report that issue when I noticed the 5.3.8 update and that update (and / or the exiftools update) resolved not only the xmp write-back problem, but also populated the xmp gps location.
I thought you might have forgotten to include that in the release notes.

I now have one template that takes care of importing the proper date taken and camera info for videos and exiftools also fills in the gps data while it's at it. Great!