Skip to content
Avilash2001Public

About

Local AI Clipping tool

Resources

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

ClipForge — Local Gaming Clipping Studio

Turn a gaming VOD you own or are authorised to use into short-form vertical clips, using local AI.

ClipForge is a cross-platform Python desktop app for Windows, macOS and Linux. It uses faster-whisper for speech transcription, Ollama with a vision-language model to review gameplay frames and speech context, and FFmpeg for rendering. The app does not require paid APIs or a subscription.

Project status: experimental / community project. This release is a functional local-first workflow, not a guaranteed automatic viral-clip detector. Always review clips before publishing.

Features

  • Windows, macOS and Linux source setup scripts.
  • YouTube / Twitch / Kick URLs through yt-dlp, downloaded like an editor would: the audio track and a small 240p analysis copy first, then only the chosen clips in full quality (with a full-download fallback). Browser-session cookies are supported when a site requires sign-in.
  • Local MP4/MKV/WebM/MOV/AVI input.
  • GPU speech recognition by default: Whisper large-v3 on an NVIDIA GPU (float16, batched), with an automatic fallback to the CPU if anything on the GPU fails. Setup installs the CUDA 12 / cuDNN 9 libraries when an NVIDIA GPU is present.
  • Mixed-language transcription for English, Bengali and Hindi: the language is chosen per speech chunk and only from those three, so Hindi is no longer written out in Urdu, Nepali or Chinese characters.
  • Transcript-quality checks that reject punctuation-only output, plus a Medium-model retry and stereo left/right channel fallback when speech is missing from a mono downmix.
  • Visual activity analysis from sampled frames.
  • Transcript-first moment picking. The local LLM reads the transcript in 12-minute chunks, with markers where the streamer got loud and where YouTube live chat sped up. It picks the moments people share (first reactions, discoveries, freakouts, funny fails, hot takes, clutch plays) and scores each one 0-100.
  • Silent moments too: loudness, live-chat and on-screen motion spikes that the transcript picker did not cover become extra candidates, which the vision model judges from the frames alone.
  • Harsh scoring. Moments that need context are thrown out, and the Min score setting keeps only moments that clear the bar.
  • Grounded picks: every moment must quote its payoff line from the transcript, so invented moments are dropped.
  • Finalist checks:
    • An edge check trims clips that would open on a menu, loading or death screen.
    • A critic re-judges the finalists side by side and fact-checks every on-video title.
  • Auto model choice per stage: the best installed Ollama models for picking, the critic, the frame review and the edge check (gemma4:12b and qwen3.5:9b when installed).
  • Literal titles: the critic splits every title into claims (who, did what, to whom, how many) and rewrites any it cannot back up. A title that still contains hype such as "the WHOLE school" or "the most ..." is removed rather than burned in.
  • A transcript cache keyed by model, device and language mode, so re-running a video with other clip settings skips Whisper (and an old CPU transcript is never reused for a GPU run).
  • Variable-length clips that start on a sentence (leading filler trimmed) and end after the payoff and reaction.
  • Transcript clean-up that drops hallucinated Whisper output, such as wrong-script characters, character floods, repetition loops and low-confidence words.
  • Multimodal check: Ollama reviews chronological 3×3 frame contact sheets plus transcript context to reject menus and loading screens and to confirm the moment is visible.
  • Non-overlapping, de-duplicated selection.
  • 9:16 layouts:
    • Auto (default): streamer facecam on top and gameplay below when a webcam is detected, otherwise Gameplay zoom.
    • Co-op split-screen (stacked): detected per clip.
    • Manual facecam corner presets, Fit + blurred background, and Fill (center crop).
  • Letterbox bars are trimmed per clip.
  • On-video hook title card and big word-by-word captions with the active word highlighted. Captions are burned in when the local FFmpeg build has libass, and SRT/ASS sidecars are also written.
  • Audio loudness normalisation with soft in/out transitions, vertical thumbnails, and per-clip ready-to-post title/caption/hashtag suggestions, also saved as clip_NN_*.post.txt.
  • In-app Review & Publish gallery with visual previews, one-click playback/copy-post, and a persistent Posted checkbox per clip.
  • Live progress, ETA, logs and cancellation in the GUI.
  • FFmpeg child processes are isolated from terminal close/Ctrl+C events; the GUI warns before closing during an active job.
  • Local input/, output/ and logs/ runtime directories are excluded from Git.

