How Does an IPTV Channel Playlist Be Created?

How Does an IPTV Channel Playlist Be Created?

·

4 min read

Provider's custom channels, or playlists

If you are not much interested in media, there’s a very well chance you haven’t heard of IPTV. But I am sure that you have been unaware that you are using the same for years.

And it’s very likely that you will be going to use it much more in the upcoming future. IPTV is growing at a rapid speed, with new providers and services growing beside traditional TV providers with more and more IPTV offerings.

Technically, a custom channel is also a playlist that consists both of links to their sources that are located on the IPTV Media Server. A customized playlist can also be run on a schedule and it plays the same sources on an arc.

See an example of a channel that broadcasts pre-prepared video files.

Then, you can now set up how to:

  1. add a logo
  2. start the video on a schedule
  3. distribute you channel by UDP multicast.

Playlist creation

Step 1. Set up a file storage location

1) Specify the path to a directoy with video files (a VOD location). The default directory for files is /opt/flussonic/priv, and it is already present in the configuration file /etc/flussonic/flussonic.conf.

Example of the default path:

# VOD locations:
vod vod {
  storage /opt/flussonic/priv;
}

or:

# VOD locations:
vod vod {
  storage priv;
}

We'll use the directory that is specified in vod. If you want to use another directory, you can create another VOD location or just change the path in vod.

Alternatively, you can use the Flussonic UI to specify storage for playlist files.

2) Place the files in the specified directory. In the example, we'll use bunny.mp4 and beepbop.mp4, which already exist in /opt/flussonic/priv/.

Step 2. Create a playlist

Playlist is a text file with a list of links to sources. To edit the playlist, we'll use nano, a text editor for Linux systems.

1) To install nano, run these commands:

apt-get update
and then
apt-get install nano

2) Create a file playlist.txt in the directory /opt/flussonic/priv/ by using this command: nano /opt/flussonic/priv/playlist.txt

The file immediately opens in the editor. Now add links to video files that we are going to broadcast:

vod/bunny.mp4
vod/beepbop.mp4

To exit and save the changes, press CTRL + X and agree to save the changes by pressing y.

Step 3. Create a stream

1) Add to the configuration file /etc/flussonic/flussonic.conf the directive stream NAME:

stream infochannel {
  input playlist:///opt/flussonic/priv/playlist.txt;
}

Alternatively, you can create a static stream in the UI: Media > click add next to Streams. Specify the stream name (infochannel) and URL (playlist:///opt/flussonic/priv/playlist.txt). For information about static streams, see Live streaming .

2) Reload the server configuration by running this command in the Linux command line:

service flussonic reload

A new stream will appear in the list of streams in the web interface (Media > Streams) and it will play the specified files on a loop. You can play it and check how it works.

Adding a logo and setting up the schedule

Our example of creating a logo uses transcoding and is considered resource-intensive. This method burns a logo image into the video track. It is suitable for channels distributed in IPTV networks.

To add a logo, you need an image file in PNG format. An example can be found on the server in /opt/flussonic/wwwroot/flu/images/erly-small.png. Let's use it as a logo in your video stream.

Add the transcoder directive to the infochannel stream settings and specify erly-small.png as the logo:

stream infochannel {
  input playlist:///opt/flussonic/priv/playlist.txt;
  transcoder vb=2048k logo=/opt/flussonic/wwwroot/flu/images/erly-small.png@10:10 ab=128k;
}

Reload the server configuration, and the logo appears in the upper left corner of the screen. Learn more in Overlaying a logo.

Setting up the schedule

Open playlist.txt that you created earlier. With the #EXTINF tag (control command), you can set the playback duration for each playlist item. For example, broadcast the first 30 seconds of the first file and the first 60 seconds of the second file:

#EXTINF:30
vod/bunny.mp4
#EXTINF:60
vod/beepbop.mp4

With the tag #EXT-X-UTC, you can set the Unix Timestamp of the time when you want to play the playlist item:

#EXT-X-UTC:1522839600
vod/bunny.mp4
#EXT-X-UTC:1522843200
vod/beepbop.mp4

Using the #EXT-X-PROGRAM-DATE-TIME tag, you can set the start time of the playlist item, in the ISO 8601 format:

#EXT-X-PROGRAM-DATE-TIME:2018-04-04T11:00:00Z
vod/bunny.mp4
#EXT-X-PROGRAM-DATE-TIME:2018-02-04T12:00:00Z
vod/beepbop.mp4

Learn more about the tags in Server-Side Playlists.

Distribute the Channel Over UDP Multicast

Add the push directive to the stream's configuration and specify a multicast address for distribution in a local network:

stream infochannel {
  input playlist:///opt/flussonic/priv/playlist.txt;
  transcoder vb=2048k logo=/opt/flussonic/wwwroot/flu/images/erly-small.png@10:10 ab=128k;
  push udp://239.0.0.1:1234;
}

Conclusion IPTV operators can use m3u editors to build custom playlists on the server and can share video files and streams via these playlists. IPTV channels you want to add to the list should be managed in the same way. Click activities first, then Library, and finally Export playlist in iTunes to export the playlist.