How I Mirror MP4 Videos On The Ubuntu Command Line

Alright, listen up. You want to mirror an MP4 in Ubuntu? Good. Because wasting time on clunky interfaces and overpriced software is for amateurs. We’re going to do this the lean, mean, command-line way.

Here’s the deal: You’re going to use ffmpeg. It’s the Swiss Army knife of video manipulation. If you don’t have it, you’re not serious about video.

Step 1: Get ffmpeg (If You Don’t Have It Already)

Open your terminal. This is where the magic happens. Don’t be scared. It’s just a black box waiting for your commands.

sudo apt update
sudo apt install ffmpeg

Punch that in. Hit enter. Type your password. This updates your package list and then installs ffmpeg. If you already have it, it’ll just tell you it’s the latest version. Good.

Step 2: Mirror That Damn Video

Now, for the main event. You’ve got your video. Let’s say it’s called original_video.mp4. You want to flip it horizontally? Vertically? We can do both.

Horizontal Flip (Mirroring along the Y-axis):

This is what most people mean by “mirror.” It’s like looking in a mirror. Your left is its right, and vice versa.

ffmpeg -i original_video.mp4 -vf "hflip" mirrored_video_h.mp4
  • -i original_video.mp4: This tells ffmpeg your input file. Simple.
  • -vf "hflip": This is the crucial part. -vf means “video filter.” hflip is the filter for horizontal flip.
  • mirrored_video_h.mp4: This is your output file. Give it a descriptive name so you know what it is.

Vertical Flip (Mirroring along the X-axis):

Maybe you shot something upside down, or you’re going for some weird effect. This flips it top to bottom.

ffmpeg -i original_video.mp4 -vf "vflip" mirrored_video_v.mp4

Same principle, just vflip instead of hflip.

Both Horizontal and Vertical Flip:

You want to get real crazy? Flip it both ways.

ffmpeg -i original_video.mp4 -vf "hflip,vflip" mirrored_video_hv.mp4

See that comma? That chains the filters. You can combine them.

Understanding the Process (The ffmpeg Vibe):

When you run these commands, ffmpeg is going to work. It’ll show you a bunch of text, frames per second, encoding speeds. Don’t freak out. It’s just doing its job. When it’s done, you’ll have your mirrored video file in the same directory where you ran the command.

Why This Matters:

  • Speed: No opening bloated software, no clicking through menus. Type, enter, done. This is about efficiency.
  • Control: You have precise control over what you’re doing. No hidden settings, no weird defaults.
  • Scalability: If you have 100 videos to mirror, you can write a simple script to automate this. Try doing that with a GUI program. You can’t.

Now go. Take action. Mirror those damn videos and get back to building something big.