Skip to content

Multibitrate VOD streaming using SMIL

If you have several files with the same content and different bitrate, you can use SMIL files for adaptive bitrate VOD streaming.

SMIL file is a file in XML format that allows to make playlists for different combinations of files with different bitrates. It works similarly to auto-mbr functionality described here, but gives more flexibility: you can use not all files from the directory, but only the specified files. Also, there are no rules for naming the files, they just should be placed into the directory where the SMIL file is located or its subdirectories.

You can use SMIL-files for a VOD location on a local computer or in Amazon S3 storage. The example below is related to a local VOD location. If you are using Amazon S3 storage, follow the similar steps, but specify the URL of the storage in the VOD location settings as described here.

Configuring VOD location

Let's assume you have already created a VOD location.

Add the option auto_mbr to the VOD location that you want to use to store files for a multi-bitrate playlist.

  • Via configuration file:
vod vod1 {
  storage /storage;
  auto_mbr;
}
  • Via the web UI:

Go to Files (VOD) > open a location > go to the Output tab > select Enable MBR from multiple files.

Preparing files

Prepare the files with the same content and different bitrate, for example: bunny_450, bunny_750, bunny_1100. You can give the files any names.

Place the files into the same directory in the VOD location. Some files may be placed into subdirectories of this directory (e.g., you may place bunny_110 into the folder subdirectory).

Creating SMIL file

Using a text editor, create a *.smil file (for example, my.smil) in the same directory, where the files are placed. The SMIL file should have the following structure:

<?xml version="1.0" encoding="UTF-8"?>
<smil title="">
    <body>
        <switch>
            <video height="240" src="bunny_450.mp4" systemLanguage="eng" width="424">
                <param name="videoBitrate" value="450000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
            <video height="360" src="bunny_750.mp4" systemLanguage="eng" width="640">
                <param name="videoBitrate" value="750000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
            <video height="720" src="folder/bunny_1100.mp4" systemLanguage="eng" width="1272">
                <param name="videoBitrate" value="1100000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>            
        </switch>
    </body>
</smil>

The only required and meaningful parameter for each file is src — the relative path to the file in the directory where the SMIL file is located. Flussonic ignores all other parameters and determines the size, language, and bitrate of the video automatically.

You can use any number of SMIL files in the directory to create playlists for different combinations of files.

Playback

You can request the playlist as described below.

  • HLS playlist:
http://FLUSSONIC-IP/vod1/my.smil/index.m3u8
  • DASH playlist:
http://FLUSSONIC-IP/vod1/my.smil/index.mpd

Flussonic creates an HLS or DASH playlist from multiple files listed in the SMIL file. The player works with this playlist as if it was one multi-bitrate file.