Directives are comment lines that begin #EXT (and one other, listed below).
They apply to the entry that follows. No authority defines them: the set below is what
programs have adopted, gathered from the
Wikipedia summary and each program’s own
use. A player ignores any directive it does not know.
Core directives
| Directive | Syntax | Meaning |
|---|---|---|
#EXTM3U | #EXTM3U | Marks an extended playlist. Must be the first line. |
#EXTINF | #EXTINF:seconds,title | The length and display title of the entry on the next line. |
In #EXTINF the length is a whole number of seconds, with
-1 or 0 for a stream with no set length. The title follows
the comma, usually as Artist - Title. Under RFC 8216 the length may also
be a decimal, except that it must be an integer in a playlist whose compatibility
version is below 3.
IPTV attributes
IPTV playlists put extra key-value attributes on #EXTINF, between the
length and the comma.
#EXTINF:-1 tvg-id="news.example" tvg-logo="https://example.com/news.png" group-title="News",News Channel
https://tv.example.com/news.m3u8
| Attribute | Holds |
|---|---|
tvg-id | The channel’s identifier in an electronic programme guide |
tvg-name | The channel’s name in the guide |
tvg-logo | URL of the channel’s logo |
tvg-chno | The channel number |
tvg-country | The channel’s country |
tvg-language | The channel’s language |
group-title | The group the channel appears under |
radio | true if the channel is a radio stream |
Other directives
| Directive | Example | Meaning | Origin |
|---|---|---|---|
#PLAYLIST: | #PLAYLIST:My Channels | Display title of the playlist. | IPTV playlists |
#EXTGRP: | #EXTGRP:Foreign Channels | Begins a named group of entries. | IPTV playlists |
#EXTALB: | #EXTALB:Album Title (2009) | Album title. | Album List for Winamp and M3A |
#EXTART: | #EXTART:Various | Album artist. | Album List for Winamp and M3A |
#EXTGENRE: | #EXTGENRE:Jazz Fusion | Album genre. | Album List for Winamp |
#EXTM3A | #EXTM3A | Marks a playlist of album tracks or chapters held in one file. | M3A (M3U Album) |
#EXTBYT: | #EXTBYT:34124 | The file’s size in bytes. | M3A |
#EXTBIN: | #EXTBIN: | Binary data follows, usually concatenated MP3 data. | M3A |
#EXTALBUMARTURL: | #EXTALBUMARTURL:https://example.com/a1b2c3d4.jpg | URL of the album art. | Jamendo and VLC |
#EXTVLCOPT: | #EXTVLCOPT:network-caching=1000 | Sets a VLC option for the next item, as option-name=value. | VLC |
A line beginning #EXTBIN: means binary data follows in the same file,
which a reader that handles only text will not cope with. M3A keeps its audio and its
listing together in this way. No specification for it could be confirmed, so the
details above are all that is known here.
HTTP Live Streaming
Apple’s HTTP Live Streaming builds on extended M3U. All of its tags begin
#EXT-X-, and a file containing them is an
HLS playlist, covered as a separate format. It
shares only #EXTM3U and #EXTINF with ordinary M3U.