广播现场摄像头stream

我想logging我的摄像头,并实时向其他客户端广播stream。

我可以很容易地在同一页面的video标签中显示我的摄像头:

function initialize() { video = $("#v")[0]; width = video.width; height = video.height; var canvas = $("#c")[0]; context = canvas.getContext("2d"); nav.getUserMedia({video: true}, startStream, function () {}); } function startStream(stream) { video.src = URL.createObjectURL(stream); video.play(); requestAnimationFrame(draw); } function draw() { var frame = readFrame(); if (frame) { replaceGreen(frame.data); context.putImageData(frame, 0, 0); } requestAnimationFrame(draw); } function readFrame() { try { context.drawImage(video, 0, 0, width, height); } catch (e) { return null; } return context.getImageData(0, 0, width, height); } 

但是,如何将这个stream发送到服务器,做一些image processing,然后brodcast到其他客户端?

nodejs是最好的方法吗? 你有一些阅读/库推荐我吗?

目前有几个工作草案,但我认为目前在浏览器中直播video的最好方法是使用Flash ActionScript。 当然,客户端仍然需要安装一个插件来在浏览器中运行应用程序。 请注意,在这种情况下,您不能使用Apache Web服务器来播放实况video。 您将需要一个媒体服务器,如Red5(免费),Wowza或Adobe Media Server。

另外,看看你是否可以在这里find一些帮助:

“WebRTC(RTC代表实时通信)是一种能够在浏览器客户端(对等体)之间实现audio/videostream和数据共享的技术。 作为一套标准,WebRTC为任何浏览器提供了共享应用程序数据和进行远程电话会议的能力,而无需安装插件或第三方软件。 “