Flussonic Media Server documentation

VOD file broadcasting

Containers and codecs Anchor Anchor x2

Flussonic is able to deliver video from file in mp4 and flv containers with h264, hevc, flv video and aac, mp3, ac3, pcma, pcmu audio codecs.

Server settings Anchor Anchor x2

In order to broadcast content of files from subdirectory /movies, choose a arbitrary, unique prefix and add the following line to the configuration /etc/flussonic/flussonic.conf:

file vod /movies;

File broadcasting can be also configured via the web interface. To this end, create a VOD Location in the media list:

From now on, files will be served with the prefix vod via the protocols HLS, HDS, RTMP, RTSP.

Note that for one file prefix multiple sources can be specified, cloud storage. More detail on setting up multiple paths for one prefix.

Managing files via the web interface Anchor Anchor x2

Flussonic has a full-fledged built-in file manager, which enables the user admin to load and view files on the local disk as well as those stored in the cloud.

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

Now you can create subfolders:

Once the desired directory is selected, you can upload one or more files to it:

You can view the file in this interface by clicking on it. Placing the mouse cursor over the file name displays the option to delete the file.

Using files Anchor Anchor x2

To play the file on the disk at the path /movies/elementary/s01e02.mp4, specify for players the following sources:

HDS (StrobeMediaPlayback and other OSMF-based players)
http://erlyvideo:8080/vod/elementary/s01e02.mp4/manifest.f4m

HLS (iOS, Android, STB)
http://erlyvideo:8080/vod/elementary/s01e02.mp4/index.m3u8

RTMP (Jwplayer, Flowplayer, Uppod)
application: rtmp://erlyvideo/vod, path: elementary/s01e02.mp4

Playing the file from the Admin Panel Anchor Anchor x2

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

And then you may select a protocol and press "click to play".

Embedding the player to a webpage Anchor Anchor x2

The OSMF player that plays video over HDS is embedded as follows:

    <script type="text/javascript" src="http://192.168.2.3:8080/flu/js/swfobject.js"></script>
    <div id="videoplayer" style="width: 640px; height: 480px"></div>
    <script type="text/javascript">
    var flashvars = {
    src : "http://192.168.2.3:8080/vod/elementary/s01e02.mp4/manifest.f4m",
    autoPlay: true
    };
    var paramObj = {allowScriptAccess : "always", allowFullScreen : "true", allowNetworking : "all"};
    swfobject.embedSWF("http://192.168.2.3:8080/flu/StrobeMediaPlayback.swf", "videoplayer", 640, 480, "10.3", false,
    flashvars, paramObj, {name: "player"});
    </script>

For iOS devices, use the tag video:

    <video src="http://192.168.2.3:8080/vod/elementary/s01e02.mp4/index.m3u8" controls></video>

Using multiple catalogs Anchor Anchor x2

Sometimes, when dealing with high volume of streaming traffic, the admin's best strategy is to use the available hard drives in the JBOD mode as opposed to RAID.
In this case, each hard drive is handles separately in the system and mounts to a separate catalog.

It is possible to specify to Flussonic a common file zone for multiple catalogs. In this way, the file can be moved among different devices without changing the URL:

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

VOD settings Anchor Anchor x2

file

  • file vod /storage; shortened version of the prefix for file playback.
  • file vod {path /storage;} complete version of the prefix for file playback.

cache

  • cache /ssd misses=5 2d 40G; all requests for files will be cached in the /ssd folder for no longer than 2 days, with the size limit of 40GB. The caching feature will turn on when one file gets more than 5 uncached requests.
  • cache @globalcache; all requests for files will be cached in the global cache globalcache.
  • cache globalcache /ssd misses=5 20d 800G; specifying global cache for different file prefixes. all requests for files will be cached in the /ssd folder for no longer than 20 days, with the size limit of 800GB. The caching feature will turn on when one file gets more than 5 uncached requests.

domain

domain host.com;
specifies the domains where the video can be played. This does not work for those clients that do not pass the value of Referer.

domains

domains host1.com *.host2.com;
specifies the domains where the video can be played. This does not work for those clients that do not pass the value of Referer.

path

path /storage; path s3://key:secret@s3.amazonaws.com/bucket/; specifies file search path. You can specify multiple search 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 poster generation with optional offset time in seconds. The flussonic-ffmpeg package must be installed.

Multi-language streaming Anchor Anchor x2

The HLS and HDS protocols allow language switching. Flussonic automatically enables this option, if you simply add extra language tracks to the mp4 file.

By the same token, add subtitles in the tx3g format as tracks to the mp4 file to turn on the subtitles feature.

Exporting subtitle track as SRT Anchor Anchor x2

Flussonic can serve subtitle tracks within mp4 as SRT, which with some Flash players is a requirement:

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

Adaptive streaming (multi-bitrate) Anchor Anchor x2

To make sure that users with different network speed have good viewing experience, adaptive streaming can be used. In order to set up adaptive streaming, you will need to create a multi-bitrate mp4 file and request a manifest file for it. Flussonic will do the rest. The file encoding section gives a detailed instruction on creating multi-bitrate files.

Track names in OSMF players Anchor Anchor x2

The MP4 container supports only the language code in the language track description. Sometimes this is not enough: two or three tracks with different translation versions is a frequent case. To deal with this, Flussonic distribution includes the contrib/tag_mp4 utility that enables displaying meaningful track names in HDS players. The utility provides a way to assign to each track a label visible in OSMF:

cd /opt/flussonic
./contrib/tag_mp4 /videos/movie.mp4 -n 2 -t "Русский"
./contrib/tag_mp4 /videos/movie.mp4 -n 3 -t "Русский (люб.)"
./contrib/tag_mp4 /videos/movie.mp4 -n 4 -t "English"

Preparing files for broadcasting (transcoding) Anchor Anchor x2

See below for the 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".