.M3U8
HTTP Live Streaming playlist
Introduction
An .m3u8 file is the playlist of HTTP Live Streaming (HLS), the streaming
protocol Apple introduced in 2009 and published as RFC 8216. The video is cut into short
segments, often at several qualities, and the playlist tells the player where to fetch
each one. HLS plays natively in Safari and on Apple devices, and in other browsers
through JavaScript players.
The format extends the M3U music playlist, and the 8 in the extension
means the text is UTF-8. Some music software also saves ordinary UTF-8 playlists as
.m3u8; those hold a list of tracks rather than a stream.
Software
Structure
An HLS playlist is UTF-8 text with one item per line. The first line is
#EXTM3U. Lines that start with #EXT are tags, other lines that
start with # are comments, and every other line is the address of a
segment or of another playlist.
There are two kinds of playlist. A multivariant playlist, also called a master
playlist, lists the versions of a stream: each #EXT-X-STREAM-INF tag gives
a bandwidth, resolution and codecs, and the next line names that version’s media
playlist. A media playlist lists the segments themselves: #EXTINF gives
each segment’s duration, followed by its address. #EXT-X-ENDLIST marks a
playlist that will not grow, as for a film rather than a live broadcast.
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:6
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:6.000,
segment0.ts
#EXTINF:6.000,
segment1.ts
#EXTINF:4.200,
segment2.ts
#EXT-X-ENDLIST
See also
Other formats that use the same extension:
- M3U playlist (UTF-8) .m3u8