11/3/2025
Fix incorrectly oriented videos with FFmpeg. Learn the simple, one-line command to rotate a video 90, 180, or 270 degrees clockwise or counter-clockwise in seconds.
How to Rotate a Video 90/180 Degrees with FFmpeg (Fix Incorrect Orientation)
Have you ever faced this annoying issue? You shoot a vertical video with your phone, but when you play it on your computer, it's lying on its side. This is an incredibly common problem. Luckily, you don't need a complex video editor; FFmpeg can get your video standing upright with a single command.
🚀 Quick Path: The FFmpeg Command
To rotate a video (input.mp4) 90 degrees clockwise, use the following command:
ffmpeg -i input.mp4 -vf "transpose=1" output_rotated.mp4
After running this, you'll have a new video with the correct orientation.
🧠The Breakdown: What Each Parameter Means
The core of this command is the transpose filter. Let's break it down:
| Parameter | Explanation | Example |
|---|---|---|
ffmpeg |
The command to start the FFmpeg program. | ffmpeg |
-i input.mp4 |
-i (input) points to your source video file. |
-i my_vertical_video.mov |
-vf |
Short for "video filter," this tells FFmpeg you are about to apply a video filter. | -vf |
"transpose=N" |
This is the filter used for rotation. N is a number that determines the direction of the rotation. |
"transpose=1" |
output_rotated.mp4 |
The filename for your new, rotated video. | fixed_video.mp4 |
FAQ & Variations
Q: What do the numbers for transpose mean? How do I rotate in other directions?
A: Excellent question! The transpose filter uses numerical parameters to control the rotation, which are easy to remember:
Value of N |
Rotation Operation |
|---|---|
0 |
Rotate 90 degrees counter-clockwise and vertically flip |
1 |
Rotate 90 degrees clockwise (most common) |
2 |
Rotate 90 degrees counter-clockwise |
3 |
Rotate 90 degrees clockwise and vertically flip |
So, if you want to rotate 90 degrees counter-clockwise, simply change the command to:
ffmpeg -i input.mp4 -vf "transpose=2" output_rotated_ccw.mp4
Q: How do I rotate a video 180 degrees (upside down)?
A: FFmpeg doesn't have a direct parameter for a 180-degree rotation, but you can achieve it by applying a 90-degree rotation twice! This showcases the power of FFmpeg's filter chaining.
To rotate 180 degrees, you can apply two consecutive 90-degree clockwise rotations:
ffmpeg -i input.mp4 -vf "transpose=1,transpose=1" output_rotated_180.mp4
Inside the -vf parameter, you can chain multiple filters by separating them with a comma ,. They will be applied to the video in sequence.