Short Form Video Pipeline

Short-Form Video Clip Pipeline — Skill

by ericosiu · MIT license · ★ 3,615 on GitHub

Short-Form Video Clip Pipeline — Skill cover

python3 telemetry/versioncheck.py 2>/dev/null || true

# Short-Form Video Clip Pipeline — Skill

## Preamble (runs on skill start)

```bash
# Version check (silent if up to date)
python3 telemetry/version_check.py 2>/dev/null || true

# Telemetry opt-in (first run only, then remembers your choice)
python3 telemetry/telemetry_init.py 2>/dev/null || true
```

> **Privacy:** This skill logs usage locally to `~/.ai-marketing-skills/analytics/`. Remote telemetry is opt-in only. No code, file paths, or repo content is ever collected. See `telemetry/README.md`.

---

Extract viral short-form clips (TikTok, Reels, Shorts) from long-form YouTube videos. Handles download, transcription, AI segmentation, cutting, vertical cropping, and caption burn-in.

Overview

Extract viral short-form clips (TikTok, Reels, Shorts) from long-form YouTube videos. Handles download, transcription, AI segmentation, cutting, vertical cropping, and caption burn-in.

What you get

  • 1080×1920resolution (9:16 vertical)
  • H.264 + AACencoding
  • Word-highlighted captionsburned in
  • Ready for direct upload to TikTok, Reels, or Shorts
Manual install (npx, ZIP)
Claude Codenpx skills add ericosiu/ai-marketing-skills --skill short-form-pipeline -g -a claude-code
Claude Code (degit)npx degit ericosiu/ai-marketing-skills/short-form-pipeline#main ~/.claude/skills/short-form-pipeline
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md3.9 KB
Read SKILL.md here
ericosiu/main1 file shown
SKILL.md
Show the full text103 lines

Short-Form Video Clip Pipeline — Skill

Preamble (runs on skill start)

# Version check (silent if up to date)
python3 telemetry/version_check.py 2>/dev/null || true

# Telemetry opt-in (first run only, then remembers your choice)
python3 telemetry/telemetry_init.py 2>/dev/null || true

Privacy: This skill logs usage locally to ~/.ai-marketing-skills/analytics/. Remote telemetry is opt-in only. No code, file paths, or repo content is ever collected. See telemetry/README.md.


Extract viral short-form clips (TikTok, Reels, Shorts) from long-form YouTube videos. Handles download, transcription, AI segmentation, cutting, vertical cropping, and caption burn-in.

Prerequisites

  • yt-dlp and ffmpeg installed
  • ANTHROPIC_API_KEY environment variable set
  • Python dependencies from requirements.txt installed
  • Optional: mediapipe and opencv-python for face-detected smart crop

Quick Start

Single video → clips
python3 scripts/shortform_pipeline.py \
  --url "https://www.youtube.com/watch?v=VIDEO_ID" \
  --max-clips 3 \
  --output-dir ./output
Standalone clipper (no Claude, heuristic scoring)
python3 scripts/video_clipper.py --url "https://www.youtube.com/watch?v=VIDEO_ID"

Pipeline Overview

  1. Download — yt-dlp fetches video + auto-generated VTT captions
  2. Transcribe — Whisper generates word-level timestamps (falls back to YouTube captions)
  3. Segment — Claude identifies 2–5 best 30–60s moments with hook scoring ≥7/10
  4. Cut Verification — Second Claude pass verifies each clip ends on a complete thought
  5. Cut — FFmpeg extracts each clip from the source video
  6. Vertical Crop — Layout-aware 16:9 → 9:16 conversion with face detection
  7. Caption Burn — TikTok-style word-highlighted captions (ASS format) burned in

Key Files

File Purpose
scripts/shortform_pipeline.py Full pipeline: download → segment → cut → crop → caption
scripts/video_clipper.py Standalone clipper with heuristic scoring (no Claude needed)
scripts/clip_sender.py Helper for clip delivery and review workflow

Layout-Aware Cropping

