[FFmpeg-devel] [RFC] Channel layouts
Fri Aug 29 11:16:38 CEST 2008
Peter Ross write:
> This patch adds the notion of channel layouts to libavcodec.
> Summary of new concepts:
> * Channel IDs: We give each speaker a notional bit index.
> e.g. CHANNEL_FRONT_LEFT=0, CHANNEL_FRONT_RIGHT=1,
> * Channel Layout: An ORing together of Channel IDs.
> e.g. ((1<<CHANNEL_FRONT_LEFT)|(1<<CHANNEL_FRONT_RIGHT))
> The resulting layout is identical to the dwChannelMask value found
> WAVEFORMATEXTENSIBLE. A channel layout of zero implies 'no
> * Chanels are stored with the FFmpeg 'samples' array according to ID
> e.g. left comes before right.
> * Encoders will indicate their supported channel layouts in AVCodec,
> in the
> same way we do for pixel and sample formats.
This is a very good idea.
As already discussed in other posts this implies that there is sort of
a standard channel order that all codecs have to tribute to, meaning
every encoder needs to accept the audio data in exactly that channel
order and every decoder needs to deliver in exactly that order.
This indeed a huge amount of work, but it is a solution to get rid of
the format chaos.
BTW have you read EBU tech doc 3306
They are recommending to extend the channel mask with STEREO_LEFT and
STEREO_RIGHT (the bitstream extensions are a little weird I think) to
address the issue of audio streams carrying 5.1 and stereo together
(this is used in broadcasting when delivering FM stereo and satellite
surround in a single program/playout for example).
As the channel mask concept allows to add additional positions this
doesn't affect codecs that do not care about this additional stereo
pair, but it makes it possible to read the data from the file with
libav and for example pass it to the audio card or the other way
Just my 0.02$
More information about the ffmpeg-devel