我在目录中有一堆.dav文件,需要将目录中的所有文件转换为.mp4格式。我在Linux上顺便说一句,因此最好寻找一个命令行选项
经过一堆挖掘,找到了我想要的解决方案。 Bash是你的朋友:)
cd到目录:
for i in `ll|awk '{print $9}'|cut -d '.' -f1`;do ffmpeg -y -i $i.dav -vcodec libx264 -crf 24 -filter:v "setpts=1*PTS" $i.mp4; done
参考ffmpeg解决方案:here