更新时间:2025-08-12 GMT+08:00
分享

实例视频设置

功能介绍

实例视频设置。

调用此api的前提条件是租户需要先购买实例。

使用该接口可以设置实例每一个清晰度对应的码率和出流的帧率。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

PUT /v1/instances/video-setting

请求参数

表1 请求Header参数

参数

是否必选

参数类型

描述

x-request-id

String

消息跟踪唯一id

X-Auth-Token

String

租户级Token

表2 请求Body参数

参数

是否必选

参数类型

描述

instance_ids

Array of strings

实例列表,单个实例最大长度32,列表最大长度100

instance_settings

Array of InstanceSetting objects

视频设置内容

表3 InstanceSetting

参数

是否必选

参数类型

描述

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

视频规格组

表4 VideoSpecGroup

参数

是否必选

参数类型

描述

definition_540P

VideoSpec object

标清参数设置,540P

definition_720P

VideoSpec object

高清参数设置,720P

definition_1080P

VideoSpec object

超清参数设置,1080P

表5 VideoSpec

参数

是否必选

参数类型

描述

code_rate

Integer

码率,单位kbps,值范围100-10000,需要是100的倍数

fps

Integer

帧率,单位fps,可选30,60

响应参数

状态码:200

表6 响应Body参数

参数

参数类型

描述

error_code

String

响应码,KOOPHONE.API.xxxx或者common.00000xxx

error_msg

String

响应描述

状态码:400

表7 响应Body参数

参数

参数类型

描述

error_code

String

响应码,KOOPHONE.API.xxxx或者common.00000xxx

error_msg

String

响应描述

状态码:500

表8 响应Body参数

参数

参数类型

描述

error_code

String

响应码,KOOPHONE.API.xxxx或者common.00000xxx

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

内部错误

错误码

请参见错误码

相关文档