metadataexiftoolxmp

Copy values from one XMP tag to another XMP tag


I have a lot of images (JPG) with some metadata. I'm interested in these three tags, for example, from one of the images:

[XMP] FlightPitchDegree : 0.734793
[XMP] FlightRollDegree : -1.024403
[XMP] FlightYawDegree : 192.286436

I need to copy these values for each image to the next tags:

Xmp.Camera.Pitch Xmp.Camera.Roll Xmp.Camera.Yaw

Mostly for tag editing, I'm using ExifTool, but I can't find commands for copying values between tags inside one file. I'll be very appreciative of any recommendation.

Best, Andriy


Solution

  • To copy from one tag to another you would use the redirection feature of the -TagsFromFile option. Basically it would be
    exiftool "-TARGETTAG<SOURCETAG" file.xmp

    You have the names of the SourceTags (FlightPitchDegree/FlightRollDegree/FlightYawDegree), you just need to figure out the exiftool names of your target tags. I can find CameraPitch/CameraYaw/CameraRoll tags on the DJI Tags page, but those are not XMP tags. The only other place I can find tags with similar names are part of the XMP-Camera group, which are not built into exiftool and you would have to download the pix4d.config file and use the -Config option to include those definitions.

    exiftool -config /path/to/pix4d.config "-XMP:Pitch< FlightPitchDegree" "-XMP:Yaw<FlightYawDegree" "-XMP:Roll< FlightRollDegree" file.xmp
    

    The -config option must be the very first option in the command in order to load the definitions.