Please support creation and modification of Quicktime's GPSCoordinates tag

Started by Tempest Character, April 25, 2019, 05:56:20 PM

Previous topic - Next topic

Phil Harvey

I've now completed a more extensive round of testing, and have found a number of minor bugs, so you may want to update to ExifTool 11.49 (just released).  None of the bugs affect MOV/MP4 file integrity -- they are all related to trying to get ExifTool to write the expected tags, and many of the problems were related to the alternate-language support.

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

Tempest Character

Phil (and StarGeek) an emphatic thank you for all your efforts.  For those of you interested, this workflow appears to allow GPS-untagged MOV files to be tagged and properly read by Apple Photos.  Suggestions for streamlining appreciated.

(1)   Create JPG poster frame from MOV files to accept GPS data -- it uses ffmpeg -- if there is a way to do it in exiftool, by all means share!

FOR /F "tokens=*" %G IN ('dir /b *.mov') DO ffmpeg -ss 00:00:00 -i "%G" -vframes 1 -q:v 2 "%~nG.jpg"

(2)   Make sure the poster frames have the same timestamps as the corresponding MOV files (since I am not sure whether DateTimeOriginal, FileModifyDate or FileCreateDate is used, I synch them all):

a.   Run this on all the MOV files:

exiftool -DateTimeOriginal %d%f.MOV -r -ext jpg .

b.   Run this on all the corresponding poster frames:

exiftool -"FileModifyDate<DateTimeOriginal" -"FileCreateDate<DateTimeOriginal"

