News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

GPS tag for mov, mp4 and m4v

Started by wywh, April 17, 2021, 05:51:09 AM

Previous topic - Next topic

wywh

Is there a common GPS tag that should work in all movies (mp4, m4v and mov)?

In macOS 11 Photos.app 6.0 Keys:GPSCoordinates works for mp4, m4v and mov. iOS devices seem to use Keys for mov so I have used it with some movies with exiftool.

But to my surprise in macOS 11 QuickTime Player Keys:GPSCoordinates works only in mp4 and mov, and not in m4v that AFAIK is very similar to mp4.

On the other hand when a GPS is pasted in GraphicConverter 11.4.3 (4893):

If mov from an iOS device has Keys:GPSCoordinates and another GPS is pasted GC preserves Keys tag but adds a weird UserData:GPSCoordinates-un tag. Not a big deal but I wonder why it adds such a redundant tag:

[Keys]          GPSCoordinates                  : -36.6101 -66.9151 0
[UserData]      GPSCoordinates-un               : -36.6101 -66.9151 0


On the other hand, if mp4 or m4v has Keys:GPSCoordinates and another GPS is pasted, GC deletes that Keys tag, and writes a weird UserData: LocationInformation tag:

[UserData]      LocationInformation             : (none) Role=shooting Lat=-36.61009 Lon=-66.91510 Alt=0.00 Body=earth Notes=

Photos.app and QuickTime Player both do read that OK but I am not familiar with that tag and could not write or modify it with exiftool.

exiftool -m -P -overwrite_original_in_place -UserData:LocationInformation='(none) Role=shooting Lat=-36.6101 Lon=-66.91515 Alt=0.00 Body=earth Notes=' .
Warning: Sorry, UserData:LocationInformation doesn't exist or isn't writable
Nothing to do.


What is that UserData:LocationInformation anyway?

But all in all, both Photos.app and QuickTime Player can read the location GC pastes so this might be OK. But I am puzzled what is the standard to do this. Or is there currently any standard for GPS in movies?

p.s. I have used Keys:GPSCoordinates in Google Photos and for H.264 mp4 it has worked OK but for the latest H.265 mp4 it didn't display the location.

- Matti

Phil Harvey

Hi Matti,

I'm not aware of any standard that specifies where the various tags should be written in the different format video files.  You could take a shotgun approach and write them all, and that may work.

However, LocationInformation isn't yet writable as the warning states.  I would need more test samples to be able to add the ability to write this.  If you want to send me some, my email is philharvey66 at gmail.com

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Hi Matti,

ExifTool 12.25 has just been released with the ability to write LocationInformation (plus a number of other 3gp tags).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

wywh

Thanks for the note. v12.25 now successfully writes UserData:LocationInformation:

exiftool -m -P -overwrite_original_in_place -UserData:LocationInformation='(none) Role=shooting Lat=-36.6101 Lon=-66.91515 Alt=0.00 Body=earth Notes=' 2020-0101-1200-00.mp4
Use of uninitialized value $format in hash element at /usr/local/bin/lib/Image/ExifTool/WriteQuickTime.pl line 317.
    1 image files updated

exiftool -a -G1 -s 2020-0101-1200-00.mp4
[UserData]      LocationInformation             : (none) Role=shooting Lat=-36.61011 Lon=-66.91515 Alt=0.00 Body=earth Notes=
[Composite]     GPSAltitude                     : 0 m
[Composite]     GPSAltitudeRef                  : Above Sea Level
[Composite]     GPSLatitude                     : 36 deg 36' 36.40" S
[Composite]     GPSLongitude                    : 66 deg 54' 54.54" W
[Composite]     Rotation                        : 0
[Composite]     GPSPosition                     : 36 deg 36' 36.40" S, 66 deg 54' 54.54" W

[QuickTime]     CompatibleBrands                : mp42, mp41
[Track1]        HandlerDescription              : Apple Video Media Handler
[Track2]        HandlerDescription              : Apple Sound Media Handler


But neither Big Sur macOS 11 QuickTime Player or Photos.app display that location.

On the other hand, if I paste the same GPS from GraphicConverter 11.4.3 beta (4893), then QuickTime Player and Photos.app display the location. GC seems to make the following edits to the metadata:

[QuickTime]     CompatibleBrands                : isom, mp41, mp42
[Track1]        HandlerDescription              : Core Media Video
[Track2]        HandlerDescription              : Core Media Audio
[UserData]      LocationInformation             : (none) Role=shooting Lat=-36.61009 Lon=-66.91510 Alt=0.00 Body=earth Notes=


But anyway, I continue to use exiftool for Keys:GPSCoordinates for .mp4, .mov and also for .m4v locations because it works with Photos.app and Google Photos.

- Matti

wywh

Quote from: wywh on April 17, 2021, 05:51:09 AM
p.s. I have used Keys:GPSCoordinates in Google Photos and for H.264 mp4 it has worked OK but for the latest H.265 mp4 it didn't display the location.

In another thread I noticed that "Google Photos doesn't like positions in decimal degrees with more that 5 digits after the dot".

And sure enough, with 6 decimals neither H.264 nor H.265 new test .mp4 displayed location but with 5 decimals they both did. FWIW I had an older H.264 with 6 decimals that shows the location but maybe Google Photos has changed after that upload.

https://exiftool.org/forum/index.php?topic=11055.msg67171#msg67171