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. The Winamp text says “No characters follow
the title”. VLC splits the title at the first - into artist and name,
and also reads time,artist,name and time,,name; mpv keeps the
whole text after the first comma as the 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-group | A named group of channels; some players read a hierarchical separator in the value, as in Music/Rock |
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 |
M3A, an album in one file
BirdCage Software’s note M3A (M3U Album) Format (2002–2003, “feel free to distribute this document”) describes the format in full. An M3A file is an M3U file with a little more, followed by the audio:
- The text lists the file names as in any M3U. Each name is preceded by
#EXTBYT:and the size of that file in bytes. The optional lines#EXTM3Uand#EXTM3Amay come first, and#EXTINF,#EXTALBand#EXTARTmay describe the album. - After the last name comes the line
#EXTBIN:. “#EXTBIN: plus CR+LF is the 0 offset for the first file”: from there the files follow as they are, joined end to end, with no header between them. - To extract a file, add up the
#EXTBYT:sizes of the files before it to find where it starts; its own size says where it ends. The extracted file takes the name in the list.
No tag in the M3A file itself is changed, so the audio files are untouched, and the note
says an M3A file “will play as one continuous mp3 if renamed to mp3” (when the files
are MP3). A program that knows nothing of M3A reads the text part and finds names; a
plain text reader sees binary data after #EXTBIN:. The explorer stops
reading text at that line and shows each embedded file as a node of its own, which it
can open, and reports data that ends early or is left over.
Album List for Winamp
Album List is a Winamp plug-in by Safai Ma. Its FAQ (answer to “How can I change the
Artist - Album associated with an album?”) says to put the two extra lines
#EXTART: and #EXTALB: after #EXTM3U in an M3U
file kept beside the audio files, followed by the usual #EXTINF lines. It is
where #EXTART and #EXTALB come from; #EXTGENRE is
listed by Wikipedia as an Album List directive and is not in the FAQ.
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.