简体   繁体   English

有没有办法在没有 WebRTC 的情况下从客户端 A -> 服务器 -> 客户端 B 的 stream 视频进行一对多广播?

[英]Is there a way to stream video from client A -> server -> client B for one-to-many broadcast without WebRTC?

I am trying to do a one-to-many broadcast.我正在尝试进行一对多广播。

I do not want to use WebRTC for this because a p2p connection is not ideal when many clients are involved.我不想为此使用 WebRTC,因为当涉及许多客户端时,p2p 连接并不理想。

Is there a way to take a MediaStream from client A, send it to a server, then broadcast it to many other viewer clients?有没有办法从客户端 A 获取 MediaStream,将其发送到服务器,然后将其广播到许多其他查看器客户端?

I have looked into socket.io-stream, but this seems to be more for filestreams and not video streams.我研究了 socket.io-stream,但这似乎更多地用于文件流而不是视频流。

I have thought of sending a screenshot of the screen every so many milliseconds, and sending from client A using socket.emit("frameUpdate",screenshotImgString), but this seems rather resource intensive and does not include handy things like video compression.我曾想过每隔这么多毫秒发送一次屏幕截图,并使用 socket.emit("frameUpdate",screenshotImgString) 从客户端 A 发送,但这似乎相当耗费资源,并且不包括视频压缩等方便的东西。

Is there a way to simply take a stream object, pass it to the server, and then have the server share it with everyone?有没有办法简单的拿一个stream object,传给服务器,然后让服务器分享给大家?

A possibility when using WebRTC is using the Selective Forwarding Unit architecture.使用 WebRTC 时的一种可能性是使用选择性转发单元架构。 But this requires p2p connections between multiple clients with the server, possibly each of which is mediated by a TURN server.但这需要多个客户端与服务器之间的 p2p 连接,可能每个客户端都由 TURN 服务器进行调解。 So there's servers upon servers processing all this, Ideally, if I'm gonna be using a TURN server anyways.因此,服务器上的服务器处理所有这些,理想情况下,如果我无论如何都要使用 TURN 服务器。 I would want a single server relaying everything.我想要一台服务器来中继所有内容。

Not going Client 1 --> TURN server --> SFU server --> TURN server --> {Client 2...N}不去 Client 1 --> TURN server --> SFU server --> TURN server --> {Client 2...N}

But instead Client 1 --> Video Relay Server --> {Client 2...N}而是 Client 1 --> Video Relay Server --> {Client 2...N}

Everything online seems very WebRTC focused, but I am unsure if this is the best solution to my problem.网上的一切似乎都非常专注于 WebRTC,但我不确定这是否是解决我问题的最佳方法。

My development environment is in Node.js我的开发环境在Node.js

An SFU is exactly what you're looking for. SFU 正是您正在寻找的。

With an SFU, a TURN server is normally not needed, data flows directly from the sender to the SFU and then from the SFU to the receiver.使用 SFU,通常不需要 TURN 服务器,数据直接从发送方流向 SFU,然后从 SFU 流向接收方。 (In some rare cases, such as when the client is behind a very restrictive firewall, a TURN server may be useful, but that will be negotiated automatically by the WebRTC stack.) (在极少数情况下,例如当客户端位于非常严格的防火墙后面时,TURN 服务器可能很有用,但这将由 WebRTC 堆栈自动协商。)

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

相关问题 通过服务器将视频从一个客户端传输到另一个客户端 - Stream video from one client to another client through a server WebRTC 客户端无法在视频元素上显示远程 stream - WebRTC Client side can not display remote stream on video element WebRTC-从服务器创建连接客户端-客户端 - WebRTC - create a connection client-client from the server 无法通过flask-socketIO服务器在HTML客户端中显示来自python客户端的视频流 - Cant display my video stream from a python client in the HTML client through a flask-socketIO server 如何从客户端到 flask 服务器并返回客户端的 stream 实时视频帧? - How to stream live video frames from client to flask server and back to the client? 如何直接从我的 WebRTC 到 Facebook RTMP 服务器的 stream 视频? - How to stream video from my WebRTC to Facebook RTMP server directly? 将视频的一部分流传输到客户端 - Stream part of the video to the client Webrtc数据通道服务器到客户端 - Webrtc Data channel server to client WebSockets的-的NodeJS。 是否可以向所有连接的客户端(从服务器)广播消息,而无需客户端首先发送客户端消息 - Websockets-NodeJS. Is it possible to broadcast a message to all connected clients(from the server) without having a client message the client first 如何在Webrtc中保存客户端的stream帧? - How to save the stream frames at the client in Webrtc?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM