Baud
All protocols

HLS

Video as a text playlist of small files, so a web server and a CDN are all you need.

A media playlist

A text file that says which chunks make up the video.

HLS media playlist (.m3u8) · plain text0163248648023#45E58X54T4DM33355U0ALF23#45E58X54T2D-58X2D-54T41A52R47G45E54T44D55U52R41A54T49I4FO4EN3A:3660ALF23#45E58X54T49I4EN46F3A:3662E.3002C,0ALF73s65e67g3002E.74t73s0ALF23#45E58X54T49I4EN46F3A:3662E.3002C,0ALF73s65e67g3112E.74t73s0ALF23#45E58X54T2D-58X2D-45E4EN44D4CL49I53S54T0ALFHeader tagTarget durationSegment durationSegment URISegment durationSegment URIEnd of listClick a field to inspect it

Whole frame

A playlist is just a text file listing video chunks. HLS needs no special server: any web server or CDN that can serve files will do.

FieldOffsetExample valueMeaning
Header tagByte 0–7#EXTM3UEvery playlist begins with #EXTM3U. Lines starting with # are tags (instructions); lines without # are URIs of media. Lines end with a plain LF here (CRLF is also allowed).
Target durationByte 8–31#EXT-X-TARGETDURATION:6The maximum segment length in seconds. A player uses it to decide how often to re-fetch a live playlist (about once per target duration).
Segment durationByte 32–44#EXTINF:6.0,The exact duration of the NEXT segment: 6.0 seconds. The tag always precedes its URI.
Segment URIByte 45–52seg0.tsWhere to download the media: a relative URL, so this is fetched with a normal HTTP GET from the same directory. It is a few seconds of MPEG-TS (or fMP4) video.
Segment durationByte 53–65#EXTINF:6.0,The second segment is also 6 seconds.
Segment URIByte 66–73seg1.tsThe second segment.
End of listByte 74–88#EXT-X-ENDLISTSays the list is complete: this is a recorded video (VOD). A live playlist has no ENDLIST and keeps growing; the player keeps reloading it.

Overview

HTTP Live Streaming cuts a video into a few seconds long segments and publishes a text playlist (.m3u8) that lists them. The player downloads the playlist, then the segments, over plain HTTP. For adaptive bitrate, a master playlist offers the same video in several qualities and the player switches between them as bandwidth changes.

Because it is just HTTP and files, it passes every firewall and scales on any CDN: the price is latency of several seconds, which Low-Latency HLS reduces by publishing partial segments.

Key facts

Transport
HTTP(S) over TCP
Playlist
.m3u8 (UTF-8 text)
Segments
MPEG-TS or fragmented MP4, ~2–10 s
Adaptive
Yes, per segment
Latency
~6–30 s (LL-HLS: 2–3 s)
Standard
RFC 8216

A master playlist

The same video at several qualities.

HLS master playlist · adaptive bitrate016324864809611212814423#45E58X54T4DM33355U0ALF23#45E58X54T2D-58X2D-53S54T52R45E41A4DM2D-49I4EN46F3A:42B41A4EN44D57W49I44D54T48H3D=3883003003003003002C,52R45E53S4FO4CL55U54T49I4FO4EN3D=36634430078x3333663000ALF6Cl6Fo77w2F/69i6En64d65e78x2E.6Dm33375u3880ALF23#45E58X54T2D-58X2D-53S54T52R45E41A4DM2D-49I4EN46F3A:42B41A4EN44D57W49I44D54T48H3D=3333003003003003003002C,52R45E53S4FO4CL55U54T49I4FO4EN3D=31132238830078x3773223000ALF6Dm69i64d2F/69i6En64d65e78x2E.6Dm33375u3880ALFHeader tagVariant 1 infoVariant 1 playli…Variant 2 infoVariant 2 playlistClick a field to inspect it

Whole frame

The master playlist lists the same video at several qualities. The player starts somewhere in the middle and switches up or down between segments as the connection changes.

FieldOffsetExample valueMeaning
Header tagByte 0–7#EXTM3UA master playlist also starts with #EXTM3U.
Variant 1 infoByte 8–61#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360Describes the next URI as one rendition of the same video: needs about 800 kbit/s and is 640×360. The player picks among renditions by measured throughput.
Variant 1 playlistByte 62–76low/index.m3u8The media playlist for the low-quality version.
Variant 2 infoByte 77–132#EXT-X-STREAM-INF:BANDWIDTH=3000000,RESOLUTION=1280x720A medium version: 3 Mbit/s, 720p.
Variant 2 playlistByte 133–147mid/index.m3u8Its media playlist.

Playing and adapting

Nothing but HTTP requests, one file at a time.

Playerbrowser / phoneCDN / web serverplain HTTPGETmaster.m3u8200 OK3 variantsGETmid/seg0.ts200 OKMPEG-TS, 6 sGEThigh/seg1.ts200 OKhigher bitrate

Whole exchange

HLS turns video into a series of small files and lets the player decide quality. That is why it scales on ordinary CDNs, and why it has latency of several seconds.

  1. 1Fetch the master playlist

    An ordinary HTTP GET. There is no streaming server and no special protocol: it is just a file.

  2. 2Choose a quality

    The player reads the variants and starts with a conservative one, then measures how fast the downloads go.

  3. 3Download segment 0

    Video arrives as 6-second chunks, each an independent HTTP download.

  4. 4Play it

    The segment is a short MPEG-TS file. The player decodes it while fetching the next one.

  5. 5Throughput was good: step up

    Downloading segment 0 was much faster than real time, so the player requests the next segment from a higher-quality variant. Quality changes only at segment boundaries.

  6. 6And on it goes

    For a live stream the player also re-fetches the media playlist about every target duration to discover new segments.

Where you meet it

  • Video on websites, Safari/iOS (native), and most video platforms
  • Live events on CDNs for audiences of millions
  • DRM-protected streaming with FairPlay

Watch out for

  • Segment length trades latency for efficiency: short segments mean more requests and a bigger playlist.
  • Segments should start with a key frame, or quality switching shows glitches.
  • Cross-origin playback in browsers needs CORS headers on both playlists and segments.

Standards

  • RFC 8216: HTTP Live Streaming

Related protocols