Anatomy of an M3U8 File: Tags, Segments, and Layers

この記事は中文と英語で提供されています。日本語訳は準備中です。

M3U8 is plain text you can open in any editor. Learn a few core tags and you can read most playlists.

Essential tags

  • #EXTM3U: the file header, identifying an extended M3U.
  • #EXTINF:<duration>,<title>: the duration of the segment that follows.
  • #EXT-X-ENDLIST: marks the end of a VOD stream; live streams don't have it.

Quality and encryption

  • #EXT-X-STREAM-INF: declares a bitrate variant in a master playlist, with attributes such as BANDWIDTH and RESOLUTION.
  • #EXT-X-KEY: declares how segments are encrypted and where the key lives; common in protected content.
  • #EXT-X-MEDIA-SEQUENCE: the sequence number of the first segment in a live playlist, advancing as the window slides.

Two levels

A master playlist points to several media playlists, which in turn point to individual segments. The player reads the master to choose, then reads the matching media playlist to fetch segments. This structure lets one stream serve both phones and televisions.

← Adaptive Bitrate: Why Video Doesn't StutterHow to Find a Working M3U8 Live Stream URL →