Author Topic: Please support creation and modification of Quicktime's GPSCoordinates tag  (Read 461 times)

Tempest Character

  • Jr. Member
  • **
  • Posts: 18
It is so annoying that Apple's Photos application reads the GPSLatitude and GPSLongitude tags from JPEGs, but not MOVs (it's bad enough that it won't read the DateTimeOriginal tag from AVCHD/MTS files -- making the MTS file the Photos copying date, but at least I have a workflow that losslessly remuxes MTS files to MOV files).  Thus, if I could only create and write to the GPSCoordinates tag to the MOV file, I can use my geotagging data to establish the movie's location as well, that would show up in Photos!

I see people over the years have touched on this subject, and I get the sense that it was something Mr. Harvey meant to do, so if my little vote helps, I'd be grateful! 

Thanks!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Yes, This is top of my list at the moment.

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

Tempest Character

  • Jr. Member
  • **
  • Posts: 18
Just tried it, and seems to work great.   ;D
Now with the following that will stuff the GPSLatitude and GPSLongitude fields into GPSCoordinates:

exiftool -GPSCoordinates<"$GPSLatitude, $GPSLongitude"

and we're off to the races!
Much thanks!
« Last Edit: May 08, 2019, 06:51:08 PM by Tempest Character »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Great!
...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 ($).

Tempest Character

  • Jr. Member
  • **
  • Posts: 18
Phil -- again thanks for your help and patience, but the Apple Mac OS X Photos app still seems to be looking for something before accepting the *.mov files GPS data and presenting same.  I cannot figure out what that may be.  I thought it could be the GPSAltitude having to be concatenated onto the GPSCoordinates tag, but no such luck (since it only presents location in 2 dimensions, I should have suspected as such). 

Looking at just the tags with "GPS" in them (i.e., exiftool "-*GPS*" a.mov) in a movie I tagged as we discussed here, I get:

Quote
GPS Altitude Ref                : Above Sea Level
GPS Coordinates                 : 40 deg 25' 1.27" N, 3 deg 42' 12.77" W, 667 m Above Sea Level
GPS Altitude                    : 667 m Above Sea Level
GPS Latitude                    : 40 deg 25' 1.27" N
GPS Latitude Ref                : North
GPS Longitude                   : 3 deg 42' 12.77" W
GPS Longitude Ref               : West
GPS Position                    : 40 deg 25' 1.27" N, 3 deg 42' 12.77" W

while I compare it with a .mov file generated by my iPhone (that Apple Photos does present GPS coordinates), I get:

Quote
GPS Coordinates                 : 30 deg 19' 20.64" N, 35 deg 27' 6.12" E, 995.625 m Above Sea Level
GPS Altitude                    : 995.625 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 30 deg 19' 20.64" N
GPS Longitude                   : 35 deg 27' 6.12" E
GPS Position                    : 30 deg 19' 20.64" N, 35 deg 27' 6.12" E

So, the tags appear in different orders and the iPhone mov lacks the GPS Latitude Ref and GPS Longitude Ref tags, and the GPS Altitude tag does not have "Above Sea Level" appended.  If that were the reason, I don't think I would be able to manipulate the tags to come out exactly the same.  If on the other hand, there is tag other than one with "GPS" in it that is cause Apple Photos to avoid reading the GPS data, I wouldn't have a clue what tag that could be.

Will understand perfectly if you shrug your shoulders and say you are not an Apple developer and thus do not know it's internal architecture.

Cheers,

Ariel

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2516
What is the output of
exiftool -gps* -a -g1 a.mov

This will help figure out where the tags are located and if there are duplicate entries.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Tempest Character

  • Jr. Member
  • **
  • Posts: 18
StarGeek -- again thanks for your help.  You may be onto something regarding where the tags are located.

The mov I tagged gave the following result:

