task_id is returned upon success.task_id until the status is completed, and obtain the result video URL from output.file_url.Parameter Name | Required | Type | Description |
video_url | Yes | string | Enter the video URL. http(s) public network URLs or data:video/...;base64,... format are supported. The Base64-decoded data cannot exceed 20 MB. Example: https://example.com/input.mp4 |
dst_language | Yes | string | The target language for dubbing, which is used for both translated text and voiceover. Currently, zh (Chinese) and en (English) are supported. For support for other languages, submit a ticket for confirmation. |
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"}'
Parameter Name | Type | Description |
task_id | string | Unique task identifier, used to poll the query API. |
status | string | Task status. |
request_id | string | Unique request identifier. Include it when troubleshooting issues. |
{"task_id": "1400000001-DubbingAsync-xxxxxxxx","status": "queued","request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9"}
status is completed or failed.GET https://tokenhub.tencentmaas.com/v1/wand/tool/dubbing/tasks/{task_id}Parameter Name | Required | Type | Description |
task_id | Yes | string | Path parameter. Task ID returned by the submission API, which must be passed in as is. |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/dubbing/tasks/1400000001-DubbingAsync-xxxxxxxx' \\-H 'Authorization: Bearer YOUR_API_KEY'
Parameter Name | Type | Description |
task_id | string | Unique task identifier. |
status | string | Task status: queued / in_progress / completed / failed. |
progress | integer | Processing progress, ranging from 0 to 100. During translation tasks, it may remain at 0 for a long time or change slowly. |
output | object | Result product, returned only when completed. |
output.file_url | string | URL of the translated video, which can be directly downloaded or played. |
error | object | Failure details, returned only when failed. |
error.code | string | Error code. See "Unified error codes". |
error.message | string | Error description, used for troubleshooting and not recommended for program logic judgment. |
request_id | string | Unique request identifier. Include it when troubleshooting issues. |
{"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 field in the query API) are unified as follows:Error Code | Error Message | Description |
InvalidParameter | One or more parameters specified in the request are not valid. | The request contains one or more invalid parameters (including missing video_url, missing dst_language, invalid URL format, unsupported media type, and so on). Check the parameter names, types, and value ranges against the documentation and retry. |
MissingParameter | The request failed because it is missing %s parameter. | The request is missing the required parameter %s (such as dst_language). Provide the missing parameter and retry. |
InvalidParameterValue.DstLanguage | The value of dst_language is not supported. | The value of dst_language is not supported. Use a supported language value. |
SourceFileError | The source file could not be downloaded or decoded. | The source file cannot be downloaded or decoded: the URL is inaccessible or expired, the content is corrupted, the format is unsupported, or no usable audio track is available. Check the source URL and file, and then resubmit. |
FailedOperation | Operation failed. | Dubbing processing failed (for example, ASR or synthesis failed). You can retry. If the failure persists, submit a ticket with the Request ID for troubleshooting. |
InternalError | The service encountered an unexpected internal error. Please retry later. | An unexpected internal error has occurred. You can retry. If the issue persists, submit a ticket with the Request ID for troubleshooting. |
Unauthorized | The API key is missing or invalid. | The API Key is missing or invalid. Check the Authorization request header. |
InsufficientQuota | The account balance is insufficient. | The account has an overdue payment or no valid plan. Check the billing status. |
Forbidden | The account is forbidden, frozen or recycled. | The account is disabled, frozen, or reclaimed. Contact customer service. |
ResourceNotFound | The requested resource does not exist. | The request path or task does not exist. Check the spelling of the path and task_id. |
RequestTooLarge | The request entity is larger than the limit allowed. | The request body or inline Base64 material exceeds the limit. Use a public network URL instead. |
TooManyRequests | The request rate limit has been exceeded. | QPS rate limiting or quota exhaustion has been triggered. Reduce the request frequency and retry. |
task_id and request_id.Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários