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:

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:

  1. 0: Defined in AOT Specifc Config
  2. 1: 1 channel: front-center
  3. 2: 2 channels: front-left, front-right
  4. 3: 3 channels: front-center, front-left, front-right
  5. 4: 4 channels: front-center, front-left, front-right, back-center
  6. 5: 5 channels: front-center, front-left, front-right, back-left, back-right
  7. 6: 6 channels: front-center, front-left, front-right, back-left, back-right, LFE-channel
  8. 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).

FFmpeg + sed: How to insert clean metadata based on input file name
This post shows you how to extract the movie/show name from the file name and insert it into the title metadata field of MKV & MP4 containers.
Supported MP4 Metadata Keys with FFmpeg
The following table lists the supported MP4 container metadata key names in FFmpeg.
FFmpeg Batch Transcode Audio
Recently I have been dealing with transcoding media files for my streaming site travisflix and performing ad-hoc media conversions is no longer realistic. I strongly recommend checking out my FFmpeg Examples to give you a head start if you’re not familiar with deep diving in FFmpeg details. Before you
FFmpeg Map English Subtitles or Audio Stream Only
Dynamic FFmpeg Subtitle Stream Mapping via Language This post shows how you can dynamically map streams based upon the language as the criteria/condition. * Map English subs only by using the parameter -map 0:s:m:language:eng * Map Spanish subs only by using the parameter -map 0:s:m: