Skip to content

Lesson 1 of 9 · 24m

Adaptive Bitrate, HLS, and DASH: The Mental Model

Learn what players actually download, why aligned segments matter, and how manifests, renditions, and network behavior fit together.

The first time a video system melts down, it rarely looks like a video problem. It looks like a hot object store, a CDN cache miss storm, or a database queue full of transcode jobs. That is because streaming is not one big file moving to one client. It is a distributed state machine made of tiny objects, timing assumptions, and players making independent decisions every few seconds.

Players do not stream; they schedule downloads

Adaptive bitrate playback cuts media into short segments. The player reads a manifest, estimates available bandwidth and buffer occupancy, then chooses a rendition for the next segment:

master manifest
  -> variant playlist: 1080p at 5 Mbps
       segment_00001.ts
       segment_00002.ts
       segment_00003.ts
  -> variant playlist: 720p at 2.8 Mbps
       segment_00001.ts
       segment_00002.ts

If the network worsens, the player picks a lower bitrate segment next. It cannot retroactively change a segment already downloaded. This means your encoding ladder is really a menu of future decisions, not a description of the current picture.

HLS and DASH are packaging contracts

HLS uses an .m3u8 master playlist and variant playlists. DASH uses an .mpd manifest with AdaptationSet, Representation, and segment addressing. Neither format is a codec. Both can carry H.264, HEVC, AV1, or other codecs depending on player support and packaging constraints.

A minimal HLS variant playlist looks like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:4.000,
seg_00000.ts
#EXTINF:4.000,
seg_00001.ts
#EXT-X-ENDLIST

The contract is strict: duration metadata, sequence numbers, discontinuities, encryption labels, and segment availability all mean something. Players will tolerate some deviation, but at scale "the browser mostly plays it" is not compatibility testing.

Segment alignment is the hidden requirement

For clean bitrate switching, renditions must have boundaries at the same presentation timestamps. A 1080p segment starting at 12.000 seconds and a 480p segment starting at 12.040 seconds create small gaps, duplicated decode work, or visible switching artifacts. This is why transcoding ladders must share keyframe cadence even when resolution and bitrate differ.

VOD and live differ in one crucial way

For VOD, the whole manifest can be true at once. For live, the manifest is a rolling window of the recent past. Players poll for updates and expect sequence numbers to advance predictably. If your origin rewrites sequence numbers incorrectly or a cache holds an old playlist too long, viewers do not merely see stale video; playback can jump, stall, or end.

Buffering is a feature until it is not

Players intentionally build buffer. That buffer hides jitter but costs latency and startup time. A sports viewer may tolerate two seconds of startup delay but not forty-five seconds behind the live edge. A film viewer may tolerate neither long startup nor rebuffering, but does not care whether the content is ten seconds old. The product requirement determines the packaging parameters, not the other way around.

Field notes

  • A bitrate switch is a client decision. The server offers choices; it does not force one.
  • Manifests are small, hot, latency-sensitive objects. Treat them differently from immutable media segments.
  • Test with real devices. TV browsers and old WebViews are stricter and stranger than desktop Chrome.
  • Never debug playback using only a player on the same fast network as the origin.

Was this lesson helpful?

Sign in to rate