Creation of m3u playlist for IPTV. M3U file extension m3u file

Engineering systems 06.02.2022
Engineering systems
jeweler February 23, 2011 at 02:26 pm

What does the M3U format eat with?

  • Lumber room *

This article is intended to tell in detail about the intricacies of the M3U playlist format - the de facto standard for many music players, both software and hardware.

A bit of history

This format appeared in 1997, it was the standard playlist view for the Winamp program.
It was impossible to call this format something special - its first version was just a list of paths to music files, and both relative paths and full paths were supported. A little later, it became possible to use the URL to set the path in the file. The carriage return and line feed characters (/r/n) were used as separators. Also, Windows-1252 was used as an encoding according to the standard.
Single-line comments like

# Some comments

No headers were required to declare that this is an M3U file, or any other.
Such ascetic playlists are used to this day - for example, they can be used to exchange links to streaming video or audio.
The entire playlist will consist of one line:

http://example.com:8000/audio

However, there is an important nuance that has been going on from those times to this day - the characters / r / n must also be at the end of the last line.

But everything flows and changes. It became clear that paths to files alone cannot satisfy the needs of both the user and the developer.
Increasingly, some players used comments to store their service information - in particular, the name of the track and its length.
And all this resulted in the next step in the evolution of the M3U format.

Extended M3U

The extended syntax of the M3U format allows you to set the tags for the file, the duration and the name of the playlist.
It's sparse, but you don't need more.
In addition, ExtM3U is backwards compatible with M3U because it uses comments for markup.
However, the requirements for the encoding (and it should be Windows-1252) and for the separator (line feed only with carriage return) remain the same.
But everything for the encoding began to appear indulgent - with the selected Russian localization, many players began to read the playlist in Win-1251.

So, let's look at the example of the ExtM3U syntax.

#EXTM3U
#PLAYLIST:Playlist Name
#EXTINF:100,Track Title
music/Track01.mp3
#EXTINF:456,Artist Name - Track Name
C:/music/Track01.mp3
#EXTINF:456,Unix Full Pathname
/home/usr/data/music/Track01.mp3
#EXTINF:-1,Some Radiostation
http://example.com:8000/radio

  • #EXTM3U - M3U file header. It says that we really have an M3U playlist in front of us and that the syntactic constructions of the ExtM3U format are fully supported.
    In fact, as always, not everything is so rosy. For example, an Mp3 player in a Siemens CX75 phone prescribes this directive at the beginning of the playlist when it is created. But it ignores the rest of the ExtM3U markup. It even refused to digest relative paths to files(!).
  • #PLAYLIST - playlist name. For example: "Songs about birds." Not included in the official specification and is an amateur performance of some players.
  • #EXTINF - description of the track itself. Let's take a closer look at the syntax of this directive.
EXTINF Directive
Syntax:

#EXTINF:track_length sec,track_name\r\n
path_to_file.ext

According to the M3U syntax, all directive parameters are described after a colon and separated by commas.

  1. Track duration in seconds. Any positive number, including zero.
    -1 means track length is ignored.
    Some players immediately put question marks instead of the duration, some still try to determine it on their own. If successful, the length of the track will be displayed.
  2. Name of the track. Any phrase in Windows encoding.
    If the track has an artist and a name, then it is advisable to use a hyphen (minus) - "-" as a separator.
  3. The path to the file. Required parameter, separated from the \r\n directive description.
    If you specify a relative path, the player will search for files, "starting" from the folder where the playlist is located.
    When specifying a URL, it is possible to specify any protocol that the player supports (http(s), ftp, etc). It is desirable to use http or a special protocol for streaming audio / video rtsp.
But the most important pitfall is encoding. Sometimes, to indicate that Russian letters follow in the name of the track or path, the US character is used. But utf-8 suggests itself here.
So, the next evolution of M3U playlists is the M3U8 format.

M3U8 - m3u in utf-8

The *.m3u8 format has been predominantly used on Unix systems.
Many players automatically recognize the file encoding and do not require the presence of an eight in the extension.
The differences from the usual m3u format are, of course, the utf-8 encoding and the ability to use only line feed (\n) as a line separator.

