Server-Side Playlists
Flussonic Media Server allows you to create server-side playlists. With server-side playlists, you can create your own TV channel by scheduling video files and streams to broadcast.
On this page:
- The usage of server-side playlists
- Creating server-side playlists
- Control commands
- Using streams in a playlist
- Disadvantages of server-side playlists
Using server-side playlists
Server-side playlists can be used to:
- Simultaneously broadcast a playlist to multiple devices in a local network.
- Switch between multiple streams regularly. For example, you could create a playlist which switches between CCTV camera streams every other minute.
- Create a digital signage platform to display informational clips or to advertise (for example, set up a barker channel).
Creating server-side playlists
Here we give a brief overview of the process of creating a server-side playlist in Flussonic Media Server.
To create a server-side playlist:
-
Upload the video files you wish to play to the server. In this example, they are located in
/var/movies
. -
Create a VOD location to pull the video files from:
vod vod {
storage /var/movies;
}
- Create a playlist file. Ours will be in the directory
/tmp/playlist.txt
. Add to the playlist file a list of video files to be played:
vod/video1.mp4
vod/video2.mp4
- Create a stream with a
playlist://
schema as its source. You can use a local file or a playlist file hosted on another server (playlist://http://).
stream playlist1 {
input playlist:///storage/playlist.txt;
}
stream playlist2 {
input playlist://http://examplehost:5000/file/playlist.txt;
}
If the directory /var/movies
contains video1.mp4
and video2.mp4
, Flussonic will start playing them immediately and will loop each time both files have been played.
The playlist can also include control commands:
#EXT-X-MEDIA-SEQUENCE:20
#EXT-X-PROGRAM-DATE-TIME:2013-02-12T12:58:08Z
vod/video1.mp4
#EXTINF:64
vod/video2.mp4
For a more detailed example of the use of server-side playlists, demonstrating how to overlay a logo on top of the video stream and how to send a UDP multicast stream, see Provider's custom channels.
Control commands
Flussonic playlists support the following control commands:
#EXT-X-MEDIA-SEQUENCE
. The serial number of the first element in the playlist. You can use it to correctly rotate through and update a playlist.#EXTINF
. The duration in seconds to play a playlist element. You can use it to embed live content into a playlist.#EXT-X-UTC
. The start time of a playlist element, in the Unix Timestamp format.#EXT-X-PROGRAM-DATE-TIME
. The start time of a playlist element, in the ISO 8601 format:2013-02-12T12:58:38Z
(GMT).
Every time each file in a playlist finishes playing, Flussonic re-reads the playlist.
Consider the following rules for processing playlists:
- If the option
EXT-X-MEDIA-SEQUENCE
is specified, the playlist remembers the last played item, and playback continues from the next item after re-reading. The playlist will be synced from the next number. If the new playlist contain only numbers less than last number, the playlist file will be reread every second, waiting for the correct number; - If the option
EXT-X-MEDIA-SEQUENCE
is not specified and the playlist file has not been changed, then the next element will be played. If the file has been changed, playback starts from the beginning.
Using streams in a playlist
In this example, we have two live streams, cam1
and cam2
, and a camplaylist
stream:
stream cam1 {
input fake://fake;
}
stream cam2 {
input fake://fake;
}
stream camplaylist {
input playlist:///storage/playlist1.txt;
}
In the playlist1.txt
file, we enter the stream names as follows:
#EXTINF:60
cam1
#EXTINF:60
cam2
We have created a playlist that plays cam1
and cam2
sequentially, switching between the streams every 60 seconds.
Disadvantages of server-side playlists
Server-side playlists have a number of disadvantages when used on the Internet to insert video into websites:
- You cannot use targeting when inserting ads.
- You cannot use stats for ads with AdRiver and other similar networks.
- Complexity of creating a multi-bitrate broadcasting: different files can contain different number of different bitrates.
- Rewinding, one of the major advantages of online broadcasting, is unreasonably difficult to implement.
- The pause function is also very complex to implement.
The main disadvantage of such playlists is that they offer no means to create an adequate ad tracking system. Instead of server-side playlists, it's recommended to use client-side playlists. These playlists allow an IPTV subscriber to select channels and form a playlist.
However, server-side playlists could be used for purposes that are different from online broadcasting. Practice shows that users are more willing to consume predefined content rather than to search for video manually.