Hey all
Thanks to your help I was able to correct the dates on my MP4 files. Is it also possible to add GPS to them? When I run the command
exiftool -a -G1 -s C:\file\WP_20130730_003.mp4
I don't see a line for GPS anywhere. Does this mean it's not possible?
Thanks
You can add XMP GPS tags to MP4 videos. They go in the XMP-exif family 1 group, not the GPS group as with JPEG images.
- Phil
This works for .mp4, .m4v and .mov on Apple devices and Google Photos (you can optionally leave the altitude off):
exiftool -m -P -n -overwrite_original_in_place -Keys:GPSCoordinates='-36.6101 -66.91515 119.9' 2020-0101-1200-00.mp4
exiftool -a -G1 -s -n -ee -Location:all 2020-0101-1200-00.mp4
[Keys] GPSCoordinates : -36.6101 -66.91515 119.9
exiftool -a -G1 -s -ee -Location:all 2020-0101-1200-00.mp4
[Keys] GPSCoordinates : 36 deg 36' 36.36" S, 66 deg 54' 54.54" W, 119.9 m Above Sea Level
[edit: deleted a an extra typo -n from the last command]
- Matti
Matti has a better idea. QuickTime Keys:GPSCoordinates is more widely supported than XMP in videos.
- Phil
Quote from: wywh on September 19, 2022, 04:40:45 PMThis works for .mp4, .m4v and .mov on Apple devices and Google Photos (you can optionally leave the altitude off):
exiftool -m -P -n -overwrite_original_in_place -Keys:GPSCoordinates='-36.6101 -66.91515 119.9' 2020-0101-1200-00.mp4
exiftool -a -G1 -s -n -ee -Location:all 2020-0101-1200-00.mp4
[Keys] GPSCoordinates : -36.6101 -66.91515 119.9
exiftool -a -G1 -s -n -ee -Location:all 2020-0101-1200-00.mp4
[Keys] GPSCoordinates : 36 deg 36' 36.36" S, 66 deg 54' 54.54" W, 119.9 m Above Sea Level
- Matti
You'll have to forgive my ignorance but could you tell me what each line's function is?
Quote from: suninmoon on September 19, 2022, 08:08:56 PMwhat each line's function is
Write GPS as decimal degrees with positive altitude to a movie.mp4 (does not make a backup file):
exiftool -m -P -n -overwrite_original_in_place -Keys:GPSCoordinates='-36.6101 -66.91515 119.9' movie.mp4Check all relevant location tags as decimal degrees DD or degrees minutes seconds DMS without -n (-ee Extract information from embedded files might provide extra info in some movies):
exiftool -a -G1 -s -n -ee -Location:all movie.mp4
[Keys] GPSCoordinates : -36.6101 -66.91515 119.9
or:
exiftool -a -G1 -s -ee -Location:all movie.mp4
[Keys] GPSCoordinates : 36 deg 36' 36.36" S, 66 deg 54' 54.54" W, 119.9 m Above Sea Level- Matti
Thanks Matti
ok, so what did I do wrong here?
C:\File>exiftool -m -P -n -overwrite_original_in_place -Keys:GPSCoordinates="34.022373664513765, -84.65778051977105" C:\File\WP_20130729_003.mp4
Warning: Error converting value for Keys:GPSCoordinates (ValueConvInv)
Nothing to do.
Thanks
This works for ExifTool 12.45. What version are you using?
- Phil
Obviously -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
Oh, I tried it without -n.
Right. With -n you shouldn't use the comma. The ExifTool print formatting adds the comma and formats the coordinates, so the comma shouldn't be used when print-formatting is disabled.
Thanks Matti.
- Phil
Quote from: Phil Harvey on September 20, 2022, 08:12:20 PMThis works for ExifTool 12.45. What version are you using?
- Phil
I've been using 12.4.4.0 but I just downloaded the latest.
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
Thanks Matti
I tried both commands and they both seemed to work but Lightroom sees no GPS for the file
C:\File>exiftool -m -P -overwrite_original_in_place -Keys:GPSCoordinates="34.022373664513765, -84.65778051977105" C:\File\WP_20130729_003.mp4
1 image files updated
C:\File>exiftool -m -P -n -overwrite_original_in_place -Keys:GPSCoordinates="34.022373664513765 -84.65778051977105" C:\File\WP_20130729_003.mp4
1 image files updated
Any idea?
Thanks
If you have an MP4 where Lightroom sees the GPS, then run ExifTool on it with the -G1 option to see where it is stored, and use ExifTool to write to this location.
If you don't have an MP4 where Lightroom shows the GPS, then maybe LR doesn't extract this metadata from MP4 files.
- Phil
I have previously used Lightroom only for images, not for movies. But I did a short test with the latest Lightroom on the Mac.
Lightroom Classic 11.5 seems to support XMP locations like:
exiftool -m -P -overwrite_original -XMP-exif:GPSLatitude=34.022373664513765 -XMP-exif:GPSLongitude=-84.65778051977105 movie.mp4
or just:
exiftool -m -P -overwrite_original -GPSLatitude=34.022373664513765 -GPSLongitude=-84.65778051977105 movie.mp4
exiftool -a -G1 -s -n -ee -Location:all movie.mp4
[XMP-exif] GPSLatitude : 34.0223736645
[XMP-exif] GPSLongitude : -84.6577805198333
or:
exiftool -a -G1 -s -ee -Location:all movie.mp4
[XMP-exif] GPSLatitude : 34 deg 1' 20.28" N
[XMP-exif] GPSLongitude : 84 deg 39' 27.72" W
On the other hand, macOS 12 QuickTime Player.app, Photos.app and Google Photos do NOT show that 'XMP-exif:GPS*' (even with only 4 decimals) but do show 'Keys:GPSCoordinates'.
- Matti
Matti
My media will end up in Photos for Apple devices and the GPS command you provided
exiftool -m -P -n -overwrite_original_in_place -Keys:GPSCoordinates="-36.6101 -66.91515 119.9" movie.mp4
did add GPS coordinates that do show up in Photos for macOS so that will work for me. The command worked fine once I upgraded to the latest version of Exiftool.
So would you say that "Keys:GPSCoordinates" seems to be the most universally supported format for GPS?
Thanks again
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
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.
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