Skip to main content
Skip table of contents

Example of server configuration file settings

Below is an example of media server configuration file settings.

The configuration file is a file that contains information necessary for the successful operation of the program.

CODE
[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&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     = testnsms1.<xxxx>.video
    1088    = testnsms2.<xxxx>.video

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

Term

Definition

node-id

Node number of the installed media server

node-host

Media server name. If the value is empty, the hostname of the system will be used

cluster

Group of combined nodes (node) of media servers

cluster-enable

true – enabling a cluster group

false – disabling the cluster

cluster-id

Cluster number – server groups

cluster-controller

cluster-controller = rabbitmq:// # rabbitmq:// mysql:// pg:// tarantool://

cluster-ping-interval

Interval between ping requests

cluster-warming-up

Launch timeout. for checking and enabling all cluster nodes

cluster-tolerance

Time interval after the last health check

sys-limit

System setting for setting a limit

sys-umask

System setting for creating a mask

[threads]

Threads. Necessary for thread settings

threads-medium

The number of system threads that will be launched to capture streams

threads-media

The number of threads for delivering camera streams

threads-web

The number of threads for API/WEB work

[stream]enable 

true | false | rtsp,publish,web

rtsp = *:5554:/

publish  = *:7554:/ 

web = *:8443/

Suitable for thick clients

Suitable for media bridge

Suitable for web format and mobile devices

whitelist

Setting the IP address for connection

whitelist-access

Everyone is allowed if no specific IP addresses are specified

whitelist-publishers

Limitation of who can send streams

auth-module

Token verification during authorization

auth-secret

For checking and creating access token

ssl

Certificates. A protocol that provides more secure communication

ssl-enable

Enabling or disabling SSL certificates (for web, api, hls, mse, etc.)

ssl-cert

Stores the location of the cert file

ssl-key

Stores the location of the private key

reconnect-numbers

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

reconnect-timeout

Reconnect once every specified number of seconds

reconnect-interval

Connection attempt interval

reconnect-invalid

Number of connection attempts

keep-alive

keep-alive  = true

Enable/disable (enabled by default) tcp activity support between the server and streams (global for all streams, fixing poor subway network)

[module]

Additional functionality for connecting CPanel and API

listen

Port

cpanel-enable

true. Connection of the web module CPanel

cpanel-baseurl = /cpanel

Name path to the module

cpanel-module = modules/cpanel/cpanel.lua

Script to implement the functionality of the CPanel module

cpanel-whitelist = #127.0.0.1/24

IP addresses that can connect

cpanel-auth = none # basic, none

basic – there is authorization

none – connection is possible without authorization

api-enable = true 

true/false. Connection of the API module

api-baseurl = /api

Path to the API

api-module = modules/api/api.v2.lua

Script to implement the functionality of the API module

api-whitelist = #127.0.0.1/24, 192.168.1.150/28, 192.168.1.1

IP addresses that can connect to API

api-auth = none # basic, none

basic – there is authorization

none – connection is possible without authorization

ssl-enable = false # enable\disable SSL for (web, api, hls, mse etc.)

Enabling or disabling SSL certificates (for web, api, hls, mse, etc.)

ssl-cert = # ssl cert file

Stores the location of the cert file

ssl-key = # ssl key file

Stores the location of the private key

[users]

Input format role = <login>:[<plain-password>] 

role = <login>:[<plain-password>]

role - root, admin, guest, user, if left blank, the role is disabled

admin = siteadmin:siteadmin

root = 

user =

guest = 

Possible user roles

dvr

A function that enables creating archives on a media server

record-tmp-dir = /storage/tmp

Path for creating temporary files

include = streams/*.ini

Path from which to connect configuration settings

[nodes]

The section works when clusters are present

include = media-server.nodes

Matching the node and hostname

101 = testnsms1.<xxxx>.video

The media server with node 101 has the specified hostname

1088 = testnsms2.<xxxx>.video

The media server with node 1088 has the specified hostname.

[storages]

Specifying disks that are available for recording archives

default = /storage

Main archive storage location

secondary = /storage2

Backup archive storage location

JavaScript errors detected

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

If this problem persists, please contact our support.