Merge XMP info to MOV files

Started by MikeVP, April 11, 2024, 05:25:43 PM

Previous topic - Next topic

MikeVP

I exported my videos from Apple Photos Library using the Export Unmodified Originals option. But what do you know, the dates are completely wrong. The dates that the finder shows are the dates the videos were imported into the Photos library, not the date they were shot. However, inside the XMP files that are also exported, the correct created dates are there.

How do I go about reading the dates inside the XMP files and writing them to make the video files show the correct created dates? Thank you.

Here is the contents of an example XMP file:

<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:GPSHPositioningError>3.5518960000000002</exif:GPSHPositioningError>
         <exif:GPSImgDirection>0.0</exif:GPSImgDirection>
         <exif:GPSAltitudeRef>0</exif:GPSAltitudeRef>
         <exif:GPSAltitude>0.0</exif:GPSAltitude>
         <exif:GPSLatitudeRef>N</exif:GPSLatitudeRef>
         <exif:GPSLatitude>40.913200000000003</exif:GPSLatitude>
         <exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>
         <exif:GPSLongitude>74.127099999999999</exif:GPSLongitude>
         <exif:GPSImgDirectionRef>T</exif:GPSImgDirectionRef>
         <exif:GPSSpeed>0.0</exif:GPSSpeed>
         <exif:GPSSpeedRef>K</exif:GPSSpeedRef>
         <exif:GPSTimeStamp>2022-12-25T16:10:21Z</exif:GPSTimeStamp>
         <photoshop:DateCreated>2022-12-25T16:10:21-05:00</photoshop:DateCreated>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>

Phil Harvey

I'll have to make some assumptions because you haven't given me enough information>

1. Assuming the XMP files have the same name but with a ".xmp" extension.

2. Assuming they are in the same directory as the other files.

3. Assuming the other files are MP4.

4. Assuming you want to do this to multiple files at once.

5. Assuming you want to use the photoshop:DateCreated date/time.

Then the command could be:

exiftool -tagsfromfile %d%f.xmp "-filemodifydate<datecreated" "-filecreatedate<datecreated" -ext mp4 DIR

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