简体   繁体   中英

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.

Is there a way to take a MediaStream from client A, send it to a server, then broadcast it to many other viewer clients?

I have looked into socket.io-stream, but this seems to be more for filestreams and not video streams.

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.

Is there a way to simply take a stream object, pass it to the server, and then have the server share it with everyone?

A possibility when using WebRTC is using the Selective Forwarding Unit architecture. But this requires p2p connections between multiple clients with the server, possibly each of which is mediated by a TURN server. So there's servers upon servers processing all this, Ideally, if I'm gonna be using a TURN server anyways. I would want a single server relaying everything.

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

But instead 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.

My development environment is in Node.js

An SFU is exactly what you're looking for.

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. (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.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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