News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Help using xmp2gps.args

Started by acook, October 21, 2017, 09:06:35 PM

Previous topic - Next topic

acook

Hello,

I have a folder (called "movie") with 2 files in it

2001-03-26-Texas.mp4
2001-03-26-Texas.xmp


I am trying to write the xmp data to the mp4 using exif, specifically the GPS information. 

If I use this command, it works (despite the errors)


❯ exiftool -overwrite_original_in_place -tagsfromfile %d/%f.xmp %d/%f.mp4 movie
Warning: Error opening file - %d/%f.XMP
Error: File not found - %d/%f.mp4
    1 directories scanned
    2 image files updated
    1 files weren't updated due to errors


When I look at the mp4 file after the command, I can see the XMP data in the video.  However, I'm still after the GPS composite data, so I wanted to use xmp2gps.args.  However, this command doesn't work

❯ exiftool -overwrite_original_in_place -tagsfromfile %d/%f.xmp -@ xmp2gps.args %d/%f.mp4 movie
Warning: Error opening file - %d/%f.xmp
Error: File not found - %d/%f.mp4
    1 directories scanned
    0 image files updated
    2 image files unchanged
    1 files weren't updated due to errors


I also tried

❯ exiftool -tagsfromfile %d%f.xmp -@ xmp2gps.args movie
    1 directories scanned
    0 image files updated
    2 image files unchanged


In both cases it doesn't update the movie file.  I fear I'm using xmp2gps.args incorrect.  Any ideas?

Thanks!

StarGeek

No, you're not using the arg file incorrectly.  The problem is that xmp2gps.args writes to the GPS group, which is actually EXIF data.  The .mp4 format doesn't hold EXIF data (with some rare exceptions).  You can write the GPS data to the XMP GPS tags.  There is also the Quicktime:GPSCoordinates tag, but exiftool cannot write to that tag.

As for your first command, you can remove the "%d/%f.mp4" part to remove the error, though you might want to add -ext mp4 to limit processing to only mp4 files.  Currently, it's copying 2001-03-26-Texas.xmp back onto itself, which is why you have 2 image files updated.
exiftool -overwrite_original_in_place -ext mp4 -tagsfromfile %d/%f.xmp movie
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

acook

Thanks for the reply.  What you said makes sense.  Is there a way to write the following tags based on the XMP?


[Composite]     GPSLatitude
[Composite]     GPSLongitude


Currently, my movies only have

[Composite]     GPSLatitudeRef
[Composite]     GPSLongitudeRef


Thanks for the tips on the command syntax also!

StarGeek

Composite tags are tags derived from other tags and not writable in this case.

Odds are your MP4 file has a GPSCoordinates tag and the composite tags are give you values based upon this tag.  If you try this command
exiftool -g1 -a -s -gps* FileOrDir
It will show you all tags that start with GPS.

To copy the tags to the XMP, try this:
exiftool -overwrite_original_in_place "-XMP:GPSLatitude<GPSLatitude" "-XMP:GPSLongitude<GPSLongitude" FileOrDir

Unfortunately, not everything (especially websites) will read XMP GPS coordinates. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).