admin管理员组文章数量:1312888
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: .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.
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./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.
Share Improve this question asked Jun 27, 2015 at 23:39 ctuluctulu 4441 gold badge6 silver badges23 bronze badges1 Answer
Reset to default 7You 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.
本文标签: javascriptSending video and audio stream to serverStack Overflow
版权声明:本文标题:javascript - Sending video and audio stream to server - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741901843a2403912.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论