mediamtx/rtsp-simple-server.yml

234 lines
9.7 KiB
YAML
Raw Normal View History

2021-02-03 08:55:11 +00:00
###############################################
# General parameters
2021-02-03 08:55:11 +00:00
2021-10-28 15:29:27 +00:00
# sets the verbosity of the program; available values are "error", "warn", "info", "debug".
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-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
# enable the HTTP API.
api: no
# address of the API listener.
apiAddress: 127.0.0.1:9997
# enable Prometheus-compatible metrics.
2021-02-03 08:55:11 +00:00
metrics: no
# address of the metrics listener.
metricsAddress: 127.0.0.1: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
# address of the pprof listener.
pprofAddress: 127.0.0.1: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 parameters
2021-01-31 15:58:57 +00:00
# disable support for the RTSP protocol.
rtspDisable: no
2021-10-22 16:41:10 +00:00
# supported RTSP transport protocols.
2021-07-04 16:16:17 +00:00
# UDP is the most performant, but doesn't work when there's a NAT/firewall between
2020-12-13 22:43:31 +00:00
# server and clients, and doesn't support encryption.
# UDP-multicast allows to save bandwidth when clients are all in the same LAN.
2020-12-13 22:43:31 +00:00
# TCP is the most versatile, and does support encryption.
# The handshake is always performed with TCP.
protocols: [udp, multicast, tcp]
2020-12-13 22:43:31 +00:00
# encrypt handshake and TCP streams with TLS (RTSPS).
# available values are "no", "strict", "optional".
encryption: "no"
# address of the TCP/RTSP listener. This is needed only when encryption is "no" or "optional".
rtspAddress: :8554
# address of the TCP/TLS/RTSPS listener. This is needed only when encryption is "strict" or "optional".
rtspsAddress: :8555
# address of the UDP/RTP listener. This is needed only when "udp" is in protocols.
rtpAddress: :8000
# address of the UDP/RTCP listener. This is needed only when "udp" is in protocols.
rtcpAddress: :8001
2021-06-21 15:28:00 +00:00
# IP range of all UDP-multicast listeners. This is needed only when "multicast" is in protocols.
multicastIPRange: 224.1.0.0/16
2021-06-21 15:28:00 +00:00
# port of all UDP-multicast/RTP listeners. This is needed only when "multicast" is in protocols.
multicastRTPPort: 8002
2021-06-21 15:28:00 +00:00
# port of all UDP-multicast/RTCP listeners. This is needed only when "multicast" is in protocols.
multicastRTCPPort: 8003
# path to the server key. This is needed only when encryption is "strict" or "optional".
# this can be generated with:
# openssl genrsa -out server.key 2048
# openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
2020-12-13 22:43:31 +00:00
serverKey: server.key
# path to the server certificate. This is needed only when encryption is "strict" or "optional".
2020-12-13 22:43:31 +00:00
serverCert: server.crt
# authentication methods.
authMethods: [basic, digest]
# 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 parameters
2020-08-05 09:20:11 +00:00
# disable support for the RTMP protocol.
rtmpDisable: no
# address of the RTMP listener.
rtmpAddress: :1935
2021-01-31 15:58:57 +00:00
2021-04-11 17:05:08 +00:00
###############################################
# HLS parameters
2021-04-11 17:05:08 +00:00
# disable support for the HLS protocol.
hlsDisable: no
# address of the HLS listener.
hlsAddress: :8888
2021-08-14 09:40:35 +00:00
# by default, HLS is generated only when requested by a user;
# this option allows to generate it always, avoiding an initial delay.
hlsAlwaysRemux: no
2021-04-11 17:05:08 +00:00
# number of HLS segments to generate.
# increasing segments allows more buffering,
# decreasing segments decreases latency.
2021-04-11 17:05:08 +00:00
hlsSegmentCount: 3
# minimum duration of each segment.
2021-08-14 09:40:35 +00:00
# the final segment duration is also influenced by the interval between IDR frames,
# since the server changes the segment duration to include at least a IDR frame in each one.
2021-04-11 17:05:08 +00:00
hlsSegmentDuration: 1s
# value of the Access-Control-Allow-Origin header provided in every HTTP response.
# This allows to play the HLS stream from an external website.
hlsAllowOrigin: '*'
2021-04-11 17:05:08 +00:00
2021-02-03 08:55:11 +00:00
###############################################
# Path parameters
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.
paths:
all:
# source of the stream - this can be:
# * publisher -> 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
2021-10-25 18:54:18 +00:00
# * rtsps://existing-url -> the stream is pulled from another RTSP server with RTSPS
2021-09-05 15:35:04 +00:00
# * rtmp://existing-url -> the stream is pulled from another RTMP server
# * http://existing-url/stream.m3u8 -> the stream is pulled from another HLS server
2021-10-25 18:54:18 +00:00
# * https://existing-url/stream.m3u8 -> the stream is pulled from another HLS server with HTTPS
2020-10-27 23:29:53 +00:00
# * redirect -> the stream is provided by another path or server
source: publisher
2020-10-27 23:29:53 +00:00
# if the source is an RTSP or RTSPS URL, this is the protocol that will be used to
# pull the stream. available values are "automatic", "udp", "multicast", "tcp".
# the TCP protocol can help to overcome the error "no UDP packets received recently".
sourceProtocol: automatic
# if the source is an RTSP or RTSPS URL, this allows to support cameras that
# don't provide server ports. This is a security issue and must be enabled only
# when interacting with old cameras that require it.
sourceAnyPortEnable: no
# if the source is a RTSPS or HTTPS URL, and the source certificate is self-signed
# or invalid, you can provide the fingerprint of the certificate in order to
# validate it anyway.
# the fingerprint can be obtained by running:
# openssl s_client -connect source_ip:source_port </dev/null 2>/dev/null | sed -n '/BEGIN/,/END/p' > server.crt
# openssl x509 -in server.crt -noout -fingerprint -sha256 | cut -d "=" -f2 | tr -d ':'
sourceFingerprint:
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.
sourceOnDemand: no
# 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
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:
# if the source is "publisher" 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 "publisher" 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:
# username required to publish.
2020-12-31 18:47:25 +00:00
# sha256-hashed values can be inserted with the "sha256:" prefix.
publishUser:
# password required to publish.
2020-12-31 18:47:25 +00:00
# sha256-hashed values can be inserted with the "sha256:" prefix.
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.
readUser:
# password required to read.
2020-12-31 18:47:25 +00:00
# sha256-hashed values can be inserted with the "sha256:" prefix.
readPass:
# ips or networks (x.x.x.x/24) allowed to read.
readIPs: []
# 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.
# 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.
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.
# 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.
# 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.
runOnDemandRestart: no
# 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.
# 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.
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.
# 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.
runOnReadRestart: no