reading/writing googlefied mp4 GEO data ?

Started by gibman, April 14, 2020, 08:44:18 AM

Previous topic - Next topic

Phil Harvey

OK then.  So the "/" is the problem. :(  I guess I'll have to add a Google-compatibility option somehow.

- 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 ($).

gibman

yep I knew that google does not read XMP data from sidecar files :)
It was my attempt at importing and applying the XMP coordinates into the mov file itself.

Maybe Im doing the syntax wrong here ?

Phil Harvey

I've finally got around to running some tests with Google Photos.  The problem isn't the trailing "/".  It also doesn't matter what language code is used (I tried both default "UserData:GPSCoordinates" and "UserData:GPSCoordinates-eng").  The problem is that Google Photos doesn't recognize UserData:GPSCoordinates if the coordinates have fewer than 3 digits after the decimal point (stupid, stupid, stupid...).  ExifTool 12.11 will pad to 3 digits if necessary.

- 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 ($).

StarGeek

Ah, good to know.  I had forgotten about following up on this.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

LSPAUN

Hi Phil and wonderful community of wonderful tool,

Probably many as me are busy with some Google Photos stuff as the date of changing their storage policy comes soon.

What I want to achieve - adding GPSLocation to old mp4 files without location, or to new video clips, or correcting some wrong locations.
Exiftool (using windows, latest version) works perfectly.

However, Google Photos
- displays location OK for original video from the phone (data is in UserData:GPSLocation)
- displays location OK for downloaded videos from Google (data is in ItemList:GPSCoordinates)
- does NOT display location for any added location or modified location  (dummy or real, tried GPSCoordinates, UserData:GPSCoordinates, Keys:GPSCoordinates)

Do you know if something changed at Google Photos recently ?

Can someone give a try ?

Example of tag from original video:
exiftool -g1 -a -s -GPSCoordinates .\1.mp4
---- UserData ----
GPSCoordinates                  : 45 deg 21' 3.24" N, 6 deg 8' 32.28" E


After modifying (tried all kind of tag categories, etc),
exiftool -P -UserData:GPSCoordinates="11.664880, -3.515751" .\1.mp4                         
1 image files updated

exiftool -g1 -a -s -GPSCoordinates .\1.mp4
---- UserData ----
GPSCoordinates                  : 11 deg 39' 53.57" N, 3 deg 30' 56.70" W

But Google refuses to display the location...

LSPAUN

#35
Ok, quick reply as I found (probably) the main rootcause: Google Photos doesn't like positions in decimal degrees with more that 5 digits after the dot (funny as I remember I have seen in the forum they also require a minimum of 3 digits after the dot).

Now debugging if there is a difference between UserData:GPSCoordinates, ItemList:GPSCoordinates, Keys:GPSCoordinates.

And I have to find the correct usage of -n and -c  with -tagsFromFile for the following, somthing like this works very well:

exiftool -overwrite_original -c "%.5f" -P -tagsfromfile '%f.xmp' "-ItemList:GPSCoordinates<GPSPosition" .

(not the most accurate as it also tries to rewrite the respective .xmp file but in the end it does not as there are no changes, but I haven't find the correct way to use %f to tell from each .xmp file in the directory, apply the change to the respective filename with .mp4 extension)

My source master GPS data is stored in sidecar XMP files created by geosetter tool, example:

<exif:GPSLatitude>44,11.349680N</exif:GPSLatitude>
  <exif:GPSLongitude>5,42.882317E</exif:GPSLongitude>
  <exif:GPSMapDatum>WGS-84</exif:GPSMapDatum>

read by exiftool like

exiftool -a -g -G1 -n example.xmp
[ExifTool]      ExifTool Version Number         : 12.25
[System]        File Name                       : example.xmp
[System]        Directory                       : .
[System]        File Size                       : 1086
[System]        File Modification Date/Time     : 2021:04:16 00:57:34+02:00
[System]        File Access Date/Time           : 2021:04:25 11:37:54+02:00
[System]        File Creation Date/Time         : 2021:04:25 11:37:54+02:00
[System]        File Permissions                : 100666
[File]          File Type                       : XMP
[File]          File Type Extension             : XMP
[File]          MIME Type                       : application/rdf+xml
[XMP-x]         XMP Toolkit                     : Image::ExifTool 10.96
[XMP-exif]      Date/Time Digitized             : 2002:12:15 05:00:00+01:00
[XMP-exif]      Date/Time Original              : 2002:12:15 05:00:00+01:00
[XMP-exif]      GPS Latitude                    : 44.1891613333333
[XMP-exif]      GPS Longitude                   : 5.71470528333333
[XMP-exif]      GPS Map Datum                   : WGS-84
[XMP-exif]      GPS Date/Time                   : 2002:12:15 04:00:00Z
[XMP-exif]      GPS Version ID                  : 2.2.0.0
[XMP-photoshop] Date Created                    : 2002:12:15 05:00:00+01:00
[XMP-xmp]       Modify Date                     : 2002:12:15 05:00:00+01:00
[Composite]     GPS Latitude Ref                : N
[Composite]     GPS Longitude Ref               : E
[Composite]     GPS Position                    : 45.1891613333333 5.71470528333333

wywh

#36
Quote from: LSPAUN on April 25, 2021, 05:55:14 AM
Google Photos doesn't like positions in decimal degrees with more that 5 digits after the dot

Thanks for the info! Just recently I wondered why H.264 .mp4 displayed the location in Google Photos while a new H.265 did not. I use Keys:GPSCoordinates because iOS devices seem to use it.

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=12393.0

- Matti

LSPAUN

Indeed, I remember I have seen in an earlier other post that 6 decimals were the maximum, now tested that max 5 works.

Phil Harvey

It just boggles my mind that programmers can be so stupid at Google.  In what world would 6 decimal points ever be too many?  And why even impose a restriction like this in the first place?

I wonder if those programmers can eat a pizza that is cut into 16 pieces. :/

- 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 ($).

StarGeek

Quote from: LSPAUN on April 25, 2021, 05:55:14 AM
Ok, quick reply as I found (probably) the main rootcause: Google Photos doesn't like positions in decimal degrees with more that 5 digits after the dot (funny as I remember I have seen in the forum they also require a minimum of 3 digits after the dot).

Thanks for figuring it out.  I was trying to test it out and getting the same lack of results.  I wouldn't have thought to have limited the number of decimals.

Quotenot the most accurate as it also tries to rewrite the respective .xmp file

Add --ext xmp to the command to exclude xmp files. See the -ext (-extension) option.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Note that ExifTool already has a patch for writing GPSCoordinates because Google Photos didn't accept coordinates with less than 3 digits after the decimal place.  So there's also that restriction to consider.  I'm not going to test this myself, but it seems that the coordinates must have 3, 4 or 5 digits after the decimal point.  However, this also seems to be a moving target.

- 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 ($).