- 1 year ago
FFmpeg, MPEG4 video rotate and Windows
Rotating a video using FFmpeg on Windows involves using the command-line interface of FFmpeg to apply the rotation filter. Here's how you can do it:
Download FFmpeg: If you haven't already, download the FFmpeg executable for Windows from the official website: https://ffmpeg.org/download.html
Rotate Video: Open Command Prompt and navigate to the folder where you placed the FFmpeg executable.
Run FFmpeg Command: Use the following command to rotate a video:
bashffmpeg -i input.mp4 -vf "transpose=1" output.mp4
In this example, -i input.mp4
specifies the input video file, and -vf "transpose=1"
applies the transpose filter to rotate the video 90 degrees clockwise. You can adjust the filter value (1
, 2
, or 3
) to rotate the video in different directions. For example, use transpose=2
for 90 degrees counterclockwise.
- Output Video: After running the command, FFmpeg will create the rotated video named
output.mp4
.
Remember to replace input.mp4
with the actual path to your input video file and adjust the output filename as needed.
Here's a quick overview of the transpose filter values:
transpose=1
: Rotate 90 degrees clockwise and flip horizontallytranspose=2
: Rotate 90 degrees counterclockwisetranspose=3
: Rotate 90 degrees clockwisetranspose=0
: No rotation (default)
Make sure to experiment with different filter values to achieve the desired rotation.
Keep in mind that FFmpeg is a powerful tool with numerous features and options. You can find more information about FFmpeg's filters and video manipulation capabilities in the official documentation: https://ffmpeg.org/documentation.html