...
REST-method | Example of REST query | Example of response | Response statuses | Description | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
/mixer/startup |
| 200 - OK 400 - Bad request 409 - Conflict 500 - Internal error | Creates a mixer the provided stream is published for | ||||||||
/mixer/add |
| 200 - OK 404 - Mixer not found 404 - Stream not found 500 - Internal error | Add the RTMP stream to the mixer | ||||||||
/mixer/remove |
| 200 - OK 404 - Mixer not found 404 - Stream not found 500 - Internal error | Remove the RTMP stream from the mixer | ||||||||
/mixer/find_all |
| 200 - OK 404 - Not found 500 - Internal error | Find all mixers | ||||||||
/mixer/terminate |
| 200 - OK 404 - Not found 500 - Internal error | Terminate operation of the mixer | ||||||||
/stream/startRecording |
| 200 - OK 404 - Not found 500 - Internal error | Start recording of the stream in the given media session | ||||||||
/stream/stopRecording |
| 200 - OK 404 - Not found 500 - Internal error | Stop recording the stream in the given media session |
Parameters
Parameter name | Description | Example | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
uri | Unique identifier of the mixer | ||||||||||
localStreamName | Name of the output stream of the mixer | stream3 | |||||||||
/mixer/setAudioVideo |
| 200 - OK 400 - Bad request 404 - Not found 500 - Internal error | Mute/unmute video or change audio level for mexer incoming stream |
Parameters
Parameter name | Description | Example |
---|---|---|
uri | Unique identifier of the mixer | |
localStreamName | Name of the output stream of the mixer | stream3 |
hasVideo | Mix video | true |
hasAudio | Mix audio | true |
remoteStreamName | Name of the stream added to the mixer | stream1 |
mediaSessionId | Media session identifier | ce92b134-2468-4460-8d06-1ea3c5aabace |
status | Stream status | PROCESSED_LOCAL |
background | Mixer background | background.png |
watermark | Mixer watermark | watermark.png |
mixerLayoutClass | Mixer layout | com.flashphoner.mixerlayout.TestLayout |
Sending the REST query to the WCS server
...
streams | Streams list or regular expression for search | ^stream.* ["stream1", "stream2"] |
audioLevel | Incoming stream audio level | 0 |
videoMuted | Mute video | true |
Sending the REST query to the WCS server
To send the REST query to the WCS server use a REST-client.
Known limits
...
If video MCU support is enables, channel losses can affect mixer output stream quality. Custom lossless videoprocessor can be used to improve quality, that can make an additional latency.
Incoming streams audio and video management
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.
For example, create a mixer and add 3 streams to it: 2 participants and 1 speaker
Code Block | ||
---|---|---|
| ||
curl -H "Content-Type: application/json" -X POST http://localhost:8081/rest-api/mixer/startup -d '{"uri": "mixer://m1", "localStreamName":"m1"}'
curl -H "Content-Type: application/json" -X POST http://localhost:8081/rest-api/mixer/add -d '{"uri": "mixer://m1", "remoteStreamName": "stream1"}'
curl -H "Content-Type: application/json" -X POST http://localhost:8081/rest-api/mixer/add -d '{"uri": "mixer://m1", "remoteStreamName": "stream2"}'
curl -H "Content-Type: application/json" -X POST http://localhost:8081/rest-api/mixer/add -d '{"uri": "mixer://m1", "remoteStreamName": "desktop"}' |
Mute all participants excluding speaker
Code Block | ||
---|---|---|
| ||
POST /rest-api/mixer/setAudioVideo HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:8081
Accept: */*
Content-Type: application/json
Content-Length: 62
{
"uri": "mixer://m1",
"streams": "^stream.*",
"audioLevel": 0
} |
REST query streams
parameter may be set either as regular expression to match streams by name, or as streams list. Use regular expression syntax supported by Java, the examples can be found here.
Mute stream1 video
Code Block | ||
---|---|---|
| ||
POST /rest-api/mixer/setAudioVideo HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:8081
Accept: */*
Content-Type: application/json
Content-Length: 65
{
"uri": "mixer://m1",
"streams": ["stream1"],
"videoMuted": true
} |
Check streams state by /mixer/find_all query
|
|
Quick manual on testing
1. For this test we use:
...