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 re-encoding/transcoding to the AAC codec (Advanced Audio Coding) from a source with various other high quality codecs such as:
- AC3 (Dolby Digital/DD) - lossy
- E-AC-3 (Dolby Digital Plus/DDP/DD+) - lossy
- DTS (DTS-HD Master Audio) - lossless
- Dolby TrueHD - lossless
it does not auto-select the standard 5.1 channel layout (called 5.1) if the 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 use the desired layout.
Here is an example of using it with a real world example:
for f in *.mkv; do ffmpeg -i "$f" -map 0:v:0 -map 0:a:m:language:eng \
-map "0:s?" -dn -c:v copy -b:a 341k -channel_layout "5.1" -c:a aac \
-c:s copy "${f/.mkv/-modified.mkv}"; 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
Credit goes to: https://trac.ffmpeg.org/ticket/7384
If you have any questions/comments regarding this article, click here or scroll down below (login isn't required to post comments and there's no waiting period).







