Overview
Menu

Smart Erase Tutorial

Last updated: 2025-04-18 17:42:12Download PDF

Overview

Smart erase function can blur, pixelate, or seamlessly process elements like logos, subtitles, and sensitive info like faces and vehicle license plates in videos, aiding content sharing. It's used in drama, short videos, Vlogs, and international e-commerce.

Key features

Automatically: Capable of automatically recognizing and removing over a dozen common logos, watermarks, subtitles, and sensitive info with effects like blurring and seamless removal.
High Customizability: It allows customization of model parameters for specific video scenarios, improving removal accuracy and making the final imagery appear more natural.




Integration Method 1: Integrating Through API

Call the Media Processing Service (MPS) API, select AiAnalysisTask, set Definition to 24 (preset smart erase template), and enter extended parameters in ExtendedParameter for specific capabilities. For details, see Specifying an Erasure Scenario below.
Note:
If you need to enable the smart erase feature for a custom intelligent analysis template, you can contact us and provide the template ID, and Tencent Cloud MPS developers will configure and enable the smart erase feature for you.




1. API Explorer Quick Verification

You can perform quick verification through API Explorer. After filling in relevant parameter information on the page, you can initiate an online API call.



Note:
If API Explorer is used, fill in the corresponding JSON content for ExtendedParameter. API Explorer will automatically convert it to a string.
Parameter example for API Explorer:

