[FFmpeg-devel] Channel mapping in libavfilter

Clément Bœsch ubitux at gmail.com
Wed Jan 11 13:17:55 CET 2012


Hi,

-map_channel was recently introduced in ffmpeg (only this program), using a
libswresample feature integrated at the same time. Now the issue is, this option
is supposed to be able to pick channels from different streams, but due to
ffmpeg design it is not possible (one output stream is only associated with one
input stream). To workaround this issue, we can use amerge audio filter (to
merge streams), but this is not that easy to use.

The second patch (first one is just an almost not related patch) introduce the
channel remapping feature in libavfilter, so the -map_channel feature could
actually create a filtergraph transparently, using amerge and channelremap audio
filters. This should result in a simpler ffmpeg.c, a more complete libavfilter
so it could be used elsewhere, and more importantly the ability for -map_channel
to pick channels from different streams (and thus remove the unfamous
limitation).

Note that this will require a hard dependency in lavfi to libswr. There is
already a dependency to libswscale so I guess it won't hurt to have the same for
the audio. Also, I believe libswr could help simplifying and remove a lot
duplicated code in af_aconvert, af_aformat and af_aresample (and maybe extend
the current lavfi support and performances).



More information about the ffmpeg-devel mailing list