Write Rotation tag in MPEG4

Started by hajdbo, November 25, 2013, 05:03:48 PM

Previous topic - Next topic

hajdbo

Current ExifTool will not accept to write the Rotation tag in a MPEG4 video file.

I tried with a video created on an Android phone and on a MP4 video file created using HandBreak with output profile "Android"

File Type                       : MP4
MIME Type                       : video/mp4
Major Brand                     : MP4 v2 [ISO 14496-14]
Minor Version                   : 0.0.0
Compatible Brands               : mp42, isom, avc1


exiftool -Rotation VID_20131125_223725.mp4  VID_20131125_223750.mp4
======== VID_20131125_223725.mp4
Rotation                        : 90
======== VID_20131125_223750.mp4
Rotation                        : 0
    2 image files read


exiftool -tagsFromFile VID_20131125_223725.mp4 -Rotation VID_20131125_223750.mp4
    0 image files updated
    1 image files unchanged

exiftool -Rotation=90  VID_20131125_223750.mp4
    0 image files updated
    1 image files unchanged


Phil Harvey

Correct.  Changing the rotation of an MP4 video would be fairly complex.  I'm not even sure I know how to do this.  The Rotation tag is a Composite tag based on the MatrixStructure tag extracted from the video track.  This matrix controls more than just rotation.  It may also control things like aspect ratio, but I don't know for sure.  Also, there are other places where matrices are stored in the file, and I don't know which of these would be need to be changed.  My opinion is that this comes too close to image manipulations, and ExifTool doesn't venture into this realm.  I suggest finding a video editor to do 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 ($).