Encoding 7.1 channel audio with the native AAC encoder should use PCE
|Reported by:||Rob||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Summary of the bug:
Encoding 7.1 channel audio (FL FR FC LFE BL BR SL SR) with the native AAC encoder produces an output file using channel configuration 7, while the same command except using the FDK AAC encoder produces an output file with a PCE. Channel configuration 7 is supposed to correspond to "7.1(wide)" though some players will interpret this as "7.1" [rear] instead. Considering the inconsistencies in interpreting channel configuration 7, it should probably use a PCE in this case, matching the FDK AAC encoder.
How to reproduce:
% ffmpeg -i "7.1auditionOutLeader v2.wav" -c:a aac -b:a 640k out_aac.mkv ffmpeg version N-97630-gae8980319b-gbdd57e2a37+1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.0 (Rev2, Built by MSYS2 project) % ffmpeg -i "7.1auditionOutLeader v2.wav" -c:a libfdk_aac -b:a 640k out_fdkaac.mkv ffmpeg version N-97630-gae8980319b-gbdd57e2a37+1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.0 (Rev2, Built by MSYS2 project)
out_aac.mkv will output the following warning if used as input, since it uses channel configuration 7:
[aac @ 00000183de2e1940] Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead.
Input file is from:
Looking at the PCE code in libavcodec/aacenc.h, it looks like most of the listed configurations are incorrect, so that would likely have to be fixed here -- if I'm interpreting it correctly, it is going to output channels in the order L R C ... instead of C L R ... and there are likely other things that are incorrect (LFE missing in .1 configs, etc.)