How do you convert an entire directory with ffmpeg?

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

    @Linux To convert a bunch, my one liner is this, as example (.avi to .mkv) in same directory:

    for f in *.avi; do ffmpeg -i "${f}" "${f%%.*}.mkv"; done
    

    please observe the double "%%" in the output statement. It gives you not only the first word or the input filename, but everything before the last dot.

提交回复
热议问题