Writing / Copying the 'video-orientation' tag?

Started by sabaatworld, February 23, 2021, 02:58:30 PM

Previous topic - Next topic

sabaatworld

The videos associated with live photos taken on iPhone 12 (or similar) seems to use the 'video-orientation' tag to determine if the video needs to mirrored or not. After compressing the video in my application, I'm trying to copy over the tag value from the original file but its not working. According to the https://exiftool.org/TagNames/QuickTime.html page, the 'video-orientation' is not writable.

I wanted to know if there are any plans to support this tag in the future or if there are any alternates to copying over / writing this tag?

'video-orientation'  values for photos captured with the front camera of iPhone 12:
6,1,8,3 <- Normal Mode
5,2,7,4 <- Mirrored Mode (selected in Camera settings)


Phil Harvey

I'll look into this and post back if I have any questions or require samples, but looking at my comments in the code it may be difficult to add the ability to write this.

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


Phil Harvey

OK.  The problem here is that this information is not written in the top-level metadata.  Instead, it is stored in the timed metadata (presumably so it will change if the phone is rotated during the video).  ExifTool doesn't yet have the ability to write timed metadata, and it is unlikely that this feature will be added in the foreseeable future because it would be a very difficult addition for a number of reasons.

However, it seems as if the values correspond to the normal EXIF:Orientation values, so I'll add a human-readable conversion for this tag when reading.

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

sabaatworld

Didn't knew about timed metadata. The reason I wanted to copy over the values from the original file was so that I wouldn't need to deal with rotating and / or mirroring the video.