centricular / gstwebrtc-demos

Superseded by https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-examples/webrtc - Demo apps for using gstreamer's webrtc implementation
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/tree/main/subprojects/gst-examples/webrtc
BSD 2-Clause "Simplified" License
488 stars 197 forks source link

Demo and Janus Gateway: DTLS BIO error #27

Closed steveseguin closed 4 years ago

steveseguin commented 6 years ago

Amazing work guys, really. I'm super excited by this new webRTC integration! Anyways, I've deployed Gstreamer Master onto a Raspberry Pi and got the sendrecv Python demo to work with the provided website. Bouncing ball and noise.

I then modified the demo a small amount to interface with a working custom Janus WebRTC gateway server I have; the goal being to push the same bouncing ball stream to that.

The thing is, it isn't working. After the SDP answer is processed by Gstreamer and all ICE candidates are sent, instead of beginning the stream, I get a few DTLS errors, and then nothing. Janus just sits idle waiting for the stream to begin it looks like.

0:00:05.914482127 6232 0x9e2c30 WARN dtlsconnection gstdtlsconnection.c:737:openssl_poll:GstDtlsConnection@0x71f1a0a8 do_handshake encountered BIO error

A full output dump is here: https://paste.ofcode.org/tCEyRq2jiAAfvtQEiWKUNY

I'll work on this endlessly until I get it working, but at this point I feel there is a good chance there is an incompatibility. I ran into a lot of DTLS errors in the past with Janus.

thaytan commented 6 years ago

It's common in my experience to get a few of the DTLS BIO warnings during startup that should stop after DTLS nego is done.

It looks like the log paste is gone alraedy. so it's hard to comment further on your failure. It could be trying ICE candidates to establish a feed, or perhaps Janus can't handle the packets it's receiving?

ystreet commented 5 years ago

@steveseguin Did you ever manage to get this working?

steveseguin commented 5 years ago

No, I didn't, though I didn't pursue this past a few hours of effort. I appreciate the follow up.

On Thu, Sep 27, 2018 at 2:13 AM Matthew Waters notifications@github.com wrote:

@steveseguin https://github.com/steveseguin Did you ever manage to get this working?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/centricular/gstwebrtc-demos/issues/27#issuecomment-424970949, or mute the thread https://github.com/notifications/unsubscribe-auth/ACdNUnxxboyfr6G3z1SaSG_mLFYHLwHTks5ufGyHgaJpZM4U1RJX .

petergerten commented 5 years ago

I am also trying to get this to work with Janus and ran into DTLS errors. Is anybody still working on this or got it running?

petergerten commented 5 years ago

Using wireshark I now figured out that gstreamer does not initiate the DTLS handshake.

petergerten commented 5 years ago

@ystreet What conditions need to be met to make gstreamer initiate the DTLS handshake? According to Janus everything is setup and a candidate peer selected. But gstreamer should be the active DTLS role and initiate the handshake. Wireshark does not see any DTLS packets though and janus times out. (Janus status output: https://pastebin.com/qFBctiyS)

petergerten commented 5 years ago

I tried to force Janus initiate the handshake by modifying the SDP from gstreamer -> DTLS role "active"->"passive" and Janus indeed starts the handshake with a "Client hello" DTLS paket on the wire. GStreamer never answers it though.

petergerten commented 5 years ago

After further investigation I found that gstreamer did not automatically add the ICE candidates from the SDP and I had to manually add them. (I wrongly assumed I only have to do that for trickle candidates) After that - all is fine and the DTLS handshake works :-)

saket424 commented 5 years ago

@petergerten , Can you please post a gist with some sample code to connect and handshake with Janus using gstreamer webrtcbin so I can replicate your success? Thanks