Conclusion

M3U is a simple and forward looking playlist format with thirteen years of history.
It is simpler and more understandable than playlists with an xml structure, since csv-like formats for storing small structured data volumes are much more convenient.
Many manufacturers of equipment give their preference to m3u, and this format is supported by all music players.
I hope that a more detailed acquaintance with these formats has been of benefit to you in the future.

Iptv m3u playlist is essentially a collection of links to streams. The playlist allows the program for viewing IPTV or IPTV set-top box to navigate the information flows of the Internet. It can be said that iptv m3u playlist- it's a phone book!

#EXTM3U - IPTV playlist format

So, each Iptv m3u playlist file starts with the statement #EXTM3U is a title that defines the purpose and format of the playlist.
#EXTM3U- this is M3U iptv playlist format.
In fact, this is a text file with the extension M3U Latin-1 encoding, also known as ISO 8859-1, is for Western European languages. Therefore, if the Iptv m3u playlist file contains Russian characters (Cyrillic) in the name of the streams, then get ready to meet unreadable hieroglyphs in the iptv application.
But channels with latin characters like - MCM Top, MUSIC BOX EN, RUTV, VH1 Classic in the IPTV player and VLC will be displayed normally.

Streams with Cyrillic in the title, such as - NST, 365 days TV, 24 DOK, Amusement park, will reflect with krakozyabry.

How to get rid of krakozyabr and hieroglyphs in the structure of IPTV M3U playlist

To avoid the appearance of hieroglyphs in channel names when viewing an IPTV playlist, you need to use UTF-8 encoding. The UTF-8 encoding makes it possible to display characters in almost all languages ​​of the world. And the channels will be readable!

Correction of IPTV playlist in UTF-8 encoding

Correcting the encoding in UTF-8 is quite simple, for this we need to open the iptv playlist using the Notepad application. Right-click on the playlist file, a menu for selecting actions appears. Select the "Open with" tab and if you do not see the "Notepad" application in the menu that opens, then click "Choose another application".

After that, select the desired program from the proposed list.

So our iptv playlist opens.

Now the most important thing is to select UTF-8 in the "Encoding" tab and safely save the file under the name you need and in the right place.

#EXTINF - extended information about IPTV playlist streams

There is a strange word in the playlist file #EXTINF, but this is an indicator for an application that will display iptv channels on a computer or smartphone. This indicator tells the application about the media file that will be displayed using this playlist. In fact #EXTINF stand for Extended information or Extended information. In most cases #EXTINF contains 2 parameters.
The first is the duration of the media file, in the iptv playlist this parameter is "-1". Minus one means that the length of the media file is unknown and will be played as long as the data is being received.
The second is the name of the stream of the media file, or just the name of the channel.

There are also a few more options:
"tvg-logo" - the logo of the media file or stream being played
"audio-track" - an audio track, usually if there are several of them and their choice is possible
"group-title" - denotes a group of streams and media files according to the criteria (Kids, Educational and News)

An IPTV playlist contains a lot of http addresses of playable video files or streams. for instance http://217.174.225.146/legacyhls/ch006.m3u8 it is this link that tells the IPTV program where to start downloading the video file for playback.

But unfortunately IPTV streams change and update quite often, so on my own I try to post links to iptv m3u playlists in a timely manner for easy viewing.

Click on the desktop with the right mouse button. Then select the "Create" line. Select "Text Document" from the drop down menu.

And on your desktop there is such a file called New Text Document.

Change the file format from TXT to M3U

Press the "Start" button. Go to the "Control Panel" of the Computer.

Change the appearance of the Control Panel menu to large icons. This can be done using the "View" menu, which is located in the upper right corner of the "Control Panel" folder.

A lot of icons appear in front of you. Among them, you find the "Folder Options" icon.

Click on the "Folder Options" icon. A window appears in front of you, in which you select the “View” tab at the top.

Scroll to the bottom of the slider and uncheck "Hide extensions for known file types".

After you have unchecked the box "Hide extensions for known file types", click the "Apply" button and the "OK" button.

