diff --git a/docs/1-kickoff/1-introduction.md b/docs/1-kickoff/1-introduction.md index a1b5975b..cd276db5 100644 --- a/docs/1-kickoff/1-introduction.md +++ b/docs/1-kickoff/1-introduction.md @@ -17,10 +17,10 @@ Main features: - [Authenticate](../2-features/06-authentication.md) users with internal, HTTP or JWT authentication - [Forward](../2-features/11-forward.md) streams to other servers - [Proxy](../2-features/12-proxy.md) requests to other servers -- [Control](../2-features/20-control-api.md) the server through the Control API -- [Extract metrics](../2-features/21-metrics.md) from the server in a Prometheus-compatible format -- [Monitor performance](../2-features/22-performance.md) to investigate CPU and RAM consumption -- [Run hooks](../2-features/19-hooks.md) (external commands) when clients connect, disconnect, read or publish streams +- [Control](../2-features/22-control-api.md) the server through the Control API +- [Extract metrics](../2-features/23-metrics.md) from the server in a Prometheus-compatible format +- [Monitor performance](../2-features/24-performance.md) to investigate CPU and RAM consumption +- [Run hooks](../2-features/21-hooks.md) (external commands) when clients connect, disconnect, read or publish streams - Compatible with Linux, Windows and macOS, does not require any dependency or interpreter, it's a single executable Use the menu to navigate through the documentation. diff --git a/docs/2-features/05-configuration.md b/docs/2-features/05-configuration.md index 7a1d22b6..3a036b07 100644 --- a/docs/2-features/05-configuration.md +++ b/docs/2-features/05-configuration.md @@ -47,7 +47,7 @@ There are several ways to change configuration parameters: docker run --rm -it --network=host -e MTX_PATHS_TEST_SOURCE=rtsp://myurl bluenviron/mediamtx:1 ``` -3. Use the [Control API](20-control-api.md). +3. Use the [Control API](22-control-api.md). ## Encrypt the configuration diff --git a/docs/2-features/12-proxy.md b/docs/2-features/12-proxy.md index ee084109..b9437fb2 100644 --- a/docs/2-features/12-proxy.md +++ b/docs/2-features/12-proxy.md @@ -4,11 +4,11 @@ The server allows to proxy incoming requests to other servers or cameras. This i ```yml paths: - "~^proxy_(.+)$": + "~^(.+)$": # If path name is a regular expression, $G1, $G2, etc will be replaced # with regular expression groups. source: rtsp://other-server:8554/$G1 sourceOnDemand: yes ``` -All requests addressed to `rtsp://server:8854/proxy_a` will be forwarded to `rtsp://other-server:8854/a` and so on. +All requests addressed to `rtsp://server:8854/a` will be forwarded to `rtsp://other-server:8854/a` and so on. diff --git a/docs/2-features/20-scaling.md b/docs/2-features/20-scaling.md new file mode 100644 index 00000000..ebade7b3 --- /dev/null +++ b/docs/2-features/20-scaling.md @@ -0,0 +1,255 @@ +# Scaling + +When handling large amounts of readers or publishers, streaming performance might get degraded due to bottlenecks in the underlying hardware infrastructure. In case of streaming without re-encoding (which is what MediaMTX does), these bottlenecks are almost always related to the limited bandwidth between server and readers. This issue can be strongly mitigated by enrolling horizontal scaling, which means deploying multiple coordinated server instances, and evenly distributing load on them. + +There are several methods available to implement horizontal scaling, the main ones are described in this page. + +## Read replicas + +The main technique for handling additional readers consists in instantiating additional MediaMTX instances, called read replicas, that are in charge of picking streams from a MediaMTX "origin" instance and serving them to users. User connections and requests are distributed to each replica by a load balancer. + +![read replicas](read-replicas.svg) + +Publishers are meant to publish to the origin instance. + +Read replicas must be configured in this way: + +- Add one or more proxy paths, pointing to the MediaMTX origin instance, as described in [Proxy](12-proxy.md). +- If the protocol used by readers is WebRTC, disable `webrtcLocalUDPAddress` and `webrtcLocalTCPAddress` and enable a STUN server, as described in [Solving WebRTC connectivity issues](26-webrtc-specific-features.md#solving-webrtc-connectivity-issues). + +The load balancer has to behave differently depending on the protocol(s) readers are gonna use to read the stream: + +- When using RTSP, RTMP, SRT, the load balancer must be a Layer 4 LB. +- When using HLS and WebRTC, the load balancer must be a Layer 7 LB with sticky sessions enabled. Sticky sessions are needed to forward HTTP requests from the same user to the same replica, since a single HLS or WebRTC session is composed of several HTTP requests. + +### Generic implementation + +1. On the machine meant to host the MediaMTX origin instance, launch the instance: + + ```sh + docker run -d \ + --name mediamtx \ + --restart always \ + --network host \ + bluenviron/mediamtx:1 + ``` + +2. On machines meant to host read replicas, create this MediaMTX configuration: + + ```yml + webrtcLocalUDPAddress: + webrtcICEServers2: + - url: stun:stun.l.google.com:19302 + + paths: + "~^(.+)$": + source: rtsp://dns-of-origin:8554/$G1 + sourceOnDemand: yes + ``` + + Replace `dns-of-origin` with the DNS or IP of the origin machine. + + Then launch MediaMTX: + + ```sh + docker run -d \ + --name mediamtx \ + --restart always \ + --network host \ + -v $PWD/mediamtx.yml:/mediamtx.yml \ + bluenviron/mediamtx:1 + ``` + +3. On machines meant to host the load balancer, create this [Traefik](https://traefik.io/) configuration (`traefik.yml`): + + ```yml + entryPoints: + rtsp: + address: ":8554" + rtmp: + address: ":1935" + srt: + address: ":8890/udp" # SRT usually uses UDP + hls: + address: ":8888" + webrtc: + address: ":8889" + + providers: + file: + filename: "/etc/traefik/dynamic_conf.yml" + watch: true + ``` + + Create this second, dynamic, configuration (`dynamic_conf.yml`): + + ```yml + tcp: + routers: + rtsp-router: + rule: "HostSNI(`*`)" + entryPoints: ["rtsp"] + service: "rtsp-service" + rtmp-router: + rule: "HostSNI(`*`)" + entryPoints: ["rtmp"] + service: "rtmp-service" + + services: + rtsp-service: + loadBalancer: + servers: + - address: "replica-1-ip:8554" + - address: "replica-2-ip:8554" + rtmp-service: + loadBalancer: + servers: + - address: "replica-1-ip:1935" + - address: "replica-2-ip:1935" + + udp: + routers: + srt-router: + entryPoints: ["srt"] + service: "srt-service" + services: + srt-service: + loadBalancer: + servers: + - address: "replica-1-ip:8890" + - address: "replica-2-ip:8890" + + http: + routers: + hls-router: + rule: "PathPrefix(`/`)" + entryPoints: ["hls"] + service: "hls-service" + webrtc-router: + rule: "PathPrefix(`/`)" + entryPoints: ["webrtc"] + service: "webrtc-service" + + services: + hls-service: + loadBalancer: + sticky: + cookie: + name: "SERVERID" + servers: + - url: "http://replica-1-ip:8888" + - url: "http://replica-2-ip:8888" + webrtc-service: + loadBalancer: + sticky: + cookie: + name: "SERVERID" + servers: + - url: "http://replica-1-ip:8889" + - url: "http://replica-2-ip:8889" + ``` + + Then launch Traefik: + + ``` + docker run -d \ + --name traefik \ + --restart always \ + --network host \ + -v $PWD/traefik.yml:/etc/traefik/traefik.yml \ + -v $PWD/dynamic_conf.yml:/etc/traefik/dynamic_conf.yml \ + traefik:v3.6.14 + ``` + +You can now use the IP address or DNS of the load balancer machines to read streams with any protocol. + +### AWS-based implementation + +1. Create a _Security group_ called `mediamtx-load-balancer`, that will be used by the load balancers. In _Inbound rules_, add: + - a rule with type _All TCP_, source `0.0.0.0/0` (anywhere). + - a rule with type _All UDP_, source `0.0.0.0/0` (anywhere). + +2. Create a _Security group_ called `mediamtx-read-replicas`, that will be used by the read replicas. In _Inbound rules_, add: + - a rule with type _All TCP_, source _Custom_, pick the `mediamtx-load-balancer` security group. + - a rule with type _All UDP_, source _Custom_, pick the `mediamtx-load-balancer` security group. + +3. Create a _Security group_ called `mediamtx-origin`, that will be used by the origin. In _Inbound rules_, add: + - a rule with type _Custom TCP_, port `8554`, source _Custom_, pick the `mediamtx-read-replicas` security group. + - a rule with type _All UDP_, source _Custom_, pick the `mediamtx-read-replicas` security group. + - a rule of type _Custom TCP_, port `8554`. In the _source_ field, insert the IP range of publishers. + - a rule of type _All UDP_. In the _Source_ field, insert the IP range of publishers. + +4. Launch an EC2 instance that is meant to host the MediaMTX origin instance. Pick the _Amazon Linux_ AMI. Associate the `mediamtx-origin` _Security group_ to the instance. In _Advanced Details_, in the _User data_ textarea, copy and paste this: + + ```sh + #!/bin/bash + dnf update -y + dnf install -y docker + systemctl start docker + systemctl enable docker + usermod -aG docker ec2-user + + docker run -d \ + --name mediamtx \ + --restart always \ + --network host \ + bluenviron/mediamtx:1 + ``` + +5. Create a _Launch template_ for the read replicas. Pick the _Amazon Linux_ AMI. Associate the `mediamtx-read-replicas` _Security group_ to the launch template. In _Advanced Details_, in the _User data_ textarea, copy and paste this: + + ```sh + #!/bin/bash + dnf update -y + dnf install -y docker + systemctl start docker + systemctl enable docker + usermod -aG docker ec2-user + + mkdir -p /etc/mediamtx/ + tee /etc/mediamtx/mediamtx.yml << EOF + webrtcLocalUDPAddress: + webrtcICEServers2: + - url: stun:stun.l.google.com:19302 + + paths: + "~^(.+)$": + source: rtsp://dns-of-origin:8554/\$G1 + sourceOnDemand: yes + EOF + + docker run -d \ + --name mediamtx \ + --restart always \ + --network host \ + -v /etc/mediamtx/mediamtx.yml:/mediamtx.yml \ + bluenviron/mediamtx:1 + ``` + + Replace `dns-of-origin` with the private DNS of the origin EC2 instance. + +6. Create several _Target groups_, with target type _Instances_, one for each of the following Protocol / Port combinations: + - Name `mediamtx-read-replicas-8554`, Protocol _TCP_, port `8554` (RTSP), health check protocol _TCP_. + - Name `mediamtx-read-replicas-1935`, Protocol _TCP_, port `1935` (RTMP), health check protocol _TCP_. + - Name `mediamtx-read-replicas-8890`, Protocol _UDP_, port `8890` (SRT), health check protocol _TCP_, Advanced health check settings, Health check port, override, insert `8554`. + - Name `mediamtx-read-replicas-8888`, Protocol _HTTP_, port `8888` (HLS), health check protocol _HTTP_, Advanced health check settings, Health check success codes `404`. + - Name `mediamtx-read-replicas-8889`, Protocol _HTTP_, port `8889` (WebRTC), health check protocol _HTTP_, Advanced health check settings, Health check success codes `404`. + + Do not associate these target groups with any instance for now. + +7. Select the `mediamtx-read-replicas-8888` target group, tab _Attributes_, _Edit_, section _Target selection configuration_, _Turn on stickiness_, _Save_. Do the same for the `mediamtx-read-replicas-8889` target group. + +8. Create a _Load Balancer_, type _Network Load Balancer_. Associate the `mediamtx-load-balancer` _Security group_ with the load balancer. In _Listeners_, define 3 listeners: + - Protocol _TCP_, port `8554` (RTSP), forward to target group `mediamtx-read-replicas-8554` + - Protocol _TCP_, port `1935` (RTMP), forward to target group `mediamtx-read-replicas-1935` + - Protocol _UDP_, port `8890` (SRT), forward to target group `mediamtx-read-replicas-8890` + +9. Create a _Load Balancer_, type _Application Load Balancer_. Associate the `mediamtx-load-balancer` _Security group_ with the load balancer. In _Listeners_, define 2 listeners: + - Protocol _HTTP_, port `8888` (HLS), forward to target group `mediamtx-read-replicas-8888` + - Protocol _HTTP_, port `8889` (WebRTC), forward to target group `mediamtx-read-replicas-8889` + +10. Create an _Auto scaling group_ for the read replicas. Pick the launch template that was defined before. CPU and Memory parameters are usually not important. In the _Load balancing_ section, pick _Attach to an existing load balancer_ and select all 5 target groups that were created before. In the _Group size_ section, in _Desired capacity_, set the desired instance count. + +You can now use the DNS of the _Network Load Balancer_ to read streams with RTSP, RTMP and SRT, and the DNS of the _Application Load Balancer_ to read streams with HLS and WebRTC. + +This process involved all available protocols, but it can be greatly simplified if users are meant to read streams with a single protocol only (for instance, WebRTC), in this case, opening specific ports only (8889) and creating specific load balancers only (Application load balancer) is enough. diff --git a/docs/2-features/19-hooks.md b/docs/2-features/21-hooks.md similarity index 100% rename from docs/2-features/19-hooks.md rename to docs/2-features/21-hooks.md diff --git a/docs/2-features/20-control-api.md b/docs/2-features/22-control-api.md similarity index 100% rename from docs/2-features/20-control-api.md rename to docs/2-features/22-control-api.md diff --git a/docs/2-features/21-metrics.md b/docs/2-features/23-metrics.md similarity index 100% rename from docs/2-features/21-metrics.md rename to docs/2-features/23-metrics.md diff --git a/docs/2-features/22-performance.md b/docs/2-features/24-performance.md similarity index 100% rename from docs/2-features/22-performance.md rename to docs/2-features/24-performance.md diff --git a/docs/2-features/23-srt-specific-features.md b/docs/2-features/25-srt-specific-features.md similarity index 100% rename from docs/2-features/23-srt-specific-features.md rename to docs/2-features/25-srt-specific-features.md diff --git a/docs/2-features/24-webrtc-specific-features.md b/docs/2-features/26-webrtc-specific-features.md similarity index 100% rename from docs/2-features/24-webrtc-specific-features.md rename to docs/2-features/26-webrtc-specific-features.md diff --git a/docs/2-features/25-rtsp-specific-features.md b/docs/2-features/27-rtsp-specific-features.md similarity index 100% rename from docs/2-features/25-rtsp-specific-features.md rename to docs/2-features/27-rtsp-specific-features.md diff --git a/docs/2-features/26-rtmp-specific-features.md b/docs/2-features/28-rtmp-specific-features.md similarity index 100% rename from docs/2-features/26-rtmp-specific-features.md rename to docs/2-features/28-rtmp-specific-features.md diff --git a/docs/2-features/27-decrease-packet-loss.md b/docs/2-features/29-decrease-packet-loss.md similarity index 100% rename from docs/2-features/27-decrease-packet-loss.md rename to docs/2-features/29-decrease-packet-loss.md diff --git a/docs/2-features/read-replicas.svg b/docs/2-features/read-replicas.svg new file mode 100644 index 00000000..5ad720c8 --- /dev/null +++ b/docs/2-features/read-replicas.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + readers + + + + + + + + + + + + + + + + read replicas + 1 + 2 + ... + N + + + + + load + balancer + origin + + + + + + diff --git a/docs/3-publish/01-srt-clients.md b/docs/3-publish/01-srt-clients.md index 4fe8e932..71ccda5b 100644 --- a/docs/3-publish/01-srt-clients.md +++ b/docs/3-publish/01-srt-clients.md @@ -8,7 +8,7 @@ srt://localhost:8890?streamid=publish:mystream&pkt_size=1316 Replace `mystream` with any name you want. The resulting stream will be available on path `/mystream`. -If you need to use the standard stream ID syntax instead of the custom one in use by this server, read [Standard stream ID syntax](../2-features/23-srt-specific-features.md#standard-stream-id-syntax). +If you need to use the standard stream ID syntax instead of the custom one in use by this server, read [Standard stream ID syntax](../2-features/25-srt-specific-features.md#standard-stream-id-syntax). If you want to publish a stream by using a client in listening mode (i.e. with `mode=listener` appended to the URL), read the next section. diff --git a/docs/3-publish/03-webrtc-clients.md b/docs/3-publish/03-webrtc-clients.md index 44c79df2..38ba9953 100644 --- a/docs/3-publish/03-webrtc-clients.md +++ b/docs/3-publish/03-webrtc-clients.md @@ -14,8 +14,8 @@ 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 [Codec support in browsers](../2-features/24-webrtc-specific-features.md#codec-support-in-browsers). +Be aware that not all browsers can read any codec, check [Codec support in browsers](../2-features/26-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](../2-features/24-webrtc-specific-features.md#solving-webrtc-connectivity-issues). +Depending on the network it might be difficult to establish a connection between server and clients, read [Solving WebRTC connectivity issues](../2-features/26-webrtc-specific-features.md#solving-webrtc-connectivity-issues). Some clients that can publish with WebRTC and WHIP are [FFmpeg](14-ffmpeg.md), [GStreamer](15-gstreamer.md), [OBS Studio](16-obs-studio.md), [Unity](19-unity.md) and [Web browsers](20-web-browsers.md). diff --git a/docs/3-publish/05-rtsp-clients.md b/docs/3-publish/05-rtsp-clients.md index 4ceecbbb..fab683d6 100644 --- a/docs/3-publish/05-rtsp-clients.md +++ b/docs/3-publish/05-rtsp-clients.md @@ -10,7 +10,7 @@ The resulting stream will be available on path `/mystream`. Some clients that can publish with RTSP are [FFmpeg](14-ffmpeg.md), [GStreamer](15-gstreamer.md), [OBS Studio](16-obs-studio.md), [Python and OpenCV](17-python-opencv.md). -Advanced RTSP features and settings are described in [RTSP-specific features](../2-features/25-rtsp-specific-features.md). +Advanced RTSP features and settings are described in [RTSP-specific features](../2-features/27-rtsp-specific-features.md). ## MPEG-TS inside RTSP diff --git a/docs/3-publish/06-rtsp-cameras-and-servers.md b/docs/3-publish/06-rtsp-cameras-and-servers.md index 53573fe0..3a00653f 100644 --- a/docs/3-publish/06-rtsp-cameras-and-servers.md +++ b/docs/3-publish/06-rtsp-cameras-and-servers.md @@ -44,4 +44,4 @@ paths: All available parameters are listed in the [configuration file](../5-references/1-configuration-file.md). -Advanced RTSP features and settings are described in [RTSP-specific features](../2-features/25-rtsp-specific-features.md). +Advanced RTSP features and settings are described in [RTSP-specific features](../2-features/27-rtsp-specific-features.md). diff --git a/docs/3-publish/07-rtmp-clients.md b/docs/3-publish/07-rtmp-clients.md index ab93f516..fe32d5f1 100644 --- a/docs/3-publish/07-rtmp-clients.md +++ b/docs/3-publish/07-rtmp-clients.md @@ -1,6 +1,6 @@ # RTMP clients -RTMP is a protocol that allows to read and publish streams. It supports encryption, read [RTMP-specific features](../2-features/26-rtmp-specific-features.md). Streams can be published to the server by using the URL: +RTMP is a protocol that allows to read and publish streams. It supports encryption, read [RTMP-specific features](../2-features/28-rtmp-specific-features.md). Streams can be published to the server by using the URL: ``` rtmp://localhost/mystream diff --git a/docs/3-publish/15-gstreamer.md b/docs/3-publish/15-gstreamer.md index 83d63a19..ce63f2dd 100644 --- a/docs/3-publish/15-gstreamer.md +++ b/docs/3-publish/15-gstreamer.md @@ -20,7 +20,7 @@ d.video_0 ! rtspclientsink location=rtsp://localhost:8554/mystream The resulting stream will be available on path `/mystream`. -For advanced options, read [RTSP-specific features](../2-features/25-rtsp-specific-features.md). +For advanced options, read [RTSP-specific features](../2-features/27-rtsp-specific-features.md). ## GStreamer and RTMP @@ -38,7 +38,7 @@ videotestsrc ! video/x-raw,width=1280,height=720,format=I420 ! x264enc speed-pre audiotestsrc ! audioconvert ! avenc_aac ! mux. ``` -For advanced options, read [RTSP-specific features](../2-features/25-rtsp-specific-features.md). +For advanced options, read [RTSP-specific features](../2-features/27-rtsp-specific-features.md). ## GStreamer and WebRTC diff --git a/docs/4-read/01-srt.md b/docs/4-read/01-srt.md index e90ccbf0..41779af2 100644 --- a/docs/4-read/01-srt.md +++ b/docs/4-read/01-srt.md @@ -8,6 +8,6 @@ srt://localhost:8890?streamid=read:mystream Replace `mystream` with the path name. -If you need to use the standard stream ID syntax instead of the custom one in use by this server, read [Standard stream ID syntax](../2-features/23-srt-specific-features.md#standard-stream-id-syntax). +If you need to use the standard stream ID syntax instead of the custom one in use by this server, read [Standard stream ID syntax](../2-features/25-srt-specific-features.md#standard-stream-id-syntax). Some clients that can read with SRT are [FFmpeg](06-ffmpeg.md), [GStreamer](07-gstreamer.md) and [VLC](08-vlc.md). diff --git a/docs/4-read/02-webrtc.md b/docs/4-read/02-webrtc.md index eed25c22..ddb48870 100644 --- a/docs/4-read/02-webrtc.md +++ b/docs/4-read/02-webrtc.md @@ -12,8 +12,8 @@ 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 [Codec support in browsers](../2-features/24-webrtc-specific-features.md#codec-support-in-browsers). +Be aware that not all browsers can read any codec, check [Codec support in browsers](../2-features/26-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](../2-features/24-webrtc-specific-features.md#solving-webrtc-connectivity-issues). +Depending on the network it may be difficult to establish a connection between server and clients, read [Solving WebRTC connectivity issues](../2-features/26-webrtc-specific-features.md#solving-webrtc-connectivity-issues). Some clients that can read with WebRTC and WHEP are [FFmpeg](06-ffmpeg.md), [GStreamer](07-gstreamer.md), [Unity](12-unity.md) and [web browsers](13-web-browsers.md). diff --git a/docs/4-read/03-rtsp.md b/docs/4-read/03-rtsp.md index 4a3c2abb..3c1cb357 100644 --- a/docs/4-read/03-rtsp.md +++ b/docs/4-read/03-rtsp.md @@ -1,6 +1,6 @@ # RTSP clients -RTSP is a protocol that allows to publish and read streams. It supports several underlying transport protocols and encryption (read [RTSP-specific features](../2-features/25-rtsp-specific-features.md)). In order to read a stream with the RTSP protocol, use this URL: +RTSP is a protocol that allows to publish and read streams. It supports several underlying transport protocols and encryption (read [RTSP-specific features](../2-features/27-rtsp-specific-features.md)). In order to read a stream with the RTSP protocol, use this URL: ``` rtsp://localhost:8554/mystream diff --git a/docs/4-read/04-rtmp.md b/docs/4-read/04-rtmp.md index 893902c6..555847cd 100644 --- a/docs/4-read/04-rtmp.md +++ b/docs/4-read/04-rtmp.md @@ -1,6 +1,6 @@ # RTMP clients -RTMP is a protocol that allows to read and publish streams. It supports encryption, read [RTMP-specific features](../2-features/26-rtmp-specific-features.md). Streams can be read from the server by using the URL: +RTMP is a protocol that allows to read and publish streams. It supports encryption, read [RTMP-specific features](../2-features/28-rtmp-specific-features.md). Streams can be read from the server by using the URL: ``` rtmp://localhost/mystream diff --git a/docs/4-read/07-gstreamer.md b/docs/4-read/07-gstreamer.md index 07c1deb6..fe90ca71 100644 --- a/docs/4-read/07-gstreamer.md +++ b/docs/4-read/07-gstreamer.md @@ -8,7 +8,7 @@ GStreamer can read a stream from the server in several ways. The recommended one gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/mystream latency=0 ! decodebin ! autovideosink ``` -For advanced options, read [RTSP-specific features](../2-features/25-rtsp-specific-features.md). +For advanced options, read [RTSP-specific features](../2-features/27-rtsp-specific-features.md). ## GStreamer and WebRTC diff --git a/docs/5-references/2-control-api.md b/docs/5-references/2-control-api.md index 09eaed7d..1e9a760b 100644 --- a/docs/5-references/2-control-api.md +++ b/docs/5-references/2-control-api.md @@ -1,3 +1,3 @@ # Control API reference -This is the reference of the Control API of the latest _MediaMTX_ release ({version_tag}), generated automatically from the [OpenAPI / Swagger file](https://github.com/bluenviron/mediamtx/blob/{version_tag}/api/openapi.yaml) available in the repository. Check the [Control API usage page](../2-features/20-control-api.md) for instructions on how to use the API. +This is the reference of the Control API of the latest _MediaMTX_ release ({version_tag}), generated automatically from the [OpenAPI / Swagger file](https://github.com/bluenviron/mediamtx/blob/{version_tag}/api/openapi.yaml) available in the repository. Check the [Control API usage page](../2-features/22-control-api.md) for instructions on how to use the API. diff --git a/internal/linters/docsorder/docsorder_test.go b/internal/linters/docsorder/docsorder_test.go index a1158f00..5dd6bbc5 100644 --- a/internal/linters/docsorder/docsorder_test.go +++ b/internal/linters/docsorder/docsorder_test.go @@ -64,22 +64,15 @@ func TestDocsOrder(t *testing.T) { } sort.Slice(numbered, func(i, j int) bool { - return numbered[i].num < numbered[j].num + return numbered[i].name < numbered[j].name }) usesPadding := len(numbered) >= 10 - for i, nf := range numbered { - expected := i + 1 - - if nf.num != expected { - t.Errorf("docs/%s/%s: expected number %d, got %d", entry.Name(), nf.name, expected, nf.num) - } - + for _, nf := range numbered { if usesPadding { - expectedStr := fmt.Sprintf("%02d", expected) - if nf.numStr != expectedStr { - t.Errorf("docs/%s/%s: expected zero-padded prefix %q, got %q", entry.Name(), nf.name, expectedStr, nf.numStr) + if len(nf.numStr) != 2 { + t.Errorf("docs/%s/%s: expected zero-padded prefix, got %q", entry.Name(), nf.name, nf.numStr) } } else { if strings.HasPrefix(nf.numStr, "0") {