Parameters for directly calling an API:
{\"delogo\":{\"cluster_id\":\"gpu_zhiyan\",\"CustomerAppId\":\"subtitle_erase_fast\"}}

2. ExtendedParameter: Common Parameters (For Specifying Erasure Scenarios)

The following elaborates on how the ExtendedParameter parameter passing can specify different erasure scenarios.
Note:
Currently, each request can only select one scenario capability and does not support multiple selections. If you need to use a combination of multiple capabilities, contact us for evaluation and support.

Scenario 1: Watermark Removal

If ExtendedParameter is not specified, the watermark removal scenario is used by default.
Currently, we support the recognition and removal of over 10 types of watermarks. For watermarks not within our supported range, we also offer customized training services, however, this will incur additional model training fees.

Scenario 2: Subtitle Removal + Voice Subtitle & Translation + Text To Speech (TTS) & Replacement

Description
Original subtitle removal, subtitle & voice translation, and multilingual subtitle & voice replacement can be accomplished in one go in this scenario, facilitating video dissemination overseas. It is widely applicable to short drama platforms, short video platforms, cross-border e-commerce, and independent media studios. By using this scenario capability, the input video will be processed in the following steps sequentially:
1. Recognize and remove the subtitles in the original video image;
2. Recognize the audio in the original video, generate subtitle files, translate the subtitles, and then:
2.1 Render the translated subtitles to the original video image;
2.2 Use TTS to replace the original video's audio track.
3. Generate a new video.
Note:
This scenario is a combination of multiple features. If you only need to use a specific feature, refer to other scenarios below.
Parameter
// Target language: English
{\"delogo\":{\"cluster_id\":\"gpu_pp\",\"CustomerAppId\":\"audio_subtitle_replace\",\"subtitle_param\":{\"translate_dst_language\":\"en\"}}}
/*
Note: translate_dst_language is used to specify the target language. If it is left blank, no translation will be performed, and only the original subtitles will be output.
Valid values: en: English; zh: Chinese.
*/
Effect Example
Left: original Chinese short video; Right: processed output video with English subtitles and English dubbing.
Left: original Chinese short video; Right: processed output video with English subtitles and English dubbing.


Scenario 3: Specified Area Erasure

Description
The area specified by parameters is erased and a new video is generated.
Parameter
{\"delogo\":{\"custom_objs\":{\"type\":0,\"time_objs\":[{\"objs\":[{\"type\":1,\"value\":\"customobjs\",\"score\":99,\"rect\":{\"lt_x\":120,\"lt_y\":75,\"rb_x\":395,\"rb_y\":158}}]}]}}}

// Note: custom_objs is used to specify the area to be erased, where (lt_x, lt_y) is the top-left coordinate of the area, and (rb_x, rb_y) is the bottom-right coordinate of the area.
Effect Example
Left: original video; Right: output video after erasure.
Left: original video; Right: output video after erasure.


Scenario 4: Subtitle Extraction and Translation

Description
The subtitles in the video image are recognized, analyzed, and proofread and then translated into the specified language, and both the original and translated subtitle files are generated.
Parameter
{\"delogo\":{\"CustomerAppId\":\"subtitle_extract\",\"subtitle_param\":
{\"translate_dst_language\":\"en\"}}}

/*
Note: translate_dst_language is used to specify the target language。If translate_dst_language is set to empty, no translation will be done, and only the original subtitles will be output.
Other values: en: English, zh: Chinese.
*/
Effect Example
Left: original video; Right: extracted subtitle file.
Left: original video; Right: extracted subtitle file.


Scenario 5: Subtitle Removal

Description
The text at the lower middle part of the video image is automatically recognized and removed using AI models to generate a new video. This feature offers two editions:
Refined edition: This edition is recommended. It is faster and has a better erasing effect.
Standard edition: The erasing area is larger, but the effect is not as good as that of the refined edition. In addition, the processing speed is lower.
Refined Edition Parameters
{\"delogo\":{\"cluster_id\":\"gpu_zhiyan\",\"CustomerAppId\":\"subtitle_erase_fast\"}}
{\"delogo\":{\"cluster_id\":\"gpu_zhiyan\",\"CustomerAppId\":\"subtitle_erase_fast\"}}
Standard Edition Parameters
{\"delogo\":{\"cluster_id\":\"gpu_pp\",\"CustomerAppId\":\"subtitle_erase\"}}
Effect Example
From left to right: original video; subtitle erasing effect by using the standard edition; subtitle erasing effect by using the refined edition
From left to right: original video; subtitle erasing effect by using the standard edition; subtitle erasing effect by using the refined edition


Scenario 6: Face Mosaic

Description
After faces in the video image are recognized, mosaic processing is applied to the faces and a new video is generated.
Parameter
{\"delogo\":{\"CustomerAppId\":\"facial_mosaic\"}}
Effect Example
Left: original video image; Right: processed video with all faces mosaicked.
Left: original video image; Right: processed video with all faces mosaicked.


Scenario 7: Face Blur

Description
After faces in the video image are recognized, blur processing is applied to the faces and a new video is generated.
Parameter
{\"delogo\":{\"CustomerAppId\":\"facial_blur\"}}
Effect Example
Left: original video image; Right: face blur processing.
Left: original video image; Right: face blur processing.


Scenario 8: Face and License Plate Mosaic

Description
After faces and license plates in the video image are recognized, mosaic processing is applied to both the faces and license plates and a new video is generated.
Parameter
{\"delogo\":{\"CustomerAppId\":\"facial_and_numberplate_mosaic_v2\"}}
Effect Example
Left: original video image; Right: both faces and license plates mosaicked.
Left: original video image; Right: both faces and license plates mosaicked.


3. Additional Details on ExtendedParameters

The preceding section provided a succinct overview of several prevalent methods for passing ExtendedParameter, aimed at designating erasure scenarios. What follows is a display of all the parameters supported by ExtendedParameter along with their descriptions:
"delogo":{
"CustomerAppId": "subtitle_extract", # string; Set up scene parameters: Different scenes may use only some of these parameters. Changes to general parameters need internal confirmation.
"cluster_id": "", # string; Reserved fields: Used for scheduling tasks in clusters. Certain tasks must run on specific clusters and should not be changed casually.
"output_patten": "{task_type}-{session_id}", # string; Output file name: Cannot contain special characters, must be less than 200 characters, includes {}. Supports placeholders like task_type and session_id.
"als_filter": { # JSON object: recognition results filter.
"min_ocr_height": 10, # Float; Must be greater than or equal to 0. For text recognition: Minimum text size. Less than 1 means video height ratio; greater than 1 means pixels.
"max_ocr_height": 0.06, # Float; Must be greater than or equal to 0. For text recognition: Maximum text size.
"active_areas": [ # JSON array: Area filter. Only recognition results with center points within this area will be used.
{
"lt_x": 0.1, # float, valid if >= 0; x coordinate of top-left corner of the area, less than 1 indicates video height ratio, greater than 1 indicates pixels
"lt_y": 0.6, # float, valid if >= 0; y coordinate of top-left corner of the area
"rb_x": 0.9, # float, valid if >= 0; x coordinate of bottom-right corner of the area
"rb_y": 0.95 # float, valid if >= 0; y coordinate of bottom-right corner of the area
}
]
},
"custom_objs": { # json object; custom erasure area
"type": 0, # int, set to 0; specify type
"time_objs": [# json array; time area information
{
"begin_ms": 0, # int; start time, in ms, if not filled, same as video start
"end_ms": 100, # int; end time, in ms, if not filled, same as video end
"objs": [ # json array; area information
{
"rect": { # json object; target area
"lt_x": 55, # float, valid if >= 0; x coordinate of top-left corner of the area, in pixels
"lt_y": 143, # float, valid if >= 0; y coordinate of top-left corner of the area
"rb_x": 327, # float, valid if >= 0; x coordinate of bottom-right corner of the area
"rb_y": 192 # float, valid if >= 0; y coordinate of bottom-right corner of the area
},
"score": 100, # int, fill 100 here; target reference score
"type": 2, # int; target type, 1 for logos, 2 for text
"value": "LUSN" # string; target value, e.g., text recognition output
}
]
}
]
}
"subtitle_param" : { # json object; subtitle related parameters
"margin_bottom": 0.2, # float, valid if >= 0; for subtitle file rendering, distance from bottom edge, less than 1 indicates video height ratio, greater than 1 indicates pixels;
"font_size": 50, # float, valid if >= 0; for subtitle file rendering, font size for subtitles, less than 1 indicates video height ratio, greater than 1 indicates pixels;
"font_type": "simkai", # string; subtitle rendering font: simkai for KaiTi, hei for HeiTi, song for SongTi;
"translate_dst_language": "en" # string; for subtitle translation, leave empty to not translate, just output original subtitles; other values: en for English, zh for Chinese;
}
}

4. Querying Task Results

Querying a Task in the Console

Log in to the console and go to VOD Processing Tasks, where the newly initiated tasks are displayed in the task list.



When the subtask status is "Successful", you can go to COS Bucket > Output Bucket, find your output directory, and locate the files starting with delogo- in the directory, which are the output files processed by smart erase.




Querying Task Results by Calling an API

Call the DescribeTaskDetail API and fill in the task ID (for example, 24000022-WorkflowTask-b20a8exxxxxxx1tt110253 or 24000022-ScheduleTask-774f101xxxxxxx1tt110253) to query task results. Example:


Event Notification Callback

When initiating an MPS task using ProcessMedia, you can set callback information through the TaskNotifyConfig parameter. After the task is completed, the task results will be called back through the configured callback information. You can parse the event notification results through ParseNotification.

Integration Method 2: Initiating a Task from Console (Zero Code)

Note:
When an erasure task is initiated from the console, the default scenario is watermark removal. For other erasure scenarios, use the API to specify an erasure scenario through parameters. For details, refer to the above Integration Method 1: Integrating Through API.

1. Creating a Task

1.1 Log in to the MPS console and click Create Task > Create VOD Processing Task.



1.2 Specify an input video file. Currently, the smart erase feature supports two input sources: Tencent Cloud Object Storage (COS) and URL download addresses. AWS S3 is currently not supported.
1.3 In the "Process Input File" step, add the Intelligent Analysis node.



In the intelligent analysis settings drawer that pops up, select the preset smart erase template (template ID: 24). If you need to enable the smart erase feature for a custom intelligent analysis template, you can contact us and provide the template ID, and Tencent Cloud MPS developers will configure and enable the smart erase feature for you.
Note:
The preset template (template ID: 24) defaults to the watermark removal scenario. For other erasure scenarios, refer to the above method 1 of integrating through API.



1.4 After specifying the save path for the output video after erasure, click Create to initiate the task.




2. Querying Task Results

After the task is completed, you can go to the console, choose COS Bucket > Output Bucket, and find the output file. For detailed directions, see Querying Task Results above.

3. Automatically Triggering a Task (Optional Capability)

If you require automatically performing smart erase according to the preset parameters after a video file is uploaded in the COS bucket, you can:
3.1 When creating a task, click Save The Orchestration, and configure parameters such as Trigger Bucket and Trigger Directory in the pop-up window.



3.2 Go to the VOD Orchestration list, find the new orchestration, and turn on the switch at Enable. Subsequently, any new video files added to the trigger directory will automatically initiate tasks according to the preset process and parameters of the orchestration, and the processed video files will be saved to the output path configured in the orchestration.
Note:
It takes 3-5 minutes for the orchestration to take effect after being enabled.




FAQs

Which logos can be erased?

This service erases logos based on AI recognition. Currently, over ten logos can be recognized and erased. For logos that are not supported currently, the customized training service is provided, which incurs a model training fee.

Are fees charged for videos without a logo?

Yes. The service still performs recognition even if the video has no logo, which also consumes computing resources.

Is live streaming supported?

Currently, only VOD files are supported by the external interface. For live streaming processing needs, please get in touch with the developer.
ck information will relay the task results.

How to specify the output file name?

You may specify the output filename within the ExtendedParameter through the parameter output_pattern.
The placeholder symbol is {}, and the placeholders support task_type, session_id, with the default output being {task_type}-{session_id}.
Usage example:
//Example code before translation, only suitable for use in API Explorer:
{
"delogo": {
"CustomerAppId": "subtitle_extract",
"subtitle_param": {
"translate_dst_language": ""
},
"output_patten": "custom-{task_type}-{session_id}"
}
}
// If using the API directly, escape the above code as a string:{\"delogo\":{\"delogo\":{\"CustomerAppId\":\"subtitle_extract\",\"subtitle_param\":{\"translate_dst_language\":\"\"},\"output_patten\": \"custom-{task_type}-{session_id}\"}}

// The output file name for the above parameters will be: custom-delogo-02EF93096ADCC84F4ACF156F3A0D1120DD_1721359047292.vtt