Skip to content

node-av / lib / avChannelLayoutDefault

Function: avChannelLayoutDefault() ​

avChannelLayoutDefault(nbChannels): ChannelLayout

Defined in: src/lib/utilities.ts:1308

Get the default channel layout for a given number of channels.

Returns the canonical native layout FFmpeg uses for that channel count (e.g. 1 → mono, 2 → stereo, 6 → 5.1). Useful to turn an unspecified layout (order AV_CHANNEL_ORDER_UNSPEC, common for PCM) into a concrete one.

Direct mapping to av_channel_layout_default().

Parameters ​

nbChannels ​

number

Number of channels

Returns ​

ChannelLayout

The default channel layout for that channel count

Example ​

typescript
const stereo = avChannelLayoutDefault(2); // { order: 1, nbChannels: 2, mask: 3n }

See ​

av_channel_layout_default - FFmpeg Doxygen