Mastering HTTP Live Streaming

Part 2: Components of HTTP Live Streaming

Balaji Malliswamy
Oct 1, 2019 · 3 min read
Components of HTTP Live Streaming

This article is a part of Mastering HTTP Live Streaming series. In my previous article, I described about HTTP Live Streaming

In this article, I’m going to explain setup architecture of HLS and basic tags of .m3u8 playlist file.


Server Component

  • Encoder : Converting data from one format to another using defined compression mechanism
  • Transcoder: Creating multiple quality variants of the same content.
  • Stream Segmenter: Breaking the content into a series of short media files

Distribution Component

  • Origin web server : System that delivers the media files and index files of the client over HTTP
  • CDN (Content delivery network)

Client (Player)

This process continues until the player encounters an end tag in the .m3u8 file. If no end tag is present, the .m3u8 file is part of an ongoing broadcast i.e live event.

During ongoing broadcasts, the player loads a new version of the .m3u8 file periodically to download updated media chunks.

AVPlayer for play the HLS video

M3U8 Playlist

.m3u8 file structure

EXTM3U: Indicates that the playlist is an extended M3U file. All HLS playlists must start with this tag.

EXT-X-PLAYLIST-TYPE: This tag may contain a value of either EVENT (Live) or VOD. If the tag is present and has a value of EVENT, the server must not change or delete any part of the playlist file. If the tag is present and has a value of VOD, the playlist file must not change.

EXT-X-TARGETDURATION: Specifies the maximum media-file duration.

EXT-X-VERSION: HLS protocol version.

EXT-X-MEDIA-SEQUENCE: Indicates the sequence number of the first URL that appears in a playlist file.

EXTINF: A record marker that describes the media file identified by the URL that follows it. Each media file URL must be preceded by an EXTINF tag.

EXT-X-STREAM-INF: Indicates that the next URL in the playlist file identifies another playlist file, parameter defines stream’s metadata like BANDWIDTH, AVERAGE-BANDWIDTH, RESOLUTION, CODECS, etc.

EXT-X-ENDLIST: Indicates that no more media files will be added to the playlist file.

The next step will be how to integrate HLS with your app. I think this deserves a separate post. I’m planning to write one soon, keep watching this space for updates.


Find it a good read?

Recommend this post (by clicking 👏 button) so other people can see it too…
reach me on Twitter Balaji Malliswamy

Swift India

Swift Developer Community in India 🇮🇳

Balaji Malliswamy

Written by

 developer, Chennai & Writer at Swift India https://about.me/balajimalliswamy , https://unsplash.com/@blahji

Swift India

Swift Developer Community in India 🇮🇳

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade