Templates / Extract viral-worthy clips from YouTube videos with Gemini AI & FFmpeg editing

Extract viral-worthy clips from YouTube videos with Gemini AI & FFmpeg editing

Ready for 3.0

by Habeeb Mohammed ✓ · 5,936 views · created 2025-12-07 · Content Creation, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (18)

GmailGoogle Gemini

What it does

!Workflow Overview Who's it for This workflow transforms hours of manual video editing into an automated AI-powered pipeline. Perfect for anyone looking to repurpose long-form content into viral short-form clips. Ideal users include: - Content Creators - YouTubers producing long-form videos who want to maximize reach by automatically generating TikTok, Reels, and Shorts from their content - Social Media Managers - Agencies and freelancers handling multiple clients who need to scale clip production without hiring additional editors - Podcasters - Audio and video podcast hosts wanting to create promotional clips highlighting the best moments from each episode - Video Editors - Professional editors looking to automate repetitive clipping tasks and focus on creative decisions rather than technical execution - Marketing Teams - B2B and B2C teams extracting key moments from webinars, product demos, tutorials, and educational content for social campaigns Whether you're a solo creator or managing content at scale, this workflow saves 5-10 hours per video while maintaining professional quality output. How it works This workflow combines AI analysis with professional video editing tools to automatically identify and produce viral-ready clips from any YouTube video. The process flows through three main stages: Stage 1: Download and Analysis - Submit a YouTube URL through the built-in form trigger - yt-dlp simultaneously downloads the video in highest quality and extracts subtitles or auto-generated transcripts - The transcript is intelligently chunked into 150-segment batches for optimal AI processing - Each batch is analyzed by Gemini AI using specialized prompts that evaluate viral potential based on hooks, pacing, emotional peaks, and engagement triggers - AI identifies 3-5 high-quality moments per batch and assigns virality scores to each potential clip Stage 2: Clip Selection and Extraction - All AI-identified clips are merged and sorted by their virality scores - The top 10 candidates are automatically selected for processing - FFmpeg extracts each clip segment from the original video at precise timestamps - Clips are processed sequentially to prevent system overload Stage 3: Professional Editing Pipeline - Each clip enters a multi-stage editing subworkflow with automated operations: - Smart 9:16 cropping that intelligently frames the subject for vertical platforms - Precise trimming to remove dead air and optimize pacing - Dynamic subtitle generation with sizing calculated based on video resolution - Professional subtitle styling including bold text, high-contrast colors, strategic positioning, and text wrapping - Subtitles are burned directly into the video as permanent overlays Final Delivery: The workflow processes clips with configurable wait times to match your system's capabilities. When all clips complete processing, you receive an email notification and find your social-ready clips in the /data/clips/ directory, ready for upload to any platform. Requirements ⚠️ Self-hosted n8n only - This workflow requires command-line access and cannot run on n8n Cloud due to its dependency on system-level tools. System dependencies you must install: - FFmpeg - Industry-standard video processing tool for trimming, cropping, and subtitle burning. Install on your n8n host system following this comprehensive guide. Most Linux systems can install via package manager: apt-get install ffmpeg or yum install ffmpeg. - yt-dlp - Advanced YouTube downloader that handles video and subtitle extraction. Follow official installation instructions. Recommended: pip install yt-dlp or direct binary download. - FFprobe - Usually included with FFmpeg, used for detecting video dimensions for dynamic subtitle sizing. Credentials needed: - Google Gemini API account - Powers the AI analysis for clip identification and editing instructions. Get your free API key with generous free tier limits. - Gmail OAuth2 credentials - Enables email notifications when clips are

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.