What it does not do

  • It does not guarantee detection of kills, clutches or other game-specific events in every game. It judges sampled video frames and available transcript/audio signals. Very brief events can fall between sampled frames.
  • Speech recognition can still struggle with rapid English/Bengali/Hindi code-switching inside one sentence, overlapping Discord voices, noisy microphones, or game audio much louder than speech. Whisper picks one language per speech chunk, so a Hindi sentence inside an English chunk may come out translated into English. Hindi and Bengali speech is captioned in its own script. If no usable speech is present, captions and transcript-based context are skipped.
  • Visual AI reviews contact sheets, not every frame as a human editor would.
  • Facecam auto-detection looks for a real, mostly frontal face that stays in the same place across the stream (boxed webcams and green-screen cut-outs both work). Illustrated/VTuber avatars, cameras that are off for most of the stream, or faces turned away are not detected. Pick the facecam corner manually in those cases.
  • Live-chat spikes only exist for replays of YouTube live streams, not for normal uploads, Twitch or Kick.
  • Social titles and hashtags are suggestions, not factual guarantees.
  • Publishing to YouTube Shorts / Instagram Reels is manual. There is no automatic upload integration.
  • No copyrighted music or stock sound effects are bundled. The original game/commentary audio is preserved and can be normalised.

Requirements

Required on all operating systems

  1. Python 3.11 or 3.12 (both are supported).
  2. FFmpeg and ffprobe available on PATH.
  3. Ollama installed and running for visual AI ranking.
  4. A local vision-capable Ollama model. The default is qwen3.5:9b.
  5. Deno 2.3+ recommended for yt-dlp's YouTube JavaScript challenge solver. yt-dlp[default] installs the matching yt-dlp-ejs scripts; Deno is a separate runtime.

Internet access is required to download YouTube source videos and first-time Whisper/Ollama models. Transcription, visual analysis, ranking and rendering run locally after setup.

Hardware guidance

  • 16 GB RAM is a practical minimum; 32 GB is recommended for larger videos and local vision models.
  • An NVIDIA GPU with NVENC accelerates rendering on supported systems. CPU rendering is used automatically when NVENC is unavailable.
  • Whisper device Auto uses an NVIDIA GPU when the CUDA 12 / cuDNN 9 libraries load (Setup installs the nvidia-cublas-cu12 / nvidia-cudnn-cu12 wheels; a cuda-libs folder next to the app also works), and the CPU otherwise. large-v3 needs about 6 GB of VRAM; ClipForge asks Ollama to free the GPU before transcribing. On an RTX 3060 a 3.8-hour Hindi stream took 32 minutes: 15 for the batched pass and 17 more re-decoding the stretches where it looped. On the CPU, Auto uses the small model.
  • Model memory depends on the Ollama model/quantisation. qwen3.5:9b is the default vision model; smaller Qwen3.5 vision tags can be selected in the app if memory is constrained.
  • Recommended for better picks: ollama pull gemma4:12b (about 8 GB) and ollama pull qwen3.5:9b. With both installed, Auto uses gemma4:12b to choose moments, review the frames and fact-check titles, and qwen3.5:9b to check the first/last frames of each clip. In testing gemma4:12b got who-did-what right where the 9B model called the streamer's own death a clutch. Ollama swaps models between stages, so they do not need to fit in VRAM together.

Install from GitHub

Installer note: Setup installs dependencies using the pip bundled with the virtual environment. It deliberately does not self-upgrade pip, avoiding Windows file-lock failures while pip replaces its own files. If pip is incomplete, Windows setup tries ensurepip; if repair fails, it backs up the broken .venv before creating a clean one. Runtime media and logs are not deleted.

