Have you ever taken a video with a digital camcorder, phone or camera only to have it come out sideways? I am sure we’ve all done this! If you are running linux you can easily rotate these videos using a free tool called FFMPEG.
Open your terminal program and obtain the program if you do not already have it installed. If you have it installed this command will just exit.
$ sudo apt install ffmpeg
After installing ffmpeg, change to the directory that contains the video file you wish to rotate and enter the following command that will actually rotate the video.
$ ffmpeg -i <video to rotate> -vf "transpose=1" -c copy <rotated video file>
The in the two placeholders (<video to rotate> and <rotated video file>) enter the full file name of the video you wish to rotate, and what you’d like the output file to be called.
Transpose can have several different values.
Rotate clockwise 90 degrees.
- Rotate counterclockwise 90 degrees.
Transpose can also be used to rotate and flip the image. Use values of 0 (clockwise) and 3 (counterclockwise) respectively.
In some cases you may have to omit the “-c copy” argument. Including this significantly speeds up the process, but sometimes a re-encode is required and ffmpeg may indicate that you should omit this.
Check out more of our How-To’s for additional great tips like this one.