Video streaming with bitrate ladders, segments and adaptive bitrate
Updated Nov 10, 2026 · 4 min read
Streaming video looks like serving a big file, but it’s closer to serving millions of small ones. Each upload is encoded several times at different qualities, every version is cut into segments a few seconds long, and the player picks which version to fetch next based on how its connection is doing. Your servers barely touch the video itself. A CDN carries the bytes.
Transcoding into a bitrate ladder
Creators upload one high-quality file. A transcoding pipeline encodes it into a set of versions called a bitrate ladder, from small and blurry to large and sharp, so every viewer has a rung that fits their connection. Big services split the upload into chunks and encode them in parallel on many machines, so a two-hour film is ready in minutes.
| Rung | Resolution | Bitrate |
|---|---|---|
| 1080p | 1920 × 1080 | 6 Mbps |
| 720p | 1280 × 720 | 3 Mbps |
| 480p | 854 × 480 | 1.5 Mbps |
| 360p | 640 × 360 | 1 Mbps |
| 240p | 426 × 240 | 0.5 Mbps |
Newer codecs such as HEVC and AV1 give the same picture in 30 to 50% fewer bits, but take far longer to encode and don’t play everywhere. Services often encode popular titles in several codecs and leave the long tail in H.264.
Segments and manifests
Each version is cut into segments of 2 to 6 seconds, all at the same moments, and every segment starts with a keyframe so it can be decoded on its own. A manifest lists the versions and their segments. HLS, from Apple, calls it a playlist and uses .m3u8 files. DASH, the open standard, uses an XML file called an MPD. Both work over plain HTTP, and the player pulls each file it wants.
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=6000000,RESOLUTION=1920x1080
1080p/playlist.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3000000,RESOLUTION=1280x720
720p/playlist.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1500000,RESOLUTION=854x480
480p/playlist.m3u8That is a master playlist. Each line it points to is a media playlist listing that version’s segments in order, like seg_00001.ts, seg_00002.ts and so on. Because segments are ordinary files at ordinary URLs, any CDN can cache them.
Adaptive bitrate
The player decides which version to fetch, one segment at a time. It times each download to estimate its bandwidth and watches how many seconds of video it has buffered. A healthy, growing buffer lets it step up a rung. A draining buffer makes it step down before the picture freezes. This is adaptive bitrate streaming, or ABR.
- Start low. The first segments come from a small rung so playback starts in about a second, then the player climbs.
- Leave headroom. A player measuring 8 Mbps picks a rung well below it, because bandwidth wobbles.
- Watch the buffer as well as the speed. With 30 seconds buffered, a short dip needs no switch at all.
The CDN carries the bytes
Video is mostly bandwidth. A viewer at 5 Mbps pulls 2.25 GB an hour, and a hundred thousand of them pull 500 Gbps at once. No fleet of app servers should carry that. Segments go to a CDN, which keeps copies in cities near viewers, and your origin storage sees roughly one request per segment per CDN location.
Paid video still needs protecting. When playback starts, your app server checks the subscription and hands out signed URLs or a signed cookie that expire after a few hours. The CDN checks the signature on each segment request without asking you.
The math
| Question | Working | Answer |
|---|---|---|
| Peak bandwidth for 200,000 viewers at 5 Mbps | 200,000 × 5 Mbps | 1,000 Gbps = 1 Tbps |
| Data for one viewer over a 2-hour film | 5 Mbps × 7,200 s ÷ 8 | 4.5 GB |
| Storage for one hour in every rung | 12 Mbps × 3,600 s ÷ 8 | 5.4 GB |
| A year of 500 upload hours a day | 500 × 5.4 GB × 365 | ≈ 1,000 TB |
Remember to divide by 8. Video is sized in megabits per second, storage in bytes. A handy constant is that 1 Mbps for an hour is 450 MB.
Where your own servers fit
With the CDN carrying the video, app servers handle the small requests. They answer “play this”, check the subscription, return manifests, and save each viewer’s place every few seconds so they can resume later. Those requests are tiny next to the video, but there are many of them, and the resume points are personal, so a shared cache can’t answer them.