Flussonic Media Server documentation

How to view a file?

How to view a file? Anchor Anchor x2

The task: you have a video file, and you need to organize broadcasting of this file over a network.

Content:

Installing Flussonic Media Server Anchor Anchor x2

First, you should install Flussonic Media Server.

Preparing the file: correct format Anchor Anchor x2

Flussonic Media Server can only play files in certain formats.
The main container format is mp4, video codec is h264, and audio codec is aac.

In order to be able to check and change the file format on the server, if necessary, you have to install ffmpeg.
It is not necessary to install it on the server itself, it can be installed on another computer with Linux, Windows or OSX operating systems.

Instructions for downloading ffmpeg are available from the official website: https://www.ffmpeg.org/download.html.

Many GNU/Linux distributions already have ffmpeg in their standard repositories. For example, in Ubuntu starting with version 15.04 Vivid Vervet, it is enough to enter "apt-get install ffmpeg" in the command line. If you don't have this package, you should search in third-party repositories, or just download static build.

To detect the format, we will use command ffprobe in the just installed ffmpeg.
In the command prompt, type ffprobe /path/to/your/video/video.mp4. The correct path to the video file should be specified.

Here is what the ffprobe output for an incorrect file should look like:

ffprobe version N-61916-g46f72ea Copyright (c) 2007-2014 the FFmpeg developers

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
  Duration: 00:05:00.18, start: 0.012000, bitrate: 769 kb/s
    Chapter #0.0: start 0.000000, end 300.000000
    Metadata:
      title           : Chapter 1
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1331:1000 DAR 2662:1125], 636 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(rus): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Subtitle: mov_text (text / 0x74786574)
    Metadata:
      handler_name    : SubtitleHandler

Here we can see several tracks, where Video: h264 means using proper codec h264 and Audio: aac - proper codec aac.

Here is how the ffprobe output for an incorrect file should like:

Input #0, asf, from 'video.wmv':
  Duration: 00:05:00.22, start: 0.000000, bitrate: 388 kb/s
    Chapter #0.0: start 0.000000, end 300.217000
    Metadata:
      title           : Chapter 1
    Stream #0:0: Video: msmpeg4v3 (MP43 / 0x3334504D), yuv420p, 640x360, 23.98 tbr, 1k tbn, 1k tbc
    Stream #0:1: Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, 2 channels, fltp, 128 kb/s

Here we can see that the Windows Media format (wmv) is used with the corresponding codecs. Flussonic Media Server will not play anything back.

What should be done if the format is incorrect? To convert wmv/msmpeg/wma into mp4/h264/aac, ffmpeg may be used:

ffprobe /path/to/your/original/video/video.wmv /path/to/your/modified/video/video.mp4

The monitor will display something like:

Stream mapping:
  Stream #0:0 -> #0:0 (msmpeg4 -> libx264)
  Stream #0:1 -> #0:1 (wmav2 -> libvo_aacenc)
Press [q] to stop, [?] for help
frame=  937 fps=180 q=-1.0 Lsize=    2320kB time=00:00:39.04 bitrate= 486.7kbits/s dup=1 drop=0  

This process is called transcoding, and it may be very time- and resource-consuming. The more powerful your hardware is, the faster transcoding is performed.

For the same reason, Flussonic Media Server does not transcode files automatically. It is assumed that users will do it manually on dedicated hardware. By the way, you cannot transcode live broadcasts in advance, therefore Flussonic offers [a built-in transcoder] for streams (http://erlyvideo.ru/doc/transcoder).

As a result of all the above we will receive a file that is completely suitable for playing back in Flussonic Media Server.

Preparing file: Picture quality Anchor Anchor x2

You might wish to lower the quality, or make a multi-bitrate file (which will ensure comfortable viewing videos by users connected to the Internet at different rates). [A separate article] has been written about it (http://erlyvideo.ru/doc/ffmpeg-transcoding).

Configuring Flussonic Media Server Anchor Anchor x2

In order to make Flussonic Media Server start servicing files, add special configuration to the configuration file (/etc/flussonic/flussonic.conf):

file vod {
  path /movies;
  download;
}

This setting is called 'VOD location' (the use of this word can be noted in documentation or in communication with customer support).

/movies is the folder on the server disk where video files are stored.

By the way, technically this folder may be located in a NFS shared disk, but it's not a very good decision, since NFS is slow and not always good to use. One should better use a local hard disk, or an SSD.

After you add this setting, apply the changes in configuration by running the command /etc/init.d/flussonic reload

Uploading file to server Anchor Anchor x2

To upload a file to the server, you can use web interface. In the main menu, select Media > VOD.

video codec is h264

Select the file, start upload, and wait.

Note that using the web interface is not the only way to upload a file. The file can be uploaded using SSH or FTP, or any other way of transferring files over the network. The main thing is that the file is in the directory that is specified in the configuration file. Flussonic Media Server is executed as root, meaning it has access to any files, therefore, no special access rights to this uploaded file are required.

Viewing the file Anchor Anchor x2

In the web interface (in Media > VOD) click on the desired file to start playing it.

The URL of the video is indicated just below it, and may be used for watching outside the web interface.
It should look something like: http://erlyvideo:8080/vod/elementary/s01e02.mp4/index.m3u8
The URL ends with .m3u8, which means that the HLS protocol will be used for playback.

Such an URL may be watched in any player that supports HLS well. For example, you may download and run video player VLC, select Media > Open Network Stream or Media > Open URL in the Russian version in the main menu, or press combination Ctrl+N and paste the URL into the input field.

Additional actions Anchor Anchor x2

Read the documentation about description of VOD operation
It contains answers to a few questions that are not covered in this article.