调用 ListVhostSubtitleTranscodePreset 接口,查询指定域名空间下所有字幕配置列表。
请求频率:单用户请求频率限制为 10 次/秒。
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
| 参数 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | ListVhostSubtitleTranscodePreset | 接口名称。当前 API 的名称为 ListVhostSubtitleTranscodePreset。 |
| Version | String | 是 | 2023-01-01 | 接口版本。当前 API 的版本为 2023-01-01。 |
| 参数 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
Vhost | String | 是 |
| 推拉流域名所属的域名空间。
|
下表仅列出本接口特有的返回参数。更多信息请见返回结构。
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| PresetList | Array of PresetList | - | 字幕配置列表。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| Vhost | String | push.example.com | 域名空间。 |
| App | String | live | 应用名称。 |
| Suffixes | Array of String | ["_hd","_bd"] | 转码后缀。例如转码流地址为 rtmp://pull.example.com/live/test_hd,则转码后缀为 _hd。 |
| TranscodePreset | Object of TranscodePreset | - | 字幕配置详细参数。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| PresetName | String | igxx**qjks | 字幕配置的名称。 |
| Description | String | subtitleconfig001 | 字幕配置的描述信息。 |
| SuffixName | String | _subtitle | 字幕后缀。例如字幕流地址为 rtmp://pull.example.com/live/test_subtitle,则字幕后缀为 _subtitle。 |
Delay | Integer |
| 播出延迟时长,以保证同传声音和字幕的翻译处理完成。单位为秒。 说明
|
DisplayPreset | String |
| (不推荐使用)预设效果,用于快速配置。
|
MaxRowNumber | Integer |
| 每种语言字幕最多显示的行数。取值如下:
说明
|
Position | Object of Position |
| 字幕位置。 说明 如传入 |
| SIConfig | Object of SIConfig | - | 声影同传模式配置。 |
| SourceLanguage | Object of SourceLanguage | - | 原文字幕配置。 |
| TargetLanguage | Array of TargetLanguage | - | 译文字幕配置。 |
HotWordList | Array of String |
| 热词列表。 说明 仅原文 ASR 字幕生效。 |
GlossaryWordList | Array of String |
| 关键词列表。 说明 仅字幕翻译和同传声音生效。 |
ReplaceMap | JSON Map |
| 易错词列表。 |
| SubtitleTosConfig | Object of SubtitleTosConfig | - | TOS 配置,用于生成字幕 SRT 文件。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Relative | String |
| 字幕在画面中的位置。取值如下:
|
MarginVertical | Float |
| 字幕的上下边距,即字幕距离画面顶部或底部的距离。取值为画面高度的百分比,取值范围为
|
| MarginHorizontal | Float | 0.2 | 字幕的左右边距,即字幕距离画面左右边缘的距离。取值为画面宽度的百分比,取值范围为 (0, 0.3]。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Enable | Boolean |
| 是否开启声影同传模式。取值如下:
|
Pipe | String |
| 声影同传类型。取值如下:
|
SpeakerRecognition | Integer |
| 是否开启同传声音功能。取值如下:
说明 仅在 |
DigitalHumanMouthShape | Boolean |
| 是否开启数字人口型功能。取值如下:
说明
|
PipeExtra | String |
| 额外配置,为 JSON 格式的字符串,包含音量均衡、降噪、原声音量等信息。详见 CreateSpeechTask 接口的 说明 仅在 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Display | Boolean |
| 是否展示原文字幕,取值如下:
|
Language | String |
| 原文字幕语言。
|
ShowPriority | Integer |
| 原文字幕的展示优先级。 |
MaxCharNumber | Integer |
| 原文每行字幕的最大字符数。 说明
|
Font | String |
| 原文字幕字体。
|
FontSize | Integer |
| 原文字幕字号。单位为 px。 说明 如传入 |
FontColor | String |
| 原文字幕的字体颜色。
说明
|
| Border | Object of Border | - | 原文字幕字体阴影。 |
| Box | Object of Box | - | 原文字幕字体背景。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Language | String |
| 译文字幕语言。
|
ShowPriority | Integer |
| 译文字幕的展示优先级。 |
MaxCharNumber | Integer |
| 译文每行字幕的最大字符数。 说明
|
Hidden | Boolean |
| 是否隐藏译文字幕。取值如下:
|
Font | String |
| 译文字幕的字体。
|
FontSize | Integer |
| 译文字幕字号。单位为 px。 说明 如传入 |
FontColor | String |
| 译文字幕的字体颜色。
说明
|
| Border | Object of Border | - | 译文字幕字体阴影。 |
| Box | Object of Box | - | 译文字幕字体背景。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
Enable | Boolean |
| 是否生成字幕 SRT 文件。取值如下:
|
| Bucket | String | bucketa | 存储字幕 SRT 文件的 TOS 桶名称。 |
Region | String |
| 存储字幕 SRT 文件的 TOS 桶区域。取值如下:
|
| StorageDir | String | FolderA | 存储字幕 SRT 文件的 TOS 桶文件夹名称。 |
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| Width | Float | 2 | 宽度。单位为 px。 |
Color | String |
| 颜色。
说明
|
| 参数 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| W | Float | 1.0 | 宽度。单位为 px。 |
Color | String |
| 颜色。
说明
|
POST https://live.volcengineapi.com?Action=ListVhostSubtitleTranscodePreset&Version=2023-01-01 { "Vhost": "push.example.com" }
{ "ResponseMetadata": { "RequestId": "20230604110420****100232280022D31", "Action": "ListVhostSubtitleTranscodePreset", "Version": "2023-01-01", "Service": "live", "Region": "cn-north-1" }, "Result": { "PresetList": [ { "App": "live", "Suffixes": [ "_hd", "_bd" ], "TranscodePreset": { "Delay": 8, "Description": "subtitleconfig001", "DisplayPreset": "small", "GlossaryWordList": [ "字节跳动:ByteDance", "视频直播:MediaLive" ], "HotWordList": [ "视频直播", "赛事直播", "智能家居" ], "MaxRowNumber": 0, "Position": { "MarginHorizontal": 0.2, "MarginVertical": 0.5, "Relative": "top" }, "PresetName": "igxx**qjks", "SourceLanguage": { "Border": { "Width": 2, "Color": "0xFF0000@0.5" }, "Display": true, "Font": "siyuanheiti", "FontColor": "0xFF0000@0.5", "FontSize": 18, "Language": "zh", "Box": { "W": 1, "Color": "0xFF0000@0.5" }, "MaxCharNumber": 60, "ShowPriority": 2 }, "SuffixName": "_subtitle", "TargetLanguage": [ { "Border": { "Color": "0xFF0000@0.5", "Width": 1 }, "Font": "inter", "FontColor": "0xFF0000@0.5", "FontSize": 18, "Language": "en", "Hidden": false, "Box": { "W": 1.0, "Color": "0xFF0000@0.5" }, "MaxCharNumber": 60, "ShowPriority": 1 } ], "SIConfig": { "Enable": true, "DigitalHumanMouthShape": true, "Pipe": "mix", "SpeakerRecognition": 1, "PipeExtra": "{\"Separator\":{\"HandleType\":1},\"Amix\":{\"AudioEnhance\":false}}" }, "SubtitleTosConfig": { "Enable": true, "Bucket": "bucketa", "Region": "cn-beijing", "StorageDir": "FolderA" }, "ReplaceMap": { "蒂姆": "Tim", "提姆": "Tim" } }, "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.AccountIDNotAllow | 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. | 内部服务超时,请联系技术支持。 |
视频直播提供了配套的开发工具集 SDK,支持多种编程语言,帮助您更方便的调用 API。