node-webrtc-examples icon indicating copy to clipboard operation
node-webrtc-examples copied to clipboard

Unable to record video from different network

Open co2nut opened this issue 4 years ago • 5 comments

Based on examples/record-audio-video-stream, when I run it on different network, it seems that it does not go through this listener

videoSink.addEventListener('frame', ({ frame: { width, height, data }}) => {

everything works fine on same network.

I tried to add below config too, but no luck

peerConnections = new RTCPeerConnection({
            sdpSemantics: 'unified-plan',
            iceServers: [
              {
                urls : 'stun:stun.l.google.com:19302'
              },
              {
                urls : 'turn:numb.viagenie.ca',
                username: "[email protected]",
                credential: "password",
              }
            ]
          }    
})

Is there anything that I could possibly miss out?

co2nut avatar Oct 29 '20 09:10 co2nut

I am facing this same issue. Is there a way to resolve this?

Pirsanth avatar Oct 30 '20 08:10 Pirsanth

Same issue

kalradivyanshu avatar Nov 09 '20 10:11 kalradivyanshu

Same issue

TurningTide avatar Nov 23 '20 12:11 TurningTide

Has anyone solved this?

brndusic avatar Mar 01 '21 15:03 brndusic

Refer the document here. These examples are not currently support for srflx/relay candidate. So STUN/TURN server cannot work for these example right now.
https://github.com/node-webrtc/node-webrtc-examples/blob/master/README.md


RTCPeerConnection Negotiation

RTCPeerConnections are negotiated via REST API. The Server always offers (with host candidates) and the Client always answers. In order to negotiate a new RTCPeerConnection, the Client first POSTs to /connections. The Server responds with an RTCPeerConnection ID and SDP offer. Finally, the Client POSTs an SDP answer to the RTCPeerConnection's URL.

Client                                               Server
  |                                                     |
  |  POST /connections                                  |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |  { "id": "$ID", "localDescription": "$SDP_OFFER" }  |
  |                                                     |
  |<----------------------------------------------------|
  |                                                     |
  |  POST /connections/$ID/remote-description           |
  |  $SDP_ANSWER                                        |
  |                                                     |
  |---------------------------------------------------->|
  |                                                     |
  |                                             200 OK  |
  |                                                     |
  |<----------------------------------------------------|

milochen0418 avatar Mar 08 '21 07:03 milochen0418