Quote
---- XMP-exif ----
GPS Altitude                    : 7 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 38 deg 20' 27.84" N
GPS Longitude                   : 0 deg 29' 10.87" W
---- UserData ----
GPS Coordinates                 : 38 deg 20' 27.84" N, 0 deg 29' 10.86" E, 7 m Above Sea Level
---- Composite ----
GPS Altitude                    : 7 m Above Sea Level
GPS Altitude                    : 7 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 38 deg 20' 27.84" N
GPS Latitude Ref                : North
GPS Longitude                   : 0 deg 29' 10.86" E
GPS Longitude Ref               : West
GPS Position                    : 38 deg 20' 27.84" N, 0 deg 29' 10.86" E

while the iPhone mov gave this result:

Quote
---- Keys ----
GPS Coordinates                 : 30 deg 19' 20.64" N, 35 deg 27' 6.12" E, 995.625 m Above Sea Level
---- Composite ----
GPS Altitude                    : 995.625 m
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 30 deg 19' 20.64" N
GPS Longitude                   : 35 deg 27' 6.12" E
GPS Position                    : 30 deg 19' 20.64" N, 35 deg 27' 6.12" E

Definitely in different places!  Should I thus assume the following is insufficient to get the tag in the right place:

Quote
exiftool -GPSCoordinates<"$GPSLatitude, $GPSLongitude, $GPSAltitude" a.mov

and if so, what else needs to be added?

Thanks again.

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2516
The Composite tags are tags exiftool creates from other tags in the file (in this case, GPSCoordinates), so you can dismiss those.  The XMP tags are probably not read.

But the GPSCoordinates tag is in different places.  Try
exiftool "-Keys:GPSCoordinates<GPSCoordinates"
or in the case of your original command
exiftool "-Keys:GPSCoordinates<$GPSLatitude, $GPSLongitude"



Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Tempest Character

  • Jr. Member
  • **
  • Posts: 18
StarGreek -- appreciate your persistence here.  I tried your suggestion, but I am wondering if Phil Harvey's recently-added support for GPSCoordinates does not go that far.  I put on the verbose flag to see what happened:

Quote
exiftool "-Keys:GPSCoordinates<GPSCoordinates" -v1 00330.mov
======== 00330.mov
Setting new values from 00330.mov
Rewriting 00330.mov...
  FileType = MOV
  FileTypeExtension = MOV
  MIMEType = video/quicktime
  Editing tags in: Keys
  Rewriting Movie
  Rewriting MovieHeader
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
  Rewriting SampleTable
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
  Rewriting SampleTable
  Rewriting UserData
  Rewriting Meta
  Rewriting ItemList
  Rewriting XMP
Nothing changed in 00330.mov
    0 image files updated
    1 image files unchanged

Is it because there is no "Keys" section created to which exiftool can write GPSCoordinates?

Thanks!

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2516
I haven't really played with the new features regarding video files yet, so this was just a guess.  You may have to wait for a response from Phil as to the difference between Keys and UserData tags.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Keys tags are harder to write, but this is next on my list of features to add.  Apple does seem to prefer this location.

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

Tempest Character

  • Jr. Member
  • **
  • Posts: 18
Well, I sure appreciate your continued dedication to this task!  The weather should be getting nicer in Kingston, make sure you enjoy it...  And I say that as a former Torontonian!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
Wow.  This is turning out to be a lot more work that I had hoped.  I've put in about 30 hours of time so far adding this feature, and am at the point where everything is in place and just needs to be tested thoroughly.  Testing will take some time, but it is looking good so far.

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

Tempest Character

  • Jr. Member
  • **
  • Posts: 18
Oh my!  I can only hope that this has taught you things that have broader applicability to enhance ExifTool!  Best wishes...!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14759
    • ExifTool Home Page
I have just released ExifTool 11.45.  The testing had been going very well, but I had wanted to do another day or two of testing before I made the release.  However, I released this version early to roll out an emergency patch to fix a compatibility issue with CR3 editing. 

I'll continue to test this for the next couple of days, and make another quick release if I find any problems.  So please let me know if you find anything that doesn't work the way you expect.

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