M3U

From Simple English Wikipedia, the free encyclopedia

M3U (MP3 URL or Moving Picture Experts Group Audio Layer 3 Uniform Resource Locator in full) is a computer file format for a multimedia playlist.

Extended M3U[change | change source]

The M3U file can include comments. They are prefaced by the "#" character. In extended M3U, "#" also introduces extended M3U directives which are terminated by a colon ":" if they support parameters.

M3U extensions
Directive Description Example Required Standard
#EXTM3U file header, must be the first line of the file #EXTM3U Yes
#EXTINF: track information: runtime in seconds and display title of the following resource #EXTINF:123,Artist Name – Track Title␤artist - title.mp3 No Yes
additional properties as key-value pairs #EXTINF:123 logo="cover.jpg",Track Title No IPTV
#PLAYLIST: playlist display title #PLAYLIST:Music TV IPTV
#EXTGRP: begin named grouping #EXTGRP:Foreign Channels No IPTV
#EXTALB: album information, title in particular #EXTALB:Album Title (2009) AL, M3A
#EXTART: album artist #EXTART:Various AL, M3A
#EXTGENRE: album genre #EXTGENRE:Jazz Fusion AL
#EXTM3A playlist for tracks or chapters of an album in a single file #EXTM3A M3A
#EXTBYT: file size in bytes #EXTBYT:34124 No M3A
#EXTBIN: binary data follows, usually concatenated MP3s #EXTBIN: No M3A
#EXTENC: text encoding, must be the second line of the file #EXTENC: UTF-8 No
#EXTIMG: cover, logo or other image #EXTIMG: front cover␤cover.jpg No No

HLS M3U extensions[change | change source]

Apple used the extended M3U format as a base for their HTTP Live Streaming (HLS). It was written in an Independent Submission Stream RFC in 2017 as RFC 8216. Therein, a master playlist references segment playlists which contain URLs for short parts of the media stream. Some tags only apply to the former type and some only to the latter type of playlist. But they all begin with #EXT-X-.

HLS M3U extensions
Directive Example Description
#EXT-X-START: TIME-OFFSET=0
#EXT-X-INDEPENDENT-SEGMENTS toggle without parameters
#EXT-X-PLAYLIST-TYPE: VOD or EVENT
#EXT-X-TARGETDURATION: 10 in seconds
#EXT-X-VERSION: 4
#EXT-X-MEDIA-SEQUENCE: 0
#EXT-X-MEDIA: NAME="English", TYPE=AUDIO, GROUP-ID="audio-stereo-64", LANGUAGE="en", DEFAULT=YES, AUTOSELECT=YES, URI="english.m3u8"
#EXT-X-STREAM-INF: BANDWIDTH=1123000, CODECS="avc1.64001f,mp4a.40.2 parameters have either one combined value or one per stream, separated by commas
#EXT-X-BYTERANGE: 1024@256000
#EXT-X-DISCONTINUITY toggle without parameters The segment represents the start of a new period
#EXT-X-DISCONTINUITY-SEQUENCE: 2 Indicates start of numbering of periods
#EXT-X-GAP: toggle without parameters The segment represents a "spacer" before a new period
#EXT-X-KEY: METHOD=NONE
#EXT-X-MAP: URI=MediaInitializationSection
#EXT-X-PROGRAM-DATE-TIME: 2010-02-19T14:54:23.031+08:00 ISO 8601 format
#EXT-X-DATERANGE: ID=foo
#EXT-X-I-FRAMES-ONLY i-frame toggle without parameters
#EXT-X-SESSION-DATA: DATA-ID=com.example.movie.title
#EXT-X-SESSION-KEY:
#EXT-X-ENDLIST end-of-list signal without parameters