AI-Youtube-Shorts-Generator

Open-source alternative to Opus Clip, Vidyo.ai, Klap & SubMagic. Turn long-form YouTube videos into viral 9:16 shorts using LLM highlight detection, Whisper tra

What is AI-Youtube-Shorts-Generator?

Open-source alternative to Opus Clip, Vidyo.ai, Klap & SubMagic. Turn long-form YouTube videos into viral 9:16 shorts using LLM highlight detection, Whisper transcription, and auto vertical cropping — free, no watermarks, no per-clip credits.

Overview of AI-Youtube-Shorts-Generator

What it is

AI-Youtube-Shorts-Generator is an open-source alternative to Opus Clip, Vidyo.ai, Klap, SubMagic, and 2short.ai. It turns long-form YouTube videos into viral-ready 9:16 shorts using LLM highlight detection, Whisper transcription, and auto vertical cropping. The tool is free, has no watermarks, and does not use per-clip credits. It is licensed under MIT and can be self-hosted or used via an API mode.

Key features

  • YouTube In, Vertical Out: Provide any YouTube URL and receive multiple viral-ready 9:16 MP4 clips.
  • Two modes: API mode (fast, uses MuAPI for download, transcription, and cropping) or Local mode (offline, uses yt-dlp, faster-whisper, ffmpeg/OpenCV, and lets you choose OpenAI or Gemini for highlight ranking).
  • Virality-Aware Highlight Selection: Clips are ranked based on hooks, emotional peaks, opinion bombs, revelation moments, conflict, quotable lines, story peaks, and practical value.
  • Score + Hook + Reason: Each highlight includes a viral score, an opening hook line, and a one-sentence explanation.
  • Smart Vertical Crop: API mode uses MuAPI auto-crop; local mode uses OpenCV face tracking with motion smoothing.
  • CLI + Python Library: Use from the command line or import generate_shorts(...) into your own pipeline.
  • JSON Output: The --output-json flag dumps the full result (transcript, candidate highlights, clip URLs/paths) for downstream automation.

Use cases

  • Creators, agencies, and developers who want a free, open-source alternative to paid clipping tools like Opus Clip or Vidyo.ai.
  • Building a custom Opus Clip–style SaaS by using the same APIs that power this repository.
  • Batch processing multiple YouTube URLs via xargs for efficient content repurposing.
  • Self-hosting for full control over the highlight algorithm, output format, and data privacy.

Getting started

  1. Clone the repository: bash git clone https://github.com/SamurAIGPT/AI-Youtube-Shorts-Generator.git cd AI-Youtube-Shorts-Generator 2. Create and activate a virtual environment: bash python3.10 -m venv venv source venv/bin/activate 3. Install Python dependencies: bash pip install -r requirements.txt # Only if you plan to use --mode local: pip install -r requirements-local.txt 4. Set up environment variables in a .env file: bash # API mode (default) MUAPI_API_KEY=your_muapi_key_here # Local mode (--mode local) LLM_PROVIDER=openai OPENAI_API_KEY=your_openai_key_here OPENAI_MODEL=gpt-4o-mini GEMINI_API_KEY=your_gemini_key_here GEMINI_MODEL=gemini-2.5-flash LOCAL_WHISPER_MODEL=base LOCAL_WHISPER_DEVICE=auto LOCAL_OUTPUT_DIR=output For full usage details, see the repository README.

License and pricing

The project is licensed under MIT. It is open source and free to use. Users pay only for API usage if they choose API mode (MuAPI key required). There are no per-clip credits and no watermarks.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/anil-matchaai-youtube-shorts-generator.svg)](https://yunodb.com/tools/anil-matchaai-youtube-shorts-generator?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/anil-matchaai-youtube-shorts-generator?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/anil-matchaai-youtube-shorts-generator.svg" alt="Featured on YunoDB" height="20"></a>