How to record only active speaker video as composed video

Hi all,

I have developed a conference system where only active speakers can be viewed in zoomed window now I want to record only active speaker video as composed video. I already configured the custom layouts but there is no way to handle active speaker video for recording.

Thanks in advance.

I have this same need and the same scenario.

" but there is no way to handle active speaker video for recording."

That is not true. Custom layouts have the same abilities as any other subscriber participant. You can subscribe the recorder participant to PublisherSpeakingEvents (https://docs.openvidu.io/en/2.13.0/api/openvidu-browser/classes/publisherspeakingevent.html) if that’s what you are using for detecting “active speakers”.

To sum up: a custom recording layout can behave in the same manner as any other client, and you have available all openvidu-browser features to be used in it.

Thanks for the prompt response @pabloFuente; as I mentioned earlier that I have already handled the active speaker in large div using publisherStartSpeaking event now I want to record ONLY active speaker video. Suppose there are two participants A and B, when A start speaking only A’s video should be recorded and when B start speaking only B’s video should be recorded and so on. Please let me know is there some event to do this?

Why don’t you implement that in your custom recording layout? Just reproduce all of the audio streams but show only a single video, changing its video stream when some user triggers the speaking event. That way all audio will be recorded, but only the participant speaking will be seen.

Even if I set the video width and height to 0px that is not active speaker I still see them in recording. What could be the problem?

Thanks

Have you tested your layout is working with a browser?

Maybe the problem is that your own layout is not being used and standard one is being used.

Yes, I have tested my layout and its working perfectly in browser (only active speaker video is showing) but in recording all the videos are being recorded.

Do you have any way to know if your layout is really being used on recording? Can you include some text to identify it?

Can you include a component showing the JavaScript console in the page? In that way, we can see what is happening under the hood.

I thing you can have one of the following problems: a) your layout is not being used.
b) there is a problem with speaker detection on the chrome used by Recording.

You should test your custom layout in your local setup. Follow the instructions in the recording documentation to setup the dev container with recordings enabled and custom layouts. Once you have checked that it is working fine with the dev container and that your custom layout behaves as expected. Once you confirm this come back here, and we will continue helping you.

I think it must be a configuration problem or wrong call to POST /api/recordings/start

Thanks for the help. I just fixed it by reconfiguring the server end, the property defaultRecordingLayout was set as recordingLayout that was wrong.

Now, I want my active speaker video stream as RTMP whenever clicked to broadcast button. I already set up kurento-rtmp that is working fine but I want RTMP in my current project only for active speaker stream. Instead of starting new video stream (#activVideo element) how can I use the stream of participant already joined a session and started speaking, when other participant start speaking RTMP link must be same but video of new active speaker should show in RTMP?

Waiting for your prompt response.

Thanks again. Regards

RTMP streaming is not supported in OpenVidu. It is in our long term roadmap.

If this feature is important for your use case, you can consider supporting it through our commercial services. If you are interested, please contact use sending an email to openvidu+commercial@gmail.com.

Regards

I am interested and contacted openvidu-commercial, please refer me on your behalf too if you can.

Thank you. Regards

In each OpenVideo recording there is white screen video approx 10 sec, but the voice recording is ok. Why this white screen instead of actual stream and how can I get rid of this white screen video from start?

I guess you are using COMPOSED recording. COMPOSED recording works with a containerized Chrome instance connected to the recorded session, displaying all of the published streams as any final user would do. That layout is recorded with ffmpeg.
There’s no total control over when the recorder container has started showing the published video streams, so it might happen that at the begginning some of the video shows a blank screen until the media is finally received.

But 10 seconds is absolutely too much. Whenever this happens, you can expect at most like 1 seconds, and audio and video should start playing at the same time. Check out your CPU usage, as if the server is overloaded COMPOSED recording can suffer and maybe this behavior is a consequence of that.

Regards.

You can take a look to https://recordrtc.org/

Hey @Syed_Gilani , can you share how you did that implementation (put speaker in large div)? I am trying to figure out how to do that but can’t find any support. I got until the part of publisherStartSpeaking, but I am wondering where to go after that. Can I get the publisher object in this function, but how to show in the large div for everyone in the call?

Sorry for being too late. You have to maintain each stream element and when publisherStartSpeaking event gets called you need to broadcast it to all users using signal and move that specific user and its speaker in large div using JS/jQuery.

Thanks