Communitygithub.com

jun7799/jianying-subtitle-fixer

剪映字幕AI纠错流水线。当用户说"纠字幕"、"字幕纠错"、"改字幕"、"修正字幕"、"字幕识别错了"、"处理字幕",或提到录完视频要在剪映里改专有名词字幕(如 Agent、Claude Code、MCP 识别错)时使用。流程:剪映智能字幕识别 → 本工具解密草稿 → 术语表规则+智谱glm-4-flash双层纠错 → 回加密写回 → 用户回剪映手动剪辑。

jianying-subtitle-fixer 是什么?

jianying-subtitle-fixer is a Claude Code agent skill that 剪映字幕AI纠错流水线。当用户说"纠字幕"、"字幕纠错"、"改字幕"、"修正字幕"、"字幕识别错了"、"处理字幕",或提到录完视频要在剪映里改专有名词字幕(如 Agent、Claude Code、MCP 识别错)时使用。流程:剪映智能字幕识别 → 本工具解密草稿 → 术语表规则+智谱glm-4-flash双层纠错 → 回加密写回 → 用户回剪映手动剪辑。.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add jun7799/jianying-subtitle-fixer

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Jianying Subtitle AI Fixer

What Problem Does It Solve?

CapCut's speech recognition is fast and free, but proper nouns (Agent, Claude Code, MCP, WorkBuddy…) are often misrecognized, requiring half an hour of manual corrections per video. This tool automates the process: decrypt draft → double-layer correction → re-encrypt and write back, leaving timelines and styles unchanged. After running, reopen CapCut and start editing right away.

Prerequisites (One-time – see references/setup.md)

  1. Place jy-draftc.exe in the tools/ directory (download from GitHub wenshui330/jy-draftc)
  2. CapCut desktop installed (auto-detected; or set JY_INSTALL_DIR to the version directory containing videoeditor.dll)
  3. ZhiPu API key (environment variable ZHIPU_API_KEY; if you run Claude Code via ZhiPu, it can auto-read settings.json)

Standard Workflow

1. In CapCut: Create a new draft → add video → run "Text → Smart Subtitles" until recognition completes
2. Completely exit CapCut (including system tray) – the script checks this and refuses to write back if CapCut is open
3. Run the script (dry-run first to preview):
   python scripts/fix_subtitles.py "DraftName" --dry-run
4. Show the user workspace/<DraftName>/changes.md comparison table and confirm changes
5. Write back for real (remove --dry-run)
6. User reopens CapCut → subtitles are fixed → manually trim / add speed changes → export

Command Templates

& "<skill-directory>/scripts/fix_subtitles.py" "DraftName" --dry-run   # Preview
& "<skill-directory>/scripts/fix_subtitles.py" "DraftName"             # Write back
& "<skill-directory>/scripts/fix_subtitles.py" "DraftName" --no-llm    # Rule-only, instant

Parameters

ParameterDescription
--dry-runOutput comparison table + SRT without writing back (works even if CapCut is open)
--no-llmOnly apply term table rule replacements, no API calls
--batch NNumber of subtitles per LLM batch, default 30

Term Glossary Maintenance (Core! Gets Better with Use)

config/terms.json:

  • terms: Authoritative writing style (force-checked before write-back, e.g., api→API)
  • fix: Certain "wrong → correct" mappings (e.g., 克劳德扣→Claude Code, engine→Agent)

After each run, if new misrecognitions are found, actively ask the user whether to add them to the glossary. The user is a content creator; terms in the same series of videos repeat heavily, making the glossary the most valuable asset. Note: Longer phrase mappings (e.g., "hand injection→hand-crafted Agent") may be overridden by shorter existing mappings ("hand→manual") – prefer adding a mapping for the target word itself (e.g., "injection→Agent").

Double-Layer Correction Mechanism

  • Rule Layer (primary): Exact term table replacements – instant, zero cost, 100% controllable
  • LLM Layer (fallback): Batch homophone/typo correction using glm-4-flash (30 subtitles per batch, 4 concurrent pipes). Before write-back, passes through term validation + length mutation detection (prevents hallucinated rewrites)

Safety Mechanisms

  • Refuses to write back if CapCut is running; each run automatically creates a backup in workspace/<DraftName>/backups/
  • Only modifies text fields; timestamps, styles, and tracks remain untouched; rollback by overwriting draft_content.json with backup

Known Limitations

  • Depends on jy-draftc's support for the CapCut version (currently supports versions 10.3–11.5; watch that project after major CapCut updates)
  • Manually added title text in the draft will also be corrected (visible in comparison table; generally harmless)
  • glm-4-flash occasionally makes minor oversteps (removes filler words/adds characters); the prompt enforces a "better to miss a fix than make a wrong fix" constraint; always verify with the comparison table.

相关技能