Model or dataset
Anil-matcha/AI-Youtube-Shorts-Generator avatar
Anil-matcha/AI-Youtube-Shorts-Generator

AI YouTube Shorts Generator: Open-Source Tool for Turning Long Videos into Vertical Clips

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.

5,159 stars944 forksPythonMIT

At a glance

What is it?
AI YouTube Shorts Generator is a Python tool that extracts viral-ready 9:16 clips from long-form YouTube videos using LLM-based highlight detection and Whisper transcription, with no per-clip credits, no watermarks, and a fully editable scoring algorithm. It operates in two modes: an API mode that delegates download, transcription, and cropping to MuAPI, and a local mode that runs the full pipeline on the user's own machine.
Who is it for?
AI YouTube Shorts Generator is the right tool for creators, agencies, and developers who process enough video that a monthly SaaS subscription becomes expensive, or who need to run the clipping pipeline in a batch workflow, inspect the highlight scores, or modify the virality criteria for their niche.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 12 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 28, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What This Tool Does and Who It Targets

Creators who publish long-form content on YouTube often want to produce additional short-form clips for TikTok, Instagram Reels, and YouTube Shorts. Paid SaaS tools for this task charge monthly subscriptions ranging from twenty to three hundred dollars, impose per-minute caps, and add watermarks on free tiers. AI YouTube Shorts Generator addresses all three of those constraints. According to the README, the tool is aimed at creators, agencies, and developers who do not want to pay monthly fees or be capped on minutes processed. The output is a ranked set of 9:16 MP4 files with no watermarks. The virality scoring algorithm is fully exposed in the codebase, so a developer who finds that the default scoring criteria do not match their audience can edit them. The README also describes the tool as white-labelable and embeddable under the MIT licence, which makes it usable as a library inside a larger pipeline.

How the Pipeline Works: Highlight Detection and Vertical Cropping

The README describes two processing paths. In API mode, a single call to MuAPI handles video download, transcription, highlight ranking, and vertical cropping as a managed service. In local mode, yt-dlp downloads the video, faster-whisper handles transcription either on CPU or CUDA, and an LLM (OpenAI or Gemini, configurable via environment variable) ranks the highlights. The highlight ranking uses a virality framework that scores clips on hooks, emotional peaks, opinion bombs, revelation moments, conflict, quotable lines, story peaks, and practical value. Each output clip comes with a viral score, an opening hook line, and a one-sentence explanation of why the moment was selected. For videos longer than thirty minutes, the README describes automatic chunking with overlap to avoid missing content at chunk boundaries. Overlapping highlights are collapsed by score to prevent near-duplicate clips. Vertical cropping in local mode uses OpenCV face tracking with motion smoothing to keep the subject centred in the 9:16 frame.

Installing and Running the Generator

Clone the repository and set up a virtual environment:

bash
git clone https://github.com/SamurAIGPT/AI-Youtube-Shorts-Generator.git
cd AI-Youtube-Shorts-Generator
bash
python3.10 -m venv venv
source venv/bin/activate

Install the base dependencies, and add the local-mode requirements if needed:

bash
pip install -r requirements.txt
pip install -r requirements-local.txt

Create a .env file at the project root. For API mode, the only required variable is the MuAPI key:

bash
MUAPI_API_KEY=your_muapi_key_here

For local mode, set the LLM provider and keys instead:

bash
LLM_PROVIDER=openai
OPENAI_API_KEY=your_openai_key_here
OPENAI_MODEL=gpt-4o-mini
LOCAL_WHISPER_MODEL=base
LOCAL_WHISPER_DEVICE=auto

Run the tool against a YouTube URL in API mode:

bash
python main.py "https://www.youtube.com/watch?v=VIDEO_ID"

Run in local mode with five clips at 9:16 aspect ratio:

bash
python main.py "https://www.youtube.com/watch?v=VIDEO_ID" \
    --mode local \
    --num-clips 5 \
    --aspect-ratio 9:16 \
    --output-json result.json

Local mode writes output to `./output/short_01.mp4`, `short_02.mp4`, and so on, unless overridden with `LOCAL_OUTPUT_DIR`.

Using a Local File Instead of a YouTube URL

