使用网络套接字将媒体流式传输到服务器 [英] Streaming Media to Server using web socket

查看:32
本文介绍了使用网络套接字将媒体流式传输到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 WebRtc 的新手.我想将媒体流从客户端(java 脚本)发送到我的服务器(通过 websockets).在我的服务器中,我将对这些媒体内容进行一些处理.

能否请您向我展示通过 websocket 向服务器发送媒体流的客户端代码片段.

谢谢Ganesh.R

解决方案

没有人可以向您展示这一点,因为您无法通过 Websockets 发送流.您需要阅读更多关于 WebRTC 的内容.

WebRTC 使您可以从 Javascript 请求访问媒体设备,并允许您创建一个 PeerConnection,该 PeerConnection 将与另一个端点建立连接以发送从设备捕获的流或一些原始数据(使用 DataChannel).您将无法访问要通过 WebSockets 发送的流数据.相反,浏览器将使用 SRTP 协议通过 UDP 或 TCP 发送它.如果你想在服务器端获取媒体流,你需要实现这个协议和一些协商来建立连接.

HTML5Rocks 有很好的代码片段介绍.>

I am a newbie to WebRtc. I would like to send the media stream from client ( java script) to my server (via websockets). In my server I will be doing some processing on those media content.

Could you please show me a client code snippet on sending media stream to Server via websocket.

Thanks Ganesh.R

解决方案

Nobody can show you this, because you cannot send the stream via Websockets. You need to read a little more about WebRTC.

WebRTC give you the possibility to request access to media devices from Javascript, and allows you to create a PeerConnection that will establish a connection to another endpoint to send the streams captured from the devices or some raw data (using DataChannel). You won't have access to the streams data to send via WebSockets. Instead, the browser will send it over UDP or TCP using the SRTP protocol. If you want to get media streams on server side, you will need to implement this protocol and some negotiation to establish the connection.

HTML5Rocks have a great introduction with code snippets to start.

这篇关于使用网络套接字将媒体流式传输到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