원클릭으로
video-subtitle-remover
视频硬字幕/水印去除技能。自动配置基于 YaoFANGUK/video-subtitle-remover 的环境并执行去字幕。当用户要求"去除视频字幕"、"去水印"、"把这个视频的字幕干掉"时触发此技能。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
视频硬字幕/水印去除技能。自动配置基于 YaoFANGUK/video-subtitle-remover 的环境并执行去字幕。当用户要求"去除视频字幕"、"去水印"、"把这个视频的字幕干掉"时触发此技能。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when a request asks for a Chinese-first AI video script with shot plans, image prompts, narration, subtitles, or handoff contracts for scene generation, image generation, video assembly, or WeChat draft preparation.
Use when a Codex task needs native image generation or editing, especially a set, series, material kit, long image, multi-screen design, storyboard, carousel, or other deliverable requiring multiple consistent images.
Skill 开发指南。当用户需要创建新 Skill 或更新已有 Skill 时触发,提供标准化模板、目录规范和最佳实践。
Use when reviewing an agent Skill before sharing, installing, or executing it and when checking a Skill bundle for credentials, dangerous commands, suspicious network behavior, or obfuscated code.
This skill should be used when preparing Markdown articles for a WeChat Official Account draft box, selecting wenyan-cli themes, processing article images, or troubleshooting authentication and whitelist failures.
Fetch and summarize Feishu group chat history. Use when the user asks to read, review, or summarize messages from a Feishu group chat. Triggers: "看群聊记录", "群里聊了啥", "帮我看看这个群", "群消息历史", "chat history", "what did the group discuss". NOT for: sending messages (use message tool), reading documents (use feishu-doc skill), or wiki operations (use feishu-wiki skill).
| name | video-subtitle-remover |
| description | 视频硬字幕/水印去除技能。自动配置基于 YaoFANGUK/video-subtitle-remover 的环境并执行去字幕。当用户要求"去除视频字幕"、"去水印"、"把这个视频的字幕干掉"时触发此技能。 |
当用户提到以下关键词时触发本技能:
这是一个需要本地 GPU/Apple Silicon 加速的重型任务,你需要作为一个完整的执行器,从环境准备到执行全包揽。
在首次运行前,必须检查环境并在用户机器上安装所需组件。工作目录约定为:~/.opencode/tools/video-subtitle-remover。
检查目录与代码
使用 bash 检查 ~/.opencode/tools/video-subtitle-remover/run_remove.py 是否存在。如果不存在,执行以下初始化操作:
# 1. 创建工作目录
mkdir -p ~/.opencode/tools/video-subtitle-remover/backend/models/{V4/ch_det,sttn}
cd ~/.opencode/tools/video-subtitle-remover
# 2. 拉取核心代码 (跳过模型文件)
curl -sL "https://api.github.com/repos/YaoFANGUK/video-subtitle-remover/git/trees/main?recursive=1" | python3 -c "
import sys, json, os, urllib.request
data = json.load(sys.stdin)
for item in data.get('tree', []):
if item['type'] != 'blob': continue
path = item['path']
ext = os.path.splitext(path)[1].lower()
if ext in {'.pth', '.onnx', '.pdiparams', '.pdmodel'} or '__pycache__' in path or item.get('size', 0) > 500000: continue
os.makedirs(os.path.dirname(path) if os.path.dirname(path) else '.', exist_ok=True)
url = f'https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/{path}'
try:
content = urllib.request.urlopen(url).read()
with open(path, 'wb') as f: f.write(content)
except: pass
"
安装 Python 依赖
pip3 install torch torchvision
pip3 install filesplit==3.0.2 scikit-image pyclipper lmdb PyYAML omegaconf tqdm easydict scikit-learn pandas webdataset einops av shapely paddleocr paddle2onnx albumentations imgaug
下载并合并模型 (STTN 模式必需)
如果 backend/models/sttn/infer_model.pth 或 backend/models/V4/ch_det/inference.pdiparams 不存在,使用 curl 下载:
cd ~/.opencode/tools/video-subtitle-remover/backend/models
# 下载 STTN 模型
curl -L -o sttn/infer_model.pth "https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/backend/models/sttn/infer_model.pth"
# 下载并合并 PaddleOCR 文本检测模型 (3个分割包)
curl -L -o V4/ch_det/inference_1.pdiparams "https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/backend/models/V4/ch_det/inference_1.pdiparams"
curl -L -o V4/ch_det/inference_2.pdiparams "https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/backend/models/V4/ch_det/inference_2.pdiparams"
curl -L -o V4/ch_det/inference_3.pdiparams "https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/backend/models/V4/ch_det/inference_3.pdiparams"
curl -L -o V4/ch_det/fs_manifest.csv "https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/backend/models/V4/ch_det/fs_manifest.csv"
curl -L -o V4/ch_det/inference.pdiparams.info "https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/backend/models/V4/ch_det/inference.pdiparams.info"
curl -L -o V4/ch_det/inference.pdmodel "https://raw.githubusercontent.com/YaoFANGUK/video-subtitle-remover/main/backend/models/V4/ch_det/inference.pdmodel"
# 使用 Python 合并
python3 -c "from fsplit.filesplit import Filesplit; fs=Filesplit(); fs.merge(input_dir='V4/ch_det')"
注入修复代码与启动脚本
使用 edit 工具修改 backend/config.py:
device = torch.device('mps'))shutil.which('ffmpeg'))并使用 write 工具生成 run_remove.py 启动脚本。
提取信息与评估
获取用户提供的视频绝对路径,运行 ffprobe 或 ls -lh 获取帧数,给用户预报处理时间。
执行处理 运行处理脚本:
export KMP_DUPLICATE_LIB_OK=True
python3 ~/.opencode/tools/video-subtitle-remover/run_remove.py "<视频绝对路径>"
注意:如果视频较长,务必使用 tmux 放后台跑。
结果交付
使用 open 命令为用户自动打开输出的 _no_sub.mp4 视频。