How can I install WebRTCSink on Ubuntu 22.04

GST Developer gstreamer at gallery.co.uk
Mon Jul 10 10:08:35 UTC 2023


Hi Mathieu

You are correct - the issue was using an older version of webrtcsink (from a different git) with the current signalling server - perhaps the case/syntax has changed.

We have rebuilt everything from scratch many times and after more work, we have it working !  Many thanks for your input.

One thing we have discovered is that the default congestion control is causing us a problem:
if we use congestion-control=gcc, gstreamer crashes.
With congestion-control=homegrown or disabled, it does not crash

congestion-control=gcc : 
ERROR: from element /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:
streaming stopped, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstWebRTCSink:ws: Panicked

Otherwise, everything works well, thanks again.

One final question about the web server component - we have set this to use http instead of https since we dont need camera access, and all works well - however, it throws an error in the web page if we connect via the machine's dns name ("Invalid Host header”). It will only work with the external IP address of the machine, even tho the DNS resolves to this same address.  This same error happens in the default https mode, although this was more expected since the dns doesnt match the self-signed certificate.

We will dig into that code today, but if you have a quick answer to this, it would be very useful.

Many thanks again for this excellent code and your support.

> On 10 Jul 2023, at 10:53, Mathieu Duponchelle <mathieu at centricular.com> wrote:
> 
> Are you sure you are using the correct version of webrtcsink? Did you
> build it from the repo and have your plugin path point to this version?
> 
> On Sun, 2023-07-09 at 09:09 +0100, GST Developer wrote:
>> Thanks for your guidance Mathieu !!!
>> 
>> I have been able to work through the documentation you linked to and
>> have been able to build the gst-plugins-rs components and get 2/3rd
>> of the example running.
>> Referring to the 3 shell windows mentioned here:
>> gstreamer.freedesktop.org
>> 
>> 
>> 
>> The first shell is working - the signalling server appears to be
>> running
>> 
>> The second shell is working, the gstwebrtc-api appears to be running
>> a webserver, and I can connect to the page on port 9090 with a web
>> gui showing a potential “start capture” and a “remote streams”
>> section
>> 
>> However, The third does not work:
>> 
>> gst-launch-1.0 webrtcsink name=ws meta="meta,name=gst-stream"
>> videotestsrc ! ws. audiotestsrc ! ws.
>> 
>> attempts to start, and I can see it has contacted the signalling
>> server, but it fails with the error sequence below:
>> 
>> Setting pipeline to PAUSED ...
>> Pipeline is live and does not need PREROLL ...
>> Pipeline is PREROLLED ...
>> Setting pipeline to PLAYING ...
>> New clock: GstSystemClock
>> Redistribute latency...
>> Redistribute latency...
>> ERROR: from element /GstPipeline:pipeline0/RsWebRTCSink:ws: GStreamer
>> encountered a general stream error.
>> Additional debug info:
>> plugins/src/webrtcsink/imp.rs(1240): webrtcsink::webrtcsink::imp ():
>> /GstPipeline:pipeline0/RsWebRTCSink:ws:
>> Signalling error: Unknown message from server:
>> {"type":"welcome","peerId":"384ad93b-1089-4fb8-93f9-8a3e9ed709ba"}
>> Execution ended after 0:00:00.122527906
>> Setting pipeline to NULL ...
>> Freeing pipeline …
>> 
>> meanwhile, the signalling server has responded:
>> 
>> 2023-07-09T08:03:49.938533Z  INFO ThreadId(01)
>> gst_webrtc_signalling_server: Accepting connection from
>> 127.0.0.1:39162
>> 2023-07-09T08:03:49.938717Z DEBUG ThreadId(61) accept_async:
>> gst_plugin_webrtc_signalling::server: new
>> 2023-07-09T08:03:49.938901Z DEBUG ThreadId(61) accept_async:
>> tungstenite::handshake::server: Server handshake done.    
>> 2023-07-09T08:03:49.938926Z  INFO ThreadId(61) accept_async:
>> gst_plugin_webrtc_signalling::server: New WebSocket connection
>> this_id=0d76097e-e8fe-45d5-9769-b184bdc30ba8
>> 2023-07-09T08:03:49.938959Z DEBUG ThreadId(61) accept_async:
>> gst_plugin_webrtc_signalling::server: close time.busy=192µs
>> time.idle=57.0µs
>> 2023-07-09T08:03:49.939310Z  INFO ThreadId(56)
>> gst_plugin_webrtc_signalling::server: Received message
>> Ok(Text("{\"type\":\"setPeerStatus\",\"roles\":[\"producer\"],\"meta\
>> ":{\"name\":\"gst-stream\"}}"))
>> 2023-07-09T08:03:49.939379Z DEBUG ThreadId(56)
>> set_peer_status{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"
>> status=PeerStatus { roles: [Producer], meta: Some(Object {"name":
>> String("gst-stream")}), peer_id: None }}:
>> gst_plugin_webrtc_signalling::handlers: new
>> 2023-07-09T08:03:49.939400Z  INFO ThreadId(56)
>> set_peer_status{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"
>> status=PeerStatus { roles: [Producer], meta: Some(Object {"name":
>> String("gst-stream")}), peer_id: None }}:
>> gst_plugin_webrtc_signalling::handlers: registered as a producer
>> peer_id=0d76097e-e8fe-45d5-9769-b184bdc30ba8
>> 2023-07-09T08:03:49.939419Z DEBUG ThreadId(56)
>> set_peer_status{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"
>> status=PeerStatus { roles: [Producer], meta: Some(Object {"name":
>> String("gst-stream")}), peer_id: None }}:
>> gst_plugin_webrtc_signalling::handlers: close time.busy=26.3µs
>> time.idle=14.2µs
>> 2023-07-09T08:03:49.981322Z DEBUG ThreadId(61) tungstenite::protocol:
>> Received close frame: None    
>> 2023-07-09T08:03:49.981347Z DEBUG ThreadId(61) tungstenite::protocol:
>> Replying to close with Frame { header: FrameHeader { is_final: true,
>> rsv1: false, rsv2: false, rsv3: false, opcode: Control(Close), mask:
>> None }, payload: [] }    
>> 2023-07-09T08:03:49.981357Z  INFO ThreadId(61)
>> gst_plugin_webrtc_signalling::server: Received message
>> Ok(Close(None))
>> 2023-07-09T08:03:49.981361Z  INFO ThreadId(61)
>> gst_plugin_webrtc_signalling::server: connection closed: None
>> this_id=0d76097e-e8fe-45d5-9769-b184bdc30ba8
>> 2023-07-09T08:03:49.981375Z DEBUG ThreadId(61)
>> remove_peer{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"}:
>> gst_plugin_webrtc_signalling::server: new
>> 2023-07-09T08:03:49.981401Z DEBUG ThreadId(61)
>> remove_peer{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"}:
>> gst_plugin_webrtc_signalling::server: close time.busy=18.1µs
>> time.idle=8.46µs
>> 2023-07-09T08:03:49.981506Z DEBUG ThreadId(56)
>> remove_peer{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"}:
>> gst_plugin_webrtc_signalling::handlers: new
>> 2023-07-09T08:03:49.981537Z  INFO ThreadId(56)
>> remove_peer{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"}:
>> gst_plugin_webrtc_signalling::handlers: removing peer
>> peer_id=0d76097e-e8fe-45d5-9769-b184bdc30ba8
>> 2023-07-09T08:03:49.981551Z DEBUG ThreadId(56)
>> remove_peer{peer_id="0d76097e-e8fe-45d5-9769-b184bdc30ba8"}:
>> gst_plugin_webrtc_signalling::handlers: close time.busy=14.5µs
>> time.idle=33.3µs
>> 
>> 
>> I wonder if you might be willing to comment on this error and offer a
>> suggestion on what might be causing it ?
>> 
>> Also, if anyone else has been able to follow the steps at :
>> rswebrtc
>> gstreamer.freedesktop.org
>> favicon.png
>> 
>> 
>> 
>> could you share your experience ?
>> 
>> Many thanks !!
>> 
>>> On 4 Jul 2023, at 16:43, Mathieu Duponchelle
>>> <mathieu at centricular.com> wrote:
>>> 
>>> Indeed, those should be absolute URLs (patch welcome), but that
>>> doesn't
>>> render the rest of the document invalid does it? In particular, the
>>> pipelines in the usage section are what you are looking for.
>>> 
>>> On Tue, 2023-07-04 at 15:07 +0100, GST Developer via gstreamer-
>>> devel
>>> wrote:
>>>> Thanks Mathieu.
>>>> 
>>>> I had been working through the documentation, but the links to
>>>> the
>>>> signalling server and the API, from this section of the
>>>> documentation
>>>> you linked to,
>>>> at 
>>>> https://gstreamer.freedesktop.org/documentation/rswebrtc/index.ht
>>>> m
>>>> l are returning a 404 error.
>>>> 
>>>> rswebrtc
>>>> (from gst-plugin-webrtc)
>>>> All-batteries included GStreamer WebRTC producer and consumer,
>>>> that
>>>> try their best to do The Right Thing™.
>>>> It also provides a flexible and all-purposes WebRTC signalling
>>>> server
>>>> (gst-webrtc-signalling-server) and a Javascript API (gstwebrtc-
>>>> api)
>>>> to produce and consume compatible WebRTC streams from a web
>>>> browser.
>>>> also, as referenced later in the documentation.
>>>> I suspect I will need to build or install this signalling server
>>>> in
>>>> order to proceed.
>>>> 
>>>> Many thanks again for your help, which is most appreciated :-)
>>>> 
>>>> 
>>>>> On 4 Jul 2023, at 13:46, Mathieu Duponchelle
>>>>> <mathieu at centricular.com> wrote:
>>>>> 
>>>>> These pipelines are simply incorrect, why don't you just read
>>>>> the
>>>>> documentation that is provided?
>>>>> 
>>>>> https://gstreamer.freedesktop.org/documentation/rswebrtc/index.html?gi-language=c#usage
>>>>> 
>>>>> 
>>>>> On Tue, 2023-07-04 at 13:37 +0100, GST Developer via gstreamer-
>>>>> devel
>>>>> wrote:
>>>>>> Many Thanks Matthieu !!!
>>>>>> 
>>>>>> Using ubuntu 22,04LTS, it takes a few quirks, such as not
>>>>>> installing
>>>>>> meson with apt (since that gets 0.61.2 which causes an error
>>>>>> later),
>>>>>> instead using 
>>>>>> pip3 install --user meson==0.62.0
>>>>>> and later maybe editing a few files to stop hard coded links
>>>>>> to
>>>>>> /usr/bin/meson from failing ‘;
>>>>>> Perhaps a few other tweaks, sorry I have done so many i dont
>>>>>> have
>>>>>> a
>>>>>> list
>>>>>> Then finally adding the path using export GST_PLUGIN_PATH
>>>>>> 
>>>>>> Finally, webrtcsink is available in gst-inspect-1.0 !!
>>>>>> 
>>>>>> However, I try an example found online: 
>>>>>> gst-launch-1.0 videotestsrc ! video/x-
>>>>>> raw,width=1024,height=768,framerate=30/1 ! timeoverlay !
>>>>>> x264enc
>>>>>> !
>>>>>> rtph264pay config-interval=1 pt=96 ! webrtcsink
>>>>>> and I get an error:
>>>>>> WARNING: erroneous pipeline: could not link rtph264pay0 to
>>>>>> rswebrtcsink0
>>>>>> 
>>>>>> realistically I guess really I want something more like this
>>>>>> example
>>>>>> I found which seems to have some addressing info : 
>>>>>> gst-launch-1.0 -v videotestsrc ! video/x-
>>>>>> raw,width=640,height=480
>>>>>> !
>>>>>> x264enc ! rtph264pay ! application/x-
>>>>>> rtp,media=video,encoding-
>>>>>> name=H264,payload=96 ! rswebrtcsink
>>>>>> uri=ws://localhost:8080/stream
>>>>>> but this uses something called “rswebrtcsink”….which doesnt
>>>>>> exist...
>>>>>> 
>>>>>> Ultimately what I would like is to run a gstreamer pipeline
>>>>>> which
>>>>>> ends in a webrtcsink, so I can connect a browser directly,
>>>>>>  ideally
>>>>>> with the webrtcsink providing the encoding, the signalling,
>>>>>> everything needed to get the picture into the browser.  
>>>>>> Perhaps
>>>>>> I
>>>>>> misunderstand the capabilities, but the various data I can
>>>>>> find
>>>>>> suggests this is possible.
>>>>>> 
>>>>>> Could you advise a simple syntax to send a test audio and
>>>>>> video
>>>>>> stream to a browser using webrtcsink ?
>>>>>> 
>>>>>> Many, many thanks for your help.
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On 4 Jul 2023, at 11:50, Mathieu Duponchelle
>>>>>>> <mathieu at centricular.com> wrote:
>>>>>>> 
>>>>>>> Compiling the webrtc crate after compiling gstreamer from
>>>>>>> source
>>>>>>> and
>>>>>>> entering the uninstalled environment should work, if you
>>>>>>> encounter
>>>>>>> issues please file them on gitlab with steps to reproduce.
>>>>>>> 
>>>>>>> As for installing GStreamer with webrtcsink included, I
>>>>>>> don't
>>>>>>> know
>>>>>>> if
>>>>>>> distributions actually package gst-plugins-rs to be honest
>>>>>>> :)
>>>>>>> 
>>>>>>> On Mon, 2023-07-03 at 18:25 +0100, GST Developer via
>>>>>>> gstreamer-
>>>>>>> devel
>>>>>>> wrote:
>>>>>>>> Hi Folks.
>>>>>>>> 
>>>>>>>> I am attempting to use WebRTCSink on Ubuntu 22.04 LTS,
>>>>>>>> but
>>>>>>>> despite 2
>>>>>>>> days trial and error I have yet to find any way to
>>>>>>>> install
>>>>>>>> it.
>>>>>>>> 
>>>>>>>> I have tried following guidance for installation of all
>>>>>>>> the
>>>>>>>> plug
>>>>>>>> in
>>>>>>>> groups via apt install, and also compiling gstreamer from
>>>>>>>> source,
>>>>>>>> but
>>>>>>>> whilst I can use webrtcbin, none of my attempts have yet
>>>>>>>> found
>>>>>>>> webrtcsink to be available.
>>>>>>>> 
>>>>>>>> I also went down the root of trying to compile
>>>>>>>> from 
>>>>>>>> https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/tree/m
>>>>>>>> ain/net/webrtc
>>>>>>>> but this tends to get hung up on now having the correct
>>>>>>>> version
>>>>>>>> of
>>>>>>>> various gstreamer or other components.
>>>>>>>> 
>>>>>>>> Is there a simple way to install GStreamer with
>>>>>>>> WebRTCSink
>>>>>>>> included ?
>>>>>>>> 
>>>>>>>> Many thanks for any clues !
>>>>>> 
>>>> 
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230710/92713cce/attachment-0001.htm>


More information about the gstreamer-devel mailing list