How to find if a video is auto-rotated? Show real auto-rotate header field of MP4 ?

Started by thoste, January 17, 2023, 08:07:40 AM

Previous topic - Next topic

thoste

Assume I have a *.MP4 video with a resolution of 2400 x 1080 pixel or 1080 x 2040 pixel.

When I double click it the well known VLC video player on Windows plays it correctly in portrait mode.
When I load it into Avidemux then its somehow shown and loaded rotated by 90 deg to the left.

How do I find out if the MP4 video file really contains a header field with a auto-rotate value of 90 deg counterclockwise?

Is there a peek-into-video-header function in Avidemux?

If there is currently such a header value:
How can I auto-rotate the video (with minimum quality loss) in Avidemux by 90 deg clockwise and set the auto-rotate flag in header to 0 (=zero)?

Thomas


eumagga0x2a

Quote from: thoste on January 17, 2023, 08:07:40 AMWhen I load it into Avidemux then its somehow shown and loaded rotated by 90 deg to the left.

By design, Avidemux shows videos as they are encoded, it doesn't apply any transformations.

Quote from: thoste on January 17, 2023, 08:07:40 AMHow do I find out if the MP4 video file really contains a header field with a auto-rotate value of 90 deg counterclockwise?

Rotation metadata is stored in MP4 containers as a display matrix in the track header ("tkhd" atom), it is always present. Avidemux doesn't evaluate it in any way, 36 bytes skipped right before reading 2 x 4 bytes used to store width and height contain the matrix.