实例视频设置 - SetVideoConfig
功能介绍
实例视频设置。
调用此api的前提条件是租户需要先购买实例。
使用该接口可以设置实例每一个清晰度对应的码率和出流的帧率。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权,具体权限要求请参见权限和授权项。
- 如果使用身份策略授权,需具备如下身份策略权限。
授权项
访问级别
资源类型(*为必须)
条件键
别名
依赖的授权项
koophone:cloudphoneResource:setVideo
Write
cloudphoneResource *
-
-
-
URI
PUT /v1/instances/video-setting
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
x-request-id | 是 | String | 消息跟踪唯一id |
X-Auth-Token | 是 | String | 租户级Token |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
instance_ids | 是 | Array of strings | 实例列表,单个实例最长32个字符,列表最长100列 |
instance_settings | 是 | Array of InstanceSetting objects | 视频设置内容 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
network_type | 是 | String | 网络类型。枚举:MOBILE_NETWORK/WIFI/WIRED,这三个参数都必须有,配合encoding_type必填的2种参数共6种组合,详细先看请求示例 |
encoding_type | 是 | String | 编码类型。H264/H265,这两个参数都必须有,配合network_type必填的3种参数共6种组合,详细先看请求示例 |
video_spec_groups | 是 | Array of VideoSpecGroup objects | 视频规格组 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 0:成功 KOOPHONE.API.0000:租户不存在 KOOPHONE.API.1000:请求参数错误 KOOPHONE.API.1001:没有实例权限 KPAPI.2209:没有可分配的设备 KOOPHONE.API.9999:服务内部错误 |
error_msg | String | 响应描述 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 0:成功 KOOPHONE.API.0000:租户不存在 KOOPHONE.API.1000:请求参数错误 KOOPHONE.API.1001:没有实例权限 KPAPI.2209:没有可分配的设备 KOOPHONE.API.9999:服务内部错误 |
error_msg | String | 响应描述 |
状态码:500
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 0:成功 KOOPHONE.API.0000:租户不存在 KOOPHONE.API.1000:请求参数错误 KOOPHONE.API.1001:没有实例权限 KPAPI.2209:没有可分配的设备 KOOPHONE.API.9999:服务内部错误 |
error_msg | String | 响应描述 |
请求示例
/v1/instances/video-setting
{
"instance_ids" : [ "iRJEVP96" ],
"instance_settings" : [ {
"network_type" : "MOBILE_NETWORK",
"encoding_type" : "H264",
"video_spec_groups" : [ {
"definition_540P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_720P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_1080P" : {
"code_rate" : 8000,
"fps" : 30
}
} ]
}, {
"network_type" : "MOBILE_NETWORK",
"encoding_type" : "H265",
"video_spec_groups" : [ {
"definition_540P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_720P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_1080P" : {
"code_rate" : 8000,
"fps" : 30
}
} ]
}, {
"network_type" : "WIFI",
"encoding_type" : "H264",
"video_spec_groups" : [ {
"definition_540P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_720P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_1080P" : {
"code_rate" : 8000,
"fps" : 30
}
} ]
}, {
"network_type" : "WIFI",
"encoding_type" : "H265",
"video_spec_groups" : [ {
"definition_540P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_720P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_1080P" : {
"code_rate" : 8000,
"fps" : 30
}
} ]
}, {
"network_type" : "WIRED",
"encoding_type" : "H264",
"video_spec_groups" : [ {
"definition_540P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_720P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_1080P" : {
"code_rate" : 8000,
"fps" : 30
}
} ]
}, {
"network_type" : "WIRED",
"encoding_type" : "H265",
"video_spec_groups" : [ {
"definition_540P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_720P" : {
"code_rate" : 6000,
"fps" : 30
},
"definition_1080P" : {
"code_rate" : 8000,
"fps" : 30
}
} ]
} ]
} 响应示例
状态码:200
正常响应
{
"error_code" : "0",
"error_msg" : "ok"
} 状态码
状态码 | 描述 |
|---|---|
200 | 正常响应 |
400 | 请求错误 |
500 | 内部错误 |
错误码
请参见错误码。

