Skip to main content
Skip table of contents

Server (mediaserver.ini)

Before launching the media server, it is necessary to edit the launch parameters in the mediaserver.ini file (by default located in the directory /opt/xxxx/media-server/).

Example configuration file (mediaserver.ini)

YAML
[server]
    node-id                 = 101 # node id
    node-host               = # if empty then resolve by hostname

    cluster-enable          = true
    cluster-id              = 100 # cluster id, leave empty for disabled
    cluster-controller      = rabbitmq:// # rabbitmq:// mysql:// pg:// tarantool://
    cluster-warming-up      = 10s # startup timeout. for warming-up all cluster nodes
    cluster-tolerance       = 20s # time interval after last check when node start grab the secondary cameras
    cluster-ping-interval   = 10s # time interval in seconds between health checking

    sys-limit               = 4096 # set fd limitis
    sys-umask               = 777 # set file\folder creation mask

    threads-medium          = 10 # Number of medium worker threads
    threads-media           = 10 # Number of media worker threads
    threads-web             = 5 # Number of web worker threads

    [[stream]]
        enable      = true      # true | false | rtsp,publish,web
        rtsp        = *:5554:/  # rtsp streaming endpoint
        publish     = *:7554:/  # push rtsp endpoint
        web         = *:8443/   # hls\mse\etc... streaming endpoint
        whitelist-access        = #127.0.0.1/24 media client rtsp\http\https whitelist
        whitelist-publishers    = #127.0.0.1/24 rtsp pushers whitelist
        auth-module = modules/auth/validate.lua
        auth-secret = "}2F+fUnU8!@(<`5]9@]6P3,rkwD&amp;XRvV[Rr`;CQR^wr$h#79SQw-[[>amr7ZX(dN"
        ssl-enable  = true # enable\disable SSL for (web, api, hls, mse etc.)
        ssl-cert    = # ssl cert file
        ssl-key     = # ssl key file

        reconnect-numbers = 500         # number of reconnects, before turn off stream
        reconnect-timeout = 10s         # timeout before reconnect attempt
        reconnect-interval = 30m        # maximum timeout interval
        reconnect-invalid = 10          # number of bad packets before camera go in state invalid

        keep-alive  = true              # enable\disable (default is enable) tcp keepalive between server and streams (global for all streams, metro bad network fix)

    [[module]]
        listen          = *:8080
        cpanel-enable   = true # enable\disable web module
        cpanel-baseurl  = /cpanel
        cpanel-module   = modules/cpanel/cpanel.lua
        cpanel-whitelist    = #127.0.0.1/24
        cpanel-auth     = none # basic, none
        api-enable  = true # enable\disable web module
        api-baseurl     = /api
        api-module  = modules/api/api.v2.lua
        api-whitelist   = #127.0.0.1/24, 192.168.1.150/28, 192.168.1.1
        api-auth        = none # basic, none
        ssl-enable  = true # enable\disable SSL for (web, api, hls, mse etc.)
        ssl-cert    = # ssl cert file
        ssl-key     = # ssl key file

        [[[users]]]
        #   role = <login>:[<plain-password>]
        #   role - root, admin, guest, user, if leave empty, role is disabled
            admin = siteadmin:
            root =
            user =
            guest =

[dvr]
    record-tmp-dir  = /storage/tmp  #temporary directory to export records

