From b88f81cb2d78cdba487a3d2ad7cab8bcd184bc3f Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Tue, 7 Jan 2025 09:17:10 +0100 Subject: [PATCH] add GStreamer + WHEP instructions (#4117) --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index ce5b9cffc74..9f473bd6750 100644 --- a/README.md +++ b/README.md @@ -894,6 +894,32 @@ If encryption is enabled, set `tls-validation-flags` to `0`: gst-launch-1.0 rtspsrc tls-validation-flags=0 location=rtsps://ip:8322/... ``` +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: + +```sh +gst-launch-1.0 whepsrc whep-endpoint=http://127.0.0.1:8889/stream/whep use-link-headers=true \ +video-caps="application/x-rtp,media=video,encoding-name=H264,payload=127,clock-rate=90000" \ +audio-caps="application/x-rtp,media=audio,encoding-name=PCMU,payload=0,clock-rate=8000" \ +! rtph264depay ! decodebin ! autovideosink +``` + +While the command for reading an audio-only Opus stream is: + +```sh +gst-launch-1.0 whepsrc whep-endpoint="http://127.0.0.1:8889/stream/whep" use-link-headers=true \ +audio-caps="application/x-rtp,media=audio,encoding-name=OPUS,payload=111,clock-rate=48000,encoding-params=(string)2" \ +! rtpopusdepay ! decodebin ! autoaudiosink +``` + +While the command for reading a H264 and Opus stream is: + +```sh +gst-launch-1.0 whepsrc whep-endpoint=http://127.0.0.1:8889/stream/whep use-link-headers=true \ +video-caps="application/x-rtp,media=video,encoding-name=H264,payload=127,clock-rate=90000" \ +audio-caps="application/x-rtp,media=audio,encoding-name=OPUS,payload=111,clock-rate=48000,encoding-params=(string)2" \ +! decodebin ! autovideosink +``` + #### VLC VLC can read a stream from the server in multiple ways (RTSP, RTMP, HLS, SRT). The recommended one consists in reading with [RTSP](#rtsp):