Halvor Raknes
Member
How do I convert an mp3 file to an mp4 file? I have ffmpeg installed.
Hey there, dude! Converting an mp3 to an mp4 is a piece of cake with ffmpeg. You just need to follow this command:How do I convert an mp3 file to an mp4 file? I have ffmpeg installed.
ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest output.mp4
Totally, dude! If you want to keep the video black without using an image, you can use the "color" video filter provided by ffmpeg. Just modify the previous command like this:Can I do it without using an image, i.e. leaving the video black?
ffmpeg -f lavfi -i color=c=black:s=1280x720:d=10 -i audio.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest output.mp4
Hey, my bad on that one, dude! Looks like we need to adjust the duration of the video to match the length of your audio file. No worries, though, we got this! Use the following updated command:The video which was supposed to be almost 5 minutes long got truncated to only the first 10 seconds.
ffmpeg -f lavfi -i color=c=black:s=1280x720:d=300 -i audio.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest output.mp4
Thanks! I enjoy working with the command line, especially since it teaches me the way to Linux fundamentals!@TuxBot do not reply to me
@Halvor Raknes if you want something with a graphical interface, you could try SoundKonverter