config.yml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. # config.yml/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
  2. # This copyright was auto-generated on Tue Feb 18 18:41:31 UTC 2025
  3. ###############################################
  4. # Global settings
  5. # Settings in this section are applied anywhere.
  6. ###############################################
  7. # Global settings -> General
  8. # Verbosity of the program; available values are "error", "warn", "info", "debug".
  9. logLevel: info
  10. # Destinations of log messages; available values are "stdout", "file" and "syslog".
  11. logDestinations: [stdout]
  12. # If "file" is in logDestinations, this is the file which will receive the logs.
  13. logFile: mediamtx.log
  14. # Timeout of read operations.
  15. readTimeout: 10s
  16. # Timeout of write operations.
  17. writeTimeout: 10s
  18. # Size of the queue of outgoing packets.
  19. # A higher value allows to increase throughput, a lower value allows to save RAM.
  20. writeQueueSize: 512
  21. # Maximum size of outgoing UDP packets.
  22. # This can be decreased to avoid fragmentation on networks with a low UDP MTU.
  23. udpMaxPayloadSize: 1472
  24. # Command to run when a client connects to the server.
  25. # This is terminated with SIGINT when a client disconnects from the server.
  26. # The following environment variables are available:
  27. # * RTSP_PORT: RTSP server port
  28. # * MTX_CONN_TYPE: connection type
  29. # * MTX_CONN_ID: connection ID
  30. runOnConnect:
  31. # Restart the command if it exits.
  32. runOnConnectRestart: no
  33. # Command to run when a client disconnects from the server.
  34. # Environment variables are the same of runOnConnect.
  35. runOnDisconnect:
  36. ###############################################
  37. # Global settings -> Authentication
  38. # Authentication method. Available values are:
  39. # * internal: users are stored in the configuration file
  40. # * http: an external HTTP URL is contacted to perform authentication
  41. # * jwt: an external identity server provides authentication through JWTs
  42. authMethod: internal
  43. # Internal authentication.
  44. # list of users.
  45. authInternalUsers:
  46. # Default unprivileged user.
  47. # Username. 'any' means any user, including anonymous ones.
  48. - user: any
  49. # Password. Not used in case of 'any' user.
  50. pass:
  51. # IPs or networks allowed to use this user. An empty list means any IP.
  52. ips: []
  53. # List of permissions.
  54. permissions:
  55. # Available actions are: publish, read, playback, api, metrics, pprof.
  56. - action: publish
  57. # Paths can be set to further restrict access to a specific path.
  58. # An empty path means any path.
  59. # Regular expressions can be used by using a tilde as prefix.
  60. path:
  61. - action: read
  62. path:
  63. - action: playback
  64. path:
  65. # Default administrator.
  66. # This allows to use API, metrics and PPROF without authentication,
  67. # if the IP is localhost.
  68. - user: any
  69. pass:
  70. ips: ['127.0.0.1', '::1']
  71. permissions:
  72. - action: api
  73. - action: metrics
  74. - action: pprof
  75. # HTTP-based authentication.
  76. # URL called to perform authentication. Every time a user wants
  77. # to authenticate, the server calls this URL with the POST method
  78. # and a body containing:
  79. # {
  80. # "user": "user",
  81. # "password": "password",
  82. # "ip": "ip",
  83. # "action": "publish|read|playback|api|metrics|pprof",
  84. # "path": "path",
  85. # "protocol": "rtsp|rtmp|hls|webrtc|srt",
  86. # "id": "id",
  87. # "query": "query"
  88. # }
  89. # If the response code is 20x, authentication is accepted, otherwise
  90. # it is discarded.
  91. authHTTPAddress:
  92. # Actions to exclude from HTTP-based authentication.
  93. # Format is the same as the one of user permissions.
  94. authHTTPExclude:
  95. - action: api
  96. - action: metrics
  97. - action: pprof
  98. # JWT-based authentication.
  99. # Users have to login through an external identity server and obtain a JWT.
  100. # This JWT must contain the claim "mediamtx_permissions" with permissions,
  101. # for instance:
  102. # {
  103. # ...
  104. # "mediamtx_permissions": [
  105. # {
  106. # "action": "publish",
  107. # "path": "somepath"
  108. # }
  109. # ]
  110. # }
  111. # Users are expected to pass the JWT in the Authorization header or as a query parameter.
  112. # This is the JWKS URL that will be used to pull (once) the public key that allows
  113. # to validate JWTs.
  114. authJWTJWKS:
  115. # name of the claim that contains permissions.
  116. authJWTClaimKey: mediamtx_permissions
  117. ###############################################
  118. # Global settings -> Control API
  119. # Enable controlling the server through the Control API.
  120. api: yes
  121. # Address of the Control API listener.
  122. apiAddress: :9997
  123. # Enable TLS/HTTPS on the Control API server.
  124. apiEncryption: no
  125. # Path to the server key. This is needed only when encryption is yes.
  126. # This can be generated with:
  127. # openssl genrsa -out server.key 2048
  128. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  129. apiServerKey: server.key
  130. # Path to the server certificate.
  131. apiServerCert: server.crt
  132. # Value of the Access-Control-Allow-Origin header provided in every HTTP response.
  133. apiAllowOrigin: '*'
  134. # List of IPs or CIDRs of proxies placed before the HTTP server.
  135. # If the server receives a request from one of these entries, IP in logs
  136. # will be taken from the X-Forwarded-For header.
  137. apiTrustedProxies: []
  138. ###############################################
  139. # Global settings -> Metrics
  140. # Enable Prometheus-compatible metrics.
  141. metrics: no
  142. # Address of the metrics HTTP listener.
  143. metricsAddress: :9998
  144. # Enable TLS/HTTPS on the Metrics server.
  145. metricsEncryption: no
  146. # Path to the server key. This is needed only when encryption is yes.
  147. # This can be generated with:
  148. # openssl genrsa -out server.key 2048
  149. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  150. metricsServerKey: server.key
  151. # Path to the server certificate.
  152. metricsServerCert: server.crt
  153. # Value of the Access-Control-Allow-Origin header provided in every HTTP response.
  154. metricsAllowOrigin: '*'
  155. # List of IPs or CIDRs of proxies placed before the HTTP server.
  156. # If the server receives a request from one of these entries, IP in logs
  157. # will be taken from the X-Forwarded-For header.
  158. metricsTrustedProxies: []
  159. ###############################################
  160. # Global settings -> PPROF
  161. # Enable pprof-compatible endpoint to monitor performances.
  162. pprof: no
  163. # Address of the pprof listener.
  164. pprofAddress: :9999
  165. # Enable TLS/HTTPS on the pprof server.
  166. pprofEncryption: no
  167. # Path to the server key. This is needed only when encryption is yes.
  168. # This can be generated with:
  169. # openssl genrsa -out server.key 2048
  170. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  171. pprofServerKey: server.key
  172. # Path to the server certificate.
  173. pprofServerCert: server.crt
  174. # Value of the Access-Control-Allow-Origin header provided in every HTTP response.
  175. pprofAllowOrigin: '*'
  176. # List of IPs or CIDRs of proxies placed before the HTTP server.
  177. # If the server receives a request from one of these entries, IP in logs
  178. # will be taken from the X-Forwarded-For header.
  179. pprofTrustedProxies: []
  180. ###############################################
  181. # Global settings -> Playback server
  182. # Enable downloading recordings from the playback server.
  183. playback: no
  184. # Address of the playback server listener.
  185. playbackAddress: :9996
  186. # Enable TLS/HTTPS on the playback server.
  187. playbackEncryption: no
  188. # Path to the server key. This is needed only when encryption is yes.
  189. # This can be generated with:
  190. # openssl genrsa -out server.key 2048
  191. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  192. playbackServerKey: server.key
  193. # Path to the server certificate.
  194. playbackServerCert: server.crt
  195. # Value of the Access-Control-Allow-Origin header provided in every HTTP response.
  196. playbackAllowOrigin: '*'
  197. # List of IPs or CIDRs of proxies placed before the HTTP server.
  198. # If the server receives a request from one of these entries, IP in logs
  199. # will be taken from the X-Forwarded-For header.
  200. playbackTrustedProxies: []
  201. ###############################################
  202. # Global settings -> RTSP server
  203. # Enable publishing and reading streams with the RTSP protocol.
  204. rtsp: yes
  205. # List of enabled RTSP transport protocols.
  206. # UDP is the most performant, but doesn't work when there's a NAT/firewall between
  207. # server and clients, and doesn't support encryption.
  208. # UDP-multicast allows to save bandwidth when clients are all in the same LAN.
  209. # TCP is the most versatile, and does support encryption.
  210. # The handshake is always performed with TCP.
  211. protocols: [udp, multicast, tcp]
  212. # Encrypt handshakes and TCP streams with TLS (RTSPS).
  213. # Available values are "no", "strict", "optional".
  214. encryption: 'no'
  215. # Address of the TCP/RTSP listener. This is needed only when encryption is "no" or "optional".
  216. rtspAddress: :8554
  217. # Address of the TCP/TLS/RTSPS listener. This is needed only when encryption is "strict" or "optional".
  218. rtspsAddress: :8322
  219. # Address of the UDP/RTP listener. This is needed only when "udp" is in protocols.
  220. rtpAddress: :8000
  221. # Address of the UDP/RTCP listener. This is needed only when "udp" is in protocols.
  222. rtcpAddress: :8001
  223. # IP range of all UDP-multicast listeners. This is needed only when "multicast" is in protocols.
  224. multicastIPRange: 224.1.0.0/16
  225. # Port of all UDP-multicast/RTP listeners. This is needed only when "multicast" is in protocols.
  226. multicastRTPPort: 8002
  227. # Port of all UDP-multicast/RTCP listeners. This is needed only when "multicast" is in protocols.
  228. multicastRTCPPort: 8003
  229. # Path to the server key. This is needed only when encryption is "strict" or "optional".
  230. # This can be generated with:
  231. # openssl genrsa -out server.key 2048
  232. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  233. serverKey: server.key
  234. # Path to the server certificate. This is needed only when encryption is "strict" or "optional".
  235. serverCert: server.crt
  236. # Authentication methods. Available are "basic" and "digest".
  237. # "digest" doesn't provide any additional security and is available for compatibility only.
  238. rtspAuthMethods: [basic]
  239. ###############################################
  240. # Global settings -> RTMP server
  241. # Enable publishing and reading streams with the RTMP protocol.
  242. rtmp: yes
  243. # Address of the RTMP listener. This is needed only when encryption is "no" or "optional".
  244. rtmpAddress: :1935
  245. # Encrypt connections with TLS (RTMPS).
  246. # Available values are "no", "strict", "optional".
  247. rtmpEncryption: 'no'
  248. # Address of the RTMPS listener. This is needed only when encryption is "strict" or "optional".
  249. rtmpsAddress: :1936
  250. # Path to the server key. This is needed only when encryption is "strict" or "optional".
  251. # This can be generated with:
  252. # openssl genrsa -out server.key 2048
  253. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  254. rtmpServerKey: server.key
  255. # Path to the server certificate. This is needed only when encryption is "strict" or "optional".
  256. rtmpServerCert: server.crt
  257. ###############################################
  258. # Global settings -> HLS server
  259. # Enable reading streams with the HLS protocol.
  260. hls: yes
  261. # Address of the HLS listener.
  262. hlsAddress: :8888
  263. # Enable TLS/HTTPS on the HLS server.
  264. # This is required for Low-Latency HLS.
  265. hlsEncryption: no
  266. # Path to the server key. This is needed only when encryption is yes.
  267. # This can be generated with:
  268. # openssl genrsa -out server.key 2048
  269. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  270. hlsServerKey: server.key
  271. # Path to the server certificate.
  272. hlsServerCert: server.crt
  273. # Value of the Access-Control-Allow-Origin header provided in every HTTP response.
  274. # This allows to play the HLS stream from an external website.
  275. hlsAllowOrigin: '*'
  276. # List of IPs or CIDRs of proxies placed before the HLS server.
  277. # If the server receives a request from one of these entries, IP in logs
  278. # will be taken from the X-Forwarded-For header.
  279. hlsTrustedProxies: []
  280. # By default, HLS is generated only when requested by a user.
  281. # This option allows to generate it always, avoiding the delay between request and generation.
  282. hlsAlwaysRemux: no
  283. # Variant of the HLS protocol to use. Available options are:
  284. # * mpegts - uses MPEG-TS segments, for maximum compatibility.
  285. # * fmp4 - uses fragmented MP4 segments, more efficient.
  286. # * lowLatency - uses Low-Latency HLS.
  287. hlsVariant: lowLatency
  288. # Number of HLS segments to keep on the server.
  289. # Segments allow to seek through the stream.
  290. # Their number doesn't influence latency.
  291. hlsSegmentCount: 7
  292. # Minimum duration of each segment.
  293. # A player usually puts 3 segments in a buffer before reproducing the stream.
  294. # The final segment duration is also influenced by the interval between IDR frames,
  295. # since the server changes the duration in order to include at least one IDR frame
  296. # in each segment.
  297. hlsSegmentDuration: 1s
  298. # Minimum duration of each part.
  299. # A player usually puts 3 parts in a buffer before reproducing the stream.
  300. # Parts are used in Low-Latency HLS in place of segments.
  301. # Part duration is influenced by the distance between video/audio samples
  302. # and is adjusted in order to produce segments with a similar duration.
  303. hlsPartDuration: 200ms
  304. # Maximum size of each segment.
  305. # This prevents RAM exhaustion.
  306. hlsSegmentMaxSize: 50M
  307. # Directory in which to save segments, instead of keeping them in the RAM.
  308. # This decreases performance, since reading from disk is less performant than
  309. # reading from RAM, but allows to save RAM.
  310. hlsDirectory: ''
  311. # The muxer will be closed when there are no
  312. # reader requests and this amount of time has passed.
  313. hlsMuxerCloseAfter: 60s
  314. ###############################################
  315. # Global settings -> WebRTC server
  316. # Enable publishing and reading streams with the WebRTC protocol.
  317. webrtc: yes
  318. # Address of the WebRTC HTTP listener.
  319. webrtcAddress: :8889
  320. # Enable TLS/HTTPS on the WebRTC server.
  321. webrtcEncryption: no
  322. # Path to the server key.
  323. # This can be generated with:
  324. # openssl genrsa -out server.key 2048
  325. # openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
  326. webrtcServerKey: server.key
  327. # Path to the server certificate.
  328. webrtcServerCert: server.crt
  329. # Value of the Access-Control-Allow-Origin header provided in every HTTP response.
  330. # This allows to play the WebRTC stream from an external website.
  331. webrtcAllowOrigin: '*'
  332. # List of IPs or CIDRs of proxies placed before the WebRTC server.
  333. # If the server receives a request from one of these entries, IP in logs
  334. # will be taken from the X-Forwarded-For header.
  335. webrtcTrustedProxies: []
  336. # Address of a local UDP listener that will receive connections.
  337. # Use a blank string to disable.
  338. webrtcLocalUDPAddress: :8189
  339. # Address of a local TCP listener that will receive connections.
  340. # This is disabled by default since TCP is less efficient than UDP and
  341. # introduces a progressive delay when network is congested.
  342. webrtcLocalTCPAddress: ''
  343. # WebRTC clients need to know the IP of the server.
  344. # Gather IPs from interfaces and send them to clients.
  345. webrtcIPsFromInterfaces: yes
  346. # List of interfaces whose IPs will be sent to clients.
  347. # An empty value means to use all available interfaces.
  348. webrtcIPsFromInterfacesList: []
  349. # List of additional hosts or IPs to send to clients.
  350. webrtcAdditionalHosts: []
  351. # ICE servers. Needed only when local listeners can't be reached by clients.
  352. # STUN servers allows to obtain and share the public IP of the server.
  353. # TURN/TURNS servers forces all traffic through them.
  354. webrtcICEServers2:
  355. []
  356. # - url: stun:stun.l.google.com:19302
  357. # if user is "AUTH_SECRET", then authentication is secret based.
  358. # the secret must be inserted into the password field.
  359. # username: ''
  360. # password: ''
  361. # clientOnly: false
  362. # Time to wait for the WebRTC handshake to complete.
  363. webrtcHandshakeTimeout: 10s
  364. # Maximum time to gather video tracks.
  365. webrtcTrackGatherTimeout: 2s
  366. ###############################################
  367. # Global settings -> SRT server
  368. # Enable publishing and reading streams with the SRT protocol.
  369. srt: yes
  370. # Address of the SRT listener.
  371. srtAddress: :8890
  372. ###############################################
  373. # Default path settings
  374. # Settings in "pathDefaults" are applied anywhere,
  375. # unless they are overridden in "paths".
  376. pathDefaults:
  377. ###############################################
  378. # Default path settings -> General
  379. # Source of the stream. This can be:
  380. # * publisher -> the stream is provided by a RTSP, RTMP, WebRTC or SRT client
  381. # * rtsp://existing-url -> the stream is pulled from another RTSP server / camera
  382. # * rtsps://existing-url -> the stream is pulled from another RTSP server / camera with RTSPS
  383. # * rtmp://existing-url -> the stream is pulled from another RTMP server / camera
  384. # * rtmps://existing-url -> the stream is pulled from another RTMP server / camera with RTMPS
  385. # * http://existing-url/stream.m3u8 -> the stream is pulled from another HLS server / camera
  386. # * https://existing-url/stream.m3u8 -> the stream is pulled from another HLS server / camera with HTTPS
  387. # * udp://ip:port -> the stream is pulled with UDP, by listening on the specified IP and port
  388. # * srt://existing-url -> the stream is pulled from another SRT server / camera
  389. # * whep://existing-url -> the stream is pulled from another WebRTC server / camera
  390. # * wheps://existing-url -> the stream is pulled from another WebRTC server / camera with HTTPS
  391. # * redirect -> the stream is provided by another path or server
  392. # * rpiCamera -> the stream is provided by a Raspberry Pi Camera
  393. # The following variables can be used in the source string:
  394. # * $MTX_QUERY: query parameters (passed by first reader)
  395. # * $G1, $G2, ...: regular expression groups, if path name is
  396. # a regular expression.
  397. source: publisher
  398. # If the source is a URL, and the source certificate is self-signed
  399. # or invalid, you can provide the fingerprint of the certificate in order to
  400. # validate it anyway. It can be obtained by running:
  401. # openssl s_client -connect source_ip:source_port </dev/null 2>/dev/null | sed -n '/BEGIN/,/END/p' > server.crt
  402. # openssl x509 -in server.crt -noout -fingerprint -sha256 | cut -d "=" -f2 | tr -d ':'
  403. sourceFingerprint:
  404. # If the source is a URL, it will be pulled only when at least
  405. # one reader is connected, saving bandwidth.
  406. sourceOnDemand: no
  407. # If sourceOnDemand is "yes", readers will be put on hold until the source is
  408. # ready or until this amount of time has passed.
  409. sourceOnDemandStartTimeout: 10s
  410. # If sourceOnDemand is "yes", the source will be closed when there are no
  411. # readers connected and this amount of time has passed.
  412. sourceOnDemandCloseAfter: 10s
  413. # Maximum number of readers. Zero means no limit.
  414. maxReaders: 0
  415. # SRT encryption passphrase require to read from this path
  416. srtReadPassphrase:
  417. # If the stream is not available, redirect readers to this path.
  418. # It can be can be a relative path (i.e. /otherstream) or an absolute RTSP URL.
  419. fallback:
  420. ###############################################
  421. # Default path settings -> Record
  422. # Record streams to disk.
  423. record: no
  424. # Path of recording segments.
  425. # Extension is added automatically.
  426. # Available variables are %path (path name), %Y %m %d %H %M %S %f %s (time in strftime format)
  427. recordPath: ./recordings/%path/%Y-%m-%d_%H-%M-%S-%f
  428. # Format of recorded segments.
  429. # Available formats are "fmp4" (fragmented MP4) and "mpegts" (MPEG-TS).
  430. recordFormat: fmp4
  431. # fMP4 segments are concatenation of small MP4 files (parts), each with this duration.
  432. # MPEG-TS segments are concatenation of 188-bytes packets, flushed to disk with this period.
  433. # When a system failure occurs, the last part gets lost.
  434. # Therefore, the part duration is equal to the RPO (recovery point objective).
  435. recordPartDuration: 1s
  436. # Minimum duration of each segment.
  437. recordSegmentDuration: 1h
  438. # Delete segments after this timespan.
  439. # Set to 0s to disable automatic deletion.
  440. recordDeleteAfter: 24h
  441. ###############################################
  442. # Default path settings -> Publisher source (when source is "publisher")
  443. # Allow another client to disconnect the current publisher and publish in its place.
  444. overridePublisher: yes
  445. # SRT encryption passphrase required to publish to this path
  446. srtPublishPassphrase:
  447. ###############################################
  448. # Default path settings -> RTSP source (when source is a RTSP or a RTSPS URL)
  449. # Transport protocol used to pull the stream. available values are "automatic", "udp", "multicast", "tcp".
  450. rtspTransport: automatic
  451. # Support sources that don't provide server ports or use random server ports. This is a security issue
  452. # and must be used only when interacting with sources that require it.
  453. rtspAnyPort: no
  454. # Range header to send to the source, in order to start streaming from the specified offset.
  455. # available values:
  456. # * clock: Absolute time
  457. # * npt: Normal Play Time
  458. # * smpte: SMPTE timestamps relative to the start of the recording
  459. rtspRangeType:
  460. # Available values:
  461. # * clock: UTC ISO 8601 combined date and time string, e.g. 20230812T120000Z
  462. # * npt: duration such as "300ms", "1.5m" or "2h45m", valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h"
  463. # * smpte: duration such as "300ms", "1.5m" or "2h45m", valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h"
  464. rtspRangeStart:
  465. ###############################################
  466. # Default path settings -> Redirect source (when source is "redirect")
  467. # RTSP URL which clients will be redirected to.
  468. sourceRedirect:
  469. ###############################################
  470. # Default path settings -> Raspberry Pi Camera source (when source is "rpiCamera")
  471. # ID of the camera
  472. rpiCameraCamID: 0
  473. # Width of frames
  474. rpiCameraWidth: 1920
  475. # Height of frames
  476. rpiCameraHeight: 1080
  477. # Flip horizontally
  478. rpiCameraHFlip: false
  479. # Flip vertically
  480. rpiCameraVFlip: false
  481. # Brightness [-1, 1]
  482. rpiCameraBrightness: 0
  483. # Contrast [0, 16]
  484. rpiCameraContrast: 1
  485. # Saturation [0, 16]
  486. rpiCameraSaturation: 1
  487. # Sharpness [0, 16]
  488. rpiCameraSharpness: 1
  489. # Exposure mode.
  490. # values: normal, short, long, custom
  491. rpiCameraExposure: normal
  492. # Auto-white-balance mode.
  493. # values: auto, incandescent, tungsten, fluorescent, indoor, daylight, cloudy, custom
  494. rpiCameraAWB: auto
  495. # Auto-white-balance fixed gains. This can be used in place of rpiCameraAWB.
  496. # format: [red,blue]
  497. rpiCameraAWBGains: [0, 0]
  498. # Denoise operating mode.
  499. # values: off, cdn_off, cdn_fast, cdn_hq
  500. rpiCameraDenoise: 'off'
  501. # Fixed shutter speed, in microseconds.
  502. rpiCameraShutter: 0
  503. # Metering mode of the AEC/AGC algorithm.
  504. # values: centre, spot, matrix, custom
  505. rpiCameraMetering: centre
  506. # Fixed gain
  507. rpiCameraGain: 0
  508. # EV compensation of the image [-10, 10]
  509. rpiCameraEV: 0
  510. # Region of interest, in format x,y,width,height
  511. rpiCameraROI:
  512. # Whether to enable HDR on Raspberry Camera 3.
  513. rpiCameraHDR: false
  514. # Tuning file
  515. rpiCameraTuningFile:
  516. # Sensor mode, in format [width]:[height]:[bit-depth]:[packing]
  517. # bit-depth and packing are optional.
  518. rpiCameraMode:
  519. # frames per second
  520. rpiCameraFPS: 30
  521. # Autofocus mode
  522. # values: auto, manual, continuous
  523. rpiCameraAfMode: continuous
  524. # Autofocus range
  525. # values: normal, macro, full
  526. rpiCameraAfRange: normal
  527. # Autofocus speed
  528. # values: normal, fast
  529. rpiCameraAfSpeed: normal
  530. # Lens position (for manual autofocus only), will be set to focus to a specific distance
  531. # calculated by the following formula: d = 1 / value
  532. # Examples: 0 moves the lens to infinity.
  533. # 0.5 moves the lens to focus on objects 2m away.
  534. # 2 moves the lens to focus on objects 50cm away.
  535. rpiCameraLensPosition: 0.0
  536. # Specifies the autofocus window, in the form x,y,width,height where the coordinates
  537. # are given as a proportion of the entire image.
  538. rpiCameraAfWindow:
  539. # Manual flicker correction period, in microseconds.
  540. rpiCameraFlickerPeriod: 0
  541. # Enables printing text on each frame.
  542. rpiCameraTextOverlayEnable: false
  543. # Text that is printed on each frame.
  544. # format is the one of the strftime() function.
  545. rpiCameraTextOverlay: '%Y-%m-%d %H:%M:%S - MediaMTX'
  546. # Codec. Available values: auto, hardwareH264, softwareH264
  547. rpiCameraCodec: auto
  548. # Period between IDR frames
  549. rpiCameraIDRPeriod: 60
  550. # Bitrate
  551. rpiCameraBitrate: 5000000
  552. # H264 profile
  553. rpiCameraProfile: main
  554. # H264 level
  555. rpiCameraLevel: '4.1'
  556. ###############################################
  557. # Default path settings -> Hooks
  558. # Command to run when this path is initialized.
  559. # This can be used to publish a stream when the server is launched.
  560. # This is terminated with SIGINT when the program closes.
  561. # The following environment variables are available:
  562. # * MTX_PATH: path name
  563. # * RTSP_PORT: RTSP server port
  564. # * G1, G2, ...: regular expression groups, if path name is
  565. # a regular expression.
  566. runOnInit:
  567. # Restart the command if it exits.
  568. runOnInitRestart: no
  569. # Command to run when this path is requested by a reader
  570. # and no one is publishing to this path yet.
  571. # This can be used to publish a stream on demand.
  572. # This is terminated with SIGINT when there are no readers anymore.
  573. # The following environment variables are available:
  574. # * MTX_PATH: path name
  575. # * MTX_QUERY: query parameters (passed by first reader)
  576. # * RTSP_PORT: RTSP server port
  577. # * G1, G2, ...: regular expression groups, if path name is
  578. # a regular expression.
  579. runOnDemand:
  580. # Restart the command if it exits.
  581. runOnDemandRestart: no
  582. # Readers will be put on hold until the runOnDemand command starts publishing
  583. # or until this amount of time has passed.
  584. runOnDemandStartTimeout: 10s
  585. # The command will be closed when there are no
  586. # readers connected and this amount of time has passed.
  587. runOnDemandCloseAfter: 10s
  588. # Command to run when there are no readers anymore.
  589. # Environment variables are the same of runOnDemand.
  590. runOnUnDemand:
  591. # Command to run when the stream is ready to be read, whenever it is
  592. # published by a client or pulled from a server / camera.
  593. # This is terminated with SIGINT when the stream is not ready anymore.
  594. # The following environment variables are available:
  595. # * MTX_PATH: path name
  596. # * MTX_QUERY: query parameters (passed by publisher)
  597. # * RTSP_PORT: RTSP server port
  598. # * G1, G2, ...: regular expression groups, if path name is
  599. # a regular expression.
  600. # * MTX_SOURCE_TYPE: source type
  601. # * MTX_SOURCE_ID: source ID
  602. runOnReady:
  603. # Restart the command if it exits.
  604. runOnReadyRestart: no
  605. # Command to run when the stream is not available anymore.
  606. # Environment variables are the same of runOnReady.
  607. runOnNotReady:
  608. # Command to run when a client starts reading.
  609. # This is terminated with SIGINT when a client stops reading.
  610. # The following environment variables are available:
  611. # * MTX_PATH: path name
  612. # * MTX_QUERY: query parameters (passed by reader)
  613. # * RTSP_PORT: RTSP server port
  614. # * G1, G2, ...: regular expression groups, if path name is
  615. # a regular expression.
  616. # * MTX_READER_TYPE: reader type
  617. # * MTX_READER_ID: reader ID
  618. runOnRead:
  619. # Restart the command if it exits.
  620. runOnReadRestart: no
  621. # Command to run when a client stops reading.
  622. # Environment variables are the same of runOnRead.
  623. runOnUnread:
  624. # Command to run when a recording segment is created.
  625. # The following environment variables are available:
  626. # * MTX_PATH: path name
  627. # * RTSP_PORT: RTSP server port
  628. # * G1, G2, ...: regular expression groups, if path name is
  629. # a regular expression.
  630. # * MTX_SEGMENT_PATH: segment file path
  631. runOnRecordSegmentCreate:
  632. # Command to run when a recording segment is complete.
  633. # The following environment variables are available:
  634. # * MTX_PATH: path name
  635. # * RTSP_PORT: RTSP server port
  636. # * G1, G2, ...: regular expression groups, if path name is
  637. # a regular expression.
  638. # * MTX_SEGMENT_PATH: segment file path
  639. # * MTX_SEGMENT_DURATION: segment duration
  640. runOnRecordSegmentComplete:
  641. ###############################################
  642. # Path settings
  643. # Settings in "paths" are applied to specific paths, and the map key
  644. # is the name of the path.
  645. # Any setting in "pathDefaults" can be overridden here.
  646. # It's possible to use regular expressions by using a tilde as prefix,
  647. # for example "~^(test1|test2)$" will match both "test1" and "test2",
  648. # for example "~^prefix" will match all paths that start with "prefix".
  649. paths:
  650. # example:
  651. # my_camera:
  652. # source: rtsp://my_camera
  653. # Settings under path "all_others" are applied to all paths that
  654. # do not match another entry.
  655. all_others: