If this site goes down it is because of the crappy DreamHost web hosting: They will disable your "unlimited traffic" web server if a single bot hammers the site with a moderate load.  If necessary, an alternate ExifTool forum page is available at

Main Menu

GPS tags for mp4 in Google Photos

Started by karlgustavv, April 12, 2020, 06:58:03 AM

Previous topic - Next topic


It is now possible to set the Keys:GPSCoordinates tag for mp4 files, which is a great addition to exiftool.

I set the coordinates in a (thumbnail) JPEG file and then transfer them to the mp4 file:

exiftool -tagsfromfile source.jpg "-keys:GPSCoordinates<$GPSLatitude, $GPSLongitude, $GPSAltitude" dest.mp4

Google Photos does not recognize the position in this way, since the altitude obviously cannot be processed.

New attempt without the altitude:
exiftool -tagsfromfile source.jpg "-keys:GPSCoordinates<$GPSLatitude, $GPSLongitude" dest.mp4

Now Google Photos recognizes the position for some files and for some not.

The reason seems to be the length of the coordinates:
too long:
GPS Coordinates : 50.9780430499889 7.01786347999278

GPS Coordinates : 50.9780430499889 7.01786347

My workaround is not elegant: Export coordinates of source.jpg, shorten them in a script, then write them back to source.jpg and in the end: copy them into the mp4 file using the command mentioned above.

The file dest.mp4 is a few bytes smaller with the shortened coordinates and Google Photos can read the coordinates.

Is there a way to tell exiftool to write the position with fewer bytes?

Thanks a lot

Phil Harvey

I think you are not telling the whole story.  Are you using the -n option when copying the coordinates?  You must be.  Either that or you are using a config file to do something like this.

Instead, just use the -c option to format the coordinates however you want.  You can specify the number of decimal places like this:

exiftool -tagsfromfile source.jpg -c %.8f "-keys:GPSCoordinates<$GPSLatitude, $GPSLongitude" dest.mp4

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


Thank you for the fast answer.

I've set all sorts of things. And the solution is so simple. Thanks again