I want to concatenate 2 audio files and play the third audio in the background. I used below code
ffmpeg -i 1.mp3 -i 2.mp3 -i background.mp3 -filter_complex "[0:0][1:0]concat=n=2:v=0:a=1,volume=1dB[a0];[2]volume=0.5dB[a1];[a0][a1]amerge[a]" -map "[a]" -strict -2 -y final.mp3
suggested here ffmpeg: How to concat audio files and add background music in a single command?
But it is giving error "The following filters could not choose their formats: Parsed_amerge_3 Consider inserting the (a)format filter near their input or output."
Please let me know what I'm doing wrong.
You can force the sample formats for inputs and output
ffmpeg -i 1.mp3 -i 2.mp3 -i background.mp3 -filter_complex "[0:0][1:0]concat=n=2:v=0:a=1,volume=1dB,aformat=fltp,pan=stereo|c0=c0|c1=c1[a0];[2]volume=0.5dB,aformat=fltp,pan=stereo|c0=c0|c1=c1[a1];[a0][a1]amerge,aformat=fltp[a]" -map "[a]" -strict -2 -y final.mp3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With