node-webrtc / node-webrtc-examples

MediaStream and RTCDataChannel examples using node-webrtc
508 stars 161 forks source link

'frame' event on RTCVideoSink is not called. #36

Open kinnefix opened 3 years ago

kinnefix commented 3 years ago

I was trying to make my nodejs application to record videos from clients through webrtc. Even if I addTrack on client side and verified that negotiation was successful, 'frame' event on RTCVideoSink on server side is not called. 'track' event on RTCPeerConnection is called as expected.

I also tried record-audio-video-stream form this repository, but it didn't work. What could be the problem?

Here are information about my environment: Server : OS: Ubuntu 18.04 x86_64, NodeJS Version : v14.12.0 Client: Chrome Version : 86.0.4240.75

Edit: I just figured out that the problem disappears when I test server on Windows 10 machine. (It now triggers exception after frame event is called. The exception is about not being able to listen on sock files which is not really related to this issue)

Perhaps wrtc has some dependency that my Ubuntu machine doesn't have? This time, NodeJS of version v14.13.0 was used.

paulgrammer commented 3 years ago

I'm also facing the same issue here, any solutions yet ?

deepakcs95 commented 1 year ago

peerConnection.ontrack = function ontrack(receiver, streams, transceiver) {

if (receiver.track.kind === "video") { const track = receiver.streams[0].getVideoTracks()[0];

const sink = new RTCVideoSink(track) works for me