How to Flip Video Vertically Using FFmpeg vflip

This guide explains how to flip a video vertically using the FFmpeg vflip video filter. You will learn the core command syntax, how to preserve audio and control output quality, and how to combine vertical flipping with other transformations.

Basic Vertical Flip Command

To flip a video upside down (vertically), pass the vflip filter to the -vf (video filter) argument:

ffmpeg -i input.mp4 -vf "vflip" output.mp4

In this command:

  • -i input.mp4 specifies the input file.
  • -vf "vflip" applies the vertical flip filter.
  • output.mp4 is the destination file.

Preserving Audio and Controlling Quality

Applying a video filter requires re-encoding the video stream. However, you can copy the original audio stream without re-encoding to save processing time and prevent quality loss. You can also specify video encoding parameters such as the H.264 codec and a Constant Rate Factor (CRF) for optimal quality.

ffmpeg -i input.mp4 -vf "vflip" -c:v libx264 -crf 20 -c:a copy output.mp4
  • -c:v libx264 encodes the video using the H.264 video codec.
  • -crf 20 sets the visual quality (a lower value means higher quality; standard ranges are 18–28).
  • -c:a copy copies the audio stream directly without re-encoding.

Combining vflip with Other Filters

FFmpeg allows chaining multiple filters using commas. For example, if you need to flip a video both vertically and horizontally (effectively a 180-degree rotation), chain vflip with hflip:

ffmpeg -i input.mp4 -vf "vflip,hflip" -c:a copy output.mp4

You can also combine vflip with scaling:

ffmpeg -i input.mp4 -vf "vflip,scale=1920:1080" -c:a copy output.mp4