How to Rotate Video 90 Degrees Counterclockwise in FFmpeg

Rotating a video is a common editing task that can be easily accomplished using FFmpeg’s powerful command-line interface. This article explains how to use the FFmpeg transpose filter to rotate any video 90 degrees counterclockwise (to the left). You will learn the exact command to run, how the filter parameters work, and how to preserve your audio stream during the rotation process.

To rotate a video 90 degrees counterclockwise, you need to use the video filter flag (-vf) along with the transpose filter set to a value of 2.

Here is the standard command to perform this rotation:

ffmpeg -i input.mp4 -vf "transpose=2" output.mp4

Understanding the Command Parameters

Optimizing the Process

Applying a video filter like transpose requires FFmpeg to decode and re-encode the video stream, which can take some time depending on your system’s hardware. However, you can speed up the process by copying the audio track directly without re-encoding it.

To copy the audio stream without changes, add the -c:a copy parameter to your command:

ffmpeg -i input.mp4 -vf "transpose=2" -c:a copy output.mp4

Using this optimized command ensures that your video is rotated exactly 90 degrees counterclockwise while keeping the original audio quality intact and reducing the overall processing time.