Multiple mixer in one session

Shri Kant

New Member
Hi,
For one room session, we want to stream two RTMP with two different layouts i.e one in portrait mode and other one in landscape mode.
And as per the flashphoner documentation, we can any customized layout by using custom mixer Layout.
https://docs.flashphoner.com/display/WCS52EN/Custom+mixer+layout+configuration+with+a+special+markup+language?src=contextnavpagetreemode

We tried the same but we were not getting the stream for second mixer.
So just wanted to confirm that, is it really valid to create two mixer simultaneously for one session ?

Regards,
Shri
 

Max

Administrator
Staff member
Good day.
You can add one stream to two mixers simultaneosly. To do this, realtime mixer should be enabled (it is on by default):
Code:
mixer_realtime=true
Then, you should:
1. Publish a WebRTC stream using Two Way Streaming, Media Devices etc
2. Create mixer by REST API
Code:
POST /rest-api/mixer/startup HTTP/1.1
HOST: localhost:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "localStreamName": "mixer1",
    "mixerLayoutDir": "/opt/layout1"
}
3. Add the stream to the mixer
Code:
POST /rest-api/mixer/add HTTP/1.1
Host: localhost:8081
Content-Type: application/json
  
{
   "uri": "mixer://mixer1",
   "remoteStreamName": "webrtc_stream"
}
4. Create a second mixer by REST API
Code:
POST /rest-api/mixer/startup HTTP/1.1
HOST: localhost:8081
content-type: application/json
 
{
    "uri": "mixer://mixer2",
    "localStreamName": "mixer2",
    "mixerLayoutDir": "/opt/layout2"
}
3. Add the stream to the second mixer
Code:
POST /rest-api/mixer/add HTTP/1.1
Host: localhost:8081
Content-Type: application/json
  
{
   "uri": "mixer://mixer2",
   "remoteStreamName": "webrtc_stream"
}
5. You can stream both mixers as RTMP using /push/startup REST query. Note that you must use a different RTMP ingest points (at lease stream key cannot be the same for simultaneous publishing).
 
Top