-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig-template.yaml
40 lines (35 loc) · 1.46 KB
/
config-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# 视频文件相关配置
video:
width_delta: 0.05 # 宽度冗余
height_delta: 0.02 # 高度冗余
groups_tolerance: 20 # 允许的组内差值,计算字幕中心和高度用
min_duration: 0.1 # 最小字幕持续时间,单位秒
# OCR 识别配置
ocr:
lang: "ch" # OCR 识别语言
det_model_dir: "./models/ch_PP-OCRv4_det_server_infer" # OCR 检测模型
rec_model_dir: "./models/ch_PP-OCRv4_rec_server_infer" # OCR 识别模型
min_height_ratio: 0.0 # 检测字幕的最小高度占比
max_height_ratio: 1.0 # 检测字幕的最大高度占比
# 字幕擦除配置
erase:
ckpt_p: "./models/sttn.pth" # STTN 模型
max_frame_length: 80 # 单次处理帧最大长度
min_frame_length: 20 # 单次处理帧最小长度
mask_expand: 20 # 掩膜外扩的像素数。
neighbor_stride: 10 # 邻居帧步长
# 字幕翻译配置
translation:
model: "gpt-4o-mini"
api_key: "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
api_base_url: "https://api.chatanywhere.tech/v1"
# 字幕处理配置
subtitle:
font: "./fonts/arialbd.ttf" # 字幕字体
font_size: 0 # 翻译后字幕的字体大小,如24,为0则使用理论计算大小
font_color: "#FFFFFF" # 字幕字体颜色,例如白色
position: 0 # 字幕位置,高度的百分比,例如0.66,为0则为原字幕位置
width_ratio: 0.8 # 字幕宽度与视频宽度的比例,用于计算字体大小
# 视频输出配置
output:
target_size: 30 # 输出视频大小,单位MB