视频字幕擦除
更新时间:2025-07-25
简介
字幕擦除或者去字幕指通过AI模型自动识别视频中的字幕文本内容,对字幕区域进行无痕化填充,生成新的视频。字幕擦除可用于二次创作如出海短剧或者电视剧等。
功能说明
针对不同场景,MCP字幕擦除提供了三个类型的擦除能力:自动擦除对白字幕、自动擦除全局字幕、手动指定字幕擦除
自动擦除对白字幕
智能识别并擦除画面中下部、水平居中的横向字幕(常见于人物对话),适用场景:影视剧、访谈、短剧等带固定位置字幕的内容
自动擦除全局字幕
智能识别画面中所有字幕区域并进行擦除。支持用户设置擦除字幕的时间范围和空间区域,即仅对时间段中限制区域内检测到的字幕进行擦除。字幕擦除通常能自动识别出较准确的字幕位置,但在某些特殊情况下可能会出现误检问题。该框选限制功能能够有效降低非字幕的误擦除问题。
手动指定字幕擦除
用户手动指定擦除时间段和空间位置坐标。如果采用自动擦除对白字幕或者自动擦除全局字幕,还有一些漏擦区域,如字幕样式、视频背景等造成的漏检,可以手动设定起始、结束时间以及该时间段需要擦除的位置。为了保证擦除效果,漏擦区域位置、时间段设置需要尽量准确。
使用示例
通过MCP的视频转码功能使用字幕擦除能力。视频转码使用流程见MCP快速使用流程
目前控制台上暂未开放完整的字幕擦除参数设置,只能通过API调用方式使用。
视频转码模板接口见视频转码模板
视频转码任务接口见视频转码任务
字幕擦除任务不建议在模板中设置帧率,即输出帧率随源。
自动擦除对白字幕
模板配置
JSON
1{
2 "extraCfg": {
3 "autoDesubtitle": 3,
4 "subtitleType": "auto_dialog_subtitle"
5 }
6}
或者
JSON
1{
2 "extraCfg": {
3 "autoDesubtitle": 3
4 }
5}
任务配置
JSON
1{
2 "source": {
3 "clips": [
4 {
5 "bucket": "example_buckect",
6 "sourceKey": "input.mp4"
7 }
8 ]
9 },
10 "target": {
11 "targetBucket": "example_bucket",
12 "targetKey": "desub_output.mp4", # 字幕擦除的文件
13 "presetName": "desub_auto_dialog" # 创建的模板名称,以desub_auto_dialog为例
14 },
15
16}
自动擦除全局字幕
模板配置
JSON
1{
2 "extraCfg": {
3 "autoDesubtitle": 3,
4 "subtitleType": "auto_global_subtitle"
5 }
6}
任务配置
JSON
1{
2 "source": {
3 "clips": [
4 {
5 "bucket": "example_buckect",
6 "sourceKey": "input.mp4"
7 }
8 ]
9 },
10 "target": {
11 "targetBucket": "example_bucket",
12 "targetKey": "desub_output.mp4", # 字幕擦除的文件
13 "presetName": "desub_auto_global" # 创建的模板名称,以desub_auto_global为例
14 "desubtitleParams": [
15 {
16 "areaList": [ # 不设置起始、结束时间,时间段为全片
17 {
18 "x": 0.0,
19 "y": 0.9,
20 "width": 1.0,
21 "height": 0.1
22 }
23 ]
24 },
25 {
26 "startTimeInMillisecond": 0,
27 "endTimeInMillisecond": 5000, # 设置起始、结束时间,时间段为0ms ~ 5000ms
28 "areaList": [
29 {
30 "x": 0.8,
31 "y": 0.3,
32 "width": 0.2,
33 "height": 0.4
34 }
35 ]
36 },
37 {
38 "endTimeInMillisecond": 2000, # 只设置结束时间,时间段为0ms ~ 2000ms
39 "areaList": [
40 {
41 "x": 0.0,
42 "y": 0.3,
43 "width": 0.8,
44 "height": 0.4
45 }
46 ]
47 },
48 {
49 "startTimeInMillisecond": 4000, # 只设置起始时间,时间段为4000ms ~ 片尾
50 "areaList": [ # 可设置多个限定区域,最多5个
51 {
52 "x": 0.2,
53 "y": 0.3,
54 "width": 0.8,
55 "height": 0.4
56 },
57 {
58 "x": 0.6,
59 "y": 0.0,
60 "width": 0.2,
61 "height": 0.4
62 },
63 {
64 "x": 0.0,
65 "y": 0.0,
66 "width": 0.2,
67 "height": 0.2
68 }
69 ]
70 }
71 ]
72 }
73}
手动指定字幕擦除
模板配置
JSON
1{
2 "extraCfg": {
3 "autoDesubtitle": 3,
4 "subtitleType": "manual_subtitle"
5 }
6}
任务配置
JSON
1{
2 "source": {
3 "clips": [
4 {
5 "bucket": "example_buckect",
6 "sourceKey": "input.mp4"
7 }
8 ]
9 },
10 "target": {
11 "targetBucket": "example_bucket",
12 "targetKey": "desub_output.mp4", # 字幕擦除的文件
13 "presetName": "desub_manual" # 创建的模板名称,以desub_manual为例
14 "desubtitleParams": [
15 {
16 "areaList": [ # 不设置起始、结束时间,时间段为全片
17 {
18 "x": 660,
19 "y": 490,
20 "width": 50,
21 "height": 290
22 },
23 {
24 "x": 360,
25 "y": 0,
26 "width": 360,
27 "height": 360
28 }
29 ]
30 },
31 {
32 "startTimeInMillisecond": 6000, # 只设置起始时间,时间段为6000ms ~ 片尾
33 "areaList": [
34 {
35 "x": 230,
36 "y": 1225,
37 "width": 260,
38 "height": 50
39 }
40 ]
41 },
42 {
43 "endTimeInMillisecond": 2000, # 只设置结束时间,时间段为0ms ~ 2000ms
44 "areaList": [
45 {
46 "x": 230,
47 "y": 1225,
48 "width": 260,
49 "height": 50
50 }
51 ]
52 },
53 {
54 "startTimeInMillisecond": 0, # 设置起始、结束时间,时间段为0ms ~ 5000ms
55 "endTimeInMillisecond": 5000,
56 "areaList": [ # 可设置多个指定区域,最多5个
57 {
58 "x": 140,
59 "y": 630,
60 "width": 440,
61 "height": 60
62 },
63 {
64 "x": 85,
65 "y": 630,
66 "width": 550,
67 "height": 60
68 },
69 {
70 "x": 280,
71 "y": 680,
72 "width": 160,
73 "height": 70
74 },
75 {
76 "x": 150,
77 "y": 630,
78 "width": 420,
79 "height": 65
80 },
81 {
82 "x": 210,
83 "y": 630,
84 "width": 300,
85 "height": 65
86 }
87 ]
88 }
89 ]
90 }
91}
效果展示

