Skip to content

PATTERN Cited by 1 source

Bandwidth-adaptive codec mode

Problem

Real-time communication network conditions change within a call. A single call may traverse great-network → congested → degraded → recovered network states. The codec has to follow — encoding at a fixed bitrate either wastes good conditions or floods bad ones.

Pattern

A Bandwidth Estimation (BWE) module continuously measures the network's capacity to carry audio packets and drives the codec operating point (bitrate, band mode, FEC ratio) as a runtime function of that estimate. When BWE drops, the codec moves down; when BWE recovers, it moves up. The codec's lower operating-point floor is a first-class feature: how well a codec behaves at its low end determines the user experience on degraded networks.

Canonical example — Meta RTC

Meta's MLow post articulates this plainly:

"Typically a bandwidth estimation module (BWE) detects the quality of the network, and as the network quality degrades, we need to lower the codec operating bitrate to avoid congesting the network and keep the audio flowing — impacting the trio balance referenced above. Complicating matters, conducting a video call despite poor network quality leaves little room for audio and pushes the audio bitrate further down."

The lower-operating-point-floor corollary:

"The lowest operating point for Opus is 6 kbps, at which it runs in NarrowBand mode (0–4 kHz) and does not adequately capture all the sound frequencies produced by human voices — and so doesn't sound as clear or natural."

So Opus's NB-at-6-kbps floor caps the achievable audio quality when BWE has pushed Meta's RTC stack into that corner. Meta built MLow with a WideBand 6 kbps operating point — a clean improvement in exactly the adverse-network regime BWE spends time in.

(Source: sources/2024-06-13-meta-mlow-metas-low-bitrate-audio-codec)

Video calls compound the problem

"Complicating matters, conducting a video call despite poor network quality leaves little room for audio and pushes the audio bitrate further down."

Video + audio compete for a shared adverse-network budget. Audio-codec floor behaviour is more critical in video-calling products than in audio-only calling.

Implementation considerations

The codec needs:

  • Graceful bitrate transitions — no audible click when BWE moves the operating point.
  • Band-mode coupling — at very low bitrate some codecs switch to NB; making sure this doesn't destroy quality is design work (MLow's split-band architecture helps here, see concepts/split-band-audio-coding).
  • FEC interaction — FEC budget comes out of the same bitrate envelope BWE constrains; see patterns/aggressive-fec-at-low-bitrate.

When it applies

  • Any RTC codec integration.
  • Any adaptive streaming codec where receiver conditions vary (most live audio/video streaming too).

When it does not apply

  • Fixed-bitrate recorded streams (on-demand audio/video).
  • Bulk transfer where the underlying transport handles congestion separately from content encoding.

Seen in

Last updated · 319 distilled / 1,201 read