问题描述
我尝试了新的和令人兴奋的功能的铬金丝雀19。
Im trying out the new and exciting features of chrome canary 19.
我基本上可以从网络摄像头抓取视频,并将其设置为源元素视频标签。
I can basically grab the video from the web-cam and set it to a source element for a video tag.
<!DOCTYPE html>
<html>
<head>
<title>Camera capture</title>
<script>
var localStream;
var localStreamObjUrl;
window.onload = function() {
navigator.webkitGetUserMedia("audio, video", gotStream);
}
function gotStream(stream) {
localStream = stream;
localStreamObjUrl = webkitURL.createObjectURL(localStream);
var video = document.getElementById("selfView");
video.src = localStreamObjUrl;
}
</script>
</head>
<body>
<video id="selfView" autoplay audio=muted></video>
</body>
</html>
从,我们可以抓取视频并将其流式传输到对等端...
我的问题是,我可以避免做所有的遍历获取p2p连接并直接将视频上传到服务器? Id想要能够中继视频流而不是发送它p2p。
From the example at https://apprtc.appspot.com, we can grab the video and stream it to a peer...
My question is, can I avoid doing all the traversal to get a p2p connection and directly upload the video to a server? Id like to be able to relay the video stream instead of sending it p2p.
推荐答案
您需要某种流媒体服务器背部。
You need some kind of streaming media server on the back.
过程将是:
- 捕获Feed
- 将其发送到服务器
- 转码为各种客户端格式
- 管理出站流
- capture the feed
- send it to the server
- transcode to various client formats
- manage the outbound streams
有许多免费和付费的品种可供选择:
There are numerous free and paid varieties available:
- nodejs(demo/POC)
- wowza(paid)
- chrome based
有关转码的详情:
媒体的瑞士军刀:
等等。
这篇关于从浏览器向服务器发送视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!