Flussonic Media Server documentation

Contents

Server-Side Playlists

Flussonic Media Server allows you to create server-side playlists. They allow you to create your own TV channel by making a schedule of files and streams to be broadcast.

The usage of server-side playlists

Server-side playlists can be used to:

  • Simultaneously broadcast 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. (I.e. 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.

First of all, upload the video files you wish to play to the server. In this example, they are located in /var/movies. Then, create a VOD location to pull the video files from:

file vod {
 path /var/movies;
}

Then, create a playlist file. Ours will be in the directory /tmp/playlist.txt. A playlist file contains a list of video files to be played:

vod/video1.mp4
vod/video2.mp4

Then, create a stream with a playlist:// schema as its source. You may use a local file or a playlist file hosted on another server to .

http 80;
stream playlist1 {
 url playlist:///tmp/playlist.txt;
}
stream playlist2 {
 url playlist://http://HOST/playlist.txt;
}
file vod {
 path /var/movies;
}

If the directory /var/movies contains video1.mp4 and video2.mp4, they will start playing immediately and will loop once both files have played.

The playlist may 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 complete 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 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 Unix Timestamp format.
  • #EXT-X-PROGRAM-DATE-TIME The start time of a playlist element, in ISO 8601 format: 2013-02-12T12:58:38Z (GMT).

Every time a file in a playlist finishes playing, the playlist is re-read.

Consider the following rules for processing playlists:

  1. 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;
  2. 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 {
 url rtsp://192.168.1.21:554/user=admin&password=&channel=0&stream=0;
}
stream cam2 {
 url rtsp://192.168.1.22:554/user=admin&password=&channel=0&stream=0;
}
stream camplaylist {
 url playlist:///tmp/playlist.txt;
}

In the playlist.txt file, we enter the stream names as follows:

#EXTINF:60
cam1
#EXTINF:60
cam2

We have created a playlist that rotates through cam1 and cam2, 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 targeted 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 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 today, where an IPTV subscriber selects channels to form a playlist.

However, it is okay to use server-side playlists in contexts other than online broadcasting. Users are more willing to watch predefined shows and not to search for video manually.

Playlist status information

You can request information about the state of a server-side playlist of the specified stream.

URL: /flussonic/api/playlist/STREAM_NAME

Example: http://example.flussonic.com:8080/flussonic/api/playlist/example_stream

Parameters: 

  • STREAM_NAME — the name of a stream that contains the playlist (required)

Response: JSON like

{
    "current_entry":"vod/ir.mp4",   //The currently played item
    "current_type":"file",   //The type of the currently played item
    "duration":null,   //Duration of the current item, in milliseconds('null' stands for 'undefined')
    "position":5.22e4   //Currently played position inside the current item, in milliseconds
}