Jack Guy
Jack Guy

Reputation: 8523

WebRTC Server PeerJS get data stream

I'd like to set up a video calling service while doing server-side work with the video stream in Node.js. Compatibility wasn't an issue for my project, so WebRTC seemed the obvious choice. I found PeerJS, which allows for really simple usage of WebRTC. Wh server can be started in a Node.js script.

I want to take this video stream and do some computations with OpenCV on the server. I considered using something like Binary.js to transfer video data, but that would be much slower. How can I get the WebRTC video stream on my Node.js server?

Something like the following

var PeerServer = require('peer').PeerServer;
var server = new PeerServer({ port: 9000 });

server.on('data', function (data)
{
     do_something_with_open_cv(data);
});

Obviously this would require the video chunks to be complete frames. Can I access this stream in such a manner?

Upvotes: 1

Views: 1734

Answers (1)

flo850
flo850

Reputation: 138

As far as I know, there is no way to use a nodejs server as a peer. PeerServer is the signaling/auth server working with peerjs.

Perhaps you'll have more luck using a MCU like erizo : https://npmjs.org/package/erizo-api

Upvotes: 1

Related Questions