Subtitle Translate logo

Subtitle Translate

OrganizationPopular
ZJU-REAL
subtitle-translate

字幕翻译 / 双语字幕:把已有字幕(SRT/VTT/ASS)翻译成目标语言,生成双语(原文+译文)或纯译文字幕,并可软挂载 / 硬烧录进视频。当用户说 字幕翻译、翻译字幕、双语字幕、中英字幕、给视频加翻译、SRT 翻译、字幕本地化、把字幕翻成中文/英文、字幕转双语 时使用。翻译由 LLM 完成,时间轴/格式/烧录由 shared/scripts/subtitle_ops.py 确定性处理。与 auto-subtitle 区别:auto-subtitle 是语音识别生成字幕,本 SKILL 是把已有字幕翻译成双语。

Overview

PublisherZJU-REAL
RepositoryEasel
Skill namesubtitle-translate
Stars
3.5K
Forks
535
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ZJU-REAL on GitHub. Read the source before you install it.

Installation

Install the Subtitle Translate AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ZJU-REAL/Easel/tree/main/skills/openclaw/subtitle-translate
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ZJU-REAL/Easel.git /tmp/Easel
mkdir -p .claude/skills
cp -r /tmp/Easel/skills/openclaw/subtitle-translate .claude/skills/subtitle-translate
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Subtitle Translate in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Subtitle Translate on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Subtitle Translate is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

字幕翻译 / 双语字幕

把已有字幕翻译成目标语言,产出双语(原文+译文)或纯译文字幕,可选烧录进视频。 翻译交给 LLM(你自己),确定性部分(解析/合并/格式/时间轴/烧录)全交给 skills/shared/scripts/subtitle_ops.py。不要手拼 ffmpeg,也不要手改时间轴。

只做"已有字幕 → 翻译/双语/烧录"。语音识别生成字幕见 auto-subtitle; 通用视频剪辑见 video-editing。

输入

字段必填说明
字幕文件是.srt / .vtt / .ass 路径(没给就问)
目标语言是译成什么语言(如中文 / English / 日本語)
输出形态否双语(默认)/ 纯译文
原译顺序否双语时原文在上(默认)或译文在上
视频文件否给了则可烧录;软挂载(可开关)或硬烧录(烧进画面)

输出(outputs/主题名/)

  • 双语 / 纯译文字幕文件(.srt 或 .ass)
  • 若烧录:带字幕的视频(*-sub.mp4)
  • 报告:条数、目标语言、形态、输出路径

执行步骤

脚本路径(相对项目根):skills/shared/scripts/subtitle_ops.py(每个子命令支持 -h)。

1. 提取待译文本

bash
python skills/shared/scripts/subtitle_ops.py extract -i <字幕> -o /tmp/st_lines.txt

每条字幕一行、行号与顺序固定。记住总行数 N。

2. 逐行翻译(你来做)

读 /tmp/st_lines.txt,逐行翻译成目标语言,写入 /tmp/st_trans.txt:

  • 行数必须严格等于 N,顺序一一对应,不增删空行、不合并、不拆行(脚本会校验,不一致直接报错)。
  • 一行内如原文有多句,整合成一行译文,不要拆成多行。
  • 语气/术语按内容领域走;口语内容译得自然口语,书面内容译得书面。
  • 空行原文对应空行译文(保持占位)。

3. 合并成双语 / 纯译文字幕

bash
# 双语 SRT(原文在上,译文在下)
python skills/shared/scripts/subtitle_ops.py merge -i <字幕> --trans /tmp/st_trans.txt \
  -o outputs/主题名/<名>-bilingual.srt

# 双语 ASS(原文白色较大 / 译文黄色略小,样式更佳,推荐用于硬烧录)
python skills/shared/scripts/subtitle_ops.py merge -i <字幕> --trans /tmp/st_trans.txt \
  -o outputs/主题名/<名>-bilingual.ass --format ass

# 纯译文(不保留原文)
python skills/shared/scripts/subtitle_ops.py merge -i <字幕> --trans /tmp/st_trans.txt \
  -o outputs/主题名/<名>-<lang>.srt --trans-only

--order trans-top 可让译文在上。

4.(可选)烧录进视频

bash
# 硬烧录(烧进画面,推荐用 .ass 保留双语样式)
python skills/shared/scripts/subtitle_ops.py burn -i <视频> \
  --sub outputs/主题名/<名>-bilingual.ass \
  -o outputs/主题名/<名>-sub.mp4

# 软挂载(可在播放器开关,不改画面;mp4→mov_text,mkv→srt)
python skills/shared/scripts/subtitle_ops.py burn -i <视频> \
  --sub outputs/主题名/<名>-bilingual.srt \
  -o outputs/主题名/<名>-sub.mp4 --soft

其它子命令

  • parse -i <字幕> [-o out.json] — 解析成 JSON(含时间轴),供程序化处理或核对。
  • build --json <cues.json> -o <字幕> — 从 JSON(cue 带 text 与可选 trans)构建,适合批量/整段翻译回填。
  • convert -i a.srt -o b.vtt — 格式互转(srt ↔ vtt ↔ ass)。

规则

  1. 翻译走 extract → 逐行译 → merge 三步,严守行数一致,绝不让脚本回退到"猜行对应"。
  2. 时间轴、字幕条数、格式一律由脚本产出,禁止手改时间戳。
  3. 硬烧录中文优先用 .ass(内置 Noto Sans CJK 样式);若用 srt 硬烧录且中文变方块,burn 加 --font-dir 指向含 CJK 字体的目录。
  4. 双语默认原文在上、译文在下(--order 可调);纯译文用 --trans-only。
  5. 产物统一进 outputs/主题名/。

参考来源

字幕翻译工具形态参考开源项目:rockbenben/subtitle-translator(批量双语、译文上下对齐)、 bonigarcia/dualsub(双语合并)、innovationmech/video-translate(软/硬字幕嵌入)。 本 SKILL 把"翻译"交给 LLM,只把易错的解析/时间轴/合并/烧录做成确定性脚本。

Frequently asked questions

What does the Subtitle Translate AI skill do?

字幕翻译 / 双语字幕:把已有字幕(SRT/VTT/ASS)翻译成目标语言,生成双语(原文+译文)或纯译文字幕,并可软挂载 / 硬烧录进视频。当用户说 字幕翻译、翻译字幕、双语字幕、中英字幕、给视频加翻译、SRT 翻译、字幕本地化、把字幕翻成中文/英文、字幕转双语 时使用。翻译由 LLM 完成,时间轴/格式/烧录由 shared/scripts/subtitle_ops.py 确定性处理。与 auto-subtitle 区别:auto-subtitle 是语音识别生成字幕,本 SKILL 是把已有字幕翻译成双语。

Why use Subtitle Translate on TypingMind?

Because you install it once and use it with any model. Subtitle Translate is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Subtitle Translate in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ZJU-REAL/Easel/tree/main/skills/openclaw/subtitle-translate. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Subtitle Translate?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Subtitle Translate?

As many as you like. As long as a model supports skills, you can use Subtitle Translate with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Subtitle Translate AI skill free?

Yes. It is published on GitHub by ZJU-REAL under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