Skip to main content

AI YouTube Shorts Generator

Automatically extract the most engaging moments from long videos and transform them into viral-ready YouTube Shorts with AI-powered highlight selection, smart cropping, and auto-generated subtitles.

Quick Start

Get your first AI-generated short in minutes

1

Clone and setup

Clone the repository and install dependencies:
git clone https://github.com/SamurAIGPT/AI-Youtube-Shorts-Generator.git
cd AI-Youtube-Shorts-Generator
python3.10 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
2

Configure OpenAI API

Create a .env file with your OpenAI API key:
OPENAI_API=your_openai_api_key_here
You’ll need an OpenAI API key for GPT-4o-mini to analyze and select highlights.
3

Run the generator

Process a video with a simple command:
./run.sh "https://youtu.be/VIDEO_ID"
The tool will automatically:
  • Download and transcribe the video
  • Use AI to select the most engaging 2-minute segment
  • Crop to vertical 9:16 format with smart face tracking
  • Add stylized subtitles
  • Output a ready-to-upload short
4

Review and approve

You’ll see an interactive prompt to approve or regenerate the AI’s selection:
SELECTED SEGMENT: 68s - 187s (119s duration)
Options:
  [Enter/y] Approve and continue
  [r] Regenerate selection
  [n] Cancel
Auto-approving in 15 seconds...
Use --auto-approve flag for batch processing to skip manual approval.

Explore Features

Discover what makes this tool powerful for content creators

AI Highlight Selection

GPT-4o-mini automatically finds the most engaging, surprising, or thought-provoking segments from your videos.

Smart Cropping

Face-centered static crops for talking heads or motion-tracked crops for screen recordings — automatically detected.

Auto Subtitles

Stylized captions with custom fonts and colors burned directly into your video.

GPU Transcription

CUDA-accelerated Whisper for lightning-fast speech-to-text processing.

User Guides

Learn how to use the tool effectively

Basic Usage

Process videos from YouTube URLs or local files with command-line options.

Configuration

Customize subtitle styling, highlight criteria, cropping behavior, and video quality.

Batch Processing

Process multiple videos simultaneously with unique session IDs and auto-approve mode.

Docker Deployment

Run the generator in a containerized environment with Docker Compose.

Key Features

Everything you need to create viral shorts

🎬 Flexible Input

Supports both YouTube URLs and local video files for maximum convenience.

🤖 AI-Powered Analysis

GPT-4o-mini intelligently selects the most engaging 2-minute segments automatically.

📱 Vertical Format

Perfect 9:16 aspect ratio optimized for TikTok, YouTube Shorts, and Instagram Reels.

⚙️ Automation Ready

CLI arguments, auto-quality selection, and timeout-based approvals for batch workflows.

🎯 Smart Detection

Automatically detects faces for static crops or applies motion tracking for screen recordings.

🔄 Concurrent Execution

Run multiple instances simultaneously with unique session IDs to prevent conflicts.

Ready to Create Your First Short?

Install the tool and start generating engaging vertical videos in minutes.

Install Now

Build docs developers (and LLMs) love