Local mode is not restricted to YouTube URLs. The README describes passing a filesystem path or a file:// URI directly to skip the YouTube download step entirely:

bash
python main.py "/Users/you/Videos/input.mp4" --mode local

This makes the tool usable on video files from any source without modifying the pipeline. The Python library interface exposes the same capability through the `generate_shorts` function, which accepts a path or URL and returns a dictionary containing the transcript, every candidate highlight with its score, and the final clip URLs or paths. Passing `--output-json result.json` writes this full result to disk for downstream processing.

API Mode versus Local Mode: Trade-offs

API mode requires a MuAPI key, which introduces an external service dependency and cost, but the requirements.txt for API mode contains only `requests>=2.31` and `python-dotenv>=1.0`, making the setup minimal. Local mode has no per-clip API cost beyond the LLM call for highlight ranking, but it requires Python 3.10, ffmpeg on the PATH, and either an OpenAI or Gemini API key for the ranking step. Transcription in local mode runs through faster-whisper and can use a CPU or CUDA device. The README lists several Whisper model sizes from tiny through large-v3, configurable through `LOCAL_WHISPER_MODEL`. Larger models produce more accurate transcripts and better highlight selection but take longer to process. For a developer building a white-label SaaS, local mode avoids a dependency on MuAPI but adds infrastructure complexity: managing ffmpeg, GPU availability, and model download on a server.

Limitations and What This Tool Does Not Do

AI YouTube Shorts Generator does not produce captions burned into the video. The README does not document any step that adds subtitle overlays to the output clips, which many short-form platforms rely on for engagement in silent viewing. The tool also does not edit for pacing or insert transitions: each output clip is a contiguous segment from the original video, trimmed and cropped but not re-edited. The virality framework is LLM-dependent, meaning highlight selection quality varies with the model used and the clarity of the transcript. Videos with heavy background noise, strong accents, or rapid topic switching may produce less accurate transcripts and therefore less relevant highlights. The README notes that running `--mode local` requires ffmpeg on the PATH and does not document an automated installation step for it.

Licence and Maintenance

The repository is licensed under MIT, which permits commercial use, modification, and redistribution. The README notes that the tool is white-labelable and can be imported as a Python library, explicitly targeting developers who want to embed it in a larger product. The last push to the repository was on 2026-09-10. There are no GitHub releases; updates go directly to the main branch. The repository includes a .claude directory in the top-level entries, suggesting the project uses Claude Code for development assistance. The README also advertises MuAPI as the hosted backend for API mode, which is a commercial service separate from the open-source repository.

Editorial conclusion

AI YouTube Shorts Generator is the right tool for creators, agencies, and developers who process enough video that a monthly SaaS subscription becomes expensive, or who need to run the clipping pipeline in a batch workflow, inspect the highlight scores, or modify the virality criteria for their niche. It is not a good fit for users who want a no-code web interface with a visual timeline editor: the tool is CLI-first, and API mode still requires setting an environment variable and running Python. Before adopting local mode, confirm that ffmpeg is on the PATH and that the LLM provider key is configured in the .env file.

Frequently asked questions

How can I create AI Shorts for YouTube using this tool?

Install the tool with pip, create a .env file with either a MUAPI_API_KEY for API mode or an OPENAI_API_KEY for local mode, then run python main.py with the YouTube URL. The tool downloads the video, transcribes it, selects the most viral moments using an LLM, and outputs ranked 9:16 MP4 files.

Which AI tool is best for creating YouTube Shorts?

AI YouTube Shorts Generator is an open-source alternative to paid tools like Opus Clip, Vidyo.ai, and Klap. It runs free with no watermarks or per-clip credits, with costs limited to API calls for the LLM ranking step. The README provides a feature comparison table against the paid services.

Does the AI YouTube Shorts Generator work on local video files?

Yes. In local mode, the tool accepts a filesystem path or a file:// URI in place of a YouTube URL, bypassing the download step entirely. The output format and highlight scoring are identical regardless of the input source.

Official sources

  1. Anil-matcha/AI-Youtube-Shorts-Generator on GitHub
  2. Issues
  3. Project website
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/anil-matcha-ai-youtube-shorts-generator.svg)](https://hysenlabs.com/projects/anil-matcha-ai-youtube-shorts-generator)