Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg Flip video horizontally

anyone know can I make the video flip horizontal using batch file?

here my batch file code that I have tried :

@echo off

ffmpeg -i "1.mp4" -vf hflip -i audio1.mp3 -map 0:v -map 1:a -c:v copy -shortest "C:\Users\Admin\Desktop\Replaced Mp3\1.mp4"

pause
like image 899
Mena Avatar asked Sep 19 '25 21:09

Mena


2 Answers

Minimally, your code should be:

ffmpeg -i "input.mp4" -i "input.mp3" -vf hflip -map 0:v -map 1:a -shortest "output.mp4"

Note the order of where the video filter goes. -vf goes after the audio input in this code.

You can of course add your desired -c:v to something like libx264 or similar, and add other parameters such as bitrates etc.

like image 196
Rajib Avatar answered Sep 23 '25 10:09

Rajib


Here's how I would flip all MP4 videos in a folder and output it in a different folder in with a batch file from Windows 11, the full path were cut

for %%a in ("C:\Users\A-User-Name\Documents\movies\*.mp4") DO ffmpeg -i "%%a" -vf hflip -c:a copy "C:\Users\A-User-Name\Documents\movies\output\%%~na_hflip.mp4"

Note that for each and every input mp4, the output file name will be concatenated with "_hflip", which is achived using %%~na_hflip.mp4

I will save the above command in a .bat file and run it and it Work like a charm every time.

like image 34
Harry Avatar answered Sep 23 '25 10:09

Harry