Skip to content

A multibitrate playlist made from files

Creating multibitrate content from multiple files

Suppose you have copies of a movie in several files with different qualities. Furthermore, you do not want to create one multi-bitrate file. You need to play these files by using a single HLS or DASH playlist so that the client player can choose the bitrate the same way as with one multi-bitrate file.

Flussonic Media Server can deliver several files with different bitrates as a single resource with multi-bitrate content. The HLS or DASH playlists contain information about these files as if it was one file in various qualities.

You should preprocess the files first and then enable the automatic generation of a multi-bitrate resource for a VOD location.

You can use 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 VOD location settings as described here.

Prepare files

Place the files in the same directory. Give them names that start with the name of the directory in which they are located. That is, file names must match the DIRNAME*.mp4 mask, where * stands for any allowed characters. For example:

Directory name: DIR_NAME, file names: DIR_NAME-1.mp4, DIR_NAMEabc.mp4, and so on.

See Step 2 below.

Set up automatic creation of a multibitrate resource

Let's assume you have already created a VOD location for accessing the files.

Step 1. 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.

Step 2. Place files in the directory, for example:

/storage/movies/bunny/bunny.480x360.mp4

/storage/movies/bunny/bunny.720x480.mp4

/storage/movies/bunny/bunny.1080x720.mp4

Flussonic determines the size of the video, so it is unnecessary to specify the size in the file name. You can use an arbitrary set of valid characters after the word bunny in file names.

Step 3. Now you can request an:

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

You can see the playlist is requested on a directory, not a single file.

When a playlist is requested on one of the directories: /vod/bunny/index.m3u8 or /vod/bunny/index.mpd, Flussonic creates an HLS or DASH playlist from multiple files matching the mask /vod/bunny/bunny*.mp4. The player works with this playlist as if it was one multi-bitrate file.

Note

Clients can read the contents of only those directories for which the auto_mbr option is specified in the settings. Otherwise, Flussonic will return a 404 error.