[Libav-user] Odp: Re: Odp: Mixing many video and audio files

Marcin krycho marcinus_007 at wp.pl
Mon Mar 31 10:50:17 CEST 2014

Dnia Poniedziałek, 31 Marca 2014 10:10 Nicolas George <george at nsup.org> napisał(a) 
> Le primidi 11 germinal, an CCXXII, Marcin krycho a écrit :
> > > Hello,
> > > I am developing APP for Android with FFMPEG library. So far I am able to achieve this using FFMPEG:
> > > 1. Create mp4 video from screen shots.
> > > 2. Add audio stream to this video from AAC file.
> > > This is working perfectly. Next I would like to mix to this mp4 file
> > > more sound from other audio or video files. Sound from other mp4 files
> > > can start and end at any moment of movie.
> > >
> > > I assume this is amix command, but how to do it using FFMPEG API in
> > > code? I was not able to find any examples of muxing files in code. Any
> > > filter has to be created? Is it possible to somehow "add" audio frames
> > > in order to achive "sum" of these frames? And result frame add to audio
> > > stream of mp4 file? Any help and code examples would be appreciated.
> You need to create a filter graph, with a buffersrc for each input you want
> to mix together, and something to do the mixing. I would suggest to use
> amerge + pan rather than amix.
> > Really no hints?
> Can you expect hints before your message actually appears on the list?
> Regards,
> -- 
>   Nicolas George

sorry but I sent this message almost week ago, I did not know it was not visible on the list. Thank you for answer. So my understanding is that there are two solutions for this problem. First solution is to use amix: filter graph + buffer for each input + mixing. Second solution would be to create video file with many audio streams with "amerge" and than mix these all channels using pan(recomended)? Is there any code example for these two methods? FFMPEG allows to do it, so maybe you know 
where it is implemented in FFMPEG? Which file etc. It is not easy to start from scratch with such mixing, this is why I am looking for example.

BR, Marcin

More information about the Libav-user mailing list