concat 2 mini audio files and make a loop and add a background music

前端 未结 1 385
刺人心
刺人心 2021-01-28 01:28

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

1条回答
  •  深忆病人
    2021-01-28 01:37

    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

    0 讨论(0)
提交回复
热议问题