简体   繁体   English

如何通过将视频 blob 转换为二进制数据包将其发送到 node.js 服务器?

[英]How to send a video blob to a node.js server by converting it to binary packets?

I am using html5 getUserMedia to attain the user's webcam stream and is stored into an object namely stream now i want to send it to the server using socket.io.我正在使用 html5 getUserMedia 来获取用户的网络摄像头流并存储到一个对象中,即流现在我想使用 socket.io 将其发送到服务器。 When I use follwing code i get an array当我使用以下代码时,我得到一个数组

    navigator.getUserMedia  = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
var video=document.querySelector("#outputview");
if( navigator.getUserMedia ) 
{
    navigator.getUserMedia( {video: true, audio: true},successcallback,errorcallback);
    function successcallback( stream ) 
    {
        video.src = window.URL.createObjectURL(stream);
        var socket = io('http://192.168.1.102:8000');
        socket.emit('data',stream);`

How to convert this into a data stream so that i could send this stream to view in another page?如何将其转换为数据流,以便我可以将此流发送到另一个页面中查看?

你可以从这个演示中得到一些帮助https://github.com/LingyuCoder/SkyRTC-demo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM