ffmpeg batch merges pictures into videos

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

@echo off & title
 
cd /d %~dp0
 
ffmpeg -y -framerate 1 -f image2 -i "images\%%d.jpg" -s 800x800 -q:v 1 "test.mp4"

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:

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

-framerate specifies the frame rate of the output video, the default is 25. 1/2 means 1 frame every 2 seconds, 1/3 means 1 frame every 3 seconds, and the test found that 1/4 will cause problems.

-i input file, here refers to the image file. %d refers to merging the images in the order of 1.jpg, 2.jpg, 3.jpg...

-s specifies the resolution of the output video. If not specified, the resolution of the first input image will be used as the resolution of the output video.

-q:v 1 q is the quality, v is the video, the value range of v is [1, 35], when the value is 1, it corresponds to the best video quality.

Guess you like

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