← Lessons

quiz vs the machine

Gold1460

System Design

The Segment and Manifest HLS

How HLS uses a playlist of small segments to deliver video over HTTP.

5 min read · core · beat Gold to climb

What HLS is

HLS delivers video as a list of small files over plain HTTP. Because it is just files and text playlists, any HTTP CDN can cache and serve it without special streaming servers.

The two layers of manifest

  • Master playlist lists each rendition and its bitrate, pointing to a media playlist per quality.
  • Media playlist lists the ordered segment files for one rendition, with their durations.

Segments

Each segment is a few seconds of video, historically a transport stream file and now often fragmented mp4. The player reads the media playlist, downloads segments in order, and stitches them into smooth playback.

How players use it

The player fetches the master, picks a rendition, then walks its media playlist. To switch quality it just loads the other rendition's segments at the next boundary. For live, the media playlist is refreshed to append new segments and drop old ones.

Key idea

HLS structures video as a master playlist of renditions, media playlists of ordered segments, and short segment files, all cacheable over plain HTTP.

Check yourself

Answer to earn rating on the learn ladder.

1. What does the HLS master playlist contain?

2. Why can any HTTP CDN serve HLS?