Add background music after every 5 seconds in .mp3 file usinf ffmpeg

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Add background music after every 5 seconds in .mp3 file usinf ffmpeg

Nilesh
Hi All

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");

Its working fine but its added stock.mp3 at last and i want to add it after every 5 seconds .

So i used passthru("$ffmpeg -i concat:'sun.mp3|stock.mp3' -itsoffset 00:00:05 -acodec copy output.mp3");

The itsoffset is not working.

How can i do it ? Please help me...

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Add background music after every 5 seconds in .mp3 file usinf ffmpeg

Carl Eugen Hoyos
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

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: Add background music after every 5 seconds in .mp3 file usinf ffmpeg

Nilesh
Hi Carl,

Yes you are right, i want to combine both audio files . The stock.mp3(2 seconds) should combine after each 5 seconds of interval to sun.mp3(3 minutes 24 seconds). Please give me reference how can i do it...



On 5 March 2014 03:37, Carl Eugen Hoyos [via FFmpeg-users] <[hidden email]> wrote:
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

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user



To start a new topic under FFmpeg-users, email [hidden email]
To unsubscribe from Add background music after every 5 seconds in .mp3 file usinf ffmpeg, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Add background music after every 5 seconds in .mp3 file usinf ffmpeg

Nilesh
In reply to this post by Carl Eugen Hoyos
Hi Carl,

I want to do something like http://www.pond5.com/stock-music/1548490/pulse-full-track.html. Here the site name is audible after some duration and i want to do same thing using ffmpeg for windows operating system.

Thanks in advance


On 5 March 2014 09:59, Nilesh Kumar <[hidden email]> wrote:
Hi Carl,

Yes you are right, i want to combine both audio files . The stock.mp3(2 seconds) should combine after each 5 seconds of interval to sun.mp3(3 minutes 24 seconds). Please give me reference how can i do it...



On 5 March 2014 03:37, Carl Eugen Hoyos [via FFmpeg-users] <[hidden email]> wrote:
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

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user



To start a new topic under FFmpeg-users, email [hidden email]
To unsubscribe from Add background music after every 5 seconds in .mp3 file usinf ffmpeg, click here.
NAML