What Is the M3U8 Protocol? HLS Streaming Explained

Contents

  1. What Is M3U8
  2. HLS Protocol Overview
  3. Playlist Structure
  4. Adaptive Bitrate
  5. Summary

What Is M3U8

An M3U8 file is a UTF-8 encoded multimedia playlist file — essentially a plain text file that describes the addresses of a set of media files (usually video segments). It is the core file format of HLS (HTTP Live Streaming).

Unlike a traditional single MP4 file, M3U8 splits a complete video into many small TS segments. The playlist records the order and addresses of these segments, and the player downloads and plays them in sequence, which is how streaming delivery works.

HLS Protocol Overview

HLS is a streaming protocol created by Apple. Its defining feature is that it is based on HTTP. This means it can pass through almost all firewalls and CDNs, with low deployment cost and excellent compatibility.

The HLS workflow can be summed up in three steps:

  1. The server slices the video into many small TS files and generates an m3u8 playlist.
  2. The client downloads the m3u8 playlist and parses out all segment addresses.
  3. The client downloads the TS segments in order and plays them continuously, achieving "play while downloading".

Playlist Structure

A typical m3u8 playlist looks like this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXTINF:10.0,
segment-000.ts
#EXTINF:10.0,
segment-001.ts
#EXT-X-ENDLIST

Where:

Adaptive Bitrate

One of HLS's great strengths is support for adaptive bitrate (ABR). The server can provide multiple m3u8 playlists at different quality levels (known as a master playlist), and the player automatically picks the most suitable quality based on current network bandwidth, keeping playback smooth even when the network fluctuates.

This is why video quality changes automatically with your network conditions when you watch videos online.

Summary

M3U8 is the core file format of HLS streaming. By splitting video into small segments organized by a playlist, it enables efficient HTTP-based streaming delivery. Combined with adaptive bitrate, HLS has become one of the most widely used protocols for live streaming and on-demand video on the internet.

Want to try m3u8 playback for yourself? Head over to the online player and give it a go.