tencent cloud

LLM Service TokenHub

Video Privacy Mask API Guide

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-11-30 19:32:34
AI翻訳

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 Privacy Mask is built on the WAND-Vega-VL multimodal understanding model. It understands video content, automatically identifies sensitive areas such as faces and license plates (including motorcycle plates), and then applies blurring or mosaic processing. You can choose to mask only faces, or mask both faces and license plates as needed. It protects personal privacy and reduces compliance risks in content publishing, without the need for frame-by-frame manual masking. It is suitable for scenarios such as news interviews and surveillance footage publishing.
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 Privacy Mask 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 Privacy Mask Task

1. API Description

Specify the masking target (face / face + license plate) with target, and specify the masking effect (blur / mosaic) with effect.
API: POST https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-privacy-mask

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
target
No
string
Masking target, case-sensitive. Face (default): face only; FacePlate: face + license plate (including motorcycle plates).
effect
No
string
Masking effect, case-sensitive. Blur (default): Gaussian blur; Mosaic: mosaic.

3. Sample Request

Basic call (face + blur, all defaults):
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-privacy-mask' \\
-H 'Authorization: Bearer YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{
"video_url": "https://example.com/input.mp4"
}'
Face + license plate, mosaic processing:
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/video-privacy-mask' \\
-H 'Authorization: Bearer YOUR_API_KEY' \\
-H 'Content-Type: application/json' \\
-d '{
"video_url": "https://example.com/input.mp4",
"target": "FacePlate",
"effect": "Mosaic"
}'

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-ProcessMediaByMPS-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 privacy mask task. After submission, poll this API until the status is completed or failed.
API: GET https://tokenhub.tencentmaas.com/v1/wand/tool/video-privacy-mask/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-privacy-mask/tasks/1400000001-ProcessMediaByMPS-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. During the algorithm processing stage, mask tasks may remain at 0 for a long time and then jump directly 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-ProcessMediaByMPS-xxxxxxxx",
"status": "in_progress",
"progress": 0,
"request_id": "0a7d2c31-e024-426a-bb00-839553cb58c9"
}
Success:
{
"task_id": "1400000001-ProcessMediaByMPS-xxxxxxxx",
"status": "completed",
"progress": 100,
"output": {
"file_url": "https://xxxxxxx.mp4"
},
"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"
}
Failed:
{
"task_id": "1400000001-ProcessMediaByMPS-xxxxxxxx",
"status": "failed",
"progress": 0,
"error": {
"code": "FailedOperation",
"message": "Operation failed."
},
"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, invalid URL format, invalid target / effect 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. Provide the missing parameter and retry.
InvalidParameterValue.Target
The value of target is not supported.
The value of target is not supported. Only Face / FacePlate are supported.
InvalidParameterValue.Effect
The value of effect is not supported.
The value of effect is not supported. Only Blur / Mosaic are supported.
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. Do I Need to Provide the Position Coordinates of the Face or License Plate?

No. Detection and masking regions are automatically determined by the algorithm, and callers only need to specify the masking target and effect.

2. What Is the Difference Between Face and FacePlate?

Face processes only faces in the frame. FacePlate processes both faces and license plates (including motorcycle plates), and is suitable for scenarios such as street views, in-vehicle footage, and road surveillance. If the frame contains license plates that require masking, use FacePlate.

3. How Do I Choose Between Blur and Mosaic?

Blur applies Gaussian blur for a more natural look. Mosaic applies a mosaic effect for more thorough mask and clearer visual indication. For scenarios with higher compliance requirements, Mosaic is recommended.

4. What Should I Do If There Are Missed Detections or Incorrect Masking?

Try adjusting target (use FacePlate if license plate masking is required), or contact technical support with sample cases from scenarios that require higher detection accuracy for evaluation.

5. 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.

6. Can I Use the Same task_id for Repeated Queries?

Yes. The query API has no side effects.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック