0

I've read this thread and this other one. They both explain well how to join a picture with an audio file to make a video (with ffmpeg).

However, I'm looking for a ffmpeg command that would merge a list of mp3 files and one picture to produce one video file. I would like to show the image for the duration of the mp3 audio list.

Can anybody suggest a working command and explaning it?

Galabyca
  • 195

2 Answers2

3

If I understood you correctly, you wish to combine all MP3s and have the video be a single picture. If so,

Prepare a text file containing the list of the MP3s in the order you want

file 'ABC.mp3'
file 'PQR.mp3'
file 'DEF.mp3'
...
file 'XYZ.mp3' 

Now, run

ffmpeg -loop 1 -framerate 5 -i image.png -f concat -i mp3list.txt -c:v libx264 -pix_fmt yuv420p -c:a copy -shortest output.mkv
Gyan
  • 38,955
2

You can use a Bash for loop:

mkdir outputdir
for f in *.mp3; do ffmpeg -i "$f" -framerate 5 -loop 1 -i image.jpg -c:v libx264 -c:a copy -pix_fmt yuv420p -shortest outputdir/"${f%.*}.mkv"; done

I assumed you're using Linux. You can do it in Windows too, but I'm not a Windows user so someone else will have to add that example.

Update: My example will make one video per MP3 input; all with the same image. If I have misinterpreted your question see Mulvya's answer to make one video from all of the MP3 inputs.

llogan
  • 63,280