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

修改频道转码模板信息

功能介绍

修改频道转码模板信息。

调试

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

URI

PUT /v1/{project_id}/ott/channels/encorder-settings

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,获取方法请参考获取项目ID。

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token,使用Token鉴权方式时为必填项。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

Authorization

String

使用AK/SK方式认证时必填,携带的鉴权信息。

X-Sdk-Date

String

请求的发生时间,使用AK/SK方式认证时为必填项。

X-Project-Id

String

使用AK/SK方式认证时为必填项,携带项目ID信息。

表3 请求Body参数

参数

是否必选

参数类型

描述

domain

String

频道推流域名

app_name

String

组名或应用名

id

String

频道ID。频道唯一标识,为必填项

encoder_settings

Array of encoder_settings objects

转码模板配置

表4 encoder_settings

参数

是否必选

参数类型

描述

template_id

String

转码模板ID

响应参数

状态码:200

表5 响应Body参数

参数

参数类型

描述

result_code

String

错误码

result_msg

String

错误描述

domain

String

推流域名

app_name

String

组名或应用名,为必填项

id

String

频道ID。频道唯一标识,为必填项

sources

Array of SourceRsp objects

推流URL列表。创建频道时,只有入流协议为RTMP_PUSH时,会返回推流URL列表

表6 SourceRsp

参数

参数类型

描述

url

String

RTMP推流地址

bitrate

Integer

码率。

单位:bps。取值范围:(0,104,857,600](100Mbps)

width

Integer

分辨率对应宽的值。取值范围:0 - 4096(4K)

height

Integer

分辨率对应高的值。取值范围:0 - 2160(4K)

enable_snapshot

Boolean

描述是否使用该流做截图

状态码:400

表7 响应Body参数

参数

参数类型

描述

result_code

String

错误码

result_msg

String

错误描述

domain

String

推流域名

app_name

String

组名或应用名,为必填项

id

String

频道ID。频道唯一标识,为必填项

请求示例

 PUT https://{endpoint}/v1/{project_id}/ott/channels/encorder-settings

{
  "domain" : "push.testott.hls.com",
  "app_name" : "ott",
  "id" : "test",
  "encoder_settings" : [ {
    "template_id" : "ld"
  } ]
}

响应示例

状态码:200

Demo Information

{
  "result_code" : "LIVE.100000000",
  "result_msg" : "SUCCESS",
  "domain" : "push.testott.hls.com",
  "app_name" : "ott",
  "id" : "test"
}

状态码:400

Error response

{
  "result_code" : "LIVE.103011019",
  "result_msg" : "The resource to access is not exists",
  "domain" : "push.testott.hls.com",
  "app_name" : "ott",
  "id" : "test2"
}

状态码

状态码

描述

200

Demo Information

400

Error response

错误码

请参见错误码

相关文档