2020-06-30 13:12:39 +00:00
|
|
|
|
2021-02-03 08:55:11 +00:00
|
|
|
###############################################
|
|
|
|
# General options
|
|
|
|
|
2020-12-13 22:43:31 +00:00
|
|
|
# sets the verbosity of the program; available values are "warn", "info", "debug".
|
2020-12-08 11:21:06 +00:00
|
|
|
logLevel: info
|
2020-11-07 21:28:32 +00:00
|
|
|
# destinations of log messages; available values are "stdout", "file" and "syslog".
|
|
|
|
logDestinations: [stdout]
|
|
|
|
# if "file" is in logDestinations, this is the file which will receive the logs.
|
|
|
|
logFile: rtsp-simple-server.log
|
|
|
|
|
2021-01-31 15:58:57 +00:00
|
|
|
# listen IP. If provided, all listeners will listen on this specific IP.
|
|
|
|
listenIP:
|
2021-02-03 08:55:11 +00:00
|
|
|
# timeout of read operations.
|
|
|
|
readTimeout: 10s
|
|
|
|
# timeout of write operations.
|
|
|
|
writeTimeout: 10s
|
|
|
|
# number of read buffers.
|
|
|
|
# a higher number allows a higher throughput,
|
|
|
|
# a lower number allows to save RAM.
|
|
|
|
readBufferCount: 512
|
|
|
|
|
2021-03-13 17:22:02 +00:00
|
|
|
# enable Prometheus-compatible metrics.
|
2021-02-03 08:55:11 +00:00
|
|
|
metrics: no
|
2021-03-13 17:22:02 +00:00
|
|
|
# port of the metrics listener.
|
|
|
|
metricsPort: 9998
|
|
|
|
|
2021-03-27 11:23:19 +00:00
|
|
|
# enable pprof-compatible endpoint to monitor performances.
|
2021-02-03 08:55:11 +00:00
|
|
|
pprof: no
|
2021-03-27 10:21:30 +00:00
|
|
|
# port of the pprof listener.
|
|
|
|
pprofPort: 9999
|
2021-02-03 08:55:11 +00:00
|
|
|
|
|
|
|
# command to run when a client connects to the server.
|
|
|
|
# this is terminated with SIGINT when a client disconnects from the server.
|
|
|
|
# the server port is available in the RTSP_PORT variable.
|
|
|
|
runOnConnect:
|
|
|
|
# the restart parameter allows to restart the command if it exits suddenly.
|
|
|
|
runOnConnectRestart: no
|
|
|
|
|
|
|
|
###############################################
|
|
|
|
# RTSP options
|
2021-01-31 15:58:57 +00:00
|
|
|
|
2021-03-10 19:19:43 +00:00
|
|
|
# disable support for the RTSP protocol.
|
|
|
|
rtspDisable: no
|
2021-01-31 15:58:57 +00:00
|
|
|
# supported RTSP stream protocols.
|
2020-12-13 22:43:31 +00:00
|
|
|
# UDP is the most performant, but can cause problems if there's a NAT between
|
|
|
|
# server and clients, and doesn't support encryption.
|
|
|
|
# TCP is the most versatile, and does support encryption.
|
|
|
|
# The handshake is always performed with TCP.
|
2020-06-30 13:12:39 +00:00
|
|
|
protocols: [udp, tcp]
|
2020-12-13 22:43:31 +00:00
|
|
|
# encrypt handshake and TCP streams with TLS (RTSPS).
|
2020-12-20 11:51:04 +00:00
|
|
|
# available values are "no", "strict", "optional".
|
2020-12-13 22:43:31 +00:00
|
|
|
encryption: no
|
|
|
|
# port of the TCP/RTSP listener. This is used only if encryption is "no" or "optional".
|
2020-06-30 13:12:39 +00:00
|
|
|
rtspPort: 8554
|
2020-12-20 11:51:04 +00:00
|
|
|
# port of the TCP/TLS/RTSPS listener. This is used only if encryption is "strict" or "optional".
|
2020-12-13 22:43:31 +00:00
|
|
|
rtspsPort: 8555
|
|
|
|
# port of the UDP/RTP listener. This is used only if "udp" is in protocols.
|
2020-06-30 13:12:39 +00:00
|
|
|
rtpPort: 8000
|
2020-12-13 22:43:31 +00:00
|
|
|
# port of the UDP/RTCP listener. This is used only if "udp" is in protocols.
|
2020-06-30 13:12:39 +00:00
|
|
|
rtcpPort: 8001
|
2020-12-20 11:51:04 +00:00
|
|
|
# path to the server key. This is used only if encryption is "strict" or "optional".
|
2020-12-13 22:43:31 +00:00
|
|
|
serverKey: server.key
|
2020-12-20 11:51:04 +00:00
|
|
|
# path to the server certificate. This is used only if encryption is "strict" or "optional".
|
2020-12-13 22:43:31 +00:00
|
|
|
serverCert: server.crt
|
|
|
|
# authentication methods.
|
|
|
|
authMethods: [basic, digest]
|
2021-02-18 22:26:45 +00:00
|
|
|
# read buffer size.
|
|
|
|
# this doesn't influence throughput and shouldn't be touched unless the server
|
|
|
|
# reports errors about the buffer size.
|
|
|
|
readBufferSize: 2048
|
2021-02-03 08:55:11 +00:00
|
|
|
|
|
|
|
###############################################
|
|
|
|
# RTMP options
|
2020-08-05 09:20:11 +00:00
|
|
|
|
2021-03-10 19:19:43 +00:00
|
|
|
# disable support for the RTMP protocol.
|
|
|
|
rtmpDisable: no
|
2021-01-31 15:58:57 +00:00
|
|
|
# port of the RTMP listener.
|
|
|
|
rtmpPort: 1935
|
|
|
|
|
2021-02-03 08:55:11 +00:00
|
|
|
###############################################
|
|
|
|
# Path options
|
2020-10-31 15:36:09 +00:00
|
|
|
|
2020-09-19 15:13:45 +00:00
|
|
|
# these settings are path-dependent.
|
2020-10-27 23:29:53 +00:00
|
|
|
# it's possible to use regular expressions by using a tilde as prefix.
|
|
|
|
# for example, "~^(test1|test2)$" will match both "test1" and "test2".
|
|
|
|
# for example, "~^prefix" will match all paths that start with "prefix".
|
|
|
|
# the settings under the path "all" are applied to all paths that do not match
|
2020-09-19 15:13:45 +00:00
|
|
|
# another entry.
|
2020-06-30 13:12:39 +00:00
|
|
|
paths:
|
|
|
|
all:
|
|
|
|
# source of the stream - this can be:
|
2021-02-03 08:55:11 +00:00
|
|
|
# * record -> the stream is published by a RTSP or RTMP client
|
2020-10-05 19:40:17 +00:00
|
|
|
# * rtsp://existing-url -> the stream is pulled from another RTSP server
|
2020-12-14 22:32:24 +00:00
|
|
|
# * rtsps://existing-url -> the stream is pulled from another RTSP server
|
2020-10-03 19:10:41 +00:00
|
|
|
# * rtmp://existing-url -> the stream is pulled from a RTMP server
|
2020-10-27 23:29:53 +00:00
|
|
|
# * redirect -> the stream is provided by another path or server
|
2020-06-30 13:12:39 +00:00
|
|
|
source: record
|
2020-10-27 23:29:53 +00:00
|
|
|
|
2021-02-09 21:33:50 +00:00
|
|
|
# if the source is an RTSP URL, this is the protocol that will be used to
|
2020-11-21 12:34:27 +00:00
|
|
|
# pull the stream. available options are "automatic", "udp", "tcp".
|
2020-12-12 22:37:15 +00:00
|
|
|
# the tcp protocol can help to overcome the error "no UDP packets received recently".
|
2020-11-21 12:34:27 +00:00
|
|
|
sourceProtocol: automatic
|
2020-12-08 11:21:06 +00:00
|
|
|
|
2021-02-09 21:33:50 +00:00
|
|
|
# if the source is an RTSP or RTMP URL, it will be pulled only when at least
|
2020-10-27 23:29:53 +00:00
|
|
|
# one reader is connected, saving bandwidth.
|
2020-07-29 21:30:42 +00:00
|
|
|
sourceOnDemand: no
|
2020-11-01 15:51:12 +00:00
|
|
|
# if sourceOnDemand is "yes", readers will be put on hold until the source is
|
|
|
|
# ready or until this amount of time has passed.
|
|
|
|
sourceOnDemandStartTimeout: 10s
|
|
|
|
# if sourceOnDemand is "yes", the source will be closed when there are no
|
|
|
|
# readers connected and this amount of time has passed.
|
|
|
|
sourceOnDemandCloseAfter: 10s
|
2020-06-30 13:12:39 +00:00
|
|
|
|
2021-02-09 21:33:50 +00:00
|
|
|
# if the source is "redirect", this is the RTSP URL which clients will be
|
2020-10-27 23:29:53 +00:00
|
|
|
# redirected to.
|
|
|
|
sourceRedirect:
|
|
|
|
|
2021-03-22 21:15:22 +00:00
|
|
|
# if the source is "record" and a client is publishing, do not allow another
|
|
|
|
# client to disconnect the former and publish in its place.
|
|
|
|
disablePublisherOverride: no
|
|
|
|
|
|
|
|
# if the source is "record" and no one is publishing, redirect readers to this
|
|
|
|
# path. It can be can be a relative path (i.e. /otherstream) or an absolute RTSP URL.
|
2020-11-01 16:48:00 +00:00
|
|
|
fallback:
|
|
|
|
|
2020-10-31 15:36:09 +00:00
|
|
|
# username required to publish.
|
2020-12-31 18:47:25 +00:00
|
|
|
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
2020-10-31 15:36:09 +00:00
|
|
|
publishUser:
|
|
|
|
# password required to publish.
|
2020-12-31 18:47:25 +00:00
|
|
|
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
2020-10-31 15:36:09 +00:00
|
|
|
publishPass:
|
|
|
|
# ips or networks (x.x.x.x/24) allowed to publish.
|
|
|
|
publishIps: []
|
|
|
|
|
|
|
|
# username required to read.
|
2020-12-31 18:47:25 +00:00
|
|
|
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
2020-10-31 15:36:09 +00:00
|
|
|
readUser:
|
|
|
|
# password required to read.
|
2020-12-31 18:47:25 +00:00
|
|
|
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
2020-10-31 15:36:09 +00:00
|
|
|
readPass:
|
|
|
|
# ips or networks (x.x.x.x/24) allowed to read.
|
|
|
|
readIps: []
|
|
|
|
|
2020-11-01 15:51:12 +00:00
|
|
|
# command to run when this path is initialized.
|
|
|
|
# this can be used to publish a stream and keep it always opened.
|
2020-10-27 23:29:53 +00:00
|
|
|
# this is terminated with SIGINT when the program closes.
|
2020-11-01 15:58:25 +00:00
|
|
|
# the path name is available in the RTSP_PATH variable.
|
2020-11-01 16:33:06 +00:00
|
|
|
# the server port is available in the RTSP_PORT variable.
|
2020-07-31 16:12:42 +00:00
|
|
|
runOnInit:
|
2021-02-03 08:55:11 +00:00
|
|
|
# the restart parameter allows to restart the command if it exits suddenly.
|
2020-10-31 15:36:09 +00:00
|
|
|
runOnInitRestart: no
|
2020-07-31 16:12:42 +00:00
|
|
|
|
2020-07-30 11:43:10 +00:00
|
|
|
# command to run when this path is requested.
|
2020-11-01 15:51:12 +00:00
|
|
|
# this can be used to publish a stream on demand.
|
2020-10-27 23:29:53 +00:00
|
|
|
# this is terminated with SIGINT when the path is not requested anymore.
|
2020-11-01 15:58:25 +00:00
|
|
|
# the path name is available in the RTSP_PATH variable.
|
2020-11-01 16:33:06 +00:00
|
|
|
# the server port is available in the RTSP_PORT variable.
|
2020-07-30 11:43:10 +00:00
|
|
|
runOnDemand:
|
2021-02-03 08:55:11 +00:00
|
|
|
# the restart parameter allows to restart the command if it exits suddenly.
|
2020-10-31 15:36:09 +00:00
|
|
|
runOnDemandRestart: no
|
2020-11-01 15:51:12 +00:00
|
|
|
# readers will be put on hold until the runOnDemand command starts publishing
|
|
|
|
# or until this amount of time has passed.
|
|
|
|
runOnDemandStartTimeout: 10s
|
|
|
|
# the runOnDemand command will be closed when there are no
|
|
|
|
# readers connected and this amount of time has passed.
|
|
|
|
runOnDemandCloseAfter: 10s
|
2020-07-30 11:43:10 +00:00
|
|
|
|
|
|
|
# command to run when a client starts publishing.
|
2020-10-27 23:29:53 +00:00
|
|
|
# this is terminated with SIGINT when a client stops publishing.
|
2020-11-01 15:58:25 +00:00
|
|
|
# the path name is available in the RTSP_PATH variable.
|
2020-11-01 16:33:06 +00:00
|
|
|
# the server port is available in the RTSP_PORT variable.
|
2020-07-30 11:43:10 +00:00
|
|
|
runOnPublish:
|
2021-02-03 08:55:11 +00:00
|
|
|
# the restart parameter allows to restart the command if it exits suddenly.
|
2020-10-31 15:36:09 +00:00
|
|
|
runOnPublishRestart: no
|
2020-07-30 11:43:10 +00:00
|
|
|
|
|
|
|
# command to run when a clients starts reading.
|
2020-10-27 23:29:53 +00:00
|
|
|
# this is terminated with SIGINT when a client stops reading.
|
2020-11-01 15:58:25 +00:00
|
|
|
# the path name is available in the RTSP_PATH variable.
|
2020-11-01 16:33:06 +00:00
|
|
|
# the server port is available in the RTSP_PORT variable.
|
2020-07-30 11:43:10 +00:00
|
|
|
runOnRead:
|
2021-02-03 08:55:11 +00:00
|
|
|
# the restart parameter allows to restart the command if it exits suddenly.
|
2020-10-31 15:36:09 +00:00
|
|
|
runOnReadRestart: no
|