[Ffmpeg-devel] Encoding multichannel audio with ffmpeg

François Revol revol
Tue Nov 7 00:44:00 CET 2006


> > AC3: LFE L C R SL SR
> > WAV: L R C LFE SL SR
> > AAC: C L R SL SR LFE
> > To properly encode multichannel audio ffmpeg would need something 
> > to 
> > correctly reorder channels depending on input and output formats.
> 
> You might want to write a fonction to reorder sample according to a 
> passed channel matrix. Then each codec/format would have its own 
> channel matrix representing the difference from a default order.

Also, the AC3 decoder plugin in Haiku has something to handle this, cf.

http://svn.berlios.de/viewcvs/haiku/haiku/trunk/src/add-ons/media/plugins/ac3_decoder/ac3_decoder.cpp?rev=13361&view=markup

It codes the matrix as a list of offsets into the samples, like:
static int lfe_offsets[6] = { 3, 0, 2, 1, 4, 5 };
shifting 0x1 by each offset would give a binary matrix like I use in my 
example. But you can probably work with them directly.

Fran?ois.




More information about the ffmpeg-devel mailing list