How do you convert an entire directory with ffmpeg?

前端 未结 26 2521
长发绾君心
长发绾君心 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:00

    I'm using this one-liner in linux to convert files (usually H265) into something I can play on Kodi without issues:

    for f in *.mkv; do ffmpeg -i "$f" -c:v libx264 -crf 28 -c:a aac -b:a 128k output.mkv; mv -f output.mkv "$f"; done
    

    This converts to a temporary file and then replaces the original so the names remain the same after conversion.

提交回复
热议问题