-
Notifications
You must be signed in to change notification settings - Fork 4
Directives
syntax: srt {...}
context: root
The block which holds all SRT settings.
syntax: log_file filename
context: srt
Location of the logfile to use. Default is logs/srt_server.log.
syntax: log_level level
context: srt
Specifies the minimum log level of messages to be logged. Must be one of TRACE, DEBUG, INFO, WARNING, FATAL or OFF. Default is INFO.
log_level info;
syntax pidfile filename
context: srt
Location of the PID file. Default is /tmp/sls/srt_server.pid.
syntax: worker_threads num_threads
context: srt
The number of SRT server worker threads. Default is 1.
worker_threads 1;
syntax: worker_connections num_connections
context: srt
The maximum number of connections each thread can handle simultaneously. Default is 300.
worker_connections 300;
syntax: stat_post_url url
context: srt
The HTTP endpoint to post statistics to. Does not POST statistics if endpoint is unspecified. Default is unspecified.
stat_post_url http://192.168.31.106:8001/sls/stat;
syntax: stat_post_interval interval
context: srt
The interval between individual POSTs of statistics (in seconds). Default is 5 seconds.
stat_post_interval 5;
syntax: server {...}
context: srt
Declares SRT server instance.
rtmp {
server {
}
}
syntax: listen port
context: server
Port on which to listen for connections.
server {
listen 8080;
}
syntax: backlog value
context: server
Defines how many sockets may be allowed to wait until they are accepted (excessive connection requests are rejected in advance). Default is 128 connections.
syntax: latency value
context: server
Defines the latency of the SRT protocol (in ms). Default is 20ms.
syntax: domain_player srt_domain
context: server
The play SRT domain, used by players connecting to SLS. SRT domain is not to be confused with a regular Domain Name - for example, live is a valid domain_player value. Default is live.sls.
syntax: domain_publisher srt_domain
context: server
The publish SRT domain, used by publishers connecting to SLS. SRT domain is not to be confused with a regular Domain Name - for example, uplive is a valid domain_publisher value. Default is uplive.sls.
syntax: idle_streams_timeout timeout
context: server
If no data is received from a client for the duration of the timeout value, the server will discard the client. The timeout is specified in seconds. Default is 10s.
syntax: on_event_url http://[server_ip]/on_event?method=on_connect|on_close&role_name=%s&srt_url=%s&remote_ip=%s&remote_ip=%d
context: server
The webhook which will be called on on_connect and on_close events. If the webhook does not return 200 OK status code when executing the on_connect webhook, the connection will be refused by the server. Webhook is not active if the URL is not specified. Default is unspecified.
syntax: app {...}
context: server
Creates a SRT application.
server {
listen 8080;
app {
}
}
syntax: app_player name
context: app
The app name of the player endpoint. The streaming (playing) endpoint follows the RTMP convention: srt://domain/app_player/stream_name.
syntax: app_publisher name
context: app
The app name of the publisher endpoint. The streaming (publishing) endpoint follows the RTMP convention: srt://domain/app_publisher/stream_name.
syntax: relay {...}
context: app
Configure a SRT relay within a SRT app.
app {
relay {
}
}
syntax: type loop|all|hash
context: relay
Set the mode of the relay. The relay supports 3 modes:
-
loopmode: the relay will connect to upstream endpoints one-by-one, until a successful connection is established. -
hashmode: the relay will be chosen based on the hash of the stream name. This means that a stream will always reach the same upstream server. -
allmode: broadcast to all available upstreams.
syntax: reconnect_interval: interval
context: relay
The reconnect interval (in seconds) when a connection with an upstream server fails.
syntax: idle_streams_timeout: timeout
context: relay
If the relay receives no data from an upstream server for the duration of the timeout (specified in seconds), the server will discard the relay. Value -1 disables the timeout.
syntax: upstreams: url1 [url2 url3 ...]
context: relay
The space-separated list of URLs of upstream relays. In an upstream URL, {stream_name} indicates the dynamic stream name, which will be inserted instead of the {stream_name} placeholder text.
syntax: allow play|publish address|all
context: app
The IP addresses to allow access (playing/publishing) to a specific SRT app. If there are multiple directives present in the configuration file, they are processed sequentially.
syntax: deny play|publish address|all
context: app
See allow for description.
syntax: record_hls_path_prefix path_prefix
context: srt
The directory to contain HLS recordings of received streams. The full recording path will be: <record_hls_path_prefix>/$listen/$domain_publisher/$app_publisher/$stream_name After the publisher stops, a VOD will be generated in: <record_hls_path_prefix>/$listen/$domain_publisher/$app_publisher/$stream_name/vod.m3u8.
record_hls_path_prefix /tmp/mov/sls;
syntax: record_hls on|off
context: app
Whether to record to a HLS stream or not. Default is off.
syntax: record_hls_segment_duration duration
context: app
The duration of HLS TS segments (in seconds). Default is 10s.