[FFmpeg-user] Preserving perceived loudness when downmixing audio from 5.1 AC3 to stereo AAC

Nicolas George nicolas.george at normalesup.org
Wed Aug 7 16:36:35 CEST 2013

Le decadi 20 thermidor, an CCXXI, Andy Furniss a écrit :
> I had a look at the old behavior and it clipped, which is not good.
> It was also inconsistent - wav and 7ch thd behaved like -ac 2.
> I don't know what it did as such - maybe there is a way to
> explicitly recreate it, or perhaps just blindly boost the levels by
> xDb as part of the processing if you don't care about clipping.

The issue has been analyzed in the devel mailing list: the old downsampling
was done with samples coded in floating point, where clipping does not
happen (but can later happen if the samples are converted to integers);
because the number of conversions have been optimized it is now done with
samples coded as integers.

> I am not a developer - but IMHO the old behavior was wrong, but I
> haven't tested enough to work out what/why it did.

I tend to agree, the downsampling matrix should not depend on the format
selected to do the conversion, unless the user specifically asked for it,
because the format is selected automatically based on a rather complex
system and can change for unrelated reasons.

> FWIW I also consider the new behavior wrong in that the description
> of aformat says -
> "Set output format constraints for the input audio. The framework
> will negotiate the most appropriate format to minimize conversions"

What is "wrong" in that?

> I think it should use -request_channels (where possible) and it
> doesn't, so anyone using -
> aformat=channel_layouts=stereo
> on say a 7.1 thd stream will not get the best result = a proper
> studio stereo mix, but instead a 7 -> 2 conversion and very low
> levels.

Not all codecs support channel layout selection like that.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20130807/f158ab6c/attachment.asc>

More information about the ffmpeg-user mailing list