Convert mp3 to mp4 In Batch

Solution 1:
ls *.mp3 | while read mp3File ; do outputFile=$(basename "${mp3File}" .mp3) ; ffmpeg -i "${mp3File}" -loop 1 -i image.png -c:a copy -c:v libx264 -shortest "${outputFile}".mp4 ; done

Solution 2:

$ mkdir out
$ for f in *.mp3; do ffmpeg -f lavfi -i color=s=160x120:r=2 -i "$f" \
-c:v libx264 -preset ultrafast -c:a copy -shortest \
out/"${f%.mp3}.mp4"; done

发表评论

zh_CN简体中文