Recently I recorded a video with my mobile inverted. When searching for a tool to undo the rotation I found that HandBrake can do what I wanted. HandBrake is a very popular and powerful multiplatform transcoder that gives fantastic output video and audio qualities at a smaller size if the right parameters are used. It has both GUI and CLI modes. There are many powerful switches in the CLI mode. For example to rotate a video by 90° clockwise, try the following command:
$ HandBrakeCLI -i input.mp4 -o output.mkv --preset=Custom --rotate=4
where Custom
is one of the presets you saved in the GUI mode.
You can do the same from the GUI as well, add the following to Video ▸ Extra options (available only for x264 on Linux):
Custom --rotate=4
There is a better option for those GUI folks. Place the equivalent CLI syntax into the field.
Hi!
Thank you! Can you please point out which field you mean?
Add this command in the Video > Extra Options:
Custom –rotate=4
Thank you! On Linux it would be Video > More Settings.
I tried adding the following to the Video tab/Extra Options box on the HandBrake GUI, but none succeeded (on Win XP):
rotate=4
-rotate=4
–rotate=4
Custom –rotate=4
Custom –rotate=4
–preset=Custom –rotate=4
If you check the Video/Use The Advanced Tab box in the HandBrake GUI (XP), and then add the following to the x264 Encoder Options text box, the rotate parameter works great!:
–preset=Custom –rotate=4
The following does work great in DOS at the command line however:
HandBrakeCLI.exe -i input.mov -o output.mp4 –preset=Custom –rotate=4
I guess I need to run it 3 times to rotate 270 degrees.
I’ve tried these on XP and it worked:
, –rotate=3 ROTATE 180 DEGREES
, –rotate=4 ROTATE CLOCKWISE
, –rotate=7 ROTATE ANTI-CLOCKWISE
Thanks for confirming!
rotate video 2015/4/16
Hi, I just used the command above “Custom –rotate=4” on running Handbrake on Win7 and worked.
Thanks for confirming!
Thank you for this! I used the CLI options and could successfully rotate. Doing so in the GUI failed for all reported options here, as well as elsewhere online. Seems to plain not work in the GUI (in Ubuntu 16.04).
Thanks for the update!