Page 1 of 1

Rotate a video without reencoding it

Posted: Wed Apr 03, 2019 1:34 pm
by Gonimo
Hi
In MediaCoder, it is possible to change the ratio of a video without re-encoding it.
There is also a function to rotate a video, but not without re-encoding it. :cry:
However, many phones and other programs include this feature.

With MediaInfo installed on its system (Included in K-Lite Codec Pack), we then see the "Rotation" line among the various information of the video.

Image

This allows you to rotate a video quickly and without loss of quality.
It is a shame to have to use another program to access this feature.
Could not we include it in a future version of MediaCoder?

Re: Rotate a video without reencoding it

Posted: Mon Jul 15, 2019 7:23 pm
by flagpole
mediacoder is a transcoder, that's why it exists. What your after is a metadata editor.

Re: Rotate a video without reencoding it

Posted: Tue Jul 16, 2019 12:10 am
by Gonimo
flagpole wrote:
Mon Jul 15, 2019 7:23 pm
mediacoder is a transcoder, that's why it exists. What your after is a metadata editor.
Although this kind of rotation is visible in MediaInfo, it does not make the change.
For example, to run a rotation with an MP4 file without re-encoding:

1. Open your MP4 file with HxD (or another Hexadecimal editor).
2. Find values for a non-rotating video:
000100000000000000000000000000000001000000000000000000000000000040

3. The value is present several times in the file.
Find and replace only the second and third times with one of the following values:

180°
FFFF0000000000000000000000000000FFFF000000000000000000000000000040

90° Clockwise
000000000001000000000000FFFF00000000000000000000000000000000000040

90° Counter clockwise
00000000FFFF000000000000000100000000000000000000000000000000000040

4. Save the changes to your file or create in a new one not forgetting its extension (.mp4).