[streams]
    include         = streams/*.ini

[nodes]
    include         = media-server.nodes    # external file nodes id list
    101     = host1.<xxxx>.video
    1088    = host2.<xxxx>.video

# Optional section with virtual storages forward declaration
[storages]
    default         = /storage
    secondary       = /storage2

CONFIGURATION PARAMETERS

server

node-idrequired

int

Identifier of the current server node.

0

node-host

string

Allows specifying the hostname that will be used by the server. If not specified, it will be taken from /etc/hostname.

cluster-enablerequired

bool

Enables cluster support in the media server.

false

cluster-idrequired

int

Numerical identifier of the cluster.

0

cluster-controller

string

Sets the endpoint to which media server events will be sent.
If the value is not specified or the protocol is not supported, the events will not be sent. Supported endpoint types: http://, https://

cluster-warming-uprequired

seconds

Time during which cluster nodes may not send ping after a restart. The more streams, the more time is needed to "warm up" the node.

10s

cluster-tolerancerequired

int

Time interval after the last health check.

20

cluster-ping-intervalrequired

seconds

Interval between ping requests.

10s

sys-limitrequired

System setting for setting the limit.

sys-umaskrequired

System setting for creating a mask.

threads-mediarequired

int

Number of threads for streaming camera streams.

10

threads-mediumrequired

int

Number of system threads that will be launched for capturing streams.

10

threads-webrequired

int

Number of threads for API\WEB operation.

5

server.stream

enablerequired

bool

Enables\Disables connection to the stream: true | false | rtsp, publish, web.

true

rtsprequired

string

Network port on which clients will be expected to connect via the RTSP protocol.

*:5554:/

publishrequired

string

Network port on which connections will be expected for the media bridge.

*:7554:/

webrequired

string

Network port on which connections will be expected via Web protocols. (HLS, MSE)

*:8443/

whitelist-access

array

Defines a list of allowed IP addresses that can connect to the Mediaserver. Everyone is allowed if no specific IP addresses are specified. The following formats can be used: 192.168.1.100, 192.168.1.100/24, 192.168.1.100-192.168.1.105

whitelist-publishersrequired

array

Restriction on who can send streams.

auth-modulerequired

path

Verifies token during authorization.

auth-secretrequired

string

Sets the seed for creating access token. It is recommended to use a randomly generated sequence of more than 32 characters.

null

ssl-enablerequired

bool

Enables or disables SSL/TLS connection support (for web, API, HLS, MSE, etc.). false - Disables SSL/TLS support. true - Enables secure connection support.

false

ssl-certrequired

string

Contains the path to the SSL certificate file.

ssl-keyrequired

string

Contains the path to the private key of the SSL certificate.

reconnect-numbersrequired

int

Global parameter. Reconnection settings. Can be configured in the stream configuration file.

500

reconnect-invalidrequired

int

Number of 'bad' packets before the camera goes into 'unavailable' state.

10

reconnect-timeoutrequired

seconds

Reconnect once every specified number of seconds.

10

reconnect-intervalrequired

seconds

Maximum interval for connection attempts to the stream.

30m

keep-aliverequired

bool

Enable/disable TCP activity support between the server and streams (global for all streams, enabled by default).

true

server.module

listen

string

Specifies the interface and port on which client connections to Web API and CPanel modules will be available.

*:8081

cpanel-enable

bool

true - Connects CPanel web module support.

true

cpanel-baseurl

string

Route to the Mediaserver control panel requests.

/cpanel

cpanel-module

string

Path to the CPanel module LUA script.

module/cpanel.default.lua

cpanel-whitelist

array

Defines a list of allowed IP addresses from which connections to CPanel can be made.

[]

cpanel-auth

enum

Defines the type of user authorization in the CPаnel.

none - CPanel authorization is disabled
basic - Basic authorization by username and password.

none

api-enable

bool

Enables API module support.

true

api-module

string

Path to the Web API module LUA script.

modules/api/api.v2.lua

api-baseurl

string

Route to Web API requests.

/api

api-whitelist

array

Defines a list of allowed IP addresses from which connections to Web API can be made.

[]

api-auth

enum

Defines the type of user authorization for Web API.

none - Connection is possible without authorization
basic - Authorization is required.

none

ssl-enablerequired

bool

Enables or disables SSL/TLS connection support (for web, API, HLS, MSE, etc.). false - Disables SSL/TLS support. true - Enables secure connection support.

false

ssl-certrequired

string

Contains the path to the SSL certificate file.

ssl-keyrequired

string

Contains the path to the private key of the SSL certificate.

usersrequired

object

Creating users.

Input format role = [login]:[plain-password].

Role - root, admin, guest, user (if left empty, the possibility will be disabled).

Login determines the user's rights in the control panel. admin - password root - ...

dvr

record-tmp-dir

string

Path for creating temporary files.

/storage/tmp

streams

include

string

Location of stream configuration files. See Mediaserver/Configuration/Stream (stream.ini)

streams/*.ini

nodes

includerequired

string

Node mapping and hostname. This section works if there are clusters.

101 = host1.[xxxx].video - The Mediaserver with node 101 has the specified hostname.

1088 = host2.[xxxx].video - The Mediaserver with node 1088 has the specified hostname.

media-server.nodes

storages

default

string

Indicates the disks where DVR streams can be stored. This parameter is used for informational purposes when calling the method see Mediaserver/Web API/Server/GetServerStorageByPath.

/storage

secondary

string

Backup storage location for DVR streams. This parameter is used for informational purposes when calling the method see Mediaserver/Web API/Server/GetServerStorageByPath.

/storage2

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.