I Need to concatenate 2 small audio files with loop and add background music in a single command.
I am capable to concatenate two audio files with a background music. My
Use the concat demuxer.
Create a text file
file 1.mp3
file 2.mp3
and then,
ffmpeg -f concat -stream_loop -1 -i list.txt -i background.mp3
-filter_complex "[0]volume=1dB,aformat=fltp,pan=stereo|c0=c0|c1=c0[a0];
[1]volume=0.5dB,aformat=fltp,pan=stereo|c0=c0|c1=c1[a1];
[a0][a1]amix=inputs=2:duration=shortest,aformat=fltp[a]"
-map "[a]" -strict -2 -y output.mp3
Both 1.mp3 and 2.mp3 should have the same properties - sampling rate, channel layout..etc