GPSTimeStamp question

Started by twoj, April 13, 2021, 06:43:36 PM

Previous topic - Next topic

twoj

I am trying to tag some mp4 files and the process is using GeoSetter which creates an xmp sidecar with the GPS information, i then am using exiftool to sync the GPS data from the xmp to the mp4; so 2 questions

1) is there a way to tell exiftool to sync 1 or multiple specific tags in the xmp file, ie just the exif:GPSAltitude tag, or exif:GPSLatitude, exif:GPSLongitude, photoshop:City, and photoshop:Country?

2) One of the tags is called <exif:GPSTimeStamp>1899-12-30T05:00:00Z</exif:GPSTimeStamp>, now it seems the is start timestamp, now i understand that GPSTimeStamp is a composite of GPSDateStamp & GPSTimeStamp which aren't writable in mp4, I can set the GPSTimeStamp from another time but it will save in the general UTC time format, ie
GPSDateTime<now -> GPS Date/Time  : 2021:04:13 18:20:09
However i would like to save either the current time or the datetimeoriginal in the format %Y:%m:%dT%H:%M:%SZ

thanks

StarGeek

First a clarification, XMP sidecar files can only contain XMP tags, not EXIF tags.  There is the XMP-exif and XMP-exifEX namespaces which correspond with most EXIF tags, but they are still XMP tags.

Quote from: twoj on April 13, 2021, 06:43:36 PM
1) is there a way to tell exiftool to sync 1 or multiple specific tags in the xmp file, ie just the exif:GPSAltitude tag, or exif:GPSLatitude, exif:GPSLongitude, photoshop:City, and photoshop:Country?

You can copy those tags directly to the MP4 using the -TagsFromFile option.  But you would have to decide where to put them.  The XMP can be directly copied into the file, but other than Adobe programs, most programs don't read XMP in video files.  The Metadata Sidecar Files page has some copying examples.

Quicktime tags are more likely to be read by most programs.  In the case of the GPS coordinates, you would have to copy along these lines
"-GPSCoordinates<GPSPosition"
or to include the altitude as well
"-GPSCoordinates<$GPSPosition , $GPSAltitude $GPSAltitudeRef"
There doesn't appear to a corresponding Quicktime tag for city or country.

QuoteI can set the GPSTimeStamp from another time but it will save in the general UTC time format, ie
GPSDateTime<now -> GPS Date/Time  : 2021:04:13 18:20:09
However i would like to save either the current time or the datetimeoriginal in the format %Y:%m:%dT%H:%M:%SZ

Any reason you feel this is necessary?  Because any program reading GPSDateTime is supposed to read it as UTC anyway.  But in order to do it, you would just use the -d (dateFormat) option exactly as you listed, e.g. -d "%Y:%m:%dT%H:%M:%SZ".  Though you would have to adjust for the timezone to get it to UTC.

In the case of video files, a separate GPS date/time tag isn't necessary as the Quicktime:CreateDate is already supposed to be in UTC.
"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

twoj

I figured out how to copy just certain tags, ie;

exiftool -P -ext mp4 -tagsfromfile %d%f.xmp -GPSDateTime -GPSLatitude -Country -r Folder

however i still can't figure out how to set the time in the specified format;
QuoteAny reason you feel this is necessary?
- Just that i would like to keep the same format - I'm not sure how much this tag is used but it seems silly to keep it at 1899, so i would just like to set it to the current time but i don't want to have issues in the future where the tag is saved in the format 2021:04:13 18:20:09 and some program is expecting 2021:04:13T18:20:09Z

i've tried using

exiftool.exe -d "%Y:%m:%dT%H:%M:%SZ" -GPSDateTime<now File

and variations but the format always comes out like

GPS Date/Time  : 2021:04:13 18:20:09

any ideas?

StarGeek

Quote from: twoj on April 14, 2021, 10:04:05 AM
Just that i would like to keep the same format -
...
i don't want to have issues in the future where the tag is saved in the format 2021:04:13 18:20:09 and some program is expecting 2021:04:13T18:20:09Z

This is extremely unlikely and to be honest, most programs are going to expect the simplified version, though if they're any good, they should be able to accommodate either form.

I did make an assumption that exiftool would be able to write it in that format, but it doesn't look like it will, even with the -n (--printConv) option.  But that alone should tell you that you don't need to do 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

Phil Harvey

Quote from: twoj on April 14, 2021, 10:04:05 AM
exiftool.exe -d "%Y:%m:%dT%H:%M:%SZ" -GPSDateTime<now File

and variations but the format always comes out like

GPS Date/Time  : 2021:04:13 18:20:09

The -d option specifies the date/time format that the user sees/uses.  It doesn't change how the value is stored, which depends on the metadata type.  If we're talking about XMP:GPSDateTime, it is always stored in standard XMP format (eg. 2021:04:13T18:20:09Z)

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