set-channel-source
Use the interface to modify input source.
Only available for users with administrative rights.
Prototype
Protocol |
HTTP/HTTPS POST |
URL |
ip[:port]/sc_cloud/channel/set-source |
Data Format |
Request: Content-Type: application/json Response: Content-Type: application/json |
Request Cookies
Parameter |
Description |
mwcloud-sid |
A string value that is used to uniquely identify user logged-in. |
mwcloud-uid |
Current logged-in username. |
Request Body
Parameter |
Description |
name |
Stream name. You can modify the parameter by using set-channel-name. |
id |
Stream ID. |
protocol |
Detailed information of protocol stream. |
protocol
Parameter |
Description |
id |
Source ID. |
name |
def-channel-src-name. It can not be modified. |
is-enable |
Whether input source switch is on. You can modify the parameter by using set-channel-enable. |
type |
Source type. The options are - 1: RTMP/RTMPS
- 2: SRT Caller
- 3: SRT Listener
|
status |
Connection status. |
uptime |
Conversion task running time in ms. |
bitrate |
Transmission bitrate in bps. |
rtmp |
Indicates input RTMP/RTMPS stream when type = 1. Request Body refers to RTMP/RTMPS. |
srt |
Indicates input SRT Listener stream when type = 3. Request Body refers to SRT Listener. |
rtmp
Parameter |
Description |
type |
Constant value: 1. |
url |
Server URL. |
key |
Stream key. |
is-auth |
Authentication state. - 0: disabled.
- 1: enabled. User name and password are required.
|
user |
User name. |
passwd |
User password. |
srt
Parameter |
Description |
ip |
Constant value: "0.0.0.0". |
port |
Port number ranges from 1 to 65535. |
latency |
Latency ranges from 20ms to 8000ms. The default value is 120ms. |
enc-type |
Encryption algorithm. The options are as follows:- 0: not encrypted
- 16: AES-128
- 24: AES-192
- 32: AES-256
The default value is 0. |
enc-pass |
Encryption passphrase. It is 10 to 79 characters when enc-type is 0. |
Request Example
POST /sc_cloud/channel/set-source HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=utf-8
Content-Length: 208
Cookie: mwcloud-sid=OCXWUMGEYPGIAWWOETYXPNMVHDZIAZJP; mwcloud-uid=Admin;
{
"name": "rtmp",
"id": 12,
"protocol": {
"id": 22,
"name": "def-channel-src-name",
"is-enable": 1,
"type": 1,
"rtmp": {
"type": 1,
"url": "rtmp://10.0.1.32/live",
"key": "pull-modify",
"is-auth": 0,
"user": "",
"passwd": ""
}
}
}
POST /sc_cloud/channel/set-source HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=utf-8
Content-Length: 202
Cookie: mwcloud-sid=OCXWUMGEYPGIAWWOETYXPNMVHDZIAZJP; mwcloud-uid=Admin;
{
"name": "srt listener",
"id": 13,
"protocol": {
"id": 23,
"name": "def-channel-src-name",
"is-enable": 1,
"type": 3,
"srt": {
"ip": "0.0.0.0",
"port": 3522,
"latency": 120,
"enc-type": 16,
"enc-pass": "dddddddddddddfff"
}
}
}
Response Parameters
Parameter |
Description |
Content-Type |
Value: 'application/json; charset=UTF-8' |
Response Body
Parameter |
Description |
result |
Result code. The options are as follows:- 0: success.
- Other values. For details about the result codes, please refer to API Status.
|
method |
set-channel-source |
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 42
Connection: keep-alive
{
"method": "set-channel-source",
"result": 0
}