[FFmpeg-user] AAC conversion from 7.1 channel to 2 channel

Carl Eugen Hoyos cehoyos at ag.or.at
Fri May 3 14:17:49 CEST 2013

rohit a <rohit.tvm.86 <at> gmail.com> writes:

> For AAC conversion from 5.1 channels to 2 channels, 
> ffmpeg code uses surround_to_stereo() in 
> libavcodec/Resample.c

This looks outdated, I believe you should use 

> In that the input data was packed in the format 
> fl, fr, c, lfe, rl, rr
>         fl = input[0];  // front left
>         fr = input[1];  // front right
>         c = input[2];   // center
>         lfe = input[3]; // low frequency effects
>         rl = input[4];  // rear left
>         rr = input[5];  // rear right

> I would like to convert AAC 7.1 channels to 2 channels.

Did you try?
Without testing, I suspect it should work.

> But i have no idea about how the input data is packed.

FFmpeg internally expects wav channel order.

> Can anyone please tell me how the input data format 
> is arranged for AAC 7.1 channels ?

In aac, different channel orderings are possible, 
and usually it is not wav-order, but the aac 
decoder should correctly order the channels.
(If it does not, this would be a bug, reports 
are very welcome!)

Carl Eugen

More information about the ffmpeg-user mailing list