[Tutorial] Structure of a .m3u list for IPTV

Gizmo

Well-known member
Joined
Jun 8, 2021
Messages
524
Awards
4
Offline

[Tutorial] Structure of a .m3u list for IPTV


IPTV is a system or technology that uses IP and Internet protocols to transmit multimedia content in streaming. It is usually used to broadcast television over broadband networks.
Not to be confused with Internet TV or Internet TV. Both technologies use the same or almost the same protocols, but the content delivery method differs. While on Internet TV the contents are usually offered freely and are not geolocated and the contents are normally accessible with an internet browser, on IPTV the contents are offered only to registered or subscription users and are usually geolocated. It is almost the same difference that there can be between cable TV or pay TV and public or broadcast TV. This system is lately used to offer live TV (or almost), almost always illegally, to users who do not have a subscription to a pay TV service.


M3U is a plain text file format (can be opened with the same Windows Notepad) used to createPlaylists or Play Lists . M3U is the acronym for MPEG Version 3.0 URL . Initially it was only supported by the Winamp player , but over time it has become a standard for creating play lists and is supported by almost all players on the market.
It was originally created to create music playlists, but is currently a type of file used to create IPTV playlists.


The objective of this article is that we learn how the m3u lists for IPTV are structured and we ourselves can create from scratch or modify ready-made lists to better suit our tastes and / or needs. As we always recommend in Addictive Knowledge, it is much more satisfying to know how things are and how things are done than to wait for others with their personal whims to tell us how they should be.


STRUCTURE OF AN M3U FILE
The structure of an m3u file must contain a series of specific labels distributed over three lines.
The structure is as follows:
# EXTM3U
#EXTINF: (duration), (attributes), (channel title)
URL


# EXTM3U

Mandatory label and must go to the beginning of the document. It is only written once in the entire document and indicates to players that this is an Extended M3U list. It is Extended because it includes additional attributes that are not present in a basic M3U list.


#EXTINF:
Indicates where the additional metadata of each streaming begins. One line must be used for each stream included in the list. For example, if we list 5 TV channels, we will have to create 5 lines #EXTINF:


(duration)

Indicates the duration in seconds of the referenced multimedia file. Two parameters are used in IPTV lists. either 0 or -1. Both parameters have the same function, they indicate that the streaming duration is not fixed and cannot be determined. Some players interpret it slightly differently, parameter 0 refers to a cached broadcast, and therefore the broadcast can be summarized, that is, pause and continue at the same point where it left off. Parameter -1 indicates that it is a live broadcast and cannot be summarized.


Examples:


#EXTINF: 523 indicates that it is a stored file that has a duration of 523 seconds
#EXTINF: 0 indicates that it is a live broadcast from a cache that allows to summarize the playback
#EXTINF: -1indicates that it is a live broadcast and does not allow summarizing.


After the duration parameter, a blank space must be placed
Example: #EXTINF: -1, Channel name


(attributes)

They are a series of optional tags that add metadata that can be read by the players. Not all players are capable of interpreting all attributes.
A blank space must be left between the attributes.
There are several attribute tags, but the most used in IPTV lists are the following:


tvg-id = ”ID EPG”
Indicates the EPG or programming guide ID or identifier. EPG (Electronic Program Guide) is similar to teletext, it offers the hourly programming of the different TV channels. In digital TV broadcasts, apart from video and audio data, additional data can also be sent with the programming of that channel. In IPTV this is not possible and these guides are usually offered in XML format that must be downloaded and used locally, or downloaded from a URL. The following image is an example of part of an XML configured to be used as an EPG Guide:








Not all players are EPG compatible. Some players that are compatible are RosadínTV, ProgDVB on PC or IPTV Pro on Android, which allow you to load EPG sources.


If we specify the ID of each channel listed in the EPG, the player will display the information of that channel. The way this information is displayed differs for each player.




Another way in which a certain channel can be associated with its EPG information is that the name of the channel must be exactly the same as that of the EPG list of that channel.


Example:


#EXTINF: -1, tvg-id = "AXN", AXN
#EXTINF: -1, tvg-name = "AXN", AXN



In these two examples the result would be the same if in the EPG the channel AXN had exactly that name as ID.


tvg-shift = setting
This is a setting for the EPG schedule. It is possible that the EPG guide used is not adjusted to your schedule. With this parameter we can readjust that data. It should always have the + or - signs .
This parameter is placed after the initial # EXTM3U tag and after a blank space.
 

Gizmo

Well-known member
Joined
Jun 8, 2021
Messages
524
Awards
4
Offline
I had to split the post because it was too long I guess.

Example:
# EXTM3U tvg-shift = + 2
In this example we indicate that two hours must be added to the time used in the EPG.
tvg-name = "Channel Name"
Specifies the name that the channel will receive internally. It is not the name that will appear on the players. Usually used instead of the tvg-id = "" tag . This name is usually the one that appears in the EPG that some players show. If the tags tvg-id = "" and tvg-name = "" are combined in our m3u file , the first indicates the ID of the channel in the guide and the second is the name that will be seen when the guide is displayed. If only the tvg-name = "" parameter is used , that will be the identifier in the EPG.
group-title = ”Group Name”
This parameter indicates the group or category of the channel. We may want to group the different channels into categories, for example Movies, Cultural, Children's, etc ...
Some players allow channels to be grouped by categories and with this parameter we can indicate to which category each channel belongs.
Example:
#EXTINF: -1, tvg-name = "AXN" group-title = "Cinema and Series", AXN
#EXTINF: -1, tvg-name = "Sony HD" group-title = "Cinema and Series", Sony
#EXTINF: -1, tvg-name = "CNN" group-title = "Noticias", CNN in Spanish
#EXTINF: -1, tvg-name = "Discovery Channel" group-title = "Cultural", Discovery

