[Libav-user] Channel mapping with amerge filter

Kerry Loux louxkr at gmail.com
Thu May 28 22:04:04 EEST 2020

Hello all,

I'm trying to create an audio filter graph (in C/C++) that takes a number
of inputs and mixes/splits/merges as necessary to produce a single stream
with multiple channels.

I would like to be able to control which amerge input is mapped to which
channel in the output stream. For example, if I'm merging two inputs, I
want to control which is the left and which is the right channel.
Similarly, for cases with more than two inputs, I'd like to know/control
which output layout is being created and how each input is mapped.

Currently, I have an implementation that generates a stream with the
correct individual channels, but mapped incorrectly. When I call
av_filter_graph_config(), I get a message stating "Input channel layouts
overlap; output layout will be determined by the number of distinct input
channels," which seems like a clue.

When I checked the source in af_amerge.c, I see that there is a route[]
array which I presume controls this mapping. Is this correct?

If so, then how should I access this array? Through context->priv directly?

Is there a way to define the output layout for the output of the amerge

Thanks in advance,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20200528/27f397b1/attachment.html>

More information about the Libav-user mailing list