Smart erase function can blur, pixelate, or seamlessly process elements like logos, watermarks, 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.
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. 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.
// 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.
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.
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.
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:
Standard edition: It is generally recommended to choose the standard edition, as its subtitle removal effect is better.
STTN edition: It provides the same feature as the standard edition, but it is slightly faster, though the effect is not as good as the standard edition.
Left: original video; Right: subtitle removal effect of standard edition, nearly seamless.
Left: original video; Right: subtitle removal effect of STTN 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\":\"rennian_msk\"}}
Effect Example
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\":\"rennian\"}}
Effect Example
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
// v1 version -- Phased out. It is recommended to use v2.
Left: original video image; Right: both faces and license plates mosaicked.
2. 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":"ocr_zimu", # 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.
"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;
}
}
3. 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: API Explorer will automatically convert the format. You only need to enter the corresponding ExtendedParameter in JSON format without converting it to a string.
4. Querying Task Results
Task callbacks: 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.
Query via API: Use the TaskId returned by ProcessMedia to call the DescribeTaskDetail API to query the task processing results. Parse the AiAnalysisResultSet field under WorkflowTask.
Query via 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.
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.
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
What types of watermarks removal are supported?
This service uses AI technology to identify watermarks and and removes them. Currently, recognition and erasion of over a dozen types of watermarks are supported. For watermarks not included in our coverage, we offer personalized training services at an additional model training cost.
Does it charge for watermark-free videos?
It will also charge in this situation. This is due to the fact that even if the video is not watermarked, normal computational analysis is performed, consumping the computational 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":"ocr_zimu",
"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\":{\"CustomerAppId\":\"ocr_zimu\",\"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