Flussonic Media Server Documentation


Configuring Flussonic Media Server


Flussonic Media Server configuration management

Flussonic Media Server configuration settings are stored in the file /etc/flussonic/flussonic.conf.

You can edit Flussonic Media Server configuration settings in several ways:

Editing the file flussonic.conf

All Flussonic Media Server settings, including global options, streams and VOD files settings, and other settings, are stored in the configuration file /etc/flussonic/flussonic.conf.

This file receives all the changes that you make using the Flussonic UI, and these changes are applied to the server at once. You can also edit the file directly.

If you have made changes to configuration parameters directly in /etc/flussonic/flussonic.conf, you must reload the Flussonic Media Server service by running:

service flussonic reload

Another way to reload the service is to use the HTTP API:

curl -u user:pass http://localhost:80/flussonic/api/reload

where user:pass — the login and password specified in the option edit_auth (see Other server options) .

Restarting Flussonic Media Server

To restart the server with Flussonic, run this command:

service flussonic restart

The server's global options

Global options include ports for protocols and general settings.

Ports and protocols

Options (Ports and Protocols) Description
https 443; Turns on accepting HTTPS requests via the specified port. Multiple ports can be specified with multiple lines.


http 80; Turns on accepting HTTP requests via the specified port. Multiple ports can be specified with multiple lines.


http; Turns on accepting HTTP requests via the specified port and IP address. Multiple ports can be specified with multiple lines.


rtmp 80; Turns on accepting RTMP requests via the specified port.


rtmps 1443 Turns on accepting RTMPS requests via the specified port.


rtsp 554; Turns on accepting RTSP requests via the specified port.


rtsps 1554; Turns on accepting RTSPS requests via the specified port.


mysql 3306; Turns on accepting MySQL queries via the specified port.



When configuring the protocols HTTPS, RTMPS, and RTSPS, Flussonic Media Server expects that there are certificates in the directory /etc/flussonic.

The RTMPS protocol works only if you have a valid certificate that works without any warnings or errors.

Flussonic Media Server expects the private key of the server in the file /etc/flussonic/flussonic.key with the password flussonic. The server's certificate is in the file /etc/flussonic/flussonic.crt. The intermediate certificate and CA certificate are in /etc/flussonic/flussonic-ca.crt.

For example, when you receive the purchased set of keys and certificates, you must do the following:

cat intermediate.crt ca.crt > /etc/flussonic/flussonic-ca.crt
cp server.crt flussonic.crt
openssl rsa -des3 -in server.key -out flussonic.key

Other server options

Server Options Description
loglevel debug; Manages the level of detail in the data being logged. Variable values: debug, notice, error.


logrequests true; Turns on logging all HTTP requests to /var/log/flussonic/access.log.


auth_token TOKEN; Specifies the name of the query string parameter to be interpreted as the authorization token.


auth false; Turns off authorization at the global scope.


auth http://backend/auth.php; Turns on the authorization backend at the global scope.


max_sessions 1000; Sets global limit on the quantity of concurrent sessions.


auto_token false;
If this option is specified, any incoming request without the token variable in the query string will be refused immediately.


auto_token UUID; If this option is specified, the authorization token will be generated automatically, provided that it is not found within the query string.


auto_token blank; If this option is specified, a blank authorization token will be accepted, provided that no token is found within the query string. This is the default behavior.


cluster_key SECRETKEY; This line of code is used for authorizing other Flussonic servers comprising a cluster.


view_auth USER PASSWORD; Turns on authorization for read-only access to API.


edit_auth USER PASSWORD; Login and password for administrator access to the server.


api_allowed_from 10/8 192.168/16; Specifies IP addresses or networks from which accessing API is allowed.


  sink http://backend/event.php;

  sink /etc/flussonic/events.lua;


Flussonic events will be sent to the specified URL or script. Learn more in Events API


pulsedb /var/lib/flussonic; Specifies the path to which streams statistical data will be recorded.


session_log /var/lib/flussonic; Specifies the path to which session history will be recorded.


session_log false; Disables writing sessions to disk.


url_prefix PREFIX
url_prefix http://my.domain.address.com:80;
This option applies to the HLS protocol, for all streams on the server. The addresses of individual segments within a segment-based playlist will start with the specified prefix. This option no longer works for variant playlists. Use it for segment-based playlists, such as tracks-v1a1/mono.m3u8 (but not for variant ones such as index.m3u8)
This setting is available in the global part of the config file as well as locally for any individual stream. Naturally, when specified at the stream level, it is only valid for this particular stream.


