Troubleshooting unidirectional stream behind NATs

Gabriel Pimenta pimentgabriel at gmail.com
Sun May 29 17:58:22 UTC 2022


Hello!
(Also posted on gstreamer-java maliling list)

I have set up a one-way WebRTC stream from a Java server (running
gstreamer) to a browser client. It all worked fine when streaming locally
to clients, but it doesnt work when the browser client is in a different
network behind a NAT.

I thought that adding a TURN server to the client's RTCPeerConnection
object would solve it, but it didnt. The logs from gstreamer show that
there was a connectivity issue between the peers, without any further
details:

"webrtcbin
gstwebrtcbin.c:1399:_update_peer_connection_state_task:<gstreamer-webrtc-server>
Peer connection state change from connecting(1) to failed(4)"

I have a couple of questions that might help me with troubleshooting:

   1. Is adding a TURN server really the only thing that needs to be done
   regarding enabling streaming through NAT holes? Is there anything else to
   be done related to WebRTCBin config in order to make it work?
   2. It seems that WebRTCBin tries the peer connection on the first
   candidate that arrives, and stops after the first failure. Shouldnt it
   retry with every possible remote candidate?
   3. Is there anywhere else I can get more information about the
   connectivity issue that is happening other than gstreamer/browser client
   logs?

Relevant information about my setup:

   - The TURN server I have been using is a public one:  turn:
   numb.viagenie.ca, as listed here
   <https://gist.github.com/sagivo/3a4b2f2c7ac6e1b5267c2f1f59ac6c6b>. It
   was tested here
   <https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice>
and
   returns relay candidates as expected.
   - The streaming server is also running in a private network but exposed
   via 8080 port-forwarding to the internet.
   - Source code <https://github.com/gpr-indevelopment/gote-game-server-2> of
   it all, if anyone is interested. It is a java app currently using bindings
   for Java.

Any help is appreciated. Thank you in advance.

Best regards,

Gabriel Robaina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220529/c6ca243c/attachment.htm>


More information about the gstreamer-devel mailing list