[Libav-user] Channel mapping with amerge filter

Paul B Mahol onemda at gmail.com
Thu May 28 22:54:26 EEST 2020


On 5/28/20, Kerry Loux <louxkr at gmail.com> wrote:
> 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
> filter?

Not possible at all, use join filter instead.


More information about the Libav-user mailing list