[Ffmpeg-devel] channel ordering and downmixing

Justin Ruggles justinruggles
Thu Mar 29 23:48:15 CEST 2007


Hi,

I need some advice on a channel ordering and downmixing framework.  I've
been trying to figure out the best solution for a while and keep running
into road blocks.

I have several ideas, but the one thing that keeps getting in the way is
that sometimes channel order depends on the codec and sometimes it
depends on the container.  For example, with PCM it's generally
determined by the container, but with AC3 it's determined by the codec.
 There are some simple ways to accomodate this on the demuxer/decoder
side, but I can't figure out a good way to handle this on the
encoder/muxer side.  Having the muxers do channel reordering if
necessary seems like a bad idea, but maybe it's the only way...

Some general ideas I've been working with are:

#1) define a channel_map in AVCodecContext and do conversions similar to
    how it's done with pixel formats.  this would be a pretty complex
    solution.

#2) define a standard FFmpeg channel order and change decoders to always
    output in that order.  this would be simpler, but has the problem
    stated above with containers vs. codecs.  the demuxer could choose
    to tell the decoder the channel order or else leave it up to the
    decoder.  i can't think of a clean way to use this on the encoding
    side though.

Any advice?

-Justin




More information about the ffmpeg-devel mailing list