Le tridi 23 frimaire, an CCXX, Matthieu Bouron a écrit :
Hi there,
Here is a first attempt to write an audio filter which merge two audio streams. Usage is: ffplay -f lavfi "amovie=test1.mp3[a];amovie=test2.mp3[b];[a][b]mix=0.7:0.3[out]"
The volume of each streams can be configured and default to 0.5:0.5 is not specified. It only support two s16 audio streams with same sample rate. Feel free to comment.
This is a much asked for feature, but I do not like the design you adopted. I think your version is confusing two different tasks: merging the streams, and mixing the channels with configurable coefficients. Thus, it only satisfies the most basic needs. I believe that it is better to separate both tasks: first merging a n-channels streams and a p-channels streams into a stream with n+p channels, and then mixing the channels together if necessary. For the first task, I started some time ago a "amerge" filter. The work as I left it is there: http://ffmpeg.org/pipermail/ffmpeg-devel/2011-November/116523.html I intend to start working on it again soon. For the second task, the pan filter can do almost anything we may need from it. Regards, -- Nicolas George