How to edit or add video metadata of "rotation" in mp4?
Asked Answered
O

3

16

I want put rotation information into my mp4 video file but I have no idea about this.

Is there any program that I can add "rotation" metadata? It would be OK if there's the way to edit video content with hexa editor.

Ouphe answered 19/4, 2012 at 4:45 Comment(0)
C
22

+1 for FFMpeg. More specifically, I had good results correcting orientation metadata with

ffmpeg -i input.mp4 -metadata:s:v rotate=90 -vcodec copy -acodec copy output.mp4
Corruption answered 22/7, 2015 at 20:47 Comment(4)
Does this still work? I have FFmpeg version 3.2.4 on a Mac with Brew, and rotate 0, 1, 2, and 3 are all not transforming the resultant video file at all. Side note, I have recorded my video files with a video camera, and they appear fine in VLC. I reduce the bitrate to a custom value. and optimize for web in Handbrake, then for the resultant video I can only hear audio, and in Mac's Quick Look feature in Finder, it is rotated 180 degrees.Raillery
Will this re-encode the video? I just want to set the rotation meta data, no re-encoding.Fubsy
@csabaToth yes this just re-muxes, no re-encoding (see the copy codecs).Corruption
@pysis - I just re-tested and it works fine here, but you'll need to do 0, 90, 180, 270 not 0,1,2,3 it seems. Your player has to support that metadata of course - if not you'll have to physically transpose the video (ffmpeg can do this too) and re-encodeCorruption
T
1

Check out the software FFMpeg, use ffprobe to give you the rotation metadata of any video file if it has it.

Check out this answer for functions allowing your to rotate videos.

Tragicomedy answered 10/7, 2012 at 17:22 Comment(0)
T
0

See my more in depth answer to same question here

In summary:

exiftool -Rotation=90 your_file.mp4

Set the value to whatever you need. Eg, if you are removing unwanted rotation, set to 0.

More info on the fantastic exiftool can be found here: https://exiftool.org

Transcendentalism answered 1/2 at 23:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.