# How video streaming works: adaptive bitrate, HLS and DASH

> Learn how HLS and DASH stream video over the internet. Discover how m3u8 playlists, chunked segments, and adaptive bitrate ladders prevent buffering.

Published 2026-10-16 · Streaming & torrents · https://www.hazenstudio.com/maclc/blog/how-video-streaming-works/

## In short

- HLS (HTTP Live Streaming) chops video into small segments indexed by an m3u8 text playlist.
- Adaptive bitrate streaming continuously tests your download speed and switches quality rungs to avoid buffering.
- DASH is an international XML-based alternative to HLS, but CMAF lets both formats share the exact same media chunks.
- Services tune their bitrate ladders to each title; Netflix's 4K streams typically run at about 8 to 16 Mbps.

HTTP Live Streaming (HLS) is an adaptive video protocol that splits video into short file segments and delivers them over standard web servers using playlist files. Instead of sending an entire movie through an uninterrupted connection, HLS lets your video player continuously request the next few seconds of footage at the highest resolution your current network connection can handle.

When you press play on a modern streaming service, you are not downloading a single monolithic MP4 file. You are downloading a dynamic sequence of two- to six-second media chunks coordinated by an index file. Understanding how this system works clarifies why video resolution drops during Wi-Fi hiccups, how streaming platforms deliver 4K video without crashing, and how modern players manage bandwidth behind the scenes.

## What is HLS, and how does it deliver video?

