How do you convert an entire directory with ffmpeg?

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

    If you have GNU parallel you could convert all .avi files below vid_dir to mp4 in parallel, using all except one of your CPU cores with

    find vid_dir -type f -name '*.avi' -not -empty -print0 |
        parallel -0 -j -1 ffmpeg -loglevel fatal -i {} {.}.mp4
    

    To convert from/to different formats, change '*.avi' or .mp4 as needed. GNU parallel is listed in most Linux distributions' repositories in a package which is usually called parallel.

提交回复
热议问题