FFmpeg [aac @ ] Using a PCE to encode channel layout “5.1(side)”
FFmpeg ERROR:
[aac @ 0x806362f00] Using a PCE to encode channel layout “5.1(side)”
SOLUTION:
If the source file signals a layout of 5.1(side)
instead of 5.1
, the AAC encoder will throw the error because the AAC spec only supports 5.1 (rear channels instead of side). To re-phrase this slightly different and with more detail:
The general cause of the problem is while transcoding to the AAC codec (Advanced Audio Coding) from various other high quality codecs such as AC3 (Dolby Digital/DD), E-AC-3 (Dolby Digital Plus/DDP/DD+), DTS, TrueHD (24-bit hd audio), it does not auto-select the standard 5.1 channel layout (called 5.1) if the original source has a channel layout of 5.1(side)
. While the AAC encoder may be able to automatically determine the amount of audio channels, FFmpeg has a hard time determining correct channel layout.
You will need to use the -channel_layout "5.1"
switch parameter to force FFmpeg to the desired layout.
Here is an example of using it with a real world example:
for f in *.mkv; do ffmpeg -y -i "$f" -default_mode infer_no_subs \ -map 0:v:0 -map 0:a:m:language:eng -map "0:s?" -dn -map_chapters -1 -metadata title= \ -metadata:s:v:0 title= -metadata:s:a:0 title= -metadata:s:s:0 title= \ -c:v copy -ac:0 6 -channel_layout:a:0 "5.1" -b:a 768k -c:a aac -c:s copy \ "/directory/subdirectory/${f/DTS/AAC}"; done
The default channel layouts supported by the AAC encoder are:
mono, stereo, 3.0, 4.0, 5.0 and 5.1 (FC, FL+FR, FL+FR+FC, FL+FR+FC+BC, FL+FR+FC+BL+BR, FL+FR+FC+BL+BR+LFE).
These are the channel configurations:
- 0: Defined in AOT Specifc Config
- 1: 1 channel: front-center
- 2: 2 channels: front-left, front-right
- 3: 3 channels: front-center, front-left, front-right
- 4: 4 channels: front-center, front-left, front-right, back-center
- 5: 5 channels: front-center, front-left, front-right, back-left, back-right
- 6: 6 channels: front-center, front-left, front-right, back-left, back-right, LFE-channel
- 7: 8 channels: front-center, front-left, front-right, side-left, side-right, back-left, back-right, LFE-channel