ffmpeg batch scales the image width and height to 1/2 of the original

1. Create a new txt file, copy the following code into it, and save it.

@echo off & title
 
cd /d %~dp0
 
for %%a in (*.jpg) do (
 
 ffmpeg -i "%%~sa" -vf scale=iw/2:ih/2 -q 2 "result\%%~na_%%06d.jpg"
 
)
 
pause

2. Change the file suffix to bat.

3. Place the file with the suffix bat into the video folder to be batch processed.

4. Make sure that ffmpeg is installed, double-click the bat file to execute it.

5. Parameter description:

-i input file, here refers to the video file.

-y means to directly overwrite the output file (if there is an original file) without asking.

-vf applies filter.

scale refers to the scaling ratio.

-q 2 indicates the image quality of the stored jpeg, generally 2 is high quality. If 0, compression quality level 0 is used, i.e. no compression. If the value of q is not specified, it defaults to 8.

Guess you like

Origin blog.csdn.net/mj412828668/article/details/128842797