subtitle-pipeline

📁 mxggle/subtitle-pipeline 📅 Today
2
总安装量
1
周安装量
#62876
全站排名
安装命令
npx skills add https://github.com/mxggle/subtitle-pipeline --skill subtitle-pipeline

Agent 安装分布

windsurf 1
amp 1
cline 1
pi 1
openclaw 1
trae 1

Skill 文档

Subtitle Pipeline (Engine Scope)

This skill is now focused on subtitle processing only.

It handles:

  1. Listing subtitle streams
  2. Extracting subtitle tracks
  3. Transcribing audio/video to SRT (Whisper)
  4. Translating subtitle tracks (OpenAI-compatible APIs)
  5. Merging multilingual tracks into bilingual/multilingual SRT

Workflow Decision Tree

When processing a video file, choose the path based on available subtitles:

  1. Multiple subtitles available → merge selected tracks.
  2. Only one subtitle available → translate to target language if needed.
  3. No subtitles available → transcribe with Whisper, then optionally translate/merge.

Commands

1) List streams

python skills/subtitle-pipeline/scripts/pipeline.py list movie.mkv

2) Extract track

python skills/subtitle-pipeline/scripts/pipeline.py extract movie.mkv --to-srt
python skills/subtitle-pipeline/scripts/pipeline.py extract movie.mkv --language eng --to-srt

3) Transcribe (Whisper)

python skills/subtitle-pipeline/scripts/pipeline.py transcribe movie.mkv
python skills/subtitle-pipeline/scripts/pipeline.py transcribe movie.mkv --language en --model small

4) Translate

# Requires OPENAI_API_KEY (or --api-key)
python skills/subtitle-pipeline/scripts/pipeline.py translate movie.eng.srt --target-language "Chinese"

5) Merge

python skills/subtitle-pipeline/scripts/pipeline.py merge movie.mkv --indices 0 1 --output movie.bilingual.srt
python skills/subtitle-pipeline/scripts/pipeline.py --verbose merge movie.mkv --languages eng chi

Output Naming (Engine)

  • movie.eng.srt (source/reference)
  • movie.zho.srt (translated output)
  • movie.eng-chi.merged.srt (merged bilingual output)

Guardrails

  • Prefer subtitle-only operations; avoid video re-encoding.
  • Use -c:s copy where possible for lossless extraction.
  • Keep translation alignment stable with source timestamps.
  • Treat long local ASR jobs as expensive; split/chunk if needed.

Reference

  • references/subtitle-notes.md