HTTP Live Streaming was developed by Apple in 2009 under the authorship of Roger Pantos and published as an open informational specification through the Internet Engineering Task Force in [RFC 8216](https://www.rfc-editor.org/rfc/rfc8216.html). Apple designed HLS to replace legacy streaming protocols like RTMP (Real-Time Messaging Protocol) and RTSP (Real-Time Streaming Protocol), which required specialized streaming servers and frequently failed to pass through corporate firewalls.

HLS operates entirely on top of standard HTTP and HTTPS over ports 80 and 443. From the perspective of a web router or content delivery network (CDN), requesting a video segment is identical to loading an image or downloading a webpage. This architecture allows streaming providers to cache video chunks on edge servers across the globe using conventional web infrastructure.

In an HLS architecture, a video encoder ingests raw footage, compresses it with codecs like H.264, HEVC, or AV1, and feeds the stream to a segmenter. The segmenter divides the video track into a sequence of small standalone media files, typically formatted as fragmented MP4 (`.m4s`) or MPEG-2 Transport Stream (`.ts`) files. Alongside these media segments, the server generates an Extended M3U playlist file with the `.m3u8` extension.

[Apple's HLS Authoring Specification for Apple Devices](https://developer.apple.com/documentation/http-live-streaming/hls-authoring-specification-for-apple-devices) recommends a default target segment duration of 6.0 seconds (`#EXT-X-TARGETDURATION:6`). Each six-second file represents a discrete slice of time containing all video, audio, and timing metadata required for immediate decoding. If a network disruption occurs during playback, the player only loses a single six-second request rather than severing an entire movie download.

## What is an m3u8 file?

An `.m3u8` file is a plain UTF-8 text playlist that directs the video player to the media files it needs to download. When a player opens an HLS stream, it first loads a master playlist, also known as a multivariant playlist. The master playlist does not point directly to video chunks; instead, it lists every available video quality, audio language, and subtitle track.

A master playlist describes the available video renditions using the `#EXT-X-STREAM-INF` tag, which details the bandwidth, screen resolution, frame rate, and codecs for each stream. Here is a typical master playlist structure:

```text
#EXTM3U
#EXT-X-VERSION:7

#EXT-X-STREAM-INF:BANDWIDTH=1800000,AVERAGE-BANDWIDTH=1500000,RESOLUTION=1280x720,FRAME-RATE=24.000,CODECS="avc1.4d401f,mp4a.40.2"
720p/prog_index.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=3600000,AVERAGE-BANDWIDTH=3000000,RESOLUTION=1920x1080,FRAME-RATE=24.000,CODECS="avc1.640028,mp4a.40.2"
1080p/prog_index.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=12500000,AVERAGE-BANDWIDTH=10000000,RESOLUTION=3840x2160,FRAME-RATE=24.000,CODECS="hvc1.2.4.L153.B0,mp4a.40.2"
4k/prog_index.m3u8
```

Once the player evaluates your screen resolution and initial download speed, it selects one of these variant playlists and requests it from the server. This secondary file, the media playlist, contains an ordered list of exact segment filenames and durations:

```text
#EXTM3U
#EXT-X-TARGETDURATION:6
#EXT-X-VERSION:7
#EXT-X-MEDIA-SEQUENCE:0

#EXTINF:6.000,
segment_0.m4s
#EXTINF:6.000,
segment_1.m4s
#EXTINF:6.000,
segment_2.m4s
#EXT-X-ENDLIST
```

The player reads the media playlist from top to bottom, downloading `segment_0.m4s`, then `segment_1.m4s`, and appending them into its decoding buffer. Because the playlist is plain text, the server can update it continuously for live broadcasts or serve a static list for on-demand movies.

## How does adaptive bitrate streaming work?

Adaptive bitrate (ABR) streaming is the mechanism that prevents playback from stalling when network conditions fluctuate. In older streaming systems, selecting a 1080p stream committed you to that exact data rate; if your connection dipped below the stream's requirements, playback froze until more data arrived.

With adaptive bitrate streaming, the video provider encodes the identical source video at several different quality rungs, forming a bitrate ladder. A standard bitrate ladder might include a 480p rendition at 800 kbps, a 720p rendition at 2 Mbps, a 1080p rendition at 4.5 Mbps, and a 4K rendition at 12 Mbps. Every rung is chopped into segments with identical start and end timestamps.

The video player maintains a buffer, which acts as a reservoir of decoded and unplayed video frames. While the screen displays segment 4, the network client is already downloading segment 8. The player's ABR decision logic monitors two primary metrics:

1. **Throughput estimation:** How many milliseconds did it take to download the previous segment, and what effective download speed does that represent?
2. **Buffer occupancy:** How many seconds of playable video remain in local memory?

If your measured bandwidth drops below the requirement of your current rung, or if your buffer occupancy sinks toward zero, the player does not stop playback. Instead, on the next segment boundary, it silently switches its requests to a lower-bitrate stream in the master playlist. Because the segment boundaries align down to the exact video frame, the audio and video continue playing without a jump or click. When bandwidth returns, the algorithm steps back up to higher rungs.

## HLS vs DASH: what is the technical difference?

While HLS dominates the Apple ecosystem and mobile web, Dynamic Adaptive Streaming over HTTP (MPEG-DASH) is the primary international standard for web streaming on Android, Windows, and smart televisions. Standardized under [ISO/IEC 23009-1](https://www.iso.org/standard/83314.html), MPEG-DASH was created by a consortium of technology vendors to establish a vendor-neutral alternative to Apple HLS, Microsoft Smooth Streaming, and Adobe HTTP Dynamic Streaming.

The most visible difference between HLS and DASH lies in the manifest format. While HLS relies on plain-text `.m3u8` files derived from audio playlist conventions, MPEG-DASH uses an XML document known as a Media Presentation Description (`.mpd`). The `.mpd` file organizes content into a formal hierarchy of Periods, AdaptationSets (grouping related video or audio renditions), and Representations (individual bitrates and resolutions).

| Attribute | HTTP Live Streaming (HLS) | MPEG-DASH |
| :--- | :--- | :--- |
| Standardizing body | Apple / IETF ([RFC 8216](https://www.rfc-editor.org/rfc/rfc8216.html)) | ISO/IEC ([ISO/IEC 23009-1](https://www.iso.org/standard/83314.html)) |
| Primary manifest format | Text playlist (`.m3u8`) | XML document (`.mpd`) |
| Standard segment length | 6.0 seconds | 2.0 to 4.0 seconds |
| Native platform support | macOS, iOS, iPadOS, Safari | Android, Windows, Chromium browsers |
| Low-latency extension | LL-HLS (RFC 8216 bis) | DASH-IF Low Latency |
| Common container | Fragmented MP4 (`.m4s`) / MPEG-TS (`.ts`) | Fragmented MP4 (`.m4s`) |

Historically, content providers had to encode and store two separate sets of media chunks: MPEG-2 Transport Stream files for Apple devices running HLS, and fragmented MP4 files for browsers running DASH. This doubled storage costs on origin servers and cut CDN caching efficiency in half.

To solve this fragmentation, the moving picture experts group created the Common Media Application Format (CMAF), standardized under [ISO/IEC 23000-19](https://www.iso.org/standard/79106.html). CMAF defines a unified fragmented MP4 structure using standard movie fragment (`moof`) and media data (`mdat`) boxes. Today, streaming providers encode a single set of CMAF video chunks on disk and reference the exact same files from both an `.m3u8` playlist for Safari and an `.mpd` manifest for Chrome.

## How does Netflix stream video to your screen?

Netflix streams video to hundreds of millions of devices by combining adaptive bitrate chunking with an optimization technique called shot-based dynamic encoding. Rather than applying a rigid bitrate ladder to every movie, Netflix analyzes video content per scene and per title using its open-source VMAF (Video Multi-Method Assessment Fusion) metric.

A low-motion dialogue sequence inside a quiet room requires far less data to achieve high visual clarity than an explosion in an action sequence. So a quiet documentary can stream at a fraction of the bitrate an action film needs at the same resolution. Netflix's 4K streams, in HEVC or AV1, typically run at about 8 to 16 Mbps.

To deliver these chunks without worldwide network bottlenecks, Netflix operates a proprietary content delivery network called Open Connect. Netflix manufactures custom storage appliances and installs them directly inside the facilities of internet service providers (ISPs) around the world. When you press play, your player downloads segments from an Open Connect server sitting directly inside your ISP's regional routing center rather than crossing transoceanic internet backbones.

## How does your Mac stream local video to an Apple TV?

Streaming does not only happen over public internet links. When you send a local video file from your Mac to an Apple TV or smart television, your computer takes on the role of the streaming server.

QuickTime Player and Safari can AirPlay a video to an Apple TV, which then streams it from the Mac. But the Apple TV only accepts what its own player handles: MP4 and MOV with H.264 or HEVC, for example, and not MKV files or DTS sound.

MacLC, the player we make, has a Play On button (in beta). For an Apple TV or another AirPlay receiver, it repackages what is playing as an HLS stream served from your Mac, on your own network, so even an MKV plays on the TV.

By generating an on-the-fly HLS stream from local video files, modern desktop video players allow an Apple TV or AirPlay 2 receiver to play video smoothly using its own hardware decoding pipeline. This direct streaming approach avoids the heavy compression artifacts and desktop lag associated with whole-screen AirPlay display mirroring.

## Why does stream quality drop suddenly before recovering?

When you notice a streaming video become pixelated for thirty seconds before snapping back to sharp clarity, you are watching adaptive bitrate streaming doing exactly what it was designed to do. A sudden drop in visual fidelity indicates that the client encountered a transient bottleneck, such as a family member starting a large download, Wi-Fi interference from a nearby appliance, or CDN congestion.

Every player's ABR engine enforces a strict hierarchy: maintaining continuous audio and video playback is always prioritized over visual sharpness. If network throughput plummets, continuing to download heavy 4K segments would exhaust the player's buffer in seconds, triggering a spinning loading wheel. Dropping to a 720p or 480p rung cuts the data it needs to a fraction, so the buffer can refill while the slowdown passes.

If streams often drop in quality at home, the cause is often not your plan's speed but a local slowdown: Wi-Fi, other devices, a busy moment on the network. Exploring [Why does video buffer?](/maclc/blog/why-does-video-buffer/) and learning [What is bitrate?](/maclc/blog/what-is-bitrate/) will help you track down and eliminate those playback bottlenecks for good.

## Questions people ask

### What is an m3u8 file?

An m3u8 file is an Extended M3U playlist saved in UTF-8 text format. It lists the web addresses and durations of individual video chunks, or links to variant playlists containing different bitrate options.

### Why does video quality drop before returning to sharp 4K?

When network throughput drops below the current stream bitrate, the player's buffer drains. To prevent playback from stopping entirely, the player immediately steps down to a lower-resolution segment on the bitrate ladder until the buffer refills.

### What is the main difference between HLS and MPEG-DASH?

HLS was created by Apple and uses m3u8 text playlists, while MPEG-DASH is an open international standard that uses an XML document called a Media Presentation Description (.mpd).

---
MacLC is a free, open-source video player for Apple Silicon Macs: https://www.hazenstudio.com/maclc/ · download: https://www.hazenstudio.com/maclc/donate/
