How to Horizontally Flip Video using FFmpeg

  • Post category:FFmpeg

In the world of video editing, adding a horizontal flip to your content can create eye-catching and dynamic visual effects. In this comprehensive guide, we’ll dive into the art of horizontally flip videos using FFmpeg, a powerful and versatile tool.

Step 1: Verify FFmpeg Installation

To start, confirm whether FFmpeg is already installed on your system. If it’s not present, you can either get it from the official website or follow our step-by-step installation guide.

Step 2: Launch Your Command Prompt or Terminal

Next, proceed by opening the command prompt (for Windows users) or the terminal (for Mac and Linux users).

Step 3: Horizontally Flip Video using FFmpeg

To horizontally flip a video using ffmpeg, you can use the hflip filter:

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

This will:

  • Take input.mp4 as input
  • Apply the hflip (horizontal flip) filter
  • Save the flipped video as output.mp4

Some examples:

  • Flip video left-to-right:
ffmpeg -i input.mp4 -vf "hflip" flipped.mp4

Flip specific section only:

ffmpeg -i input.mp4 -vf "trim=start=10:end=20,hflip[flipped];[0:v][flipped]concat" -c:a copy output.mp4
  

Flips 10-20 seconds.

So in summary, the hflip filter provides an easy way to horizontally flip video using ffmpeg.