Agent skill

embed-subtitles

Burn subtitles onto videos using FFmpeg. Use for: hardcode subtitles, embed captions, video subtitling.

Stars 26
Forks 7

Install this agent skill to your Project

npx add-skill https://github.com/aviz85/claude-skills-library/tree/main/plugins/embed-subtitles/skills/embed-subtitles

SKILL.md

Embed Subtitles

Burn SRT subtitles into video files using FFmpeg.

Prerequisites

No SRT file? Use the transcribe skill first to generate subtitles from audio/video.

Need translation? After transcribing, read the SRT, translate each entry preserving timestamps, write new SRT file. No API needed.

Quick Start

bash
cd ~/.claude/skills/embed-subtitles/scripts

# Burn SRT into video
npx ts-node embed-subtitles.ts -i video.mp4 -s subtitles.srt -o output.mp4

# Custom styling
npx ts-node embed-subtitles.ts -i video.mp4 -s subtitles.srt -o output.mp4 \
  --font-size 24 --position bottom --margin 40

# Add credit text overlay at end
npx ts-node embed-subtitles.ts -i video.mp4 -s subtitles.srt -o output.mp4 \
  --credit "Your Name" --credit-position top

Options

Option Short Default Description
--input -i (required) Input video file
--subtitles -s (required) SRT subtitle file
--output -o (required) Output video file
--font-size 20 Font size in pixels
--font-name Arial Font family name
--position bottom Subtitle position: top, center, bottom
--margin 25 Margin from edge in pixels
--color white Text color
--outline 2 Outline thickness
--shadow 1 Shadow depth
--credit Credit text to show at end
--credit-position top Credit position: top, bottom
--credit-duration 2.5 Credit display duration in seconds
--extract-frame Extract frame at specified second for verification

Position Values

  • top - Near top of video (good for credits, avoids bottom burned-in text)
  • center - Middle of video
  • bottom - Near bottom of video (traditional subtitle position)

Dependencies

  • FFmpeg (must be installed and in PATH)

RTL Auto-Detection & Fix (CRITICAL)

Before embedding ANY SRT file, Claude MUST check if the content is RTL.

Detection

Read the SRT file and check if the majority of text lines contain Hebrew/Arabic/Farsi characters:

  • Hebrew range: \u0590-\u05FF
  • Arabic range: \u0600-\u06FF
  • Farsi additional: \u0750-\u077F

If RTL content is detected, apply the fix BEFORE passing to FFmpeg.

RTL Fix

Wrap each text line (not index numbers, not timestamps) with Unicode directional marks:

python
python3 -c "
import re

with open('SRT_FILE_PATH', 'r', encoding='utf-8') as f:
    content = f.read()

lines = content.split('\n')
result = []
for line in lines:
    stripped = line.strip()
    if stripped and not re.match(r'^\d+$', stripped) and not re.match(r'\d{2}:\d{2}:\d{2}', stripped):
        line = '\u202B' + line + '\u202C'
    result.append(line)

with open('SRT_FILE_PATH', 'w', encoding='utf-8') as f:
    f.write('\n'.join(result))
"
  • U+202B (RLE - Right-to-Left Embedding): forces RTL paragraph direction
  • U+202C (PDF - Pop Directional Formatting): closes the embedding

This fixes: English words at line start, periods/commas on wrong side, mixed bidi text.

When to apply

Claude should analyze the SRT content intelligently:

  • If most text is Hebrew/Arabic/Farsi → apply RTL fix
  • If mixed but predominantly RTL → apply RTL fix
  • If LTR (English, Spanish, etc.) → skip
  • No flag needed from the user - detect automatically

Notes

  • For Arabic credits, use English text due to FFmpeg drawtext RTL limitations
  • Use --extract-frame to verify subtitle positioning before final render

Expand your agent's capabilities with these related and highly-rated skills.

aviz85/claude-skills-library

aviz-skills-installer

Install skills from the AVIZ Skills Library. Use when user wants to install a skill, browse available skills, set up Claude Code skills, or asks about skill installation. Triggers on "install skill", "add skill", "setup skill", "available skills", "skill library", "browse skills".

26 7
Explore
aviz85/claude-skills-library

wordpress-publisher

Publish posts to WordPress. Use for: publish blog post, upload to WordPress, פרסם בבלוג.

26 7
Explore
aviz85/claude-skills-library

translate-video

Translate video subtitles to any language with native-quality refinement. Full pipeline: transcribe → translate → refine → embed RTL-safe subtitles. Use for: translate video, תרגם סרטון, video translation, foreign subtitles, Hebrew subtitles, translated captions.

26 7
Explore
aviz85/claude-skills-library

aviz-skills-installer

Install skills from the AVIZ Skills Library. Use when user wants to install a skill, browse available skills, set up Claude Code skills, or asks about skill installation. Triggers on "install skill", "add skill", "setup skill", "available skills", "skill library", "browse skills".

26 7
Explore
aviz85/claude-skills-library

youtube-downloader

Download YouTube videos with quality presets. Use for: download youtube, yt download, video download, youtube to whatsapp, youtube mp3.

26 7
Explore
aviz85/claude-skills-library

reality-check

Deep code audit that detects misleading patterns — fake tests, mock abuse, shallow health checks, overly optimistic error handling, hidden debt. Produces a structured report with findings AND actionable recommendations. Use when code looks green but smells wrong.

26 7
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results