M3U

from Wikipedia, the free encyclopedia

M3U is an open playlists - format for media files, which are summarized in a list. Originally developed for MP3 files ( M3U stands for MP3 URL ), any media format can be called up using M3U files. Most media players support the M3U format as a playlist. An alternative playlist format (playlist format) is PLS .

specification

M3U is a freely editable text file . The specification was developed in the late 1990s and is supported by most media players today .

A distinction is made between the following formats:

  • Simple M3U
  • Extended M3U

Simple M3U

An M3U file consists of a list of pointers to any data sources (primarily media files), whereby the individual entries of the M3U file are separated from one another by a line break .

Each resource location can be specified in any format that the operating system can understand as a pointer to a resource. For example, either the full file name (with an absolute or relative path ) or a URL to a file on a web server can be specified .

Example of a simple M3U file:

Titel 1.mp3
Pop\Meine Auswahl\Titel 2.ogg
C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Musik\Titel 3.flac
\\example-server\example-share\Title 4.mp4
http://www.example.com/musik/titel5.mp3

The example shown above has five entries about resource locations:

  • The file Titel 1.mp3is in the same directory as the M3U file,
  • Titel 2.ogg there are two directories below the M3U file,
  • for Titel 3.flacan absolute path is specified,
  • Titel 4.mp4 is on a file share of a server in the local network,
  • titel5.mp3 is located on a web server.

Comment lines begin with '#' and are ignored.

Extended M3U

In contrast to the simple M3U, metadata and a header data area are also used in the extended M3U .

Example:

#EXTM3U
#EXTINF:221,Queen - Bohemian Rhapsody
Titel 1.mp3
#EXTINF:473,Dire Straits - Walk Of Life
Pop\Meine Auswahl\Titel 2.ogg
#EXTINF:264,冨田勲 – Boléro
C:\Dokumente und Einstellungen\All Users\Dokumente\Eigene Musik\Titel irgendeinenummer.flac
#EXTINF:504,Bob Marley - Buffalo Soldier
http://www.seite.invalid/musik/titel4.mp3

The first line # EXTM3U is the introduction of the header data and defines the format of the M3U, with extended M3Us always use the first line # EXTM3U .

The actual content of the M3U follows after the first line. Two lines are required for each media file:

  • The first line always begins with #EXTINF:, followed by the length of the media file in whole seconds. A comma is used as a separator after the length, followed by the name of the media file, which is used for display in the media player . If the specified length is smaller than the actual length, the specified length - as with the PLS format - is not taken into account. (If the length is set to −1, it is also ignored.)
  • The second line is identical to the specification of simple M3Us, for example the full file name (with either an absolute or relative path) or a URL to a file on a web server is given here.

But there are also mixed forms in which individual entries can occur without a #EXTINF line.

Unix (Mac OS X / Linux)

In Linux and macOS, M3U files have the same structure. The DOS / Windows-specific drive letter is omitted in the path information , and the names in the directory hierarchy are separated by a normal slash [/] in accordance with Unix. For example, an expanded M3U file looks like this:

#EXTM3U
#EXTINF:123,Alle - Unser Lied
/media/MeineFestplatte/Pfad/zu/meinen/Songs/Alle/Unser Album/Unser Lied.flac
#EXTINF:321,Alle - Dein Lied
Pfad/zu/meinen/Songs/Alle/Unser Album/Dein Lied.ogg
#EXTINF:231,Alle - Liedlos
../DeineFestplatte/Pfad/zu/deinen/Songs/Alle/Unser Album/Liedlos.m4a
#EXTINF:213,Alle - Euer Lied
http://www.example.org/musik/Alle-Unser_Album-Euer_Lied.mp3
#EXTINF:0,Alle - Ich
~/Musik/Alle/Ich.wma
#EXTINF:-1,Alle - Alle
Alle.mp4

The usual location for mounted external hard drives is [/ media / HDDName] . The abbreviation [~] is often used for the user folder (usually [/ home / user name] ). Two dots as directory information ( [..] ) is used under DOS / Windows and all Unix systems as information for the higher-level directory.

Other playlist formats

See: playlist # music software .

Web links