Windows 10/11

  1. Install Python 3.11 or 3.12 x64 from https://www.python.org/downloads/. Enable Add python.exe to PATH. Setup.bat automatically tries Python 3.12 first, then 3.11. If you already have Python 3.12, you do not need to install 3.11.

  2. Install FFmpeg (including ffprobe). With winget:

    winget install --id Gyan.FFmpeg.Shared -e
  3. Install Deno:

    winget install --id DenoLand.Deno -e
  4. Install Ollama from https://ollama.com/download/windows, then download the model:

    ollama pull qwen3.5:9b
  5. Clone/download this repository and open its folder:

    git clone https://github.com/YOUR-USERNAME/ClipForge.git
    cd ClipForge
  6. Double-click Setup.bat. It creates .venv, installs Python dependencies and creates ignored input/, output/ and logs/ directories.

  7. Double-click Start ClipForge.bat.

For console diagnostics, use Start ClipForge (Debug).bat.

macOS (Apple Silicon or Intel)

Install Homebrew if you do not have it: https://brew.sh/. Then install system tools:

brew install python@3.11 ffmpeg deno

Install Ollama from https://ollama.com/download/mac (or its current official macOS installer), launch it, and run:

ollama pull qwen3.5:9b

Clone the repository and install:

git clone https://github.com/YOUR-USERNAME/ClipForge.git
cd ClipForge
chmod +x setup.sh run.sh launch.command
./setup.sh

Launch with ./run.sh from Terminal or double-click launch.command in Finder. The .command launcher runs the GUI detached and writes its console log to the ignored logs/gui.log file.

Linux (Ubuntu/Debian example)

Install system packages:

sudo apt update
sudo apt install -y python3.11 python3.11-venv python3-tk ffmpeg curl

Install Deno using its official installer:

curl -fsSL https://deno.land/install.sh | sh

Add Deno to your shell PATH if the installer asks. Install Ollama using its official instructions at https://ollama.com/download/linux, then:

ollama pull qwen3.5:9b

Clone and install:

git clone https://github.com/YOUR-USERNAME/ClipForge.git
cd ClipForge
chmod +x setup.sh run.sh
./setup.sh
./run.sh

For Fedora, Arch or other distributions, install equivalent packages for Python 3.11 or 3.12, Tkinter, FFmpeg and ffprobe. The GUI requires a working desktop session and Tk support.

First run

  1. Ensure Ollama is running and the selected vision model is present (ollama list).
  2. Select either a YouTube URL or a local video file. For your own VODs, local input is the most reliable route.
  3. Leave YouTube login browser on None (anonymous). Only if YouTube says it needs you to sign in, pick the browser where you are signed in, and fully exit it first (yt-dlp cannot read a locked cookie database). Browser cookies are sensitive credentials; never export/share/commit them.
  4. Leave clip count, duration and scan interval on Auto for the best chance of coherent standalone stories. Auto adapts the number of clips, uses a longer event window, and scans more densely. Choose manual values only when you need a strict export target.
  5. Leave speech language on Mixed (English + Bengali + Hindi) for code-switched voice chat, and Whisper model/device on Auto.
  6. Keep local Ollama visual AI enabled. Use Fit + blurred background to preserve the full HUD; use Fill (center crop) only when cropping game edges is acceptable.
  7. Leave Burn in animated word-highlight captions enabled if you want captions. Only validated speech is used. If FFmpeg lacks libass, ClipForge keeps sidecar caption files instead.
  8. Start the job and keep the GUI open. The window intentionally refuses to close while a job is active; use Cancel job and wait for the safe-stop message.

Output layout

Each completed job is saved in output/<video-name>/:

clip_01_000120s.mp4
clip_01_000120s.srt        # when speech was validated
clip_01_000120s.ass        # when word-timed captions were generated
clip_01_000120s.jpg        # thumbnail
clip_01_000120s.metadata.json
...
transcript.json
clips.json

clips.json includes timestamps, scores, screen classification, story explanation, generated social copy, caption/render status and the persistent posted flag. Use Review clips in the app to preview thumbnails, play each export, copy the post text, and mark it posted. Review the actual clips before publication.

Command line (optional)

The GUI is the main workflow. A basic CLI is also available:

python clipper.py "D:/Videos/my-vod.mp4" --count 10 --clip-length 35 --stride 15

Inside the project environment, use .venv/Scripts/python on Windows or .venv/bin/python on macOS/Linux.

