...
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 | ||||||||
/mixer/setAudioVideo |
| 200 - OK 400 - Bad request 404 - Not found 500 - Internal error | Mute/unmute video or change audio level for mexer incoming stream | ||||||||
/mixer/set_body_watermark |
| 200 - OK 400 - Bad request 404 - Not found | Add watermark to mixer output stream picture | ||||||||
/mixer/set_stream_watermark |
| 200 - OK 400 - Bad request 404 - Not found | Add watermark to one of the mixer input streams pictures in the mixer output stream | ||||||||
/mixer/set_parameter |
| 200 - OK 400 - Bad request 404 - Not found | Change the mixer parameter |
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 |
streams | Streams list or regular expression for search | ^stream.* ["stream1", "stream2"] |
audioLevel | Incoming stream audio level | 0 |
videoMuted | Mute video | true |
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
[ { "localMediaSessionId": "7c9e5353-8680-4ad2-8a47-1a366091785c", "localStreamName": "m1", "uri": "mixer://m1", "status": "PROCESSED_LOCAL", "hasAudio": true, "hasVideo": true, "record": false, "mediaSessions": [], "mixerLayoutClass": "com.flashphoner.media.mixer.video.presentation.GridLayout", "mixerLayoutDir": "/opt/mixer1-layout", "mixerActivityTimerCoolOffPeriod": 1, "mixerActivityTimerTimeout": -1, "mixerAppName": "defaultApp", "mixerAudioOpusFloatCoding": false, "mixerAudioSilenceThreshold": -50, "mixerAudioThreads": 4, "mixerAutoScaleDesktop": true, "mixerDebugMode": false, "mixerDesktopAlign": "TOP", "mixerDisplayStreamName": false, "mixerFontSize": 20, "mixerFontSizeAudioOnly": 40, "mixerIdleTimeout": 20000, "mixerInBufferingMs": 200, "mixerIncomingTimeRateLowerThreshold": 0.95, "mixerIncomingTimeRateUpperThreshold": 1.05, "mixerMcuAudio": false, "mixerMcuVideo": false, "mixerMcuMultithreadedMix": false, "mixerMinimalFontSize": 1, "mixerMcuMultithreadedDelivery": false, "mixerOutBufferEnabled": false, "mixerOutBufferInitialSize": 2000, "mixerOutBufferStartSize": 150, "mixerOutBufferPollingTime": 100, "mixerOutBufferMaxBufferingsAllowed": -1, "mixerShowSeparateAudioFrame": true, "mixerTextAutoscale": true, "mixerTextColour": "0xFFFFFF", "mixerTextBulkWriteWithBuffer": true, "mixerTextBulkWrite": true, "mixerTextBackgroundOpacity": 100, "mixerTextBackgroundColour": "0x2B2A2B", "mixerTextPaddingLeft": 5, "mixerVoiceActivitySwitchDelay": 0, "mixerVoiceActivityFrameThickness": 6, "mixerVoiceActivityFramePositionInner": false, "mixerVoiceActivityColour": "0x00CC66", "mixerVoiceActivity": true, "mixerVideoWidth": 1280, "mixerVideoThreads": 4, "mixerVideoStableFpsThreshold": 15, "mixerVideoQuality": 24, "mixerVideoProfileLevel": "42c02a", "mixerVideoLayoutDesktopKeyWord": "desktop", "mixerVideoHeight": 720, "mixerVideoGridLayoutPadding": 30, "mixerVideoGridLayoutMiddlePadding": 10, "mixerVideoFps": 30, "mixerVideoDesktopLayoutPadding": 30, "mixerVideoDesktopLayoutInlinePadding": 10, "mixerVideoBufferLength": 1000, "mixerVideoBitrateKbps": 2000, "mixerUseSdpState": true, "mixerType": "NATIVE", "mixerThreadTimeoutMs": 33, "mixerTextPaddingTop": 5, "mixerTextPaddingRight": 4, "mixerTextFont": "Serif", "mixerTextPaddingBottom": 5, "mixerTextDisplayRoom": true, "mixerTextCutTop": 3, "mixerRealtime": true, "mixerPruneStreams": false, "audioMixerOutputCodec": "alaw", "audioMixerOutputSampleRate": 48000, "audioMixerMaxDelay": 300, "mixerAudioOnlyHeight": 360, "mixerAudioOnlyWidth": 640, "videoOutputCodec":"vp8", "mixerTextAlign": "TOP_CENTER" } ] |
Changing mixer parameters on the fly by REST API
Since build 5.2.1480, the following parameters can be changed for an active mixer using /mixer/set_parameter
REST query:
Code Block | ||||
---|---|---|---|---|
| ||||
[
{
...
"mixerLayoutClass": "com.flashphoner.media.mixer.video.presentation.GridLayout",
"mixerAutoScaleDesktop": true,
"mixerDesktopAlign": "TOP",
"mixerDisplayStreamName": true,
"mixerFontSize": 20,
"mixerFontSizeAudioOnly": 40,
"mixerMinimalFontSize": 1,
"mixerShowSeparateAudioFrame": true,
"mixerTextAutoscale": true,
"mixerTextColour": "0xFFFFFF",
"mixerTextBulkWriteWithBuffer": true,
"mixerTextBulkWrite": true,
"mixerTextBackgroundOpacity": 100,
"mixerTextBackgroundColour": "0x2B2A2B",
"mixerFrameBackgroundColour": "0x2B2A2B",
"mixerTextPaddingLeft": 5,
"mixerVoiceActivitySwitchDelay": 0,
"mixerVoiceActivityFrameThickness": 6,
"mixerVoiceActivityFramePositionInner": false,
"mixerVoiceActivityColour": "0x00CC66",
"mixerVoiceActivity": true,
"mixerVideoLayoutDesktopKeyWord": "desktop",
"mixerVideoGridLayoutPadding": 30,
"mixerVideoGridLayoutMiddlePadding": 10,
"mixerVideoDesktopLayoutPadding": 30,
"mixerVideoDesktopLayoutInlinePadding": 10,
"mixerTextPaddingTop": 5,
"mixerTextPaddingRight": 4,
"mixerTextFont": "Serif",
"mixerTextPaddingBottom": 5,
"mixerTextDisplayRoom": true,
"mixerTextCutTop": 3,
"mixerTextAlign": "BOTTOM_LEFT",
"mixerVideoDesktopFullscreen": false,
"mixerLayoutDir": ""
}
] |
If the REST query contains a parameters which cannot be set for active mixer, it will return 400 Bad request
with unsupported parameters list.
Sending the REST query to the WCS server
...