borjanebbal / webrtc-node-app

This repository contains a simple WebRTC app, created for educational purposes.
92 stars 53 forks source link

Streamming #3

Closed davidoween closed 3 years ago

davidoween commented 3 years ago

Could you use this example as a basis for developing Streamming ? One user streams content and the rest just join the room

borjanebbal commented 3 years ago

Although this example only allows a one-to-one video call, you can implement a one-to-many video broadcast application with WebRTC, it wouldn't require too many changes but I suggest you understand the basics first and play with the peer connections.

Take into account that the number of supported participants will be limited by the broadcaster capacity to maintain a peer connection for each viewer but you can add a media server to manage the connections.

davidoween commented 3 years ago

And how could I add a media server to handle the connections? I need to create streaming video with the web cam.

borjanebbal commented 3 years ago

Instead of a mesh architecture, where participants send their streams to all the other participants, you will have to make participants send their streams to the media server, then the server can forward the streams and the number of streams each participant sends will be reduced to one. For this purpose, you can use a Selective Forwarding Unit (SFU) or a Multipoint Control Unit (MCU) server.

It would require another article to explain these concepts deeper but I hope this brief explanation can be used as a starting point for you. There are many open-source projects for WebRTC media servers available like Janus, Kurento and Jitsi,