How can I rotate a video?
Solution 1:
You can also use ffmpeg and the commandline (taken from Rotating videos with FFmpeg):
Rotate 90 clockwise:
ffmpeg -i in.mov -vf "transpose=1" out.mov
For the transpose parameter you can pass:
0 = 90CounterCLockwise and Vertical Flip (default) 1 = 90Clockwise 2 = 90CounterClockwise 3 = 90Clockwise and Vertical Flip
And to flip it horizontally (ffmpeg documentation):
Flip the input video horizontally.
For example to horizontally flip the video in input with `ffmpeg':
ffmpeg -i in.avi -vf "hflip" out.avi
Nota bene 1
Older versions of Ubuntu supplied avconv
instead of ffmpeg
. In this case just change ffmpeg
to avconv
:
avconv -i in.mov -vf "transpose=1" out.mov
Nota bene 2
If the output is a .mp4
video you has to add strict -2
before the output file to avoid error message :
ffmpeg -i in.mp4 -vf "transpose=1" -strict -2 out.mp4
Solution 2:
If you are asking for rotate a video 90º or 180º, you should use avidemux.
sudo apt-get update
sudo apt-get install avidemux
- open the video in avidemux
- select a new video format and don't choose copy
- Under "Video" click on Filters
- Choose "Transform" and scroll down until you see rotate.
- Add it
- select the right angle
- select preview
- ok.
- Go to file
- save
- save video
And you're done.