Copy date from xmp sidecar to .mov video

Started by vdmerwedj, March 18, 2023, 07:37:38 AM

Previous topic - Next topic

vdmerwedj

Hi,

I've got an xmp side car with the following content:

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 6.0.0">
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:exif="http://ns.adobe.com/exif/1.0/"
            xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
        <exif:GPSLongitude>26.689899</exif:GPSLongitude>
        <exif:GPSLongitudeRef>E</exif:GPSLongitudeRef>
        <exif:GPSHPositioningError>1</exif:GPSHPositioningError>
        <exif:GPSLatitudeRef>S</exif:GPSLatitudeRef>
        <exif:GPSLatitude>26.81728</exif:GPSLatitude>
        <exif:GPSTimeStamp>2022-12-15T07:25:43Z</exif:GPSTimeStamp>
        <photoshop:DateCreated>1980-11-01T06:24:28+02:00</photoshop:DateCreated>
      </rdf:Description>
  </rdf:RDF>
</x:xmpmeta>

I would like to copy the photoshop:DateCreated tag to the quicktime:CreationDate tag in a .mov video.

I've tried:
-overwrite_original src.xmp '-quicktime:CreationDate<photoshop:DateCreated'  dest.mov
but no luck.

wywh

That looks like .xmp exported from macOS Photos.app, right?

macOS 11 Big Sur - macOS 13 Ventura Photos.app ignore the standard for GPS data with its "Export IPTC as XMP" option.

According to the specification, the XMP GPSLatitude/Longitude tags have the reference directions included instead of in a separate tag in the form "DDD,MM,SSk" or "DDD,MM.mmk".

So instead:

<exif:GPSLatitude>36.610100000000003</exif:GPSLatitude>
<exif:GPSLatitudeRef>S</exif:GPSLatitudeRef>
<exif:GPSLongitude>66.915149999999997</exif:GPSLongitude>
<exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>

It should be:

<exif:GPSLatitude>36,36,36S</exif:GPSLatitude>
<exif:GPSLongitude>66,54,54W</exif:GPSLongitude>


https://exiftool.org/forum/index.php?topic=12634.msg68327#msg68327

During the last few years I have reported this to Apple a few times.

Despite that non-standard GPS, eastern and northern coordinates work with something like:

exiftool -overwrite_original_in_place -api QuickTimeUTC=1 -ext mp4 -ext m4v -ext mov -tagsFromFile %d%f.xmp -api QuickTimeUTC=1 '-AllDates<XMP-photoshop:DateCreated' '-Track*Date<XMP-photoshop:DateCreated' '-Media*Date<XMP-photoshop:DateCreated' '-Keys:CreationDate<XMP-photoshop:DateCreated' '-Keys:GPSCoordinates<$XMP:GPSLatitude#, $XMP:GPSLongitude#' '-Keys:Title<XMP-dc:Title' '-Keys:Description<XMP-dc:Description' '-Keys:Keywords<XMP-dc:Subject' '-FileCreateDate<XMP-photoshop:DateCreated' '-FileModifyDate<XMP-photoshop:DateCreated' .
Or without #:

exiftool -overwrite_original_in_place -api QuickTimeUTC=1 -ext mp4 -ext m4v -ext mov -tagsFromFile %d%f.xmp -api QuickTimeUTC=1 '-AllDates<XMP-photoshop:DateCreated' '-Track*Date<XMP-photoshop:DateCreated' '-Media*Date<XMP-photoshop:DateCreated' '-Keys:CreationDate<XMP-photoshop:DateCreated' '-Keys:GPSCoordinates<$XMP-exif:GPSLatitude, $XMP-exif:GPSLongitude' '-Keys:Title<XMP-dc:Title' '-Keys:Description<XMP-dc:Description' '-Keys:Keywords<XMP-dc:Subject' '-FileCreateDate<XMP-photoshop:DateCreated' '-FileModifyDate<XMP-photoshop:DateCreated' .
But in western and southern coordinates there must be a workaround for that non-standard GPS because otherwise the location is put to the other side of the globe!

So to bypass that non-standard GPS flaw, use something like:

exiftool -overwrite_original_in_place -api QuickTimeUTC=1 -ext mp4 -ext m4v -ext mov -tagsFromFile %d%f.xmp -api QuickTimeUTC=1 '-AllDates<XMP-photoshop:DateCreated' '-Track*Date<XMP-photoshop:DateCreated' '-Media*Date<XMP-photoshop:DateCreated' '-Keys:CreationDate<XMP-photoshop:DateCreated' '-Keys:GPSCoordinates<$XMP:GPSLatitude# $XMP:GPSLatitudeRef, $XMP:GPSLongitude# $XMP:GPSLongitudeRef' '-Keys:Title<XMP-dc:Title' '-Keys:Description<XMP-dc:Description' '-Keys:Keywords<XMP-dc:Subject' '-FileCreateDate<XMP-photoshop:DateCreated' '-FileModifyDate<XMP-photoshop:DateCreated' .
https://exiftool.org/forum/index.php?topic=13167.0

That command updates also Date, Title, Description and Keywords that are edited in Photos.app. QuickTime Player and Photos.app can display the updated movie tags in .mp4, .m4v and .mov.

https://exiftool.org/forum/index.php?topic=11969.0

- Matti

vdmerwedj

Thanks Matti. It must have taken a lot of work to figure that out. Do you think it's possible to have one command that will do this for both the photos and videos that Apple photos exports with the xmp sidecars?

wywh

Quote from: vdmerwedj on March 18, 2023, 11:16:17 AMone command that will do this for both the photos and videos

I always edit all metadata with GraphicConverter or exiftool before importing them to Photos or Google Photos. If I have to re-edit metadata, I export the images out for editing. ...or actually I just edit the originals archived elsewhere in plain folders, and delete and re-import them in those viewers (I do not trust either as a main archive). Google Photos .json sidecars have their own flaws and workarounds.

Movie and image metadata is so different that I prefer to edit them separately. The last link has some info how to copy Photos sidecar .xmp to images.

- Matti