The pipeline handles four video layouts differently:

  • talking_head — Face-detected center crop using MediaPipe; audio panning fallback
  • screen_share_overlay — Stacks screen content on top, webcam bubble on bottom
  • side_by_side — Stacks screen on top, presenter face on bottom
  • gallery_view — Crops to active speaker quadrant

Claude outputs a layout_hint for each segment during segmentation.

Customization

Voice patterns

Edit VOICE_PATTERNS in video_clipper.py to match your creator's speech patterns. These boost clip scoring for authentic-sounding segments.

Segmentation prompt

The Claude prompt in shortform_pipeline.py can be customized:

  • Adjust hook_strength minimum (default: 7/10)
  • Change target duration range (default: 30–60s)
  • Modify layout hint options
Crop tuning

In video_clipper.py:

  • scale_factor — Zoom level for single face (default: 1.08)
  • desired_face_y — Target face position in frame (default: upper 35%)

Output

Each clip is output as:

  • 1080×1920 resolution (9:16 vertical)
  • H.264 + AAC encoding
  • Word-highlighted captions burned in
  • Ready for direct upload to TikTok, Reels, or Shorts

Troubleshooting

  • FFmpeg filter_complex error: Don't use -c:v copy with -filter_complex. Only -c:a copy is safe.
  • Wrong output resolution: Always crop before scaling. Verify with ffprobe -show_entries stream=width,height.
  • Caption sync issues: Run Whisper on the cut clip, not the source episode.
  • TikTok upload fails: Ensure H.264 + AAC encoding. Add -c:v libx264 -c:a aac if needed.
  • Clip too long: Claude sometimes overshoots. The pipeline auto-trims clips >90s to 75s.
1# Short-Form Video Clip Pipeline — Skill
2 
3## Preamble (runs on skill start)
4 
5```bash
6# Version check (silent if up to date)
7python3 telemetry/version_check.py 2>/dev/null || true
8 
9# Telemetry opt-in (first run only, then remembers your choice)
10python3 telemetry/telemetry_init.py 2>/dev/null || true
11```
12 
13> **Privacy:** This skill logs usage locally to `~/.ai-marketing-skills/analytics/`. Remote telemetry is opt-in only. No code, file paths, or repo content is ever collected. See `telemetry/README.md`.
14 
15---
16 
17Extract viral short-form clips (TikTok, Reels, Shorts) from long-form YouTube videos. Handles download, transcription, AI segmentation, cutting, vertical cropping, and caption burn-in.
18 
19## Prerequisites
20 
21- `yt-dlp` and `ffmpeg` installed
22- `ANTHROPIC_API_KEY` environment variable set
23- Python dependencies from `requirements.txt` installed
24- Optional: `mediapipe` and `opencv-python` for face-detected smart crop
25 
26## Quick Start
27 
28### Single video → clips
29 
30```bash
31python3 scripts/shortform_pipeline.py \
32 --url "https://www.youtube.com/watch?v=VIDEO_ID" \
33 --max-clips 3 \
34 --output-dir ./output
35```
36 
37### Standalone clipper (no Claude, heuristic scoring)
38 
39```bash
40python3 scripts/video_clipper.py --url "https://www.youtube.com/watch?v=VIDEO_ID"
41```
42 
43## Pipeline Overview
44 
451. **Download** — yt-dlp fetches video + auto-generated VTT captions
462. **Transcribe** — Whisper generates word-level timestamps (falls back to YouTube captions)
473. **Segment** — Claude identifies 2–5 best 30–60s moments with hook scoring ≥7/10
484. **Cut Verification** — Second Claude pass verifies each clip ends on a complete thought
495. **Cut** — FFmpeg extracts each clip from the source video
506. **Vertical Crop** — Layout-aware 16:9 → 9:16 conversion with face detection
517. **Caption Burn** — TikTok-style word-highlighted captions (ASS format) burned in
52 
53## Key Files
54 
55| File | Purpose |
56|------|---------|
57| `scripts/shortform_pipeline.py` | Full pipeline: download → segment → cut → crop → caption |
58| `scripts/video_clipper.py` | Standalone clipper with heuristic scoring (no Claude needed) |
59| `scripts/clip_sender.py` | Helper for clip delivery and review workflow |
60 
61## Layout-Aware Cropping
62 
63The pipeline handles four video layouts differently:
64 
65- **`talking_head`** — Face-detected center crop using MediaPipe; audio panning fallback
66- **`screen_share_overlay`** — Stacks screen content on top, webcam bubble on bottom
67- **`side_by_side`** — Stacks screen on top, presenter face on bottom
68- **`gallery_view`** — Crops to active speaker quadrant
69 
70Claude outputs a `layout_hint` for each segment during segmentation.
71 
72## Customization
73 
74### Voice patterns
75Edit `VOICE_PATTERNS` in `video_clipper.py` to match your creator's speech patterns. These boost clip scoring for authentic-sounding segments.
76 
77### Segmentation prompt
78The Claude prompt in `shortform_pipeline.py` can be customized:
79- Adjust `hook_strength` minimum (default: 7/10)
80- Change target duration range (default: 30–60s)
81- Modify layout hint options
82 
83### Crop tuning
84In `video_clipper.py`:
85- `scale_factor` — Zoom level for single face (default: 1.08)
86- `desired_face_y` — Target face position in frame (default: upper 35%)
87 
88## Output
89 
90Each clip is output as:
91- **1080×1920** resolution (9:16 vertical)
92- **H.264 + AAC** encoding
93- **Word-highlighted captions** burned in
94- Ready for direct upload to TikTok, Reels, or Shorts
95 
96## Troubleshooting
97 
98- **FFmpeg filter_complex error:** Don't use `-c:v copy` with `-filter_complex`. Only `-c:a copy` is safe.
99- **Wrong output resolution:** Always crop before scaling. Verify with `ffprobe -show_entries stream=width,height`.
100- **Caption sync issues:** Run Whisper on the cut clip, not the source episode.
101- **TikTok upload fails:** Ensure H.264 + AAC encoding. Add `-c:v libx264 -c:a aac` if needed.
102- **Clip too long:** Claude sometimes overshoots. The pipeline auto-trims clips >90s to 75s.
103 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 3,615
Checked
Source
ericosiu/ai-marketing-skills ↗
Creator
ericosiu · 34 listings
View creator

Similar skills

See all →
SkillB-Roll Video Overlaynovoads/agent-skills · by novoadsOverlays silent b-roll cutaway clips onto a finished base video — the base audio keeps running underneath while the picture cuts away and returns, and the final duration always equals the base duration. Use when the user asks to add b-roll, add cutaways, or overlay clips on a video: "add b-roll to this", cut away to a product shot here", "overlay these clips on my UGC ad". Entered from an approved base video plus its transcript, which comes from POST /v1/transcripts and needs no local install; it never generates the base itself and it never extends a video.★ 23 GitHub starsSkillHiggsfield Social Hookspixelab-ch/higgsfield-skills · by pixelab-chCrafts viral social media hook video prompts for TikTok, Instagram Reels, and YouTube Shorts via Higgsfield. Routes to kling3_0 (primary) or grok_video (fallback). Use when the user wants scroll-stopping hooks, viral short-form video, attention-grabbing openers, TikTok content, Reels content, Shorts content, or any social-media-optimized video.★ 6 GitHub starsSkillGab Video Editorgabrielxreis/ogab · by gabrielxreisGab, o editor de vídeo com IA (comando /ogab). Skill PRINCIPAL para qualquer trabalho de vídeo: criar um vídeo novo (Reels, YouTube Shorts/longo, Meta Ads, anúncio, institucional, vídeo de cliente) OU editar um vídeo/projeto/timeline no DaVinci Resolve (cortar, montar, legendar, colocar música, takes, lettering, motions, cor, áudio, exportar). Leva do roteiro até a timeline pronta no DaVinci: roteiro para aprovação, voz por IA, música, efeitos sonoros, takes de banco ou gerados, lettering animado, motions e gráficos com HyperFrames, legenda com métrica e conferência automática. Use SEMPRE que o usuário pedir para criar/fazer/editar um vídeo, mexer no DaVinci, reels, anúncio, pauta ou roteiro, mesmo sem citar a skill; as outras skills de vídeo (hyperframes, motion-graphics etc.) entram como ferramentas DENTRO deste fluxo. Comando: /ogab <pedido> ou /ogab <subcomando> (ajuda, config, update, pauta, cliente). Também cuida do Instagram: legenda do post, carrossel pronto em imagem (PNG/PDF na marca do cliente), gancho de Reel viral, hashtags, tirar cara de IA do texto, semana de conteúdo, perfil e dados do nicho.★ 1 GitHub starsSkillAI Video Clipping ToolSamurAIGPT/Generative-Media-Skills · by SamurAIGPTTurn a long video into N viral-ready short clips with a single managed API call. Wraps muapi.ai's `/ai-clipping` endpoint, which handles transcription, highlight ranking through a virality framework (hook / emotional peak / opinion bomb / revelation / conflict / quotable / story peak / practical value), overlap dedupe, and vertical face-tracking auto-crop server-side. No local Whisper, no local LLM, no GPU.★ 4.3k GitHub starsSkillYouTube Shorts GeneratorSamurAIGPT/Generative-Media-Skills · by SamurAIGPTAuto-generate viral 9:16 YouTube Shorts (or TikTok / Reels clips) from a long-form video. Thin platform-aware wrapper around the AI Clipping skill — picks sensible defaults for short-form social platforms (9:16, 30–60s sweet spot) and delegates the actual highlight extraction + crop to muapi.ai's `/ai-clipping` endpoint.★ 4.3k GitHub starsSkillVertical Video Editorericosiu/ai-marketing-skills · by ericosiuTurn newly recorded talking-head footage into review-ready vertical video drafts with an explicit edit plan, deterministic FFmpeg rendering, captions, hook cards, audio normalization, and visual QA. Use for original Instagram Reels, TikTok videos, YouTube Shorts, LinkedIn videos, founder-led recordings, multiple takes of a new script or idea card, or requests to automate the first video-editing pass. Do not use to mine clips from long-form source videos.★ 3.6k GitHub stars

More from ericosiu

SkillVideo Moment Extraction Agentericosiu/ai-marketing-skills · by ericosiuUse when an agent must extract moments, quotes, objections, hooks, or evidence from long video or audio cheaper than full-frame ingest — sales calls, podcasts, YouTube episodes, Loom trials, discovery recordings. Goal-directed watch via Gemini agentic video understanding (frames, audio, or transcript). Not for cutting, overlays, rendering, scheduling, or publishing.★ 3.6k GitHub starsSkillConversion Operationsericosiu/ai-marketing-skills · by ericosiupython3 telemetry/versioncheck.py 2>/dev/null || true★ 3.6k GitHub starsSkillFinance Operationsericosiu/ai-marketing-skills · by ericosiuAI-powered financial analysis suite. Generates executive CFO briefings from QuickBooks exports (P&L, Balance Sheet, General Ledger, Cash Flow, etc.) with anomaly detection, burn rate, runway analysis, and scenario modeling. Also estimates codebase development costs with organizational overhead and AI ROI analysis. Triggers on: 'CFO briefing', 'financial analysis', 'cost briefing', 'expense review', 'runway analysis', 'burn rate', 'cost estimate', 'how much would this cost to build', 'development cost', 'Claude ROI'.★ 3.6k GitHub starsSkillRevenue Intelligence Dashboardericosiu/ai-marketing-skills · by ericosiupython3 telemetry/versioncheck.py 2>/dev/null || true★ 3.6k GitHub starsSkillSales Pipeline Managerericosiu/ai-marketing-skills · by ericosiupython3 telemetry/versioncheck.py 2>/dev/null || true★ 3.6k GitHub starsSkillValue-Based Sales Playbookericosiu/ai-marketing-skills · by ericosiupython3 telemetry/versioncheck.py 2>/dev/null || true★ 3.6k GitHub stars