修改频道入流信息
功能介绍
修改频道入流信息。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
PUT /v1/{project_id}/ott/channels/input
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方法请参考获取项目ID。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用户Token,使用Token鉴权方式时必选。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 |
Access-Control-Allow-Internal |
否 |
String |
服务鉴权Token,服务开启鉴权,必须携带Access-Control-Allow-Internal访问服务。 |
Access-Control-Allow-External |
否 |
String |
服务鉴权Token,服务开启鉴权,必须携带Access-Control-Allow-External访问服务。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
domain |
是 |
String |
频道推流域名 |
app_name |
是 |
String |
组名或应用名 |
id |
是 |
String |
频道ID。频道唯一标识,为必填项 |
input |
否 |
InputStreamInfo object |
频道出流信息 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
input_protocol |
是 |
String |
频道入流协议
|
sources |
否 |
Array of SourcesInfo objects |
频道主源流信息。入流协议为RTMP_PUSH和SRT_PUSH时,非必填项。其他情况下,均为必填项。 |
secondary_sources |
否 |
Array of SecondarySourcesInfo objects |
备入流数组,非必填项。如果有备入流,则主备入流必须保证路数、codec和分辨率均一致。入流协议为RTMP_PUSH时,无需填写。 |
failover_conditions |
否 |
FailoverConditions object |
有主备入流时,当前参数为必选。入流协议为RTMP_PUSH时,无需填写。 |
max_bandwidth_limit |
否 |
Integer |
当入流协议为HLS_PULL时,最大带宽限制。 未配置会默认选择BANDWIDTH最高的流 |
ip_port_mode |
否 |
Boolean |
当推流协议为SRT_PUSH时,如果配置了直推源站,编码器不支持输入streamid,需要打开设置为true |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
url |
否 |
String |
频道源流URL,用于外部拉流 |
bitrate |
否 |
Integer |
码率。无需直播转码时,此参数为必填项 单位:bps。取值范围:0 - 104,857,600(100Mbps) |
width |
否 |
Integer |
分辨率对应宽的值,非必填项 取值范围:0 - 4096(4K) |
height |
否 |
Integer |
分辨率对应高的值,非必填项 取值范围:0 - 2160(4K) |
enable_snapshot |
否 |
Boolean |
描述是否使用该流做截图 |
bitrate_for3u8 |
否 |
Boolean |
是否使用bitrate来固定码率。默认值:false |
passphrase |
否 |
String |
协议为SRT_PUSH时的加密信息 |
backup_urls |
否 |
Array of strings |
备入流地址列表 |
stream_id |
否 |
String |
协议为SRT_PULL时,拉流地址的streamid |
latency |
否 |
Integer |
协议为SRT_PULL时,拉流时延 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
url |
否 |
String |
频道源流URL,用于外部拉流 |
bitrate |
否 |
Integer |
码率。无需直播转码时,此参数为必填项 单位:bps。取值范围:0 - 104,857,600(100Mbps) |
width |
否 |
Integer |
分辨率对应宽的值,非必填项 取值范围:0 - 4096(4K) |
height |
否 |
Integer |
分辨率对应高的值,非必填项 取值范围:0 - 2160(4K) |
bitrate_for3u8 |
否 |
Boolean |
是否使用bitrate来固定码率。默认值:false |
passphrase |
否 |
String |
协议为SRT_PUSH时的加密信息 |
backup_urls |
否 |
Array of strings |
备入流地址列表 |
stream_id |
否 |
String |
协议为SRT_PULL时,拉流地址的streamid |
latency |
否 |
Integer |
协议为SRT_PULL时,拉流时延 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
result_code |
String |
错误码 |
result_msg |
String |
错误描述 |
domain |
String |
推流域名 |
app_name |
String |
组名或应用名,为必填项 |
id |
String |
频道ID。频道唯一标识,为必填项 |
sources |
Array of SourceRsp objects |
推流URL列表。创建频道时,只有入流协议为RTMP_PUSH时,会返回推流URL列表 |
参数 |
参数类型 |
描述 |
---|---|---|
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
参数 |
参数类型 |
描述 |
---|---|---|
result_code |
String |
错误码 |
result_msg |
String |
错误描述 |
domain |
String |
推流域名 |
app_name |
String |
组名或应用名,为必填项 |
id |
String |
频道ID。频道唯一标识,为必填项 |
请求示例
PUT https://{endpoint}/v1/{project_id}/ott/channels/input { "domain" : "push.testott.hls.com", "app_name" : "ott", "id" : "test", "input" : { "input_protocol" : "RTMP_PUSH", "sources" : [ { "width" : 100, "bitrate_for3u8" : false, "enable_snapshot" : false, "bitrate" : 1024, "passphrase" : "", "url" : "http://192.168.8.158/ott/adtestdrm.flv?vhost=pull.testott.hls.com", "height" : 100 } ] } }
响应示例
状态码: 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" : "test", "id" : "test-abc" }
状态码
状态码 |
描述 |
---|---|
200 |
Demo Information |
400 |
Error response |
错误码
请参见错误码。