The other day I ran into a problem which is becoming increasingly common – how to right a video, taken from an iphone, which displays on its side?
I do most of my video conversions with ffmpeg, but the version I have doesn’t have any support for rotating videos (though it does have the possibility of horizontal or vertical flipping), so I had to turn to the useful MEncoder tool included with Mplayer.
The presumption here is that you’re working on windows:
Now we’re going to run a very simple command to rotate the video – there are plenty of other options that you can use, but for the purpose of this we’re just interested in rotating the video 90°
Now to explain some of the above.
-vf means video filter
-o stands for the output file MEncoder will create a new file for you based on what you name here.
rotate is the main filter we’re using. It takes a numeric value for as follows:
0 -> 90 Degree Clockwise + Mirrored
* 1-> 90 Degree Clockwise
* 2-> 90 Degree Anticlockwise
* 3-> 90 Degree Anticlockwise + Mirrored
-oac stands for output audio codec. In the above example we’re copying the audio codec from the input file to the output. You may come across an error here if there’s a conflict, in which case you can substitute -oac pcm for -oac copy (see more information here)
-ovc stands for output video codec, and lavc is an ffmpeg library which should do the job fine for you (see more information on video codecs here)
So that’s it. Run the command line, and after a minute or two, depending obviously upon the size of your video, you should find your new video file which will show the right way up!