set-channel-source接口
修改输入视频流。
仅管理员有权限。
接口原型
协议 |
HTTP/HTTPS POST |
URL |
ip[:port]/sc_cloud/channel/set-source |
数据格式 |
请求消息:Content-Type: application/json 响应消息:Content-Type: application/json |
请求Cookies
名称 |
描述 |
mwcloud-sid |
用于标识当前登录的字符串 |
mwcloud-uid |
当前登录用户名 |
Request Body
protocol
rtmp
参数 |
描述 |
type |
常量值:1。 |
url |
服务器地址。 |
key |
流密钥。 |
is-auth |
认证状态。 |
user |
用户名。 |
passwd |
密码。 |
srt
参数 |
描述 |
ip |
常量值:"0.0.0.0"。 |
port |
端口号,取值范围是1~65535。 |
latency |
延迟时间。取值范围是20ms~8000ms,默认为120ms。 |
enc-type |
加密类型,默认不加密。取值对应关系如下:- 0:不使用加密
- 16:AES-128
- 24:AES-192
- 32:AES-256
|
enc-pass |
加密密码。enc-type取值不为0时,需要输入10~79位字符的密码。 |
请求示例
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"
}
}
}
响应参数
参数 |
描述 |
Content-Type |
取值为:'application/json; charset=UTF-8' |
Response Body
参数 |
描述 |
result |
返回码。 |
method |
方法名:set-channel-source。 |
响应示例
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 42
Connection: keep-alive
{
"method": "set-channel-source",
"result": 0
}