Flussonic Media Server documentation

Contents

VOD File Broadcasting

Content:

Flussonic Media Server supports playing back video files to clients. A virtual filepath, called a VOD location, must be set up to enable this feature. One VOD location can contain multiple directories — multiple VOD locations can be used to organize video files and apply different sets of settings to files in each location.

Containers and codecs

The VOD broadcasting feature only supports playback of video files in MP4 containers. (Popular file extensions include .mp4, .f4v, .mov, .m4v, .mp4a, .3gp, and .3g2.) The H.264, HEVC and VP6 video codecs are supported. The AAC, MP3, AC3, PCMA, and PCMU audio codecs are supported.

Supported Containers Supported Video Codecs Supported Audio Codecs
MP4 (.mp4, .f4v, .mov, .m4v, .mp4a, .3gp, .3g2) H.264, H.265 MP3, AAC (all profiles)

Creating a VOD location

A virtual filepath, called a VOD location, must be set up to enable the VOD broadcasting feature. One VOD location can contain multiple directories — multiple VOD locations can be used to organize video files and apply different sets of settings to files in each location.

For example, if we would like to broadcast files from the /movies directory, we would first add a file directive to /etc/flussonic/flussonic.conf:

file vod {
  path /movies;
}

Here, vod is the unique name of our VOD location. VOD files in this location will be served from the vod prefix. The path option specifies the directory that Flussonic will scan for VOD files.

It is also possible to create VOD locations from the Web UI. Navigate to the media list, and click the add button next to the Files (VOD) heading:

VOD location

A name, and a filepath or a URL path must be entered. Click save to apply your changes.

Creating a VOD location

Under this configuration, files will be served with the prefix vod via the HLS, HDS, RTMP, RTSP protocols.

You may specify multiple sources in one file prefix. Files can be broadcast from local and cloud storage. See Setting up multiple paths for one prefix

Managing files via the web interface

Flussonic Media Server's web interface includes a fully-featured file manager. It is possible to load and view files on the local disk as well as those stored in the cloud using this feature.

After adding a file prefix to a VOD location in the config or in the web interface, go to the VOD tab:

web interface

Now you can create subdirectories:

Managing files

Select a directory to upload one or more files to it:

via the web interface

Click a file to view it.

Hovering the mouse cursor over a file's name displays the option to delete the file.

Embedding the video player in a webpage

Flussonic's built-in HTTP server can serve a special embed.html page to clients. This page can be used to insert video into a website, or to view VOD content in a browser.

It is available at the URL http://HOSTNAME/vod/bunny.mp4/embed.html.

Learn more about this feature in this article from our Knowledge Base: Adding video to websites (embed.html).

Playing files over different protocols

In section, we will demonstrate how to play VOD files over several different protocols. In our example, we would like to play the file at the path /movies/example/s01e02.mp4. We have configured a VOD location like so:

file vod {
  path /movies;
}

Playing a VOD file via HDS (StrobeMediaPlayback and other OSMF-based players) http://HOSTNAME:8080/vod/example/s01e02.mp4/manifest.f4m

Playing a VOD file via HLS (iOS, Android, STB) http://HOSTNAME:8080/vod/example/s01e02.mp4/index.m3u8

Playing a VOD file via RTMP (Jwplayer, Flowplayer, Uppod) application: rtmp://HOSTNAME/vod, path: example/s01e02.mp4

Playing VOD files from the Web UI

Video files can be played from Flussonic's Web UI. Note that the Web UI can only play files that are in VOD locations.

Go to the VOD file browser page and select a file.

Playing VOD files

Then, select a protocol and click click to play.

Using multiple directories in one VOD location

When dealing with a high volume of streaming traffic, the best strategy may be to put your system's hard drives in a JBOD (non-RAID) configuration, where each hard drive mounts to a separate directory.

It is possible to configure a common file zone from multiple directories in Flussonic Media Server. Under this configuration, a file's URL will stay the same, even if it is moved between different devices (which are all mounted on different directories):

file vod {
  path /mount/disk1;
  path /mount/disk2
}

VOD settings

Described below are the options that can be used in the file directive. They specify various file broadcasting settings.

file

file vod {
  path /storage;
}
Specifies a path to a directory that contains VOD files. You may specify multiple paths.

cache

cache /ssd misses=5 2d 40G; Configures content caching.
In this example, requests for files will be cached in the /ssd folder for no longer than 2 days (2d), with a total size limit of 40GB (40G). A file will be cached once it gets more than 5 requests (misses=5).

domain

domain host.com; Specifies the domains where the video can be played. This feature does not work for clients that do not pass the Referer header to Flussonic.

domains

domains host1.com *.host2.com; Specifies the domains where the video can be played. This feature does not work for clients that do not pass the Referer header to Flussonic.

path

path /storage;

path s3://key:secret@s3.amazonaws.com/bucket/;
Specifies a path to a directory (on disk or on another server) which contains VOD files. You may specify multiple paths.

read_queue

read_queue 100; The number of simultaneous requests to disk for a given prefix.

download

download; Enables downloading the file and Range requests for it.

max_readers

max_readers 10; Specifies the max number of simultaneous disk requests to the entire prefix.

thumbnails

thumbnails offset=10; Turns on thumbnail generation. Optionally, an offset time in seconds can be specified.

auto_mbr (new in v19.02)

auto_mbr; Turns on automatic creation of a multi-bitrate HLS playlist from several files with different bitrates.

Multi-language broadcasting

The HLS and HDS protocols allow broadcasting video content with multiple audio and subtitle tracks, each in a different language. Flussonic Media Server automatically enables multi-language broadcasting if extra audio tracks or tx3g subtitle tracks are detected in a VOD file.

Exporting subtitle tracks as SRT

Flussonic Media Server can serve subtitle tracks in the SRT (SubRip Text) format. This is the only way to display subtitles on certain platforms (e.g. some Flash players). A VOD file's SRT subtitle track can be retrieved over HTTP:

http://192.168.2.3:8080/vod/video.mp4/track-t1.srt

Adaptive streaming (multi-bitrate)

Adaptive streaming can be used to make sure that clients with low-bandwidth connections have a good viewing experience. There are two ways to enable adaptive streaming in Flussonic Media Server:

  • Use several files with the same content but with different bitrates.

    Flussonic automatically creates a single multi-bitrate playlist to play back these files. Read more about how to configure this feature.

  • Use a single file that contains multi-bitrate content.

    To play back a multi-bitrate MP4 file, you will need to create a manifest file for it. The file encoding section of our documentation gives detailed instructions on creating multi-bitrate files.

Encoding multi-bitrate files

Below is a basic example of creating a multi-bitrate file using ffmpeg:

ffmpeg -i bunny.mp4 \
-map 0:0 -c:v copy \
-map 0:0 -c:v libx264 -b:v 150k \
-map 0:0 -c:v libx264 -b:v 100k \
-map 0:1 -c:v libx264 -b:v 50k \
-map 0:1 -c:a copy \
-map 0:1 -c:a copy \
-y out.mp4

This process is discussed in more detail under the section "Preparation for broadcasting".

Restreaming VOD files

Copying a large VOD library between servers can be expensive. Flussonic is able to re-stream video files from one Flussonic server to another. This saves not only time but also storage space required to store VOD content. Saved resources can be used to enable caching of VOD content, which will increase the performance of a VOD re-streamer.

Example of VOD location configuration:

Config file on the source VOD server

file vod {
  path priv;
  download;
}

Config file on the restreamer VOD server

file vod {
  path http://FLUSSONIC-SOURCE/vod;
  cache /mount/cache 500G misses=2;
}