Case studies
Adaptive bitrate streaming
The player measures its bandwidth and buffer after each segment, then picks the quality of the next segment, so playback keeps going on a slow network.
No single bitrate fits every viewer. A phone on a weak connection needs a small rendition, and a TV on fiber can take 4K. Adaptive bitrate (ABR) streaming solves this by storing each segment in several qualities. The player switches quality at segment boundaries as conditions change.
Concept
Before you start
- Bitrate: how many bits per second a video uses. More bits means more detail and more bandwidth.
- Buffer: the seconds of video already downloaded and waiting to play. A healthy buffer is the player's safety margin.
The big idea
Think of a driver who picks a lane at each junction, based on the traffic seen so far. The driver cannot see the traffic ahead, only the cars already passed.
The picture breaks for the same reason. The player only knows the bandwidth it measured on past segments. A sudden drop shows up only after a download has started, which is why the buffer matters.
Walking through it
A typical ladder for on-demand video looks like this. The numbers are the targets from the design:
| Rendition | Resolution | Video bitrate | Audio |
|---|---|---|---|
| 240p | 426 × 240 | 400 kbps | 64 kbps |
| 360p | 640 × 360 | 800 kbps | 96 kbps |
| 480p | 854 × 480 | 1.2 Mbps | 128 kbps |
| 720p | 1280 × 720 | 2.5 Mbps | 128 kbps |
| 1080p | 1920 × 1080 | 4.5 Mbps | 160 kbps |
The rule is simple: pick the highest rung that the measured bandwidth can carry, with some headroom. Here is how it plays out:
Measured throughput ≈ 3 Mbps
720p needs 2.5 Mbps video + 0.13 Mbps audio ≈ 2.6 Mbps
2.6 fits under 3 with headroom → pick 720p
Throughput drops to about 1 Mbps mid-session
720p no longer fits
480p needs 1.2 Mbps + 0.13 Mbps ≈ 1.3 Mbps, still too much
360p needs 0.8 Mbps + 0.1 Mbps ≈ 0.9 Mbps, fits → pick 360pThe rule has to check the audio as well as the video, which is why the second step falls to 360p, not 480p.
Startup works the same way. A player that starts at 4K can miss the two-second target. Starting on a middle rung and switching up once the buffer fills gives a fast first frame:
DNS and TLS: 100–200 ms
Manifest fetch: ~50 ms
First segment: 500–1500 ms
Decode: ~50 ms
Total: under 2 s, when the first rung is modestCommon mistakes
- Starting at the top rung. The first segment is the largest, so the first frame is the slowest.
- Switching on one measurement. A single noisy sample makes quality bounce. Smooth the estimate over several segments.
- Ignoring the buffer. A healthy buffer can afford a risky upswitch. A nearly empty buffer should downshift at once.
- Choosing rungs that are too close together. Two nearly identical rungs waste storage and bounce the player back and forth.
Check yourself
1. Using the ladder above, which rendition suits a steady 3 Mbps link, and why?
Answer: 720p. It needs about 2.6 Mbps including audio, which leaves some headroom under 3 Mbps.
2. Why does ABR switch only at segment boundaries?
Answer: Each segment is a complete unit that can be decoded on its own, so the player can change quality without reloading the file.
Key takeaways
- ABR picks each segment's quality from measured bandwidth and buffer.
- Start on a middle rung for a fast first frame, then switch up.
- Keep headroom below the measured bandwidth, not right at it.
- Aligned segments make quality switches seamless.
Further learning
Return to the video streaming case study for upload, CDN and cost.
Related
Case study: video streaming
YouTube and Netflix-style delivery, with resumable uploads, parallel transcoding into a bitrate ladder, HLS and DASH adaptive streaming, and CDN economics.
Video segments and manifests
A video is stored as many short, immutable segments, listed in a manifest. The player downloads the small manifest first, then fetches segments in order from the nearest cache.
Transcoding as a DAG
Turn one uploaded master file into many renditions by splitting it into chunks and encoding each chunk in parallel, as a directed acyclic graph of small, retryable tasks.