答案1
for f in *.mkv;do ffmpeg -i "$f" -c:v copy -c:a aac -b:a 256k "${f%mkv}mp4";done
或者如果您不需要重新编码:
for f in *.mkv;do ffmpeg -i "$f" -c copy "${f%mkv}mp4";done
如果您想将新文件放在单独的目录中:
mkdir output
for f in *.mkv;do ffmpeg -i "$f" -c:v copy -c:a aac -b:a 256k "output/${f%mkv}mp4";done
答案2
为了鱼壳:
for f in *.mkv
set fnew (string replace .mkv .mp4 $f)
ffmpeg -i $f -c copy $fnew
end