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 thatvideo.mov -vf "transpose=2" ~/Desktop/thatvideo.mov
then I check that
~/Desktop/thatvideo.mov 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.
"transpose=2" means 90° counter clockwise.
"transpose=1" means 90° clockwise.
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.
I use iDealshare VideoGo to rotate video files: Step 1: Add video to iDealshare VideoGo; Step 2: Click Effect button to find the rotate option; Step 3: Click Convert button to finish rotating.
I think FFmpeg is not friendly for beginners like me. I am not tech-savvy and I don't understand how to rotate a video with FFmpeg even with a tutorial. I am personally using an easy alternative - Joyoshare Media Cutter, an all-in-one video editor. With it, I just need to drag my video to it - choose Encoding mode and output format - click Edit and select Adjust - touch Start to export. Very easy.