A Multibitrate Playlist Made from Files
Creating multi-bitrate content from multiple files
Suppose you have copies of a movie in several files with different quality. Furthermore, you do not want to create one multi-bitrate file. You need to play these files by using a single HLS platlist, so that the client player could choose the bitrate the same way as in a situation 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 playlist in this case contains information about these files as if they were one file in different quality.
You'll need to prepare files and then enable the automatic creation of a multi-bitrate resource for a VOD location.
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:
Directoty 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 multi-bitrate resource
We'll assume that you have already created a VOD location for accessing the files.
- 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:
file vod1 {
path /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.
- 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 not necessary to specify the size in the file name. You can use an arbitrary set of valid characters after the word bunny
in file names.
- Now you can request a HLS playlist by this URL:
http://FLUSSONIC-IP:80/vod/bunny/index.m3u8
You can see that the playlist is requested on a directory, not a single file.
When a playlist is requested on the directory /vod/bunny/index.m3u8
, Flussonic creates a HLS playlist from multiple files matching the mask /vod/bunny/bunny*.mp4
. The player works with this playlist as if it were for 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.