Cоnfiguration of Mediaserver
The configuration methods
A configuration file.
http, https source of configuration.
RTSP configuration
dsn rtsp.listen
REQUIRED = "*:554:/"
Network settings for incoming RTSP client connections in the <hostname>:<port>:<base-url>
format, where:
hostname
– refers to a local network name, at the IP address of which connections will be listened to. If*
is specified, connections at all network addresses will be listened to, and the current hostname fromhostname
will be used.port
– refers to a port number that will be open for listening of connections. In specific operational systems, you should allow for notroot
users to use a port lower than 1024.base-url
– a base path address.
number rtsp.ip
= 4
An IP protocol type for incoming connections:
4
– for IP46
– for IP646
– for dual stack IP4/IP6.
number rtsp.workers
= 2
– a number of system streams that serve the capture of camera streams. This value needs to be adjusted depending on the number of captured streams.
number rtsp.poll
= 256
A value that defines the maximum number of processed network events. Increase the value depending on the number of served streams. The value is specified for each system stream rtsp.workers
.
{
"rtsp": {
"listen": "*:554:/",
"ip": 4,
"workers": 2,
"poll": 256
}
}
For details, refer to the RTSP module documentation page.
ONVIF configuration
dsn onvif.listen
REQUIRED = "*:554:/"
Network settings for incoming RTSP client connections in the <hostname>:<port>:<base-url>
format, where:
hostname
– refers to a local network name, at the IP address of which connections will be listened to. If * is specified, connections at all network addresses will be listened to, and the current hostname fromhostname
will be used.port
– refers to a port number that will be open for listening of connections. In specific operational systems, you should allow for notroot
users to use a port lower than 1024.base-url
– a base path address.
number onvif.ip
= 4
An IP protocol type for incoming connections:
4
– for IP46
– for IP646
– for dual stack IP4/IP6.
number onvif.workers
=2
– a number of system streams that serve the capture of camera streams. This value needs to be adjusted depending on the number of captured streams.
number onvif.poll
= 256
– a value that defines the maximum number of processed network events. Increase the value depending on the number of served streams. The value is specified for each system stream onvif.workers
.
bool onvif.ssl
= true
– whether to use SSL (HTTPS) for incoming connections. When false
– SSL isn’t used.
{
"onvif": {
"listen": "*:554:/",
"ip": 4,
"workers": 2,
"poll": 256,
"ssl": true
}
}
For details, refer to the ONVIF documentation page.
PROXY configuration
dsn proxy.listen
REQUIRED = "*:554:/"
Network settings for incoming RTSP client connections in the <hostname>:<port>:<base-url>
format, where:
hostname
– refers to a local network name, at the IP address of which connections will be listened to. If * is specified, connections at all network addresses will be listened to, and the current hostname fromhostname
will be used.port
– refers to a port number that will be open for listening of connections. In specific operational systems, you should allow for notroot
users to use a port lower than 1024.base-url
– a base path address.
number proxy.ip
= 4
An IP protocol type for incoming connections:
4
– for IP46
– for IP646
– for dual stack IP4/IP6.
number proxy.workers
= 2
– a number of system streams that serve the capture of camera streams. This value needs to be adjusted depending on the number of captured streams.
number proxy.poll
= 256
– a value that defines the maximum number of processed network events. Increase the value depending on the number of served streams. The value is specified for each system streamproxy.workers
.
bool proxy.ssl
=true
– whether to use SSL (HTTPS) for incoming connections. When false
– SSL isn’t used.
{
"proxy": {
"listen": "*:554:/",
"ip": 4,
"workers": 2,
"poll": 256,
"ssl": true
}
}
For details, refer to the Proxy module documentation page
Media configuration
dsnmedia.listen
REQUIRED = "*:80:/"
Network settings for incoming HTTP/HTTPS to playback cameras in various media formats <hostname>:<port>:<base-url>
, where:
hostname
– refers to a local network name, at the IP address of which connections will be listened to. If*
is specified, connections at all network addresses will be listened to, and the current hostname fromhostname
will be used.port
– refers to a port number that will be open for listening of connections. In specific operational systems, you should allow for notroot
users to use a port lower than 1024.base-url
– a base path address.
number media.ip
= 4
An IP protocol type for incoming connections:
4
– for IP4,6
– for IP6,46
– for dual stack IP4/IP6.
number media.workers
= 2
– a number of system streams used to serve incoming connections from clients. The specified value depends on the planned load and the number of clients.
number media.poll
= 64
– the value that defines the maximum number of processed network events.
bool media.ssl
= true
– whether to use SSL (HTTPS) for incoming connections. When false
– SSL isn’t used.
{
"media": {
"listen": "*:80:/",
"ip": 4,
"workers": 2,
"poll": 64,
"ssl": true
}
}
For details, refer to the Media module documentation page.
API configuration
A token is required to access API. Tokens can be generated on a local level.
For detailed steps about how to generate a token, see the Create an access token to API documentation page.
dsn api.listen
REQUIRED = "*:8554:/"
Network settings for incoming HTTP/HTTPS to call out the API methods.
<hostname>:<port>:<base-url>
, where:
hostname
– refers to a local network name, at the IP address of which connections will be listened to. If*
is specified, connections at all network addresses will be listened to, and the current hostname fromhostname
will be used.
port
– refers to a port number that will be open for listening of connections. In specific operational systems, you should allow for notroot
users to use a port lower than 1024.base-url
– a base path address.
number api.ip
= 4
ТAn IP protocol type for incoming connections:
4
– for IP4,6
– for IP6,46
– for dual stack IP4/IP6.
number api.workers
= 2
– a number of system streams that serve API requests.
number api.poll
= 64
– a value that defines a maximum number of processed network connections.
bool
api.ssl = true
– whether to use SSL (HTTPS) for incoming connections. When false
– SSL isn’t used.
{
"api": {
"listen": "*:8554:/",
"ip": 4,
"workers": 2,
"poll": 64,
"ssl": true
}
}
For details, refer to the Mediaserver API documentation page.
Cluster configuration
dsn cluster.webhook
= "http://localhost:8080/event/"
– a server URL that will receive events. If it’s not specified or wrong< the webhook
functionality won’t be available.
array cluster.events
= ["service:up","service:down"]
An array of event identifiers that can be sent. If not specified or empty, all events are sent.The following are the event types:
For details on the Weebhook mechanism, refer to the Configuration of Webhook and notification events documentation page.
{
"cluster": {
"webhook": "http://localhost:8080/event/",
"events": [
"service:up",
"service:down"
]
}
}
SSL configuration
string ssl.key
= "string"
– a path to the SSL key file.
string ssl.cert
= "string"
– a path to the SSL certificate file.
{
"ssl": {
"key": "string",
"cert": "string"
}
}
Additional parameters for configuration
url streams
= "./cameras.json"
– the path to the file location that contains the configurations of the captured streams. This parameter overrides the -s
parameter of the service startup command line. The source can be designated as either a local file path or a URL, which is expected to return the list of streams along with their respective configurations.
number log.verbose
= 4
– the level of the server state logging. The levels of logging are from 0
to 7
. Where 7
provides detailed information. This may increase space during logging and reduce efficiency.
string log.out
= "stdout|syslog.user"
– Defines where to output the logs. Accepts the following values: stdout
, syslog.<facility>
, file
and combination with the divider |
, where <facility>
-- auth|authpriv|cron|daemon|ftp|kern|lpr|mail|news|security|syslog|user|uucp|local[0-7]
.
url license
REQUIRED = "url"
– specifies the location of the license file: URL or a local file.
string secret
REQUIRED = "string"
– a secret value that is used to generate authorization tokens to view and access API. Tokens generated with the same secret
will be accepted on all servers.
{
"streams": "./cameras.json",
"log": {
"verbose": 4,
"out": "stdout|syslog.user"
},
"license": "url",
"secret": "string"
}
Configuration of a virtual storage device
Mediaserver supports virtual storage devices for DVR. To configure a virtual device, define a storage
section in your Mediaserver configuration file. Once defined, you can specify this section in the recording and storage path for your DVR. If no storage section is specified, the path defined in the stream configuration will be used as the recording directory. If no storage section is defined, a default virtual storage device with the local
driver type will be created.
enum storage.driver
REQUIRED = "local"
The driver for the virtual storage device:
dvrfs
– a type of the storage device.local
– use directories for storing and recording the archive.
object storage.volume
= {}
Is used when driver dvrfs
is specified
{
"storage": {
"driver": "local",
"volume": {
"name": "string",
"option": "string",
"bucket": {
"mountpoint": {
"capacity": "bytes",
"role": "data"
}
}
}
}
}
Each mount point is checked for existence. If the mount point (directory) doesn’t exist, it won't be created – this prevents accidental writing to the root file system.
For each mount point, the writing capability is determined (filesystem status: rw
, ro
), as well as the sufficiency of permissions for writing and reading. If writing is not possible, the mount point
is marked as "read-only" but is not excluded from the bucket.
After configuration, the storage device for the DVR of each stream can be specified using a device like /bucket0
.