Git hygiene

The .gitignore excludes the runtime input/, output/ and logs/ folders, virtual environments, caches, generated media, transcripts, model files and cookie exports. These folders are created locally by the setup script and should never be committed.

Before pushing, check:

git status --short

Do not force-add ignored media, logs, browser databases, cookies or model files.

Build desktop release packages

PyInstaller cannot cross-compile a Windows executable from macOS/Linux or vice versa. The GitHub Actions workflow builds on a runner for each OS when you push a version tag. See PyInstaller's platform requirements: https://pyinstaller.org/en/latest/requirements.html.

To publish a release from your own fork:

git add .
git commit -m "Release ClipForge 1.3.2"
git push origin main
git tag v1.3.2
git push origin v1.3.2

The workflow builds Windows, macOS and Linux artifacts and attaches them to a GitHub Release. The app bundles do not include FFmpeg, Ollama, the Qwen model, or the Whisper model weights; users install/download those separately. For source installs, users can simply clone and run the OS setup script.

Troubleshooting

  • Windows setup reports WinError 32 involving pip\_vendor or a file being used by another process: close every ClipForge window and Python terminal using that project folder, then run the updated Setup.bat again. v1.3.2 no longer upgrades pip as part of setup. If pip was damaged by an earlier failed self-upgrade, setup tries ensurepip; if that fails it preserves the old environment as .venv-broken-* and creates a clean .venv.

  • 0xC000013A while rendering on Windows: FFmpeg was interrupted by a console-control/terminal shutdown event. Use the normal Start ClipForge.bat launcher and keep the GUI open during a job. The FFmpeg child process is launched without a console window. The normal launcher uses pythonw; FFmpeg is started without a console window.

  • YouTube says sign in / bot check: Update yt-dlp with pip install -U "yt-dlp[default]", install Deno 2.3+, use a signed-in browser session, and only download content you are authorised to use.

  • Chrome DPAPI error on Windows: Try Firefox or Edge. Some Chrome installations protect cookies in ways yt-dlp cannot decrypt from the current user context.

  • GPU transcription falls back to the CPU: the log says why (usually a missing cublas64_12.dll / cudnn64_9.dll). Run Setup.bat again on a PC with an NVIDIA GPU, or put the CUDA 12 / cuDNN 9 DLLs in a cuda-libs folder in the app folder.

  • Hindi/Bengali captions show boxes or dotted circles: install a font that covers the script (Windows has Nirmala UI; on Linux install fonts-noto-core).

  • Transcript empty or punctuation-only: ClipForge tests the mixed-language mode, checks left/right stereo channels when available, retries Whisper Medium, and then omits transcript-based ranking/captions if speech remains unusable. This can indicate the stream recording did not include Discord/microphone audio, voice is too quiet, or speakers overlap heavily.

  • Ollama returns invalid/empty JSON: v1.3 requests structured JSON with thinking disabled and retries batches in smaller groups. Update Ollama and verify the model supports images. The app logs and falls back to visual/audio scoring if local vision ranking is unavailable.

  • Model not found: run ollama pull qwen3.5:9b or choose a model name shown by ollama list.

  • FFmpeg has no ASS filter: SRT/ASS caption files remain as sidecars but captions cannot be burned in. Install an FFmpeg build with libass enabled.

  • NVENC unavailable: CPU H.264 encoding is selected automatically. On Linux, install an NVIDIA driver and an FFmpeg build with NVENC support.

  • GUI fails on Linux: install the distribution's Tk package (python3-tk on Ubuntu/Debian) and run from a graphical desktop session.

License

ClipForge project code is MIT-licensed. Third-party packages, FFmpeg, Whisper model weights, Ollama models and any source videos retain their own licences and terms. See LICENSE and the respective upstream projects.

Python version detection on Windows

Setup.bat detects Python 3.12 first, then 3.11, through the Python launcher. It also accepts a python executable on PATH if it is 3.11 or 3.12. If neither is found, install Python 3.12 with winget install --id Python.Python.3.12 -e, reopen the terminal, and rerun setup.

About

Local AI Clipping tool

Resources

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages