Convert mp3 to mp4 In Batch

Table of Contents


Many equations and formulas look intimidating. However, when you hunt them down, they are definitely not! Just papertigers!

Now let's hunt the papertiger.

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


There are many excellent tutorials out there. Some tutorials are too intuitive and it's helpful, but you cannot get it straight on the math details. Some focused on dymestifying math. Some focused on code. I found the best tutorials that give you the conceptual ideas and are possible for implementation without being blind to the math details. Drop a comment if I failed. It would be really appreciable.

If you want to cite this article, please cite this article as:

Lachlan Chen, "Convert mp3 to mp4 In Batch," in EarnFromScratch, May 31, 2017,


title=Convert mp3 to mp4 In Batch,
author={Chen, Lachlan},
year=May 31, 2017

EarnFromScratch (September 25, 2021) Convert mp3 to mp4 In Batch. Retrieved from
"Convert mp3 to mp4 In Batch." EarnFromScratch - September 25, 2021,
EarnFromScratch May 31, 2017 Convert mp3 to mp4 In Batch., viewed September 25, 2021,<>
EarnFromScratch - Convert mp3 to mp4 In Batch. [Internet]. [Accessed September 25, 2021]. Available from:
"Convert mp3 to mp4 In Batch." EarnFromScratch - Accessed September 25, 2021.
"Convert mp3 to mp4 In Batch." EarnFromScratch [Online]. Available: [Accessed: September 25, 2021]

Leave a Reply