To this parameter or attribute we can apply a series of "ornaments" such as a colored background, bold text, in italics, etc ... The tags to use are similar to those used in HTML. Adornment tags will be enclosed in brackets [] and will have a start and end tag [/]. Some players, such as RosadinTV, are able to interpret this data and will show these "decorations" in the channel list.
Example:
#EXTINF: -1, group-title = "CINE", [COLOR orange] CINE [/ COLOR]
http: //?

In the following image, we see the effect of applying the previous example, although only the color label was applied to it.



In this example, the CINE category will be displayed with an orange background and the text in bold and italic type. A URL is not specified for streaming because it is intended to be an ornament. Normally this type of adornment is used in a single line, as if it were a channel, but without specifying a URL, as in the previous example.
tvg-logo = ”LOGO URL”
This parameter allows specifying the path to a logo that identifies the channel. Some players support this parameter and display an image or logo representing each channel. Not all players are compatible with this parameter, PotPlayer for example is not, although RosadinTV or IPTV PRO are.

The address is usually a URL to an image file stored on the internet, although a local address can be specified. When the address is local, you can specify a relative or absolute address. If it is relative, the logo must be in the same location in the m3u list.
If we are going to use remote lists or we are going to share our IPTV lists, the ideal would be to use a URL for the logo, as this way we make sure that they are always available wherever we are, as long as there is an internet connection.
Examples:
Using a URL
#EXTINF: -1 tvg-logo = "http://rockypoint360.com/rocky-poin...-content/uploads/2015/10/logo-megacable_1.jpg" group-title = "Spain", MEGA
Using an absolute local address
#EXTINF: -1 tvg-logo = "C: \ Users \ Owner \ Documents \ RosadinTV \ Log os \ Logos 2017 \ mega.png" group-title = "Spain", MEGA
Using a relative local address
#EXTINF: -1 tvg-logo = "mega.png" group-title = "Spain", MEGA
audio-track = "LANGUAGE"

With this parameter we can specify the audio language or languages that the streaming consists of. Languages must be specified using ISO 639-2 language codes. If our streaming has several audio languages available, we can specify them all use commas as separators. Some players read this parameter and it shows us the languages available for the channel we are playing.
Examples:
#EXTINF: -1 tvg-logo = "mega.png" group-title = "Spain"
#EXTINF: -1 tvg-logo = "mega.png" group-title = "Spain" audio-track = "spa, rus, eng", MEGA

These are the most common tags in m3u lists for IPTV, although there are several more , you can even specify parameters such as preferred quality, initial language, aspect ratio, subtitles, etc ... But for our purposes of creating a functional m3u list without complications, these are the ones we will use regularly. it is even possible that none.
(channel title)
Here we will indicate the name that will appear in the players. it must be preceded by a comma and no spaces after it.
Examples:
#EXTINF: -1 tvg-logo = "mega.png" group-title = "Spain", MEGA
#EXTINF: -1, MEGA
#EXTINF: -1, tvg-name = "AXN HD",

Here we will specify the URL or internet address that is broadcasting the streaming of the channel we want to see.
We can specify the URL to a live streaming, the usual in IPTV or to a video file stored on a server or also the address to a local file.
Examples:
# EXTM3U
#EXTINF: 0, tvg-id = "1" tvg-logo = "amc.png" tvg-name = "AMC" group-title = "CINE", AMC
http://200.76.77.237/LIVE /H01/CANAL4...ertvlat=%2F.ts
# EXTM3U
#EXTINF: -1, Sample movie (2017)
https://servidor.com/movie.mpg
# EXTM3U
#EXTINF: -1, Star Wars Episode I
H: \ PELICULAS \ STAR WARS \ Star Wars Episode I The Phantom Menace (1999) .mkv
We will show below some examples of typical m3u lists for IPTV:
the URLs shown are fictitious and are only used as an example.
List to a local file
# EXTM3U
#EXTINF: -1, Star Wars Episode I
H: \ PELICULAS \ STAR WARS \ Star Wars Episode I The Phantom Menace (1999) .mkv
Simple list
# EXTM3U
#EXTINF: -1, AMC
http: //200.76.77.237/LIVE/H01/CANAL444/PROFILE03.m3u8?supertvlat=%2F.ts
#EXTINF: 0, AZ Cinema
http://200.76.77.237/LIVE/H01/CANAL425/PROFILE03.m3u8?-1332% 2F1499-20150816T153535.ts = -1
Typical list with some metadata
# EXTM3U
#EXTINF: 0, tvg-logo = "amc.png" tvg-name = "AMC" group-title = "CINE", AMC
http://200.76.77.237/LIVE/H01/CANAL444/PROFILE03.m3u8?supertvlat=%2F.ts
#EXTINF: -1, tvg-logo = "http://foto.com/Az-Cinema.png" tvg -name = "AZ Cinema" group-title = "CINE", AZ Cinema
http://200.76.77.237/LIVE/H01/CANAL444/PROFILE03.m3u8?supertvlat=%2F.ts
List with only one channel and all parameters commented previously:
# EXTM3U tvg-shift = + 2
#EXTINF: -1, tvg-id = "AXNHD" tvg-name = "AXN HD" tvg-logo = "http://foto.com/Az-Cinema.png "group-title =" CINE "audio-track =" spa, rus, eng ", AXN
http://200.76.77.237/LIVE/H01/CANAL444/PROFILE03.m3u8?supertvlat=%2F.ts
 
Top