Sending video and audio stream to the server

I am trying to develop a system that has two clients that can video chat with each other from their browsers through a server. The first client sends its video stream to the server, and the server sends it to the second client. In addition, the server saves the client's stream as a video file.

I used this WebRTC example: https://github.com/webrtc/samples/blob/master/src/content/getusermedia/source/js/main.js

Server side;

var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);

app.use(express.static('C:/source/'));
app.get('/', function(req, res) {
    res.sendFile('C:/source/index.html');
});

io.on('connection', function(socket) {
    console.log('user connected.');

    socket.on('disconnect', function() {
        console.log('user disconnected.');
    });

    socket.on('chat message', function(msg) {
        ?
    });
});

http.listen(3000, function(){
  console.log('listening on *:3000');
});

      

Client side;

var socket = io();

while(streaming) {
   socket.emit(?);
}

      

I cannot figure out from which source I should release the client video + audio stream to the server. If I load the stream successfully, I can process it server side.

+3


source to share


1 answer


You will need a server capable of handling the WebRTC environment.

I suggest looking at Kurento , Janus , Jitsi Videobridge , FreeSWITCH, and Asterisk as alternatives.



This will take a lot more effort from your end as it all requires learning more about them, WebRTC and real-time media processing.

If you need this job yesterday and want to put your effort and focus elsewhere, you should check out some of the vendors listed in this WebRTC PaaS report .

+7


source







All Articles