15

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.

Seoul
  • 161
  • 1
  • 1
  • 6

2 Answers2

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
declension
  • 4,110
  • 22
  • 25
  • 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. – Pysis Mar 24 '17 at 19:07
  • Will this re-encode the video? I just want to set the rotation meta data, no re-encoding. – Csaba Toth Aug 14 '17 at 03:30
  • 1
    @csabaToth yes this just re-muxes, no re-encoding (see the `copy` codecs). – declension Aug 15 '17 at 07:58
  • @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-encode – declension Aug 15 '17 at 08:00
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.

Community
  • 1
  • 1
danielmhanover
  • 3,094
  • 4
  • 35
  • 51