UNDERSTAND GUIDE · 9 min read

HLS playlists and segments explained

Understand what an M3U8 playlist contains and how HLS media segments work together.

The playlist is an index

An M3U8 file is a UTF-8 text playlist. It normally contains tags and media URIs rather than the audio or video payload itself. Lines beginning with # describe behavior; URI lines identify a child playlist or segment.

A VOD media playlist describes a fixed sequence and ends with EXT-X-ENDLIST. A live playlist may change as segments become available.

Read a VOD playlist

EXT-X-TARGETDURATION identifies the maximum segment duration rounded to whole seconds. Each EXTINF line records the duration of the segment URI that follows it.

Relative URIs resolve from the playlist location. If playlist.m3u8 and segment_000.ts share a directory, a bare filename is enough.

Media playlist example
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:6.000,
segment_000.ts
#EXTINF:4.200,
segment_001.ts
#EXT-X-ENDLIST

Media and master playlists

A media playlist lists playable segments. A master playlist lists one or more variant media playlists and attributes such as bandwidth and codecs.

This converter's Master output points to one 720p video rendition or one audio rendition. A conventional adaptive package includes multiple variants so the player can switch among them.

Single-rendition master
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=2500000
720p/index.m3u8

The folder is one package

Every URI in every playlist must resolve. Moving master.m3u8 while leaving the variant directory behind produces a readable text file that cannot play.

Treat the extracted ZIP as one package and change paths only when the complete resolution chain is understood.

Technical references

Primary documentation used to review this guide:

Ready to create your HLS package?

Return to the converter. Your source file stays inside your browser.

Open converter