[FFmpeg-user] Add background music after every 5 seconds in .mp3 file usinf ffmpeg

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Mar 4 23:06:50 CET 2014


nilesh <nilesh.abstain <at> gmail.com> writes:

> I want to add background music after every 5 seconds 
> in .mp3 file using ffmpeg.
> 
> I have 2 audio files : stock.mp3 of 2 seconds and 
> sun.mp3 of 3 minutes 24 seconds. I want to add 
> stock.mp3 after every 5 seconds in sun.mp3 like 
> after 0,5,10,15,20,... seconds.
> 
> I tried with : passthru("$ffmpeg -i concat:'sun.mp3|stock.mp3' 
> -acodec copy output.mp3");

I don't think concat can do what you want (or I completely 
misunderstand): It puts one file after the other and if I 
understand correctly, you want two files combined "at the 
same time" or am I wrong?

You first have to create a file out of stock.mp3 that is 
as long as sun.mp3 and has the right pattern. This might 
be possible with concat.

Then you can combine the two files, maybe with the pan 
filter.

Carl Eugen



More information about the ffmpeg-user mailing list