Interactive animated diagrams to understand HLS, DASH, ABR, and performance optimization
Video is split into small segments (2–10 seconds each), not sent as one giant file. The player downloads segments sequentially and plays them back-to-back.
The player dynamically switches quality based on available bandwidth. If the network slows down, it drops to a lower bitrate to avoid buffering.
The player maintains a buffer of future segments (typically 30–60 seconds). If the buffer empties, playback stalls — the dreaded spinner.
Segments are served from edge servers close to users, not from a single origin. This reduces latency and handles millions of concurrent viewers.
Video flows from source → encode → package → CDN → player. Each step adds latency but enables massive scale.
Developed by Apple. The most widely supported protocol across all devices.
.m3u8 playlist manifests.ts (MPEG-TS) or .fmp4An open standard (MPEG). Codec-agnostic and more flexible than HLS.
.mpd manifest (XML-based).m4s (fMP4)#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360
360p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2800000,RESOLUTION=1280x720
720p/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=5000000,RESOLUTION=1920x1080
1080p/index.m3u8
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXTINF:6.0,
720p_seg_001.ts
#EXTINF:6.0,
720p_seg_002.ts
#EXTINF:6.0,
720p_seg_003.ts
#EXT-X-ENDLIST
A master playlist references per-quality playlists, each listing individual segment files
| Feature | HLS | DASH |
|---|---|---|
| Standard | Apple proprietary → RFC 8216 | MPEG / ISO 23009-1 |
| Manifest Format | .m3u8 (text-based) |
.mpd (XML) |
| Segment Format | MPEG-TS (.ts) or fMP4 | fMP4 (.m4s) or WebM |
| Codec Support | H.264, H.265 (HEVC) | Any codec (VP9, AV1, H.264, H.265) |
| DRM | FairPlay (Apple-only) | Widevine, PlayReady, FairPlay |
| Browser Support | Native on Safari. hls.js for others | dash.js, Shaka Player |
| Low Latency | LL-HLS (2–8s target) | LL-DASH (2–5s target) |
A set of pre-encoded renditions at different resolutions and bitrates. The player climbs up or down the ladder based on network conditions.
The player continuously monitors:
Cache segments at edge locations worldwide. Popular content stays hot in cache; long-tail content may fetch from origin.
Cache-Control headersThe time from click to first frame. Target: < 2 seconds.
<link rel="preload"> for the master manifestFor live streaming, reduce the gap between real-time and what viewers see.
Track these QoE (Quality of Experience) metrics:
For standard HLS/DASH: ~10–45s total latency. LL-HLS reduces this to 2–8s by using partial segments.
EXT-X-TARGETDURATION accurate#EXT-X-PROGRAM-DATE-TIME for live streams| Resolution | Bitrate | Use Case |
|---|---|---|
| 1920×1080 | 5,000 kbps | Full HD — TVs, Desktop |
| 1280×720 | 2,800 kbps | HD — Tablets, Laptops |
| 854×480 | 1,400 kbps | SD — Mobile on WiFi |
| 640×360 | 800 kbps | Low — Mobile on 3G/4G |
| 426×240 | 400 kbps | Minimal — Very slow connections |
| Audio Only | 128 kbps | Audio-only mode / podcasts |
Adjust these values for your content type: fast-motion sports need ~30% higher bitrates.
Encrypted segments can only be decoded by the Content Decryption Module (CDM) after license validation