(3)   If you have a track log file, you can of course do something like "exiftool -geotag=track.log ." on the poster frames to tag them (see https://exiftool.org/geotag.html).  However, if you need one created in the first place (other than inverse geotagging of pictures taken from your cellphone at the same time as the non-GPS camera whose videos/pictures you wish to tag), you could have used a GPS tracking app, like gps4cam, which I did (see http://gps4cam.com/ - I have no financial ties nor do I endorse it).  I ran the gps4cam PC application on the poster frames (and if desired, any still frame pictures taken contemporaneously) – gps4cam-specific note: replace the copy of exiftool gps4cam distributes (5 years old!) along with its Windows/MAC app with a current one at .\resources\exiftool\exiftool.exe on Windows (otherwise, the old exiftool is unable to write to the poster frames created by ffmpeg -- I think it was a big vs little endian problem).

(4)   Copy all the data from the poster frames to the corresponding MOV (i was unsuccessful in limiting it to GPS tags, exiftool would not create them otherwise):

exiftool -TagsFromFile %d%f.jpg -r -ext MOV .

(5)   Create GPSCoordinates tag in the MOV files:

a.   If no altitude data is available:

exiftool "-Keys:GPSCoordinates<$GPSLatitude, $GPSLongitude"

b.   If altitude data is available:

exiftool "-Keys:GPSCoordinates<$GPSLatitude, $GPSLongitude, $GPSAltitude"

And then upload them into Apple Photos, et voila!

Best regards!

Phil Harvey

Great, glad this is working for you.  Just a couple of commenst:

Quote from: Tempest Character on June 11, 2019, 02:03:11 PM
(4)   Copy all the data from the poster frames to the corresponding MOV (i was unsuccessful in limiting it to GPS tags, exiftool would not create them otherwise):

exiftool -TagsFromFile %d%f.jpg -r -ext MOV .

Exactly what did you want copied?  You don't have to copy everything blindly if you know what you want copied.

Quotea.   If no altitude data is available:

exiftool "-Keys:GPSCoordinates<$GPSLatitude, $GPSLongitude"

b.   If altitude data is available:

exiftool "-Keys:GPSCoordinates<$GPSLatitude, $GPSLongitude, $GPSAltitude"

You can do this in one command:

exiftool -TagsFromFile %d%f.jpg "-Keys:GPSCoordinates<$GPSLatitude, $GPSLongitude" "-Keys:GPSCoordinates<$GPSLatitude, $GPSLongitude, $GPSAltitude" -ext MOV .

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

Tempest Character

Leave it to the master to show there's almost no limits on the contractions possible!  As to what I wanted to do in (4):

Quote(4)   Copy all the data from the poster frames to the corresponding MOV (i was unsuccessful in limiting it to GPS tags, exiftool would not create them otherwise):

exiftool -TagsFromFile %d%f.jpg -r -ext MOV .

What I really wanted to do is create the Keys:GPSCoordinates tag in the MOV file based on the GPSLatitude, GPSLongitude & GPSAltitude tags in the corresponding poster frame JPG file -- AND I suspect you know how do that in one fell swoop rather than my copying everything over!

Thanks

Phil Harvey

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

Tempest Character

It's me again -- thought I wouldn't come back to the well again, but as I started using the Keys:GPSCoordinates tag on .mov files and importing them into the Mac OSX Photos application from various trips, some would come through (i.e., be recognized by Photos) and others would not be recognized.  At first, I thought it might be issues with how I created the .mov files (muxed from AVCHD/MTS files), or whether I was not using a sufficiently recent exiftool version (I now use 11.60), or whether I was somehow else failing to follow the workflow I described earlier in this posting.  Then it hit me -- local pictures (i.e., SF Bay Area) worked, Far East worked, but east coast of North America, Europe, South America failed.  So I created a series of short .mov files and started moving them easterly from California and found the discontinuity at 100º W (and similarly at 100º E) -- that seemed to suggest that 2-digit (and probably 1-digit) longitudes were not being read properly by Photos the way exiftool was formatting them in the Keys:GPSCoordinates flag.  I then tried to see if latitudes had a similar problem, but here the discontinuity occurred at 10º N and S.  I am wondering whether Keys:GPSCoordinates should thus have leading zeroes to pad longitude and latitude to be fully compatible?  Note that the latitude and longitude of the .mov files were readable under GetInfo even when Photos would not show it.  Happy to provide any data should you feel motivated to look into this.  Much thanks!

Phil Harvey

Very interesting.  We are having a similar problem here.  I can update ExifTool to pad the leading digits, but it would be good to know if iPhotos tolerates more digits after the decimal point.  Could you possibly check this?

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

Tempest Character

Appreciate the prompt response -- Apple's Photos app seems insensitive to the number of digits to the right of the decimal point -- the example I gave you only had one, and typical GPS output is 5-7 digits.

Phil Harvey

OK.  ExifTool 11.66 will pad latitude to 2 digits and longitude to 3.  No padding for altitude.

Thanks for figuring this out!

- Phil

Edit: Ah ha!  This is actually part of the specification.  Sorry I missed this.
...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 ($).

Tempest Character


Phil Harvey

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

Tempest Character

I thank you for your continued attention to this issue but fear we are (or at least I am) in a "fix-break" cycle. 

(1) On the Mac, the latest version(s) install and run, and I have been able to geotag mov files within +/- 100 E/W, but even though I set the FileCreateDate to DateTimeOriginal (all in 2019), which the Mac Finder recognizes as such, Apple Photos thinks that the mov files are dated in 1969 (I forgot the full date/time, but I can check tonight if interested -- this seems to be before Unix time though!). 

(2) On Windows, any attempt to invoke exiftool gives me this warning: "System Error: The code execution cannot proceed because perl524.dll was not found.  Reinstalling the program may fix this problem."  That happened with versions 11.66, .67 and .68.  I search for perl524.dll and find it in a set of folders at Users\[login]\AppData\Local\Temp\par-7265696368\cache-exiftool-11.6X.  You said elsewhere that these folders can be deleted and exiftool would re-create as needed, but now it seems unable to do so.

Thoughts?

Ariel

Phil Harvey

Hi Ariel,

Nothing should be broken with the new updates.

If exiftool.exe is interrupted the first time it is run, then it may not properly unpack all files into the temporary directory and you can get errors like the missing dll.  To fix this, delete the PAR folder(s) in your temporary directory and run again.

I don't know what date/time Apple Photos is looking for, so I don't know if I can help there.  Are there any date/time tags reported by ExifTool as 1969?  Try this command:

exiftool -time:all -a -G1 -api requestall=2 FILE

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

Tempest Character

On the Windows side, I'm still having problems, despite deleting the PAR folder(s) and rebooting for good measure.

On the Mac side, using your search, I'm not finding any 1969 dates.  However, I am seeing this date field on Apple created mov files that my workflow does not create:

[Keys]          Creation Date                   : 2019:03:10 21:08:17

However, Apple Photos does seem to accept this date that was occasionally created (don't ask me how):

[UserData]      Date/Time Original              : 2019:09:22 12:22:23-07:00

On the other hand, this date alone does not appear to get read:

[XMP-exif]      Date/Time Original              : 2019:04:16 19:27:37

But it does look like progress.  Your collaboration is highly appreciated!

Phil Harvey

I'm not surprised that Apple doesn't read XMP in MOV.  I haven't seen much support for this other than Adobe Bridge.

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