Convert mp3 to mp4 In Batch


Table of Contents

Headnotes

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


Footnotes

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, https://www.earnfs.com/en/html/107.htm.

or

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


EarnFromScratch (September 30, 2020) Convert mp3 to mp4 In Batch. Retrieved from https://www.earnfs.com/en/html/107.htm.
"Convert mp3 to mp4 In Batch." EarnFromScratch - September 30, 2020, https://www.earnfs.com/en/html/107.htm
EarnFromScratch May 31, 2017 Convert mp3 to mp4 In Batch., viewed September 30, 2020,<https://www.earnfs.com/en/html/107.htm>
EarnFromScratch - Convert mp3 to mp4 In Batch. [Internet]. [Accessed September 30, 2020]. Available from: https://www.earnfs.com/en/html/107.htm
"Convert mp3 to mp4 In Batch." EarnFromScratch - Accessed September 30, 2020. https://www.earnfs.com/en/html/107.htm
"Convert mp3 to mp4 In Batch." EarnFromScratch [Online]. Available: https://www.earnfs.com/en/html/107.htm. [Accessed: September 30, 2020]


Leave a Reply