Dynamic MCU mixer layout

Max

Administrator
Staff member
So following your question
A layout is updated only on stream create/delete, as far as i see.
No. The layout will be switched between files 1.mix 2.mix, etc., depending on number of streams in the Mixer.
 
Actually, the custom layout is a folder with N files

1.mix
2.mix
..
N.mix

If 1 participant in the mixer then 1.mix config will be taken as XML layout
If 2 participant in the mixer then 2.mix config will be taken as XML layout
etc

Yes. You can set layout folder during mixer creation.

/rest-api/mixer/startup
{
"uri": "mixer://mixer1",
"localStreamName": "mixer1_stream",
"hasVideo": true,
"hasAudio": false,
"mixerLayoutDir": "/opt/mixer1-layout"
}
Got it, thanks. I'd like to submit a feature request to be able to re-apply/update layout on existing streams.
 

Max

Administrator
Staff member
I'd like to submit a feature request to be able to re-apply/update layout on existing streams.
Suppose there are 2 participants in mixer (2.mix layout is used).
You can update layout for a certain number of participants by the following way:
1. Change the content of 2.mix as needed (background, watermark, picture positions etc)
2. Remove one participant from mixer (without stopping the participant stream)
Code:
POST /rest-api/mixer/remove HTTP/1.1
HOST: wcs:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "remoteStreamName": "participant1"
}
The layout 1.mix will be applied
3. Re-add the participant to mixer
Code:
POST /rest-api/mixer/add HTTP/1.1
HOST: wcs:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "remoteStreamName": "participant1"
}
The layout 2.mix will be re-applied with changes made on step 1.
 
This makes sense. And after giving it a thought I realised that by using a java class i can apply any sort of modifications I want to all streams.
 

Max

Administrator
Staff member
We raised the ticket WCS-3592 to implement REST API to change mixer layout dynamically without streams readdition. Will inform about a progress. This may take a time.
 

Luca

Member
We raised the ticket WCS-3592 to implement REST API to change mixer layout dynamically without streams readdition. Will inform about a progress. This may take a time.
This is a very valuable feature which I am very interested in, I would suggest(if possible) to also implement some sort of transition effect when dynamically changing the layout as to make it more easy on the eye and make it look more professional, really looking forward to see this completed.
 

Luca

Member
Good day.
Since build 5.2.1480, some mixer parameters may be changed by REST API on the fly: Changing mixer parameters on the fly by REST API. See the example for custom mixer layout application: Applying a custom layout to an active mixer on the fly.
That's amazing news Max and an excellent addition to the feature of the WCS server!

Another great addition would be the ability to change the background on the fly, so if could be in the roadmap would be another massive help.

Thanks
 
Last edited:

Max

Administrator
Staff member
Another great addition would be the ability to change the background on the fly,
Yes, background can be changed on the fly
Code:
POST /rest-api/mixer/set_parameter HTTP/1.1
HOST: 192.168.1.101:8081
Content-type: application/json
  
{
    "uri": "mixer://mixer1",
    "background": "/opt/blue.png"
}
But it cannot rolled back to default yet (ticket WCS-3631), so you have to change background to a default (black) picture manually as workaround if needed.
 

Max

Administrator
Staff member
Good day.
We fixed the issue with rolling back to default background in build 5.2.1489. The following should work now:
- set the custom background
Code:
POST /rest-api/mixer/set_parameter HTTP/1.1
HOST: 192.168.1.101:8081
Content-type: application/json
  
{
    "uri": "mixer://mixer1",
    "background": "/opt/blue.png"
}
- roll back to default one
Code:
POST /rest-api/mixer/set_parameter HTTP/1.1
HOST: 192.168.1.101:8081
Content-type: application/json
  
{
    "uri": "mixer://mixer1",
    "background": ""
}
 
Top