tencent cloud

LLM Service TokenHub

Video Interpolate Frames API Guide

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-11-30 19:32:33
Traduzido por IA

Overview

Tencent Cloud WAND is Tencent Cloud's audio and video AI brand. Its model foundation integrates self-developed vertical AI models and mainstream SOTA models, and with deep engineering optimization, it has accumulated over 100 AI applications and industry solutions, covering capabilities such as multimodal generation, understanding, audio, codecs, image quality enhancement, and erasure. Video Interpolate Frames is built on WAND-Enhance+ to intelligently fill in intermediate video frames, increase video frame rates, make motion smoother and more natural, and reduce stuttering and motion blur in low-frame-rate videos. It is suitable for scenarios such as AIGC-generated video optimization, sports events, game recordings, and animation sources.
Note:
This API uses asynchronous calls: a task_id is returned immediately after a task is submitted, and you need to poll the query API to obtain the processing result.

Prerequisites

You have registered a Tencent Cloud account and activated the TokenHub service.
You have obtained the API Key in the TokenHub console.
Note:
In all examples below, YOUR_API_KEY must be replaced with your own API Key. The authentication method is the request header Authorization: Bearer YOUR_API_KEY.

Call Process

1. To submit a task: call the "Initiate Video Interpolate Frames Task" API, which returns a task_id upon success.
2. Query result: Call the "Query Task Result" API with the task_id until the status is completed, and obtain the result video URL from output.file_url.

Initiating a Video Interpolate Frames Task

1. API Description

Interpolate the input video to the specified target frame rate, and optionally re-specify the output resolution, codec, container, and maximum bitrate.
fps (target frame rate) is a required parameter.
If the source frame rate is already not lower than the target frame rate, Video Interpolate Frames will not take effect.
Output parameters are optional. If not specified, the codec defaults to H.264 and the container format defaults to MP4. If the resolution is not specified, that of the source video is used.
API: POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-interpolate-frames

2. Input Parameters

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
fps
Yes
integer
Target frame rate for frame interpolation. The value range is [1,120]. It must be greater than the source frame rate to produce a frame interpolation effect.
resolution
No
string
Output resolution, in the format of width x height (for example, 1920x1080). Both width and height range from 128 to 8192, and the output short side cannot exceed 2160 (4K). The output is adaptively adjusted based on the long/short side. If not specified, the source resolution is retained.
codec
No
string
Output video codec. Supported codecs: H264 (default), H265, and AV1. The value is case-insensitive. AV1 supports only MP4 container.
container
No
string
Output container format. Supported format: MP4 (default). The value is case-insensitive.
max_video_bitrate
No
integer
Upper limit of the average output video bitrate, in kbps, ranging from 128 to 35000. If not specified, the algorithm adaptively determines it based on quality. After frame rate increases, the bitrate demand rises, so it is recommended to explicitly set this parameter as needed.

3. Sample Request

Basic call (frame rate increase only, other settings follow the source):
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-interpolate-frames' \\
-H 'Authorization: Bearer YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{
"video_url": "https://example.com/input_30fps.mp4",
"fps": 60
}'
Specify output specifications:
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-interpolate-frames' \\
-H 'Authorization: Bearer YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{
"video_url": "https://example.com/input_30fps.mp4",
"fps": 60,
"resolution": "1920x1080",
"codec": "H264",
"max_video_bitrate": 5000
}'

4. Output Parameters

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.

5. Sample Response

{
"task_id": "1400000001-procedurev2-xxxxxxxx",
"status": "queued",
"request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9"
}

Querying the Task Result

1. API Description

Query the execution status and output of a video frame interpolation task. After submission, poll this API until the status is completed or failed.
API: GET https://tokenhub.tencentmaas.com/v1/wand/tool/video-interpolate-frames/tasks/{task_id}

2. Input Parameters

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.

3. Sample Request

curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-interpolate-frames/tasks/1400000001-procedurev2-xxxxxxxx' \\
-H 'Authorization: Bearer YOUR_API_KEY'

4. Output Parameters

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.
output
object
Result product, returned only when completed.
output.file_url
string
URL of the result 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.

5. Sample Response

Processing:
{
"task_id": "1400000001-procedurev2-xxxxxxxx",
"status": "in_progress",
"progress": 35,
"request_id": "0a7d2c31-e024-426a-bb00-839553cb58c9"
}
Success:
{
"task_id": "1400000001-procedurev2-xxxxxxxx",
"status": "completed",
"progress": 100,
"output": {
"file_url": "https://xxxxxxx.mp4"
},
"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"
}
Failed:
{
"task_id": "1400000001-procedurev2-xxxxxxxx",
"status": "failed",
"progress": 0,
"error": {
"code": "SourceFileError",
"message": "source file err"
},
"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"
}

Appendix

Unified Error Codes

Submission API errors (HTTP layer) and task-level errors (the 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 or out-of-range fps, invalid URL format, invalid enum values, 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 fps). Provide the missing parameter and retry.
InvalidParameterValue.Fps
The value of fps is not valid.
The frame rate is outside the range [1,120].
InvalidParameterValue.Resolution
The value of resolution is not valid.
The resolution format or range is invalid.
InvalidParameterValue.Codec
The value of codec is not valid.
The codec parameter is invalid or incompatible with the container format (for example, AV1 with a non-MP4 container).
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, or the format is unsupported. Check the accessibility of the source URL and the integrity of the file, and then resubmit.
FailedOperation
Operation failed.
Processing failed due to a downstream exception. 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.

FAQs

1. Why Is Error 400 Returned Indicating That fps Is Missing?

fps is a required parameter. Explicitly pass an integer target frame rate between 1 and 120.

2. Why Does the Output Video Show No Obvious Frame Interpolation Effect Even Though the Task Completed Successfully?

The source video frame rate may be close to the target frame rate. Check the actual frame rate of the source video and set fps to a value significantly higher than the source frame rate (for example, source 24/25/30 fps → target 60 fps).

3. Will the Generated Video Link Expire?

The links will expire. The result links are temporary addresses valid for 24 hours. Make sure to download or transfer the files within 24 hours after the task succeeds, or the links will become invalid.

4. Can the Same task_id Be Used for Repeated Queries?

Yes. The query API has no side effects.



Ajuda e Suporte

Esta página foi útil?

comentários