How do you convert an entire directory with ffmpeg?

前端 未结 26 2160
长发绾君心
长发绾君心 2020-11-22 04:33

How do you convert an entire directory/folder with ffmpeg via command line or with a batch script?

26条回答
  •  悲&欢浪女
    2020-11-22 05:11

    This is what I use to batch convert avi to 1280x mp4

    FOR /F "tokens=*" %%G IN ('dir /b *.avi') DO "D:\Downloads\ffmpeg.exe" -hide_banner -i "%%G" -threads 8 -acodec mp3 -b:a 128k -ac 2 -strict -2 -c:v libx264 -crf 23 -filter:v "scale=1280:-2,unsharp=5:5:1.0:5:5:0.0" -sws_flags lanczos -b:v 1024k -profile:v main -preset medium -tune film -async 1 -vsync 1 "%%~nG.mp4"
    

    Works well as a cmd file, run it, the loop finds all avi files in that folder.

    calls MY (change for yours) ffmpeg, passes input name, the settings are for rescaling up with sharpening. I probs don't need CRF and "-b:v 1024k"...

    Output file is input file minus the extension, with mp4 as new ext.

提交回复
热议问题