mushigaite/short-video-maker

A free open-source project designed to turn youtube-videos into viral short videos. Highlight detection, subtitles, translation, voiceover, all in one for your content: no pre-clip credits or any watermarks. Designed for creators who want an alternative to short-video SaaS tools like OpusClip or Vidyo.ai for free.

short‑video‑maker – AI‑powered YouTube‑to‑shorts generator

What it is – An open‑source Python tool that takes a full‑length YouTube video (or a local video file) and automatically creates one or more vertical short clips (e.g., 9:16 for TikTok/Reels). It does the heavy lifting with:

  • Speech‑to‑text using the local faster‑whisper model.
  • Content classification & highlight ranking via a large‑language‑model (OpenAI, Gemini or MuAPI).
  • Optional AI‑generated hook that adds a catchy intro to each short.
  • Export of the selected highlights as ready‑to‑post video files, either via CLI or a tiny local web UI.

Core features

Feature What you get
One‑click video input Paste any YouTube URL or give a local path.
Automatic transcription faster‑whisper runs locally, no external service needed.
Smart highlight detection An LLM scores transcript segments on “virality” cues (hooks, emotional peaks, quotables, etc.) and returns the top‑N clips.
AI‑generated hook (optional) A short, context‑aware intro generated by the same LLM.
Customizable output Choose number of clips (--n), aspect ratio (--ratio), resolution, language, and whether to include the hook.
API mode The same pipeline can be called from other Python code via the provided API module.
Local web UI A minimal HTML/JS front‑end lets you queue videos and set flags without touching the terminal.
No watermarks / credits All rendering is done locally, so the output is clean and ready for publishing.

How it works (step‑by‑step)

  1. Download / load video – The script pulls the source video from YouTube (or reads a local file).
  2. Transcribe – faster‑whisper produces a timestamped transcript on the user’s machine.
  3. Classify content type – The selected LLM (OpenAI/Gemini/MuAPI) labels the video (podcast, interview, tutorial, etc.) to adapt the highlight prompt.
  4. Rank highlights – The LLM scans the transcript with a “virality framework” (hooks, emotional peaks, revelations, etc.) and returns candidate clips with scores 0‑100.
  5. Deduplicate – Overlapping candidates are merged, keeping the highest‑scoring segment.
  6. Select top‑N – The user‑specified number of clips is chosen.
  7. Render – Each segment is cropped to the requested aspect ratio, optionally prefixed with an AI‑generated hook, and saved as a vertical short video.

Getting started (quick‑start)

# 1. Clone
git clone https://github.com/mushigaite/short-video-generator-AI.git
cd short-video-generator-AI

# 2. Virtual env
python -m venv venv && source venv/bin/activate   # or venv\Scripts\activate on Windows

# 3. Install deps
pip install -r requirements.txt

# 4. Create .env with your LLM API key(s) and Whisper preferences
cat > .env <<EOF
LLM_PROVIDER=openai
OPENAI_API_KEY=your_key_here
LOCAL_WHISPER_MODEL=base
LOCAL_WHISPER_DEVICE=auto
EOF

# 5. Run a single video
python main.py "https://www.youtube.com/watch?v=VIDEO_ID" \
    --n 3 --ratio 9:16 --resolution 720

The generated clips appear in the output/ folder.

Web interface (optional)

python3 server.py          # starts the backend
cd web && python3 -m http.server 8000
# then open http://localhost:8000/shorts-generator-ui.html

The UI mirrors the CLI flags and lets you queue several videos.

Who might use this?

  • Content creators who want to repurpose long‑form YouTube videos into TikTok/Reels shorts without paying SaaS services.
  • Marketers looking for quick, watermark‑free highlight reels for social media.
  • Developers who need an API to embed short‑clip generation into their own pipelines.

Limitations & considerations

  • LLM cost – Highlight scoring and hook generation rely on an external LLM API; usage will incur the provider’s fees.
  • Local Whisper model size – Larger Whisper models (e.g., large‑v3) improve transcription accuracy but need more RAM/VRAM.
  • Virality scoring is heuristic – The “viral” ranking is based on a prompt‑driven framework and may not always pick the most engaging moments.
  • No built‑in video editing effects – The tool simply crops and concatenates; advanced transitions or effects must be added separately.

License

MIT – free to use, modify, and redistribute.

Related

  • Project
  • Project
  • Project
  • Project