mcpField
T
translate-video

translate-video

github.com/aviz85Creative & media5044 installsUpdated 16w ago
Repository

About translate-video

translate-video is a skill that turns a video into translated, refined subtitles and an output video with subtitles embedded. It guides a pipeline from transcription through subtitle processing, with separate rules for short-form and regular videos.

Key features

  1. 01Transcribes video audio with word-level timestamps
  2. 02Translates subtitles while preserving timing
  3. 03Refines subtitles for short or regular video
  4. 04Applies line-length limits and RTL fixes
  5. 05Embeds subtitles in the output video

Use cases

  1. 01Prepare translated subtitles for TikTok or Reels
  2. 02Create subtitled videos for YouTube or tutorials

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aviz85/claude-skills-library --skill translate-video

After installing, type/translate-videoin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

DEPENDENCIES.md
references/
languages.md
modes.md
scripts/
build-timestamps.py
postprocess.py
rtl-fix.py

Details

From the project README

Translate Video

End-to-end video translation pipeline: transcribe → translate → refine subtitles → embed.

Usage

/translate-video /path/to/video.mp4 he --regular
/translate-video /path/to/video.mp4 he --shorts
  • $1 — video file path (required)
  • $2 — target language code (default: he). See references/languages.md
  • $3 — --shorts (TikTok/Reels) or --regular (YouTube/tutorials). If omitted, ask the user.

Pipeline

Step 1: Transcribe

If audio > 25MB, extract first:

ffmpeg -i "$VIDEO" -vn -acodec libmp3lame -ab 128k "$AUDIO.mp3" -y

Transcribe with word-level JSON (always include --json):

cd ~/.claude/skills/transcribe/scripts && [ -d node_modules ] || npm install --silent
npx ts-node transcribe.ts -i "$INPUT" -o "$BASENAME.srt" --json

Produces: {basename}.srt, {basename}.md, {basename}_transcript.json

Step 2: Translate

Read .md for full context. Translate the .srt — preserve all timestamps and index numbers exactly. See translation rules in references/modes.md.

Step 3: Refine Subtitles

Read references/modes.md for full rules.

--shorts: Fix text only, preserve all timestamps. No merging.

--regular: Merge into full sentences using word-level timestamps.

  1. Plan subtitle groups from .md (word counts per group)
  2. Fill GROUP_SIZES in scripts/build-timestamps.py and run it
  3. Replace English text in output SRT with translated text
Step 4: Post-process (both modes)

Enforces MAX 2 lines, MAX chars/line (38 for --shorts, 42 for --regular):

python3 ~/.claude/skills/translate-video/scripts/postprocess.py "$SRT" 42
Step 5: RTL Fix (Hebrew / Arabic / Farsi only)
python3 ~/.claude/skills/translate-video/scripts/rtl-fix.py "$SRT"
Step 6: Embed & Open
~/.local/bin/ffmpeg-ass -i "$VIDEO" \
  -vf "subtitles=$SRT:force_style='FontSize=24,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,Outline=2,Shadow=1,Alignment=2,MarginV=30'" \
  -c:v libx264 -preset fast -crf 23 -c:a copy "$OUTPUT" -y
open "$OUTPUT"

⚠️ Do NOT use Docker ffmpeg for long videos on ARM Mac — x86 emulation is ~100x slower.


Output Files

FileDescription
{name}.srtOriginal language SRT
{name}.mdReadable transcript
{name}_transcript.jsonWord-level timestamps
{name}_{lang}.srtTranslated + refined SRT
{name}_{lang}_subtitled.mp4Final video

Supporting Files

FilePurpose
references/modes.mdDetailed --shorts and --regular rules
references/languages.mdLanguage codes + RTL flags
scripts/build-timestamps.pyWord-index cursor for --regular timestamps
scripts/postprocess.pyEnforce line limits on any SRT
scripts/rtl-fix.pyApply RTL Unicode markers

Comments

Markdown supported