Skip to content

Instantly share code, notes, and snippets.

@anneallen
Created January 2, 2015 19:05
Show Gist options
  • Save anneallen/18133313887ac2df9718 to your computer and use it in GitHub Desktop.
Save anneallen/18133313887ac2df9718 to your computer and use it in GitHub Desktop.
Rotate Video 90 degrees using Handbrake
//This is a handy trick to rotate videos filmed in the wrong orientation (big problem with smartphones)
//Use Handbrake Version (0.99 or higher)
, --rotate=4
on the Extra Options under Video tab
@Cantar4
Copy link

Cantar4 commented Sep 15, 2016

I use Handbrake 20160906131026-b177d33-master and this no longer works
rotate 180° , --rotate=3 doesn't work either

@Weej1
Copy link

Weej1 commented Sep 25, 2016

Same issue as @Cantar4
To be clear though I'm using 0.10.2 from the ubuntu PPA mentioned on the site. On checking the logs I noticed this"

x264 options: Unknown suboption , --rotate

I tried finding what the proper format was but there doesn't seem to be any mention of rotation anywhere. I tried using Avidemux too but that just managed to crash half way through.

@tamsky
Copy link

tamsky commented Oct 24, 2016

https://tuxdiary.com/2013/11/24/rotate-video-using-handbrake/

Had the answer: It doesn't work in the gui any more (HandBrake 0.10.5)

Even on OSX, I'm unable to use the gui to trigger --rotate.

HandBrakeCLI does work though:

HandBrakeCLI -i infile.mp4 -o outfile.mp4 --rotate=3 -b 1000

@d108
Copy link

d108 commented Sep 29, 2019

This is a little different with the latest HandBrakeCLI (v1.2.2). The following command can rotate video by 90 degrees, clockwise.

$ HandBrakeCLI --preset="Fast 1080p30" --rotate="angle=90:hflip=0"

The supported values are [0, 90, 180, 270]. I only tested this on macOS but don't suspect other platforms will be different. This syntax probably also applies to the corresponding GUI version of HandBrake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment