with one click
universal-video-clipper
// Use when the user wants viral short clips from either a YouTube URL or an uploaded/local video file for Instagram Reels or TikTok.
// Use when the user wants viral short clips from either a YouTube URL or an uploaded/local video file for Instagram Reels or TikTok.
| name | universal-video-clipper |
| description | Use when the user wants viral short clips from either a YouTube URL or an uploaded/local video file for Instagram Reels or TikTok. |
Transform long-form videos into viral-worthy short clips optimized for Instagram Reels and TikTok using AI-powered analysis. Supports both YouTube URLs and local/uploaded video files.
Use natural language to create clips:
"Create viral clips from this YouTube video: https://www.youtube.com/watch?v=VIDEO_ID"
"Turn this YouTube video into Instagram Reels"
"Extract the best highlights from this tutorial for TikTok"
"Create short clips from this video file: /path/to/video.mp4"
"Make Reels from my uploaded video"
"Create 5 viral clips from this video with animated captions"
"Extract highlights from this video, skip downloading since I already have it"
For each video processed:
downloads/{video_id}/
āāā original.mp4 # Downloaded/copied video
āāā original.json # Whisper transcript with timestamps
āāā metadata.json # Video info
āāā analysis_request.md # AI analysis prompt
āāā clip_recommendations.json # AI-generated clip suggestions
āāā SUMMARY.md # Final report
āāā clips/
āāā clip_001_hook.mp4 # Standard clip
āāā clip_001_hook_instagram.mp4 # 9:16 vertical
āāā clip_001_hook_captioned.mp4 # With animated captions
āāā ...
The script pauses for AI analysis:
analysis_request.md (contains transcript + instructions)clip_recommendations.jsonVerify these are installed:
# Check installations
ffmpeg -version # Video processing
yt-dlp --version # YouTube downloader (only for YouTube URLs)
whisper --help # Audio transcription
If missing, install:
# Install Python dependencies
pip install -r assets/requirements.txt
# Install ffmpeg (macOS)
brew install ffmpeg
# Install ffmpeg (Linux)
sudo apt install ffmpeg
# Install Node.js 18+ (for animated captions)
brew install node
universal-video-clipper/
āāā SKILL.md
āāā assets/requirements.txt
āāā scripts/
āāā ai_clip_generator.py
āāā prompt_templates/clip_analysis_prompt.md
āāā remotion-captions/ # Remotion caption renderer project
# YouTube input
python3 scripts/ai_clip_generator.py "https://www.youtube.com/watch?v=VIDEO_ID"
# Local/uploaded file input
python3 scripts/ai_clip_generator.py "/absolute/path/to/uploaded_video.mp4"
# Skip download if video exists
python3 scripts/ai_clip_generator.py <source> --skip-download
# Skip transcription if done
python3 scripts/ai_clip_generator.py <source> --skip-transcription
# With animated captions
python3 scripts/ai_clip_generator.py <source> --add-captions
python3 scripts/ai_clip_generator.py <source> --add-captions --caption-style scaling
python3 scripts/ai_clip_generator.py <source> --add-captions --caption-color "#FF6600"
| Style | Description | Best For |
|---|---|---|
background | Animated highlight box behind words (default) | CapCut-style, modern IG look |
scaling | Words scale up with spring animation | Energetic, punchy content |
colored | Active word highlighted in accent color | Clean, professional look |
The AI analysis identifies viral-worthy moments based on:
Constraints:
The AI analysis must return JSON in this format:
{
"clips": [
{
"clip_number": 1,
"start_time": 5.2,
"end_time": 32.8,
"duration": 27.6,
"title": "Hook: AI Creates Apple Shortcuts",
"description": "Opens with bold claim and immediate demonstration",
"virality_score": 9,
"virality_factors": ["strong_hook", "visual_demo", "trending_topic"],
"suggested_caption": "𤯠I made AI create Apple Shortcuts!",
"content_type": "hook",
"target_audience": "iOS users, automation enthusiasts",
"key_moments": ["0:05 - Bold claim", "0:15 - First demo"]
}
],
"video_summary": "Brief summary of video content",
"overall_theme": "AI Automation",
"target_audience": "Tech enthusiasts, developers",
"hashtag_suggestions": ["#AI", "#automation", "#tech"]
}
See references/clip_analysis_prompt.md for the complete prompt template.
| Issue | Solution |
|---|---|
| Download fails | brew upgrade yt-dlp |
| Transcription fails | pip install openai-whisper |
| FFmpeg not found | brew install ffmpeg (macOS) / sudo apt install ffmpeg (Linux) |
| Invalid JSON from AI | Remove markdown code blocks (json), ensure all required fields present |
In scripts/ai_clip_generator.py:
is_youtube_url(input) - Detect source typeparse_youtube_url(url) - Extract video IDprepare_local_video(path, video_id, output_dir) - Ingest local file inputdownload_video(url, video_id, output_dir) - Download with cookie fallbackstranscribe_video(video_path, output_dir) - Whisper transcriptiongenerate_analysis_prompt(transcript, metadata, output_dir) - Create Claude promptvalidate_clip_recommendations(json_path, duration) - Validate AI outputgenerate_clips(video_path, recommendations, output_dir) - FFmpeg clip generationgenerate_captions_for_clip(...) - Remotion caption generationconvert_whisper_to_captions(...) - Whisper JSON to Remotion formatgenerate_summary_report(...) - Create final report--add-captions flag or video editing software