Extract viral-worthy clips from YouTube videos with Gemini AI & FFmpeg editing
Ready for 3.0Ready 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)
- Manual Trigger
n8n-nodes-base.manualTrigger - Extract from File
n8n-nodes-base.extractFromFile - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - n8n Form Trigger
n8n-nodes-base.formTrigger - Code
n8n-nodes-base.code - Aggregate
n8n-nodes-base.aggregate - Execute Workflow Trigger
n8n-nodes-base.executeWorkflowTrigger - Split Out
n8n-nodes-base.splitOut - Gmail
n8n-nodes-base.gmail - Execute Command
n8n-nodes-base.executeCommand - Read/Write Files from Disk
n8n-nodes-base.readWriteFile - Google Gemini
@n8n/n8n-nodes-langchain.googleGemini - Merge
n8n-nodes-base.merge - Convert to File
n8n-nodes-base.convertToFile - Filter
n8n-nodes-base.filter - Execute Sub-workflow
n8n-nodes-base.executeWorkflow - If
n8n-nodes-base.if - Wait
n8n-nodes-base.wait
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