task_id。task_id 调用“查询任务结果”接口,直至 status 为 completed,从 output.file_url 获取结果视频地址。参数名 | 必选 | 类型 | 描述 |
video_url | 是 | string | 输入视频地址,支持 http(s) 公网 URL 或 data:video/...;base64,... 形态,Base64 解码后不超过 20 MB。示例:https://example.com/input.mp4 |
dst_language | 是 | string | 译制目标语言(译文与配音使用的语言)。当前支持 zh(中文)、en(英文);其它语言支持范围请提交工单确认。 |
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/dubbing' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"video_url": "https://example.com/input_zh.mp4","dst_language": "en"}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/dubbing' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"video_url": "https://example.com/input_en.mp4","dst_language": "zh"}'
参数名 | 类型 | 描述 |
task_id | string | 任务唯一标识,用于调用查询接口轮询。 |
status | string | 任务状态。 |
request_id | string | 唯一请求标识,排查问题时请携带。 |
{"task_id": "1400000001-DubbingAsync-xxxxxxxx","status": "queued","request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9"}
status 为 completed 或 failed。GET https://tokenhub.tencentmaas.com/v1/wand/tool/dubbing/tasks/{task_id}参数名 | 必选 | 类型 | 描述 |
task_id | 是 | string | 路径参数。提交接口返回的任务 ID,需原样传入。 |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/dubbing/tasks/1400000001-DubbingAsync-xxxxxxxx' \\-H 'Authorization: Bearer YOUR_API_KEY'
参数名 | 类型 | 描述 |
task_id | string | 任务唯一标识。 |
status | string | 任务状态: queued / in_progress / completed / failed。 |
progress | integer | 处理进度,0~100。译制任务处理中可能长时间保持 0 或变化较慢。 |
output | object | 结果产物,仅 completed 时返回。 |
output.file_url | string | 译制后的视频地址,可直接下载或播放。 |
error | object | 失败详情,仅 failed 时返回。 |
error.code | string | 错误码,见“统一错误码”。 |
error.message | string | 错误描述,用于排查,不建议用于程序逻辑判断。 |
request_id | string | 唯一请求标识,排查问题时请携带。 |
{"task_id": "1400000001-DubbingAsync-xxxxxxxx","status": "in_progress","progress": 0,"request_id": "0a7d2c31-e024-426a-bb00-839553cb58c9"}
{"task_id": "1400000001-DubbingAsync-xxxxxxxx","status": "completed","progress": 100,"output": {"file_url": "https://xxxxxxx.mp4"},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
{"task_id": "1400000001-DubbingAsync-xxxxxxxx","status": "failed","progress": 0,"error": {"code": "FailedOperation","message": "Operation failed."},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
error.code)统一如下:错误码 | 错误信息 | 说明 |
InvalidParameter | One or more parameters specified in the request are not valid. | 请求中存在一个或多个非法参数(含 video_url 缺失、dst_language 缺失、URL 格式非法、媒体类型不支持等)。请对照文档核对参数名、类型、取值范围后重试。 |
MissingParameter | The request failed because it is missing %s parameter. | 请求缺少必填参数 %s(如 dst_language)。请补齐后重试。 |
InvalidParameterValue.DstLanguage | The value of dst_language is not supported. | dst_language 取值不受支持,请使用受支持的语言取值。 |
SourceFileError | The source file could not be downloaded or decoded. | 源文件无法下载或解码:URL 不可访问、已过期、内容损坏、格式不支持或缺少可用音轨。请检查源地址与文件后重新提交。 |
FailedOperation | Operation failed. | 译制处理失败(如语音识别或合成失败)。可重试;持续失败时请携带 Request ID 提工单排查。 |
InternalError | The service encountered an unexpected internal error. Please retry later. | 服务内部出现未预期错误。可重试;持续复现时请携带 Request ID 提工单排查。 |
Unauthorized | The API key is missing or invalid. | API Key 缺失或无效,请检查请求头 Authorization。 |
InsufficientQuota | The account balance is insufficient. | 账号欠费或无有效套餐,请检查计费状态。 |
Forbidden | The account is forbidden, frozen or recycled. | 账号被禁用、冻结或已回收,请联系客服。 |
ResourceNotFound | The requested resource does not exist. | 请求路径或任务不存在,请检查路径与 task_id 拼写。 |
RequestTooLarge | The request entity is larger than the limit allowed. | 请求体或内联 Base64 素材超过上限,请改用公网 URL 输入。 |
TooManyRequests | The request rate limit has been exceeded. | 触发 QPS 限频或配额用尽,请降低频率后重试。 |
task_id 与 request_id 提交工单。文档反馈