diff --git a/.github/DISCUSSION_TEMPLATE/questions.yml b/.github/DISCUSSION_TEMPLATE/questions.yml index 48d47f33..6270477f 100644 --- a/.github/DISCUSSION_TEMPLATE/questions.yml +++ b/.github/DISCUSSION_TEMPLATE/questions.yml @@ -6,9 +6,11 @@ body: * If you are asking for help because you're having trouble doing something, provide enough informations to replicate the problem. In particular, include in the question: * MediaMTX version - * precise instructions on how to replicate the problem + * List and version of any other software or device involved * MediaMTX configuration * MediaMTX logs with setting `logLevel` set to `debug` + * MediaMTX packet dumps, generated with `dumpPackets` set to `true` + * precise instructions on how to replicate the problem * If you are asking for help and you think MediaMTX is misbehaving, open a bug report, NOT a discussion. diff --git a/docs/2-publish/04-webrtc-clients.md b/docs/2-publish/04-webrtc-clients.md index 09b9f21d..b364f308 100644 --- a/docs/2-publish/04-webrtc-clients.md +++ b/docs/2-publish/04-webrtc-clients.md @@ -14,7 +14,7 @@ WHIP is a WebRTC extension that allows to publish streams by using a URL, withou http://localhost:8889/mystream/whip ``` -Be aware that not all browsers can read any codec, check [Supported browsers](../4-other/22-webrtc-specific-features.md#codec-support-in-browsers). +Be aware that not all browsers can read any codec, check [Codec support in browsers](../4-other/22-webrtc-specific-features.md#codec-support-in-browsers). Depending on the network it might be difficult to establish a connection between server and clients, read [Solving WebRTC connectivity issues](../4-other/22-webrtc-specific-features.md#solving-webrtc-connectivity-issues). diff --git a/docs/3-read/03-webrtc.md b/docs/3-read/03-webrtc.md index 86734b0e..64114f76 100644 --- a/docs/3-read/03-webrtc.md +++ b/docs/3-read/03-webrtc.md @@ -12,7 +12,7 @@ WHEP is a WebRTC extension that allows to read streams by using a URL, without p http://localhost:8889/mystream/whep ``` -Be aware that not all browsers can read any codec, check [Supported browsers](../4-other/22-webrtc-specific-features.md#codec-support-in-browsers). +Be aware that not all browsers can read any codec, check [Codec support in browsers](../4-other/22-webrtc-specific-features.md#codec-support-in-browsers). Depending on the network it may be difficult to establish a connection between server and clients, read [Solving WebRTC connectivity issues](../4-other/22-webrtc-specific-features.md#solving-webrtc-connectivity-issues). diff --git a/docs/4-other/02-configuration.md b/docs/4-other/02-configuration.md index 5f50d8fa..50eb0236 100644 --- a/docs/4-other/02-configuration.md +++ b/docs/4-other/02-configuration.md @@ -18,32 +18,32 @@ There are several ways to change the configuration: 2. By overriding configuration parameters with environment variables, in the format `MTX_PARAMNAME`, where `PARAMNAME` is the uppercase name of a parameter. For instance, the `rtspAddress` parameter can be overridden in the following way: - ``` + ```sh MTX_RTSPADDRESS="127.0.0.1:8554" ./mediamtx ``` Parameters that have array as value can be overridden by setting a comma-separated list. For example: - ``` + ```sh MTX_RTSPTRANSPORTS="tcp,udp" ``` Parameters in maps can be overridden by using underscores, in the following way: - ``` + ```sh MTX_PATHS_TEST_SOURCE=rtsp://myurl ./mediamtx ``` Parameters in lists can be overridden in the same way as parameters in maps, using their position like an additional key. This is particularly useful if you want to use internal users but define credentials through environment variables: - ``` + ```sh MTX_AUTHINTERNALUSERS_0_USER=username MTX_AUTHINTERNALUSERS_0_PASS=password ``` This method is particularly useful when using Docker; any configuration parameter can be changed by passing environment variables with the `-e` flag: - ``` + ```sh docker run --rm -it --network=host -e MTX_PATHS_TEST_SOURCE=rtsp://myurl bluenviron/mediamtx:1 ``` @@ -51,10 +51,10 @@ There are several ways to change the configuration: ## Encrypt the configuration -The configuration file can be entirely encrypted for security purposes by using the `crypto_secretbox` function of the NaCL function. An online tool for performing this operation is [available here](https://play.golang.org/p/rX29jwObNe4). +The configuration file can be entirely encrypted for security purposes by using the `crypto_secretbox` function of the NaCL library. An online tool for performing this operation is [available here](https://play.golang.org/p/rX29jwObNe4). After performing the encryption, put the base64-encoded result into the configuration file, and launch the server with the `MTX_CONFKEY` variable: -``` +```sh MTX_CONFKEY=mykey ./mediamtx ``` diff --git a/docs/4-other/18-control-api.md b/docs/4-other/18-control-api.md index e28605d5..7b3d6431 100644 --- a/docs/4-other/18-control-api.md +++ b/docs/4-other/18-control-api.md @@ -14,4 +14,4 @@ curl http://127.0.0.1:9997/v3/paths/list The control API is documented in the [Control API Reference page](../5-references/2-control-api.md) and in the [OpenAPI / Swagger file](https://github.com/bluenviron/mediamtx/blob/{version_tag}/api/openapi.yaml). -Be aware that by default the Control API is accessible by localhost only; to increase visibility or add authentication, check [Authentication](03-authentication.md). +Be aware that by default the Control API is accessible by localhost only; to increase visibility or enforce authentication, check [Authentication](03-authentication.md). diff --git a/docs/4-other/21-srt-specific-features.md b/docs/4-other/21-srt-specific-features.md index 9ceb2ae2..27fa3ee6 100644 --- a/docs/4-other/21-srt-specific-features.md +++ b/docs/4-other/21-srt-specific-features.md @@ -1,6 +1,6 @@ # SRT-specific features -SRT is a protocol that can be used for publishing and reading streams. Regarding specific tasks, read [Publish](../2-publish/02-srt-clients.md) and [Read](../3-read/02-srt.md). Features in this page are shared among both tasks. +SRT is a protocol that can be used for publishing and reading streams. Regarding specific tasks, check out [Publish](../2-publish/02-srt-clients.md) and [Read](../3-read/02-srt.md). Features in this page are shared among both tasks. ## Standard stream ID syntax diff --git a/docs/4-other/22-webrtc-specific-features.md b/docs/4-other/22-webrtc-specific-features.md index deefbfa6..384fb26b 100644 --- a/docs/4-other/22-webrtc-specific-features.md +++ b/docs/4-other/22-webrtc-specific-features.md @@ -1,19 +1,20 @@ # WebRTC-specific features -WebRTC is a protocol that can be used for publishing and reading streams. Regarding specific tasks, read [Publish](../2-publish/04-webrtc-clients.md) and [Read](../3-read/03-webrtc.md). Features in this page are shared among both tasks. +WebRTC is a protocol that can be used for publishing and reading streams. Regarding specific tasks, check out [Publish](../2-publish/04-webrtc-clients.md) and [Read](../3-read/03-webrtc.md). Features in this page are shared among both tasks. ## Codec support in browsers -The server can ingest and broadcast with WebRTC a wide variety of video and audio codecs (that are listed at the beginning of the README), but not all browsers can publish and read all codecs due to internal limitations that cannot be overcome by this or any other server. +WebRTC can be used to publish and read streams encoded with a wide variety of video and audio codecs, that are listed in [Publish a stream](../2-publish/01-overview.md) and [Read a stream](../3-read/01-overview.md), but not every browser can publish and read streams with every codec due to internal limitations that cannot be overcome by this or any other server. -In particular, reading and publishing H265 tracks with WebRTC was not possible until some time ago due to lack of browser support. The situation improved recently and can be described as following: +You can check what codecs your browser supports by [using this tool](https://jsfiddle.net/v24s8q1f/). -- Safari on iOS and macOS fully support publishing and reading H265 tracks. -- Chrome on Windows supports publishing and reading H265 tracks when a capable GPU is present. +In particular, the following codecs might cause compatibility issues: -You can check what codecs your browser can publish or read with WebRTC by [using this tool](https://jsfiddle.net/v24s8q1f/). +- H265. Lots of browsers do not support reading H265 tracks with WebRTC, others do only if some strict conditions are met. For instance, Chrome supports publishing and reading H265 tracks only on Windows and only when a capable GPU is present. -If you want to support most browsers, you can re-encode the stream by using H264 and Opus codecs, for instance by using FFmpeg: +- H264, when the stream contains B-frames. These are not part of the WebRTC specification and support for them has been intentionally left out by every browser. + +In order to support most browsers, you can re-encode the stream by using the H264 codec with the baseline profile (which does not produce B-frames) and the Opus codec, for instance by using FFmpeg: ```sh ffmpeg -i rtsp://original-source \ diff --git a/docs/4-other/23-rtsp-specific-features.md b/docs/4-other/23-rtsp-specific-features.md index e3521e54..207f689d 100644 --- a/docs/4-other/23-rtsp-specific-features.md +++ b/docs/4-other/23-rtsp-specific-features.md @@ -1,6 +1,6 @@ # RTSP-specific features -RTSP is a protocol that can be used for publishing and reading streams. Regarding specific tasks, read [Publish](../2-publish/06-rtsp-clients.md) and [Read](../3-read/04-rtsp.md). Features in this page are shared among both tasks. +RTSP is a protocol that can be used for publishing and reading streams. Regarding specific tasks, check out [Publish](../2-publish/06-rtsp-clients.md) and [Read](../3-read/04-rtsp.md). Features in this page are shared among both tasks. ## Transport protocols diff --git a/docs/4-other/24-rtmp-specific-features.md b/docs/4-other/24-rtmp-specific-features.md index f1cd1bf2..3255ca92 100644 --- a/docs/4-other/24-rtmp-specific-features.md +++ b/docs/4-other/24-rtmp-specific-features.md @@ -1,6 +1,6 @@ # RTMP-specific features -RTMP is a protocol that can be used for publishing and reading streams. Regarding specific tasks, read [Publish](../2-publish/08-rtmp-clients.md) and [Read](../3-read/05-rtmp.md). Features in this page are shared among both tasks. +RTMP is a protocol that can be used for publishing and reading streams. Regarding specific tasks, check out [Publish](../2-publish/08-rtmp-clients.md) and [Read](../3-read/05-rtmp.md). Features in this page are shared among both tasks. ## Encryption diff --git a/mediamtx.yml b/mediamtx.yml index ef84f77d..47f04b62 100644 --- a/mediamtx.yml +++ b/mediamtx.yml @@ -161,7 +161,7 @@ authJWTAudience: ############################################### # Global settings -> Control API -# Enable controlling the server through the Control API. +# Allow clients to control the server through the Control API. api: false # Address of the Control API listener. apiAddress: :9997 @@ -185,7 +185,7 @@ apiTrustedProxies: [] ############################################### # Global settings -> Metrics -# Enable Prometheus-compatible metrics. +# Allow clients to extract Prometheus-compatible metrics. metrics: false # Address of the metrics HTTP listener. metricsAddress: :9998 @@ -209,7 +209,7 @@ metricsTrustedProxies: [] ############################################### # Global settings -> PPROF -# Enable pprof-compatible endpoint to monitor performances. +# Allow clients to extract pprof-compatible performance reports. pprof: false # Address of the pprof listener. pprofAddress: :9999 @@ -233,7 +233,7 @@ pprofTrustedProxies: [] ############################################### # Global settings -> Playback server -# Enable downloading recordings from the playback server. +# Allow clients to download recordings from the playback server. playback: false # Address of the playback server listener. playbackAddress: :9996 @@ -257,7 +257,7 @@ playbackTrustedProxies: [] ############################################### # Global settings -> RTSP server -# Enable publishing and reading streams with the RTSP protocol. +# Allow clients to publish and read streams with the RTSP protocol. rtsp: true # Enabled RTSP transport protocols. The handshake is always performed with TCP. rtspTransports: [udp, multicast, tcp] @@ -300,7 +300,7 @@ rtspAuthMethods: [basic] ############################################### # Global settings -> RTMP server -# Enable publishing and reading streams with the RTMP protocol. +# Allow clients to publish and read streams with the RTMP protocol. rtmp: true # Use the secure protocol variant (RTMPS). # Available values are "no", "strict", "optional". @@ -320,7 +320,7 @@ rtmpServerCert: server.crt ############################################### # Global settings -> HLS server -# Enable reading streams with the HLS protocol. +# Allow clients to read streams with the HLS protocol. hls: true # Address of the HLS listener. hlsAddress: :8888 @@ -379,7 +379,7 @@ hlsMuxerCloseAfter: 60s ############################################### # Global settings -> WebRTC server -# Enable publishing and reading streams with the WebRTC protocol. +# Allow clients to publish and read streams with the WebRTC protocol. webrtc: true # Address of the WebRTC HTTP listener. webrtcAddress: :8889 @@ -436,7 +436,7 @@ webrtcTrackGatherTimeout: 2s ############################################### # Global settings -> SRT server -# Enable publishing and reading streams with the SRT protocol. +# Allow clients to publish and read streams with the SRT protocol. srt: true # Address of the SRT listener. srtAddress: :8890