# (ffmpeg-utils)2.8. Syntax | Channel Layout¶

doc

Channel Layout

Official documentation says:

A channel layout specifies the spatial disposition of the channels in a multi-channel audio stream. To specify a channel layout, FFmpeg makes use of a special syntax.

Individual channels are identified by an id, as given by the table below:

id

meaning

FL

front left

FR

front right

FC

front center

LFE

low frequency

BL

back left

BR

back right

FLC

front left-of-center

FRC

front right-of-center

BC

back center

SL

side left

SR

side right

TC

top center

TFL

top front left

TFC

top front center

TFR

top front right

TBL

top back left

TBC

top back center

TBR

top back right

DL

downmix left

DR

downmix right

WL

wide left

WR

wide right

SDL

surround direct left

SDR

surround direct right

LFE2

low frequency 2

Standard channel layout compositions can be specified by using the following identifiers:

id

meaning

mono

FC

stereo

FL+FR

2.1

FL+FR+LFE

3.0

FL+FR+FC

3.0(back)

FL+FR+BC

4.0

FL+FR+FC+BC

FL+FR+BL+BR

FL+FR+SL+SR

3.1

FL+FR+FC+LFE

5.0

FL+FR+FC+BL+BR

5.0(side)

FL+FR+FC+SL+SR

4.1

FL+FR+FC+LFE+BC

5.1

FL+FR+FC+LFE+BL+BR

5.1(side)

FL+FR+FC+LFE+SL+SR

6.0

FL+FR+FC+BC+SL+SR

6.0(front)

FL+FR+FLC+FRC+SL+SR

hexagonal

FL+FR+FC+BL+BR+BC

6.1

FL+FR+FC+LFE+BC+SL+SR

6.1

FL+FR+FC+LFE+BL+BR+BC

6.1(front)

FL+FR+LFE+FLC+FRC+SL+SR

7.0

FL+FR+FC+BL+BR+SL+SR

7.0(front)

FL+FR+FC+FLC+FRC+SL+SR

7.1

FL+FR+FC+LFE+BL+BR+SL+SR

7.1(wide)

FL+FR+FC+LFE+BL+BR+FLC+FRC

7.1(wide-side)

FL+FR+FC+LFE+FLC+FRC+SL+SR

octagonal

FL+FR+FC+BL+BR+BC+SL+SR

FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR

downmix

DL+DR

A custom channel layout can be specified as a sequence of terms, separated by + or |. Each term can be:

• the name of a standard channel layout (e.g. mono, stereo, 4.0, quad, 5.0, etc.)

• the name of a single channel (e.g. FL, FR, FC, LFE, etc.)

• a number of channels, in decimal, followed by c, yielding the default channel layout for that number of channels (see the function av_get_default_channel_layout). Note that not all channel counts have a default layout.

• a number of channels, in decimal, followed by C, yielding an unknown channel layout with the specified number of channels. Note that not all channel layout specification strings support unknown channel layouts.

• a channel layout mask, in hexadecimal starting with 0x (see the AV_CH_* macros in libavutil/channel_layout.h.

Before libavutil version 53 the trailing character c to specify a number of channels was optional, but now it is required, while a channel layout mask can also be specified as a decimal number (if and only if not followed by c or C).

See also the function av_get_channel_layout defined in libavutil/channel_layout.h.

[me@host: ~]$# specify channel layout to anullsrc [me@host: ~]$ ffplay -f lavfi anullsrc=r=48000:cl=stereo

[me@host: ~]$# pan audio [me@host: ~]$ ffplay audio.wav -af "pan='stereo|FL=FR|FR=FL'"