/api/channel/set
Use this interface to set a channel.
Channel editing permissions is required.
Prototype
Protocol |
HTTP/HTTPS POST |
URL |
ip[:port]/api/channel/set |
Content-Type |
Request: Content-Type: application/json Response: Content-Type: application/json |
Request Cookies
Parameter |
Description |
mwcloud-sid |
A string that is used to identify current logged-in user. |
mwcloud-uid |
Current logged-in username. |
Request Body
Channel Configurations
Parameter |
Description |
ndi |
See NDI Output Configuration |
play-key |
Playback key, globally unique, maximum length 256 bytes. |
push-key |
Push stream key, can't be the same as play key, and globally unique, max length 256 bytes |
NDI Output Configuration
Parameter |
Description |
enable |
NDI output stream configuration |
transport-mode |
Transmission type (unicast-0, multicast-1, rudp-2, multi-tcp-3) |
mcast-ip |
Multicast IP address |
mcast-sub-mask |
Multicast subnet mask |
mcast-time-to-live |
Multicast time-to-live (TTL) |
group |
NDI output group affiliation |
Request Example
POST /api/channel/set HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=utf-8
Content-Length: xx
Cookie: mwcloud-sid=OCXWUMGEYPGIAWWOETYXPNMVHDZIAZJP; mwcloud-uid=Admin;
{
"name":"test2",
"config": {
"ndi":{
"enable":true,
"transport-mode":1,
"mcast-ip":"239.255.0.0",
"mcast-sub-mask":"255.255.0.0",
"mcast-time-to-live":"1",
"group":"public"
},
"play-key": "test1",
"push-key": "push_test2",
"protocol": {
"prefer": 1,
"ndihx": true,
"rtmp": true,
"srt": true
}
}
}
Response Parameters
Parameter |
Description |
Content-Type |
Value: 'application/json; charset=UTF-8' |
Response Body
Response Example
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
content-length: xx
{
"result": 0
}