After you have done this, the New Text Document has changed its appearance.

After the name comes the file format. It can be changed just as easily as renaming a file. Just click on it with the right mouse button, put the cursor after the dot and write M3U. Windows will display the following message - "After changing the extension, this file may not be available. Make a change?". Click the "Yes" button.

An M3U format file appears in front of you - .

We fill the M3U file with information about media files

Now you need to open "New Text Document.m3u" . This can be done with any test editor - standard Windows notepad or Notepad++ and similar programs. Let's use the standard Windows notepad. To do this, right-click on the "New Text Document.m3u" file. Hover the mouse over the "Open with" line. Another submenu appears in front of you. And in it, click on the line "Notepad".

And so, you have opened the file "New text document.m3u". An empty window will appear in front of you.

And how to make an IPTV playlist out of it. Everything is quite simple, you just need to enter information about the media files that you will view using this playlist. If an iptv playlist is created to watch TV channels, then we need a list of such channels. The list of TV channels looks like this:

#EXTINF: 0, 1 CLASSIC

#EXTINF: 0, 1 NOVOROSSIYA

#EXTINF: 0, 24 DOC

#EXTINF: 0, 24 BELARUS

Where the first line means the file format for which this list is intended. The second line contains information about the duration and the name of the TV channel. And the third line is a link to the broadcast of the channel itself. You take such a list of channels and copy it into an empty file "New text document.m3u". And you will get a file that will carry information about media files.

Create an IPTV playlist from an M3U file

Before you is a window in which you should change the name "New text document.m3u". Name it "IPTV playlist". You also need to change the file encoding, this is done so that you can use both Latin and Cyrillic in the playlist. Choose UTF-8 encoding. And press the "Save" button.

Well, that's all IPTV playlist is ready. It is called "IPTV playlist.M3U" and looks like this:

How to group channels in an IPTV playlist

In order to group the channels in the IPTV playlist, you take the playlist itself presented above. In it you need to write group-title="Group name:" after #EXTINF:0. The name of the group can be written in both Latin and Cyrillic. And then do not forget to add the name of the channel itself. An example of an IPTV playlist divided into such groups:

  • Avtomobil'nye kanaly
  • Children's kanaly
  • Kanaly News
  • Kino and serial
  • Poznavatel'nye kanaly

#EXTINF:0, group-title="Avtomobil'nye kanaly:",!TV

http://185.70.130.89:1234/udp/239.0.0.102:1234

#EXTINF: 0 group-title="Children's kanaly:" 1 CLASSIC

http://185.70.130.89:1234/udp/239.0.0.17:1234

#EXTINF: 0 group-title="Kanaly News:" 1 NOVOROSSIYA

http://185.70.130.89:1234/udp/239.0.0.62:1234

#EXTINF: 0 group-title="Kino i serialy:" 24 DOC

http://185.70.130.89:1234/udp/239.0.0.64:1234

#EXTINF: 0 group-title="Poznavatel'nye kanaly:" 24 BELARUS

http://185.70.130.89:1234/udp/239.0.0.30:1234

Now you just have to open the IPTV playlist using VLC media player, IP-TV Player or similar programs. And you will be able to watch TV channels that are in the IPTV playlist.

Since almost every person has the Internet at home, IPTV technology has become more widespread, which allows you to watch television channels via an Internet connection, which is very convenient. As a rule, in order to watch TV channels via the Internet, you need to purchase a special IPTV set-top box that connects to your computer. Of course, you can do without it when viewing channels on a computer or laptop, but in this case you will need to create a special playlist for the channels. This task confuses a considerable number of users.

In this article, we will take a detailed look at how to create an m3u playlist for IPTV. Let's figure it out. Go!

The whole process consists of a series of simple steps that can be easily performed by a user of any level. First you need to create a text file. Just right-click on the desktop and go to "Create", then select "Text document".

Then you need to convert txt format to m3u. To do this, open the Control Panel. From the menu that appears, find and select Folder Options. On the View tab, uncheck the Hide extensions for known file types box and click Apply. After this operation, you will find that ".txt" has been added to the name of the text document you created. Now write any name for the file and change ".txt" to ".m3u". In the warning window that appears, click Yes.

Now that the file has been created, it needs to be populated, but first it needs to be opened. Right-click on it and click "Open With". Select "Notepad" from the pop-up list. After an empty field has appeared, you can begin to fill in the future playlist. The data required to fill in is information about television channels, which looks like:

#EXTM3U
#EXTINF:0,!TB

#EXTINF: 0, 1 CLASSIC

You can simply copy all the necessary information from the channel list.

The next step is to turn the created m3u file into an IPTV playlist. To do this, open the "File" menu while in the Notepad window and select "Save as ...", then enter (without quotes) "IPTV playlist.m3u" in the "File name" field. At the bottom, in the "Encoding" section, enter "UTF-8". Now the playlist is ready and ready to use.

In the event that it is inconvenient for you to navigate in a large number of channels, you can group them. To do this, you need to open the m3u.file using notepad and add certain lines to the existing code. Namely:

group-title="group name:"

Add this element as shown in the screenshot below.

#EXTM3U
#EXTINF:0, group-title="Avtomobil`nye kanaly:" ,!TB
http://185.70.130.89:1234/udp/230.0.0.102:1234
#EXTINF: 0, group-title="Children's kanaly:" 1 CLASSIC
http://185.70.130.89:1234/udp/230.0.0.17:1234

You can also use special IPTV players that have the function of creating playlists, instead of doing everything manually. One of these players is Simple TV.

After installing the program, set the necessary parameters, then go to the "Playlist" section and select "Search for channels" in the pop-up list. Next, set the range with addresses within which the scan will be performed. During the scanning process, delete the already existing default playlist.

After the scan is completed, a list of TV channels will open. Check the boxes next to the channels you want to add and click Save. The list of TV channels you have selected will appear in the file that was deleted in the previous step. If you want to create another file, then click "Upload channel list", then enter a name, specify the area in which the file will be saved, and click "Upload".

In this simple way, an m3u playlist is created. As you can see, there is nothing complicated in this. The whole process does not take much time. As a result, viewing will become much more comfortable.

Write in the comments if the article helped you understand the issue and ask if something remains unclear after reading.

The most common cause of M3U file disclosure problems is simply the lack of proper applications installed on your computer. In this case, it is enough to find, download and install an application that supports files in the M3U format - such programs are available below.

Search system

Enter file extension

Help

clue

Please note that some encoded data from files that our computer does not read can sometimes be viewed in Notepad. In this way we will read fragments of text or numbers - It is worth checking whether this method also works in the case of M3U files.

What to do if the application from the list has already been installed?

Often an installed application should automatically link to an M3U file. If it didn't happen, then the M3U file can be linked manually with the newly installed application manually. Simply right-click on the M3U file, then from the available list select "Choose default program". Then you need to select the "Browse" option and find your favorite application. Changes made must be approved with the "OK" option.

Programs that open M3U file

Windows
MacOS
linux
Android

Why can't I open an M3U file?

Problems with M3U files may also have other grounds. Sometimes even installing software that supports M3U files on your computer will not solve the problem. The reason for the impossibility of opening, as well as working with the M3U file, may also be:

Inappropriate M3U file links in registry entries
- damage to the M3U file that we open
- M3U file infection (viruses)
- too small computer resource
- outdated drivers
- removal of the M3U extension from the registry of the Windows system
- incomplete installation of a program that supports the M3U extension

Fixing these problems should lead to free opening and working with M3U files. In case the computer still has file problems, you need to take the help of an expert who will determine the exact cause.

My computer does not show file extensions, what should I do?

In the standard settings of the Windows system, the computer user does not see the M3U file extension. This can be successfully changed in the settings. Just go to the "Control Panel" and select "View and Personalization". Then you need to enter the "Folder Options", and open the "View". In the "View" tab there is an option "Hide extensions of known file types" - you must select this option and confirm the operation by pressing the "OK" button. At this point, all file extensions, including M3U, should appear sorted by file name.

We recommend reading

Top