Room streams control and record

kindco

Member
Hello @Max ,

We have 2 questions about room (conference) functionality.

1. Does room owner (person who created the room) have any builtin possibilities to mute/unmute other conference participants? We are developing a conference solution where host (room creator) can manage guests, and only one guest can speak at the same time.

2. We want to record conference videos. Can we use mixer functionality for this? If yes, does it have any pitfalls or, on the contrary, any special/simplified integration (that would be reasonable) in case of rooms/conferences?

Thanks!
 

Max

Administrator
Staff member
Good day.
1. Does room owner (person who created the room) have any builtin possibilities to mute/unmute other conference participants? We are developing a conference solution where host (room creator) can manage guests, and only one guest can speak at the same time.
This is not possible yet, but we already working on participants stream management implementation in ticket WCS-2957. This will be possible for MCU mixer based conference.
2. We want to record conference videos. Can we use mixer functionality for this? If yes, does it have any pitfalls or, on the contrary, any special/simplified integration (that would be reasonable) in case of rooms/conferences?
Yes, you can record a mixer output stream.
Again, we recommend you to use MCU mixer for conferencing, in this case you should just record a room (mixer) output stream using REST API:
1. Find the mixer output stream by name ("room1" for example)
Code:
POST /rest-api/stream/find HTTP/1.1
Host: 192.168.1.101:8081
Content-Type: application/json
 
{
    "name":"room1",
    "published":true
}
This will return stream parameters including mediaSessionId
Code:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

[
    {
        ....
        "mediaSessionId":"4f112b20-13d0-11e7-b521-59a9cb7eddeb",
        "name":"room1",
        "published":true,
        ...
    }
]
2. Start recording for mediaSessionId found
Code:
POST /rest-api/recorder/startup HTTP/1.1
Content-Type: application/json                      
Host: 192.168.1.101:8081                      
                                                      
{
    "mediaSessionId": "4f112b20-13d0-11e7-b521-59a9cb7eddeb"
}
Or you can record all the mixer output streams with the following parameter
Code:
record_mixer_streams=true
 

kindco

Member
@Max ,
How can we estimate server resources required for MCU mixer? Or, how many conference participants can be handled by 1 CPU if we are going to get 720p output?
 

Max

Administrator
Staff member
How can we estimate server resources required for MCU mixer?
We performed mixer load tests on hardware server (16 CPU cores Intel Xeon 3 GHz, 128 Gb RAM). This configuration is enough for 30 simultaneous participants in one MCU mixer with output stream 720p 30 fps. All the cores were evenly loaded by 40 % each.
how many conference participants can be handled by 1 CPU if we are going to get 720p output?
When MCU mixer is used, there is 1 video encoder on server and a number of audio encoders (2 * participants count + 1). For 30 participants, fro example, there will be 61 audio encoder. In this case, Linux kernel spreads a load between cores, so we cannot answer the question in this form/ Please see test results above.
Please also note that some mixer tuning is requires to handle a many participants, see details here
 

Max

Administrator
Staff member
Good day.
Since build 5.2.835 it is possible to change audio level and mute video for mixer incoming streams. In this case, the original stream remains unchanged. Video track can be muted (black screen) and then unmuted. For audio track, volume level can be set in percent up to 100, or sound can be muted by setting level to 0.
Incoming streams are managed using REST API query /mixer/setAudioVideo:
Code:
POST /rest-api/mixer/setAudioVideo HTTP/1.1
Host: localhost:8081
Accept: */*
Content-Type: application/json
Content-Length: 62
 
{
"uri": "mixer://m1",
"streams": "^stream.*",
"audioLevel": 0,
"videoMuted": true
}
Please read the details here
 

kindco

Member
Hello @Max
In our app, not every user will be able to create or join the conference. Because of this, I'm going to use server-to-server REST requests /mixer/startup and /mixer/add instead of automatic mixer creation feature. But in this case, how can I set custom stream labels?
 

Max

Administrator
Staff member
Hello,

But in this case, how can I set custom stream labels?
- mixer startup
Code:
/rest-api/mixer/startup
{
  "uri": "mixer://room1",
  "localStreamName": "room1"
}
- a stream published without auto adding to mixer
Code:
session.createStream({
    streamName: "stream1?label=John Doe",
    display: localDisplay,
    ...
}).publish();
- the stream added to the mixer
Code:
/rest-api/mixer/add
{
  "uri": "mixer://room1",
  "remoteStreamName": "stream1"
}
 

kindco

Member
Hello @Max

I couldn't do this :(

If I add ?label=NAME to the local stream name, then start a mixer with /mixer/startup, and then try to add a user with /mixer/add, like you suggested, I get a 404 error from WCS...

Also, what should be the name of the "local" mixer stream that doesn't include local audio? I tried template [mixer_name]-[stream_name][mixer_name] as in the "MCU Client" example, but get "Session does not exist" error...
 

kindco

Member
Well, the first error's gone after update.
But the second question is still actual: what should be the mixer stream name to exclude certain participant audio?
 

Max

Administrator
Staff member
But the second question is still actual: what should be the mixer stream name to exclude certain participant audio?
If you are using REST API to add stream to mixer, you should use template [mixer_name]-[stream_name] to get mixer stream without local audio, because the local stream name does not include mixer name in this case.
 

kindco

Member
@Max
Is there any possibility to add participant to a meeting already muted? Using 'hasAudio' => 'false' in /mixer/add parameters seems not working.
 

Max

Administrator
Staff member
'hasAudio' => 'false' in /mixer/add parameters seems not working
Works in latest 5.2.878: stream is added to mixer as video-only. If it does not work, please describe in which case.
 

kindco

Member
We need to mute/unmute participants during the conference, but initially (right after join) all participants must be muted. When I use 'hasAudio' => 'false' I cannot unmute this user later with audioLevel: 100, but if I use 'hasAudio' => 'true' then all users are unmuted initially. Of course, I can send /mixer/setAudioVideo with audioLevel: 0 right after /mixer/add, but I just wanted to know if this can be done in a single request.
 

Max

Administrator
Staff member
We need to mute/unmute participants during the conference, but initially (right after join) all participants must be muted.
You can mute participants audio on client side
Code:
publishStream = session.createStream({
    ...
}).on(STREAM_STATUS.PUBLISHING, function (stream) {
    stream.muteAudio();
});
publishStream.publish();
but in this case you have to unmute on client sude also.
Of course, I can send /mixer/setAudioVideo with audioLevel: 0 right after /mixer/add, but I just wanted to know if this can be done in a single request.
If you want a speaker to control participants, you should use two REST queries consequentally: /mixer/add, then /mixer/setAudioVideo with audioLevel: 0
There is no a single query for it.
 

kindco

Member
@Max maybe it makes sense to add audioLevel and videoMuted parameters to /mixer/add method, so one can add muted participants using request like
JavaScript:
{
  "uri": "mixer://mixer1",
  "remoteStreamName": "stream1",
  "hasVideo": "true",
  "hasAudio": "true",
  "audioLevel": 0,
  "videoMuted" false
}
?
 
Top