调用 ListVhostTransCodePreset 接口,查询转码配置或 ABR 配置。
请求频率:单用户请求频率限制为 10 次/秒。
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
| 参数 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | ListVhostTransCodePreset | 接口名称。当前 API 的名称为 ListVhostTransCodePreset。 |
| Version | String | 是 | 2023-01-01 | 接口版本。当前 API 的版本为 2023-01-01。 |
| 参数 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Vhost | String | 是 | push.example.com | 域名空间,即直播流地址的域名所属的域名空间。您可以调用 ListDomainDetail 接口或在视频直播控制台的域名管理页面,查看需要查询的直播流使用的域名所属的域名空间。 |
IsHlsAbr | Boolean | 否 |
| 是否查询 HLS-ABR 配置。默认值为
说明
|
IsRtmAbr | Boolean | 否 |
| 是否查询 RTM-ABR 配置。默认值为
说明
|
下表仅列出本接口特有的返回参数。更多信息请见返回结构。
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| CommonPresetList | Array of TranscodePresetVhostAPP | - | 符合查询条件的内置配置列表。 |
| CustomizePresetList | Array of TranscodePresetVhostAPP | - | 符合查询条件的自定义配置列表。 |
| AllPresetList | Array of TranscodePresetVhostAPP | - | 符合查询条件的全部配置列表,包含内置和自定义配置。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| App | String | live | 直播流地址的 AppName 字段。 |
| TranscodePreset | Object of TranscodePreset | - | 配置具体信息。 |
| Vhost | String | push.example.com | 域名空间。 |
CopyParams | Boolean |
| 是否已将请求 HLS-ABR 地址时携带的原始自定义 URL 参数复制到主 M3U8 文件中的每个子流 URL。取值如下:
说明 该参数仅对 HLS-ABR 生效。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Acodec | String |
| 音频编码格式,取值如下:
|
As | String |
| 是否自动调整视频尺寸。取值如下:
|
| AudioBitrate | Integer | 30 | 音频码率,单位为 kbps。 |
AutoTransResolution | Integer |
| 是否开启转码分辨率不超过源流分辨率。取值如下:
|
AutoTransVb | Integer |
| 是否开启转码码率不超过源流码率。取值如下:
|
AutoTransVr | Integer |
| 是否开启转码帧率不超过源流帧率。取值如下:
|
| BFrames | Integer | 3 | 输出视频中 2 个参考帧之间的最大 B 帧数量。取值 0 表示去除 B 帧。 |
| FPS | Integer | 60 | 视频帧率,单位为 fps。帧率越大,画面越流畅。 |
| GOP | Integer | 0 | IDR 帧之间的最大间隔,单位为秒。 |
Height | Integer |
| 视频高度,单位为 px。 说明
|
LongSide | Integer |
| 视频长边,单位为 px。 说明
|
| Preset | String | preset1 | 配置名称。 |
Roi | Boolean |
| 转码类型是否为极智超清转码。取值如下:
说明 视频编码格式为 H.266 ( |
ShortSide | Integer |
| 视频短边,单位为 px。 说明
|
| StopInterval | Integer | 60 | 转码停止时长。当 TransType 取值为 Pull 时,表示最后一位观众停止拉取转码流后,时隔多久会停止转码。单位为秒。取值范围为 -1 和 [0,300],-1 表示不停止转码。 |
| SuffixName | String | hd | 转码流或 ABR 子流后缀。 |
Vcodec | String |
| 视频编码格式。取值如下:
|
| VideoBitrate | Integer | 30 | 视频码率,单位为 kbps。 |
Width | Integer |
| 视频宽度,单位为 px。 说明
|
TransType | String |
| 转码触发方式。取值如下:
|
POST https://live.volcengineapi.com?Action=ListVhostTransCodePreset&Version=2023-01-01 { "Vhost": "push.example.com", "IsHlsAbr": true }
{ "ResponseMetadata": { "RequestId": "20240529174633D899A58F84B28B78E183", "Action": "ListVhostTransCodePreset", "Version": "2023-01-01", "Service": "live", "Region": "cn-north-1" }, "Result": { "AllPresetList": [ { "App": "live", "CopyParams": true, "TranscodePreset": { "Acodec": "aac", "As": "1", "AudioBitrate": 128, "AutoTransResolution": 1, "AutoTransVb": 1, "AutoTransVr": 1, "BFrames": 3, "FPS": 0, "GOP": 2, "Height": 0, "LongSide": 0, "Preset": "bukkhowjbx", "Roi": false, "ShortSide": 1000, "StopInterval": 60, "SuffixName": "_hd", "TransType": "Pull", "Vcodec": "h264", "VideoBitrate": 0, "Width": 0 }, "Vhost": "push.example.com" } ], "CommonPresetList": [], "CustomizePresetList": [ { "App": "live", "CopyParams": true, "TranscodePreset": { "Acodec": "aac", "As": "1", "AudioBitrate": 128, "AutoTransResolution": 1, "AutoTransVb": 1, "AutoTransVr": 1, "BFrames": 3, "FPS": 0, "GOP": 2, "Height": 0, "LongSide": 0, "Preset": "bukkhowjbx", "Roi": false, "ShortSide": 1000, "StopInterval": 60, "SuffixName": "_hd", "TransType": "Pull", "Vcodec": "h264", "VideoBitrate": 0, "Width": 0 }, "Vhost": "push.example.com" } ] } }
下表仅列出本接口特有的错误码。更多信息请参见公共错误码获取详细信息。
| 状态码 | 错误码 | 错误信息 | 说明 |
|---|---|---|---|
| 200 | CommonErr | - | 未分类错误。建议重试,如果仍返回该错误码,请联系技术支持。 |
| 400 | InvalidParam | - | 输入的参数无效或不符合要求,请参照请求参数说明进行检查。 |
| 400 | InvalidParam.BindError | Request parameter error, please check input data | 参数未通过校验,请检查参数类型是否正确。 |
| 400 | InvalidParam.Empty | %s is required | 参数缺失,请检查错误消息中指定的参数是否传入。 |
| 403 | RequestForbidden | - | 请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。 |
| 403 | RequestForbidden.AccountIDNotAllowed | this AccountID does not have permission to access the corresponding resource, please check the request parameters | 请求被拒绝,当前账号下无请求的资源(域名空间、域名、应用、配置模版、证书)。 |
| 403 | RequestForbidden.BillingStatus | Billing status is not available for the AccountID, please activate the service or recharge. | 未开通视频直播服务或账号欠费,造成账单不可用,请检查服务开通情况和账号欠费情况。 |
| 404 | ResourceNotFound | - | 未找到资源(域名空间、域名、应用、配置模版、证书)。建议重试,如果仍返回该错误码,请联系技术支持。 |
| 500 | InternalError | an internal error occurred, please contact the administrator. | 出现内部错误,请联系技术支持。 |
| 500 | InternalError.Preset | an internal error related to preset occurred, please contact the administrator. | 出现与功能配置相关的内部错误,请联系技术支持。 |
| 502 | InternalServiceError | an internal error occurred, please contact the administrator. | 服务间出现错误,请联系技术支持。 |
| 502 | InternalServiceError.BadResponse | an internal error occurred, please contact the administrator. | 服务间出现错误,请联系技术支持。 |
| 504 | InternalServiceTimeout | Internal Service is timeout. please contact the administrator. | 内部服务超时,请联系技术支持。 |