diff --git a/docs/1-kickoff/2-install.md b/docs/1-kickoff/2-install.md index 407ad860..4873ba4e 100644 --- a/docs/1-kickoff/2-install.md +++ b/docs/1-kickoff/2-install.md @@ -76,7 +76,7 @@ And then build it: docker build . -t my-mediamtx ``` -In particular, the custom image is using the official _MediaMTX_ image as a base stage, and then adds a Linux-based operating system on top of it. Since _MediaMTX_ binaries are not tied to a specific Linux distribution or version, you can use anything you like. +This custom image is using the official _MediaMTX_ image as a base stage, and then adds a Linux-based operating system on top of it. You can use any Linux distribution or version you like, since _MediaMTX_ binaries are compatible with anything. ## Arch Linux package diff --git a/docs/2-features/20-scalability.md b/docs/2-features/20-scalability.md index 7e75f003..3b72cac8 100644 --- a/docs/2-features/20-scalability.md +++ b/docs/2-features/20-scalability.md @@ -178,9 +178,9 @@ It is also possible to entirely skip the load balancer setup by creating a domai 3. Create a _Security group_ called `mediamtx-origin`, that will be used by the origin. In _Inbound rules_, add: - a rule of type _SSH_. In the _source_ field, insert the IP range of administrators. - - a rule with type _Custom TCP_, port `8554`, source _Custom_, pick the `mediamtx-read-replicas` security group. + - a rule with type _Custom TCP_, port `8554` (RTSP), 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 _Custom TCP_, port `8554` (RTSP). 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. Assign the `mediamtx-origin` _Security group_ to the instance. In _Advanced Details_, in the _User data_ textarea, copy and paste this: @@ -306,7 +306,7 @@ In order to allow MediaMTX to recognize CDN requests and serve cacheable files, 2. Create a _Security group_ called `mediamtx-origin`, that will be used by the EC2 instance that will host MediaMTX. In _Inbound rules_, add: - a rule of type _SSH_. In the _source_ field, insert the IP range of administrators. - - a rule of type _Custom TCP_, port `8554`. In the _source_ field, insert the IP range of publishers. + - a rule of type _Custom TCP_, port `8554` (RTSP). 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. - a rule with type _All TCP_, source _Custom_, pick the `mediamtx-load-balancer` security group. @@ -340,11 +340,11 @@ In order to allow MediaMTX to recognize CDN requests and serve cacheable files, bluenviron/mediamtx:1 ``` -5. Create a _Target group_. In _Target Type_ leave _Instance_, in _Protocol_ leave _HTTP_, in _Port_ insert `8888`. Open _Advanced health check settings_, in _Success codes_ insert `404`. Associate the _Target group_ with the EC2 instance. +5. Create a _Target group_. In _Target Type_ leave _Instance_, in _Protocol_ leave _HTTP_, in _Port_ insert `8888` (HLS). Open _Advanced health check settings_, in _Success codes_ insert `404`. Associate the _Target group_ with the EC2 instance. -6. Create a _Load Balancer_, type _Application Load Balancer_. Assign the `mediamtx-load-balancer` _Security group_ to the load balancer. In _Listeners_, set the HTTP port to `8888` and in _Target group_ select the target group that was created previously. +6. Create a _Load Balancer_, type _Application Load Balancer_. Assign the `mediamtx-load-balancer` _Security group_ to the load balancer. In _Listeners_, set the HTTP port to `8888` (HLS) and in _Target group_ select the target group that was created previously. -7. Create a _CloudFront_ distribution. Point it to the load balancer. In _HTTP port_, insert `8888`. +7. Create a _CloudFront_ distribution. Point it to the load balancer. In _HTTP port_, insert `8888` (HLS). In the distribution page, edit the origin. Under _Add custom header_, click on _Add header_ and fill: - Header name: `Authorization` diff --git a/docs/3-publish/15-gstreamer.md b/docs/3-publish/15-gstreamer.md index ce63f2dd..4a9a0a99 100644 --- a/docs/3-publish/15-gstreamer.md +++ b/docs/3-publish/15-gstreamer.md @@ -20,8 +20,6 @@ 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/27-rtsp-specific-features.md). - ## GStreamer and RTMP ```sh @@ -30,6 +28,16 @@ videotestsrc ! video/x-raw,width=1280,height=720,format=I420 ! x264enc speed-pre audiotestsrc ! audioconvert ! avenc_aac ! mux. ``` +## GStreamer and SRT + +```sh +gst-launch-1.0 -v mpegtsmux name=mux ! srtsink uri="srt://localhost:8890?streamid=publish:mystream&pkt_size=1316" \ +videotestsrc ! video/x-raw,width=1280,height=720,format=I420 ! x264enc speed-preset=ultrafast bitrate=3000 key-int-max=60 ! video/x-h264,profile=high ! mux. \ +audiotestsrc ! audioconvert ! avenc_aac ! mux. +``` + +The resulting stream will be available on path `/mystream`. + ## GStreamer and MPEG-TS over UDP ```sh @@ -38,8 +46,6 @@ 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/27-rtsp-specific-features.md). - ## GStreamer and WebRTC Make sure that GStreamer version is at least 1.22, and that if the codec is H264, the profile is baseline. Use the `whipclientsink` element: diff --git a/docs/4-read/02-webrtc.md b/docs/4-read/02-webrtc.md index 285105d1..71da9701 100644 --- a/docs/4-read/02-webrtc.md +++ b/docs/4-read/02-webrtc.md @@ -22,4 +22,4 @@ Be aware that not all browsers can read any codec, check [Codec support in brows 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). +Some clients that can read with WebRTC and WHEP are [GStreamer](07-gstreamer.md), [Unity](12-unity.md) and [web browsers](13-web-browsers.md). diff --git a/docs/4-read/07-gstreamer.md b/docs/4-read/07-gstreamer.md index fe90ca71..9018eefc 100644 --- a/docs/4-read/07-gstreamer.md +++ b/docs/4-read/07-gstreamer.md @@ -8,11 +8,24 @@ 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/27-rtsp-specific-features.md). +## GStreamer and RTMP + +GStreamer supports reading streams with the RTMP protocol, but the path must be composed by at least two elements, for instance `mypath/mysubpath`: + +```sh +gst-launch-1.0 rtmpsrc location=rtmp://localhost/mypath/mysubpath ! flvdemux name=d \ +d.video ! queue ! decodebin ! autovideosink +``` + +## GStreamer and SRT + +```sh +gst-launch-1.0 srtsrc uri="srt://localhost:8890?streamid=read:mystream" ! tsdemux ! decodebin ! autovideosink +``` ## GStreamer and WebRTC -GStreamer also supports reading streams with WebRTC/WHEP, although track codecs must be specified in advance through the `video-caps` and `audio-caps` parameters. Furthermore, if audio is not present, `audio-caps` must be set anyway and must point to a PCMU codec. For instance, the command for reading a video-only H264 stream is: +GStreamer supports reading streams with WebRTC/WHEP, although track codecs must be specified in advance through the `video-caps` and `audio-caps` parameters. Furthermore, if audio is not present, `audio-caps` must be set anyway and must point to a PCMU codec. For instance, the command for reading a video-only H264 stream is: ```sh gst-launch-1.0 whepsrc whep-endpoint=http://127.0.0.1:8889/stream/whep use-link-headers=true \ diff --git a/docs/6-misc/4-specifications.md b/docs/6-misc/4-specifications.md index 3db2e364..78702ca8 100644 --- a/docs/6-misc/4-specifications.md +++ b/docs/6-misc/4-specifications.md @@ -10,9 +10,9 @@ | [RFC7742, WebRTC Video Processing and Codec Requirements](https://datatracker.ietf.org/doc/html/rfc7742) | WebRTC | | [RFC7874, WebRTC Audio Codec and Processing Requirements](https://datatracker.ietf.org/doc/html/rfc7874) | WebRTC | | [RFC7875, Additional WebRTC Audio Codecs for Interoperability](https://datatracker.ietf.org/doc/html/rfc7875) | WebRTC | -| [H.265 Profile for WebRTC](https://datatracker.ietf.org/doc/draft-ietf-avtcore-hevc-webrtc/) | WebRTC | -| [WebRTC HTTP Ingestion Protocol (WHIP)](https://datatracker.ietf.org/doc/draft-ietf-wish-whip/) | WebRTC | -| [WebRTC HTTP Egress Protocol (WHEP)](https://datatracker.ietf.org/doc/draft-murillo-whep/) | WebRTC | +| [H.265 Profile for WebRTC](https://datatracker.ietf.org/doc/html/draft-ietf-avtcore-hevc-webrtc-08) | WebRTC | +| [RFC9725, WebRTC-HTTP Ingestion Protocol (WHIP)](https://datatracker.ietf.org/doc/html/rfc9725) | WebRTC | +| [WebRTC-HTTP Egress Protocol (WHEP)](https://datatracker.ietf.org/doc/html/draft-ietf-wish-whep) | WebRTC | | [The SRT Protocol](https://haivision.github.io/srt-rfc/draft-sharabayko-srt.html) | SRT | | [Codec specifications](https://github.com/bluenviron/mediacommon#specifications) | codecs | | [Golang project layout](https://github.com/golang-standards/project-layout) | project layout |