How to rotate a video on OSX with ffmpeg

03 January 2018   3 comments   Linux, MacOSX

Every now and then, I take a video with my iPhone and even though I hold the camera in landscape mode, the video gets recorded in portrait mode. Probably because it somehow started in portrait and didn't notice that I rotated the phone.

So I'm stuck with a 90° video. Here's how I rotate it:

ffmpeg -i -vf "transpose=2" ~/Desktop/

then I check that ~/Desktop/ looks like it should.

I can't remember where I got this command originally but I've been relying on my bash history for a looong time so it's best to write this down.
The "transpose=2" means 90° counter clockwise. "transpose=1" means 90° clockwise.

What is ffmpeg??

If you're here because you Googled it and you don't know what ffmpeg is, it's a command line program where you can "programmatically" do almost anything to videos such as conversion between formats, put text in, chop and trim videos. To install it, install Homebrew then type:

brew install ffmpeg



This is a great tip and I was so excited to see it work from ffmpeg but unfortunately, on QuickTime 10.4 you can no longer open the MOV after performing the transformation. I haven't found a way to work around this yet. Amazing how difficult it is to rotate a movie - I guess the difficulty is modifying something post-compression but in the case of these tools -decoding/re-encoding should be an obvious available option. If anyone knows of a solution - I would be eternally grateful.


iDealshare VideoGo also helps to rotate videos.


I use Avdshare Video Converter to rotate videos.
It has both Mac and Windows version.
Step 1: Add video to Avdshare Video Converter
Step 2: "Effect" button to open the 'Video Effect' window;
Then click '90 Clockwise button' to rotate video file 90 degrees, 180 degrees, 270 degrees; or click 'Flip Horizontal' button
Step 3: Click Convert button to finish rotating videos.

Your email will never ever be published

Related posts

Fastest way to uniquify a list in Python >=3.6 23 December 2017
Whatsdeployed facelift 05 January 2018
Related by Keyword:
Screenshot-sharing performance comparison 13 November 2015
Fastest way to take screencaps out of videos 19 December 2014
How I back up all my photos on S3 via Dropbox 28 August 2014
logrotating all my Zope event logs 06 February 2008