source SOURCE/PREFIX { }

source origin1.tv {


This directive turns on automated stream repeating to the local server from a remote one.


stream ntv {
  url tshttp://source/ntv.ts;
The stream directive turns on a permanent stream that will be kept alive for the entire lifetime of the server, even if no data sources are available. Please see below for the stream directive's options.


ondemand ntv {
  url tshttp://source/ntv.ts;
The ondemand directive specifies the stream to be started on demand. If the stream has been unavailable for a certain amount of time, it will be turned off automatically. Please see below for the ondemand directive's options.


rewrite client16/* {
  url rtmp://origin/%s;
The rewrite directive turns on dynamic stream start on demand, for all streams with the names satisfying the client16/* mask. Please see below for the rewrite directive's options.


live published { } The live directive makes it possible to publish to the server all streams with the names starting with published/. Please see below for the live directive's options.


file vod {
  path /storage;
The file directive turns on broadcasting for all files in the /storage directory with the names starting with vod/. Please see below for the file directive's options.


cache globalcache /var/www misses=4 2d 40G; Сonfigures a global cache named globalcache in the /var/www directory, with the limits of 40 Gigabytes and 2 days, and Flussonic beginning to put files in the cache only after 4 requests for the files (cache misses).


nvidia_monitor true; Сonfigures Flussonic to save statistics on Nvidia performance (true) or to stop saving it (false). You can retrieve the statistics figures in the Pulse section in the UI. Run a custom query like this one `sum:1m-avg:gpu_dec{from=-2h,gpu=nv0}`. Learn more


geoip PATH_TO_DATABASE; Сonfigures Flussonic to use the specified GeoLite2 database for geolocation instead of the built-in GeoLite2 database. Learn more


Stream and group settings

These settings are used in the directives stream, ondemand, rewrite, and live. We call them options.


auth http://backend/; Enables authorization for a stream. See more in the authorization section.


domains host1.ru *.host1.ru; Specifying the domains, within which playing this video is allowed. This does not work for those clients that do not pass the value of Referer. To work correcty in the WEB the flussonic domain must present in the list (the domain of the embed.


allowed_countries CA US UK; The list of two-character codes of countries where the access is allowed (for code reference see the MaxMind database).


url tshttp://transcoder:port/; URL of the data source. It is possible to list several URLs to enable trying the first available data source.

Important: If a UDP source is used, the configuration file must contain this particular UDP address only once. If multiple streams use the same UDP address, chances are it will not work.


urls source1 source2; A list of data source URLs. More info about switching sources.


url_prefix prefix

for example

url_prefix http://my.domain.address.com:80
When using HLS protocol, the addresses of individual segments and playlists within the variant playlist will start with the specified prefix. This option may be used not only as part of an individual stream's settings but also in the global portion of the config file. If the option is specified globally, it will be applied to all streams on the server.


dvr /storage 1d 50% schedule=8:00-16:00;

dvr @my_raid 1d 50% schedule=8:00-16:00;

Enables the archive feature. The first command indicates that Flussonic Media Server should store the archive in the /storage/streamname directory. The second command configures the server to store the archive in the disk array @my_raid. Flussonic will clean up that directory either once a day or when the disk gets 50% full. To set up time you could use days or hours: 20h. Parameter `schedule` allows you to set a schedule on the DVR in the form of intervals. The time is specified in UTC in hours and optionally with minutes; the interval can carry on after midnight: 22-1:30. A schedule can contain multiple intervals, separated by a comma: 8:00-16:00,22-1:30.


dvr_offline /storage 1d 50%; With this option specified, Flussonic would not write the stream to the archive on the start. Archiving of this stream will have to be turned on explicitly via API. This option used in place of dvr option.


udp multicast_loop;

This option makes Flussonic Media Server to send the stream via MPEG-TS over UDP. To set MULTICAST_TTL parameter on the UDP socket use the following syntax: udp;. To set constant bitrate (CBR) use: udp;, where 2000 is the bitrate in kbit/sec.


thumbnails; Turns on generation of the stream preview JPEG thumbnails).


retry_limit 10; Sets the number of times Flussonic Media Server will try to connect to the data sources before closing a non-static stream.


clients_timeout 10; Sets the time period (in seconds) for which Flussonic Media Server will keep serving a non-static stream after the client's last request.


source_timeout 10; Specifies the period of time, in seconds, for which Flussonic Media Server waits for new frames to come from the data source. When this time passes, Flussonic attempts to reconnect to the data source. Default source_timeout is 60 seconds.


frames_timeout 3; Specifies the period of time, in seconds, for which Flussonic Media Server waits for new frames to come from the data source before it generates the event frames_timed_out. This period of time must be smaller than in source_timeout. The event frames_timed_out informs you that the source might soon be lost. If frames come again from this source, before source_timeout has passed, Flussonic issues the frames_restored event.


password secret; The password that will be passed via query string (http or rtmp) for publication in a stream or group.


push rtmp://destination-server/name; With this option Flussonic will publish the stream to another server.


backup vod/blank.mp4; Setting this option for the stream will launch the specified file vod/blank.mp4 in case the video from the data source becomes unavailable. You can manage the backup file with additional options described in [Substituting a stream with a file](#backup)

url publish://

url publish://; This option is used for publishing video into the stream. This option is not applicable for stream groups.


on_publish http://host/publish.php;

on_publish /etc/flussonic/publish.lua;
Enables callback script or http push event when video is being published to this stream or group. HTTP push event could contains infomatino about the stream name, publisher's IP, etc. In response it is possible to allow or deny the publication: the HTTP backend must return 200 OK or 403 Forbidden; the .lua script must return {true, {}} or {false, {}.


max_sessions 1000; Sets the limit on the number of sessions for the stream.


rtp udp; Turns on mandatory use of UDP for communicating with RTSP cameras.


add_audio_only; Adds to the HLS playlist a link to an audio-only stream. This is needed to validate an app in Apple devices.

prepush off

prepush off; Turns off the prepush feature (used for a quicker stream start). This option is useful for broadcasting real-time streams.


prepush 10; Enables a buffer of a specified duration, in seconds. If the client's connection to the server is interrupted or slowed down, it will keep playing video from the buffer. This allows the player to start faster, but with a delay relative to the source.


max_bitrate 1000; Sets the bitrate limit for the stream that is being published.


logo path=flu/embed-logo.png height=100 width=100 left=0 top=0; Add logo at playback. This logo will not be displayed on mobile devices and in the DVR player. To add logo to the video use transcoder.
path (required) — path relative to wwwroot directory.
height, width — logo image size in px. If ony only one of these parameters is present then the other is scaled proportionally. Omit these parameters to display logo in the original size.
left, top, right, bottom — logo image location specified by offset in px. For example, right bottom corner: right=0, bottom=0. Don't use left and right, top and bottom parameters together.


mpegts_pids pmt=4095 sdt=0x12 v1=211 v2=212 a0=220 t0=16#fb; This parameter sets PIDs values for outgoing MPEG-TS streams. It is possible to set PID values for PMT, STD and video and audio tracks. Tracks are numbered starting from one. The code a1=123 sets a PID value for the first audio track. It is possible to set base index for the tracks of certain type using the 0 (zero) index. Example: `t0=100` sets PID=101 for the first track, 102 for the second, and so on. Numbers can be given in decimal form (by default) or in hexadecimal with 16# prefix.

For UDP2 (push udp2://), there is its own way to list PIDs.


meta program_id "10"; This parameter sets the program identifier in the output MPEG-TS stream.


provider Flussonic; This parameter sets the program provider title in the output MPEG-TS stream.


segment_duration 4; Specifies the duration of a segment for HLS and HDS streams in seconds. For some incoming streams Flussonic will not apply the specified segment duration. This depends on a stream's GOP duration in seconds. A segment duration must be divisible by GOP, because GOP structure cannot be split into smaller parts. For example, for a stream with 4-second GOPs, possible segment duration is 4 seconds, 8 seconds, 12 seconds, and so on. Otherwise, Flussonic will create segments equal to each GOP in a stream.


segment_count 4; Specifies the number of segments in HLS and HDS playlists.


group sport; Used only on a source server to define the names of TV channel groups where the stream is included. Learn more


disabled; Disables the stream.

VOD settings

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


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


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 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 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 /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 100; The number of simultaneous requests to disk for a given prefix.


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


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


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


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