Ch. 10 · In Practice

한국어日本語
7 min

Adaptive Bitrate Streaming: How HLS and DASH Work

How HLS, DASH, and CMAF work: one video is pre-encoded at several qualities, and the player switches between them segment by segment as the network changes.

You have probably watched Netflix or YouTube drop in quality in a subway tunnel, then climb back up. That is adaptive bitrate streaming (ABR).

The core idea

Encode the same video ahead of time in several quality (bitrate) versions, cut each one into short segments (usually 2-10 seconds), and keep them ready on the server. The player measures network conditions in real time and decides again, for every segment, which quality to request next.

Bitrate → 360p / 0.8M 480p / 1.5M 720p / 3M 1080p / 6M 4K/25M Switch up as the network improves
Bitrate ladder: the same content prepared at several resolutions and bitrates
HLS (Apple)MPEG-DASH
Manifest formatm3u8 (text playlist)MPD (XML)
Segment formatOriginally MPEG-TS; now CMAF (fMP4) is supported tooCentered on fMP4 (CMAF)
Main useiOS/Safari, required on Apple devices, also widely used on the webAndroid, YouTube, and others (codec- and platform-neutral)
Low-latency extensionLL-HLSCMAF Low-Latency (LL-DASH)

CMAF: bringing the two camps together

HLS and DASH used to use different segment formats, so the same video had to be encoded and stored twice. CMAF (Common Media Application Format) defines a common segment format so that an HLS manifest and a DASH manifest can point to the same segment files, which cuts storage and CDN costs considerably.

In the field: practical considerations for ABR algorithms

The logic a player uses to decide which quality to fetch next (the ABR algorithm) does not look at current bandwidth alone. It weighs the buffer level (if it is too low, drop the quality to avoid stalling), the switching frequency (changing too often is itself distracting), segment size prediction, and more. Combined with the multi-codec delivery from Chapter 7, a single manifest can list AV1, HEVC, and H.264 versions at the same quality, and the player picks among them while also taking device support into account.

ABRAdaptive Bitrate Streaming

A streaming method that switches quality in real time according to network conditions.

HLS / DASHHLS / DASH

The two main adaptive streaming protocols, from Apple and MPEG respectively.

CMAFCommon Media Application Format

A common format that lets HLS and DASH share segments.

Bitrate ladderBitrate ladder

The set of resolution and bitrate versions prepared for the same content.

Check yourself

What is the biggest practical benefit CMAF brought to the streaming industry?