AI-Powered YouTube Clipper Trimming Bilingual Subtitles
AI‑Powered YouTube Clipper: Trim, Translate, & Share in Minutes
If you’ve ever needed a quick, high‑quality clip from a long YouTube video—and wanted bilingual subtitles baked right in—this open‑source skill is exactly what you need.
Why This Project Stands Out
| Feature | What It Means | Why It Matters |
|---|---|---|
| Semantic Chaptering | Uses Claude to read the subtitle script and carve the video into meaningful 2‑5 minute chapters, not just straight‑time splits. | You get context‑based chapters that match real topic shifts, making it easier to choose the best clip. |
| Frame‑Accurate Clipping | Employs FFmpeg to cut video at precise frames. | No half‑second slippage means cleaner starts/ends. |
| Batch Translation | Translates up to ~25 subtitles at once, slashing API calls by 95%. | Faster, cheaper, and more consistent translations. |
| Bilingual & Buried Subtitles | Generates a two‑language SRT, and can hard‑code the subtitles with custom styling. | Perfect for social‑media‑ready clips that look polished. |
| Summary Generation | Produces short, platform‑friendly texts for Sina Weibo, TikTok, WeChat, etc. | Ready‑to‑post captions save you time. |
| One‑Line Install | npx skills add https://github.com/op7418/Youtube-clipper-skill |
Removes the need to manually clone or set up. |
Getting Started
1️⃣ Install the Skill
# Recommended: npx
npx skills add https://github.com/op7418/Youtube-clipper-skill
The script copies the repo into
~/.claude/skills/youtube-clipper/, installs Python deps (yt-dlp,pysrt,python-dotenv) and checks forffmpegwith libass support.Mac users: if you have the default
ffmpegfrom Homebrew, uninstall it (brew uninstall ffmpeg) and install the full build (brew install ffmpeg-full).
2️⃣ Configure Environment Variables
Edit ~/.claude/skills/youtube-clipper/.env:
# Where FFmpeg lives – empty means auto‑detect
FFMPEG_PATH=
# Output directory – defaults to current folder
OUTPUT_DIR=./youtube-clips
# Max video quality
MAX_VIDEO_HEIGHT=1080
# Batch size for translation
TRANSLATION_BATCH_SIZE=20
# Translation target language
TARGET_LANGUAGE=中文
# Desired chapter length (seconds – 180 to 300 recommended)
TARGET_CHAPTER_DURATION=180
Use a
.envfile for simple overrides—no hard‑coding required.
3️⃣ Run a Demo
# Ask Claude to clip a video
Clip this YouTube video: https://youtube.com/watch?v=VIDEO_ID
Claude will: 1. Download the video & English subtitles. 2. Analyze the subtitle script and suggest semantic chapters. 3. Let you pick which chapters to keep. 4. Clip, translate, burn subtitles, and summarize.
The outputs land under ./youtube-clips/<timestamp>/:
* Chapter_Title_clip.mp4 – raw clip
* Chapter_Title_with_subtitles.mp4 – hardcoded subtitles
* Chapter_Title_bilingual.srt – two‑language subtitle file
* Chapter_Title_summary.md – social‑media copy
Advanced Use Cases
| Scenario | How to Execute | Key Output |
|---|---|---|
| Highlight a tech interview | Same as demo – pick the desired chapters (e.g., 00:00‑03:15, 03:15‑06:30) | Clean clips with subtitles for each segment |
| Create course snippets | Add flags: Generate bilingual subtitles: Yes, Burn subtitles into video: Yes, Generate summary: Yes |
Ready‑to‑publish short lessons |
| Fast, offline processing | Set YT_DLP_PROXY if behind a corporate proxy; adjust FFMPEG_PATH if locally installed |
Reliable runs on restricted networks |
Troubleshooting Quick‑Fixes
| Issue | Symptom | Fix |
|---|---|---|
| FFmpeg subtitle burning fails | Option not found: subtitles |
Install ffmpeg-full or libass-dev (sudo apt install ffmpeg libass-dev) |
| Video download slow | Low transfer speeds | Set YT_DLP_PROXY in .env |
| Subtitle translation errors | Rate limiting or network hiccups | Reduce TRANSLATION_BATCH_SIZE, check network connection |
| Broken output filenames | Special characters in chapter titles | Skill sanitizes titles, but ensure titles are concise |
Why Adopt It?
- Zero Cost – MIT‑licensed, no hidden fees.
- Community‑Ready – Fork to tweak chapter algorithm, translation provider, etc.
- Rapid Prototyping – Developers can prototype AI‑driven media workflows.
- Social‑Media‑Optimized – Ready‑made captions & bilingual subtitles.
Get Involved
Feel free to contribute via Pull Requests: improve regex, add new subtitle styles, or integrate other translation APIs. Open issues for bugs or feature ideas.
The YouTube Clipper Skill turns a 1‑hour YouTube lecture into a set of polished clips in minutes—ready for Instagram Reels, TikTok short‑clips, or internal training videos. Grab it today and supercharge your video editing workflow.