3

I am trying to develop a system where there are two clients that can video chat to each other from their browsers over a server. First client sends its video stream to the server and the server sends it to the second client. Also, server saves 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 can't understand that from which source I should emit the video + audio stream of the client to the server. If I successfully upload the stream, I will be able to handle it on server side.

ctulu
  • 444
  • 1
  • 6
  • 23

1 Answers1

7

You will need a server that is capable of processing WebRTC media.

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

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

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

Tsahi Levent-Levi
  • 2,351
  • 2
  • 18
  • 26
  • Are you suggesting me to not to do it myself and use a project that has already done it? – ctulu Jun 28 '15 at 19:04
  • 3
    If you need it to be working yesterday, I believe you want to use something that is already done.If you have the time and want to do it, I can say that it is a wonderful long journey to learn so many protocols and implement them. – nakib Jul 01 '15 at 11:21
  • 2
    Definitely use something that is out there already - unless what you are trying to do is have a learning experience or make that a core differentiator (which you probably don't) – Tsahi Levent-Levi Nov 22 '15 at 06:05