One to many video or audio call with publisher switch

Hello everybody.

First of all congratulation for the excellent work in OpenVidu project. I tried it last week and it is really awesome.

I managed to implement a POC using Kurento as media server and performing some tests I verified that an N-to-N approach in Kurento leads to a high cpu usage and a lot of webrtc messages being exchanged between peers. When we have more than 8 participants trying to joining the call, we verified that not all participants receives the video from other participants.

I understand that for a N-to-N architecture, we would have one stream sending audio/video and N-1 Streams receiving audio/video for each participant (total N + N*(N-1)). It is a lot of connections and a lot of webrtc messages for each participant receive the video from other participants.

I would like to ask for some help…

First I would like to know if I am right in my analyse and if so, if Is it possible to optimize architecture in order to support a call with more users.

I know that Kurento offers a mechanism for one-to-many implementation. I am trying to implement this by using dispatcher and hub port techniques, but the code is getting a mess. I am assuming that this way the amount of webrtc messages would be reduced and the streams would be one 2 per participant, one to receive and another to send the media I would like to know if I am right.

My current use case is only one participant transmitting audio. But the transmitter could be changed based on a request. I need to support 100 participant in this type of call.

I managed to run the OpenVidu tutorials and I incorporate the concepts in my current POC. I have an audio and video call being setup correctly.

My point is, base on the tutorial and based on this peace of code:

const publisher: Publisher = this.OV.initPublisher(undefined, {
audioSource: undefined, // The source of audio. If undefined default microphone
videoSource: undefined, // The source of video. If undefined default webcam
publishAudio: true, // Whether you want to start publishing with your audio unmuted or not
publishVideo: true, // Whether you want to start publishing with your video enabled or not
resolution: ‘640x480’, // The resolution of your video
frameRate: 30, // The frame rate of your video
insertMode: ‘APPEND’, // How the video is inserted in the target element ‘video-container’
mirror: false // Whether to mirror your local video or not
});

How I implement, if possible an architecture where I have only on publisher at a time, but with the possibility of this publisher changes during the call.

I appreciate any help

Thanks

Claudio

Hi, could somebody help me with these doubts??

If you just want one publisher at a time, you application have to control it. That is, when a new participant start publishing, the previous publisher just terminate its publishing automatically. You can use websocket signaling to coordinate all participants.

With this coordination mechanishm in place, the subscribing code is very simple. Just subscribe to the only publisher in the room.

Best regards

Hello, thanks for the reply!! That is nice. I think I will be able to implement this control through the signaling server. I am working on it!!

But I still have doubts regarding the number of connection between these peers! By having just one publisher, will the publisher have only one stream to send media and the receivers only one stream to receive the media of the publisher? Or internally Openvidu will create the N-1 connection for each participant leading to a total of N + N*(N-1) connecctions.

Moreover, when switching the publisher a whole new webrtc signaling will be performed by openvidu in order to create the connection for the new publisher?

In my tests using a SFU architecture, for 10 participant I had 1 outgoing 9 incoming stream for each participant (total 100) This leads to a high cpu consumption.

My use case would be only one audio stream at a time for a call with 100 participants. So, I would expect onlye 2 connection per peer, one to send and one to receive…

Do you know if it is possible??

Yes.

No.

Yes. OpenVidu doesn’t allow to change from one publisher to another reusing the same WebRtc transport. We are working in adding this feature in OpenVidu Enterprise (thanks to mediasoup). But it is not available right now.

Yes. It is possible.