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 |
resolution | 否 | string | 输出分辨率,格式 宽 x 高(如 1920x1080),宽、高取值范围均为 128~8192,输出按长边/短边自适应,不传则保持源分辨率(推荐),分辨率越高耗时与费用越高。 |
codec | 否 | string | 输出视频编码,支持 H264(默认)、H265、AV1,大小写不敏感,AV1 仅支持 MP4 封装。 |
container | 否 | string | 输出封装格式,支持 MP4(默认),大小写不敏感。 |
fps | 否 | integer | 输出帧率,取值范围 [1,120],默认 30。帧率越高耗时与费用越高,且费用增幅显著,建议使用默认帧率。 |
max_video_bitrate | 否 | integer | 输出视频平均码率上限,单位 kbps,取值范围 [128,35000]。不传则由算法按画质自适应。 |
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-enhance-premium' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"video_url": "https://example.com/input_480p.mp4"}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-enhance-premium' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"video_url": "https://example.com/input_480p.mp4","resolution": "1920x1080","codec": "H264","container": "MP4","fps": 30}'
参数名 | 类型 | 描述 |
task_id | string | 任务唯一标识,用于调用查询接口轮询。 |
status | string | 任务状态。 |
request_id | string | 唯一请求标识,排查问题时请携带。 |
{"task_id": "1400000001-procedurev2-xxxxxxxx","status": "queued","request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9"}
status 为 completed 或 failed。GET https://tokenhub.tencentmaas.com/v1/wand/tool/video-enhance-premium/tasks/{task_id}参数名 | 必选 | 类型 | 描述 |
task_id | 是 | string | 路径参数。提交接口返回的任务 ID,需原样传入。 |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-enhance-premium/tasks/1400000001-procedurev2-xxxxxxxx' \\-H 'Authorization: Bearer YOUR_API_KEY'
参数名 | 类型 | 描述 |
task_id | string | 任务唯一标识。 |
status | string | 任务状态: queued / in_progress / completed / failed。 |
progress | integer | 处理进度,0~100。 |
output | object | 结果产物,仅 completed 时返回。 |
output.file_url | string | 结果视频地址,可直接下载或播放。 |
error | object | 失败详情,仅 failed 时返回。 |
error.code | string | 错误码,见“统一错误码”。 |
error.message | string | 错误描述,用于排查,不建议用于程序逻辑判断。 |
request_id | string | 唯一请求标识,排查问题时请携带。 |
{"task_id": "1400000001-procedurev2-xxxxxxxx","status": "in_progress","progress": 0,"request_id": "0a7d2c31-e024-426a-bb00-839553cb58c9"}
{"task_id": "1400000001-procedurev2-xxxxxxxx","status": "completed","progress": 100,"output": {"file_url": "https://xxxxxxx.mp4"},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
{"task_id": "1400000001-procedurev2-xxxxxxxx","status": "failed","progress": 0,"error": {"code": "SourceFileError","message": "source file err"},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
error.code)统一如下:错误码 | 错误信息 | 说明 |
InvalidParameter | One or more parameters specified in the request are not valid. | 请求中存在一个或多个非法参数(含 video_url 缺失、URL 格式非法、枚举值非法、数值越界等)。请对照文档核对参数名、类型、取值范围后重试。 |
MissingParameter | The request failed because it is missing %s parameter. | 请求缺少必填参数 %s。请补齐后重试。 |
InvalidParameterValue.Codec | The value of codec is not valid. | 编码参数非法或与封装不兼容(如 AV1 配非 MP4)。 |
InvalidParameterValue.Resolution | The value of resolution is not valid. | 分辨率格式或范围非法。 |
InvalidParameterValue.Fps | The value of fps is not valid. | 帧率超出取值范围。 |
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 限频或配额用尽,请降低频率后重试。 |
video_url 为必填字段,请确认字段名拼写为 video_url 且值为非空字符串。task_id 与 request_id 提交工单。文档反馈