Adding GPS to my MP4 files?

Started by suninmoon, September 19, 2022, 03:59:06 PM

Previous topic - Next topic

wywh

Quote from: suninmoon on September 22, 2022, 10:49:26 AMwould you say that "Keys:GPSCoordinates" seems to be the most universally supported format for GPS?

yes ... at the moment ... at least on current Apple devices ... and on Google Photos

- Matti

milchtaich

Lightroom (and Bridge) happily read the UserData:GPSCoordinates (©xyz) tag natively written by some (Xiaomi) phones to the User data (udta) subdirectory of the Movie directory (moov). There is no XMP in these MP4 files.

wywh

Quote from: milchtaich on September 22, 2022, 12:59:49 PMUserData:GPSCoordinates

Thanks for the note. Google Photos and Lightroom Classic 11.5 read this but macOS 12 QuickTime Player or Photos do not.

exiftool -a -G1 -s -n -Location:all movie.mp4
[UserData]      GPSCoordinates                  : -36.6101 -66.91515 119.9

- Matti

suninmoon

Quote from: wywh on September 21, 2022, 03:19:49 AMObviously -n (--printConv) and commas (,) in decimal degrees do not mix (v12.42) so try:

exiftool -m -P -overwrite_original_in_place -Keys:GPSCoordinates="34.022373664513765, -84.65778051977105" movie.mp4

or:

exiftool -m -P -n -overwrite_original_in_place -Keys:GPSCoordinates="34.022373664513765 -84.65778051977105" movie.mp4

Google Maps gives commas so omitting -n might be better. However, Google Maps gives absurd amount of decimals (up to 15) so I usually anyway edit and truncate them to 4-5 because Google Photos might not show positions in decimal degrees with more than 5 decimals after the dot. A value in decimal degrees to an accuracy of 4 decimal places is accurate to 11.1 meters (+/- 5.55 m) at the equator. A value in decimal degrees to 5 decimal places is accurate to 1.11 meter at the equator.

- Matti


Hi Matti

So I've been trying to add GPS to some video files I had to convert from Apple Intermediate Codec to MP4 using handbrake. That might not matter but I'm using this command to add GPS to them


exiftool -m -P -overwrite_original_in_place -Keys:GPSCoordinates="33.733964561071375, -84.37163893640016" G:\2013-10-04_10.23.48.mp4


It works and the GPS shows in macOS photos, but nothing shows in Google Photos. I got the GPS address from google maps so it seems odd. Any idea why GPS would not show for this video after importing to Google photos?

Thanks,
Josh

wywh

#19
Quote from: suninmoon on November 22, 2023, 05:13:38 PMIt works and the GPS shows in macOS photos, but nothing shows in Google Photos. I got the GPS address from google maps so it seems odd

Hey, hasn't this detail already been mentioned here? :o

Google Photos does not show Keys:GPSCoordinates (or UserData:GPSCoordinates) positions if there are more than 5 decimals after the dot (I believe 5 is the max the last time I checked...).

On the other hand, copied from Google Maps there are up to 15 decimals...

So truncate the decimals for Google Photos to 4-5 which is enough:

A value in decimal degrees to an accuracy of 4 decimal places is accurate to 11.1 meters (+/- 5.55 m) at the equator. A value in decimal degrees to 5 decimal places is accurate to 1.11 meter at the equator. Earth radius 6378137 m, circumference 40075016,7 m, 1° 111319,5 m, 4 decimals 11,1 m, 5 decimals 1,11 m.

- Matti

suninmoon

Thank you, that worked perfectly.