Skip to content

About

A basic, free and open-source Clone for Opus Clips, makes for a decent project for your university or if you want to build upon it. Future Improvements to come, maybe.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

OpusClips Clone (ClipForge)

A local-first, open-source alternative to Opus Clip. Drop in a long video and get short, vertical (9:16) clips with burned-in captions, all processed on your own computer. No account, no subscription, and your videos are never uploaded to a hosted service.

Python FastAPI FFmpeg Whisper Status

Disclaimer: This is an independent hobby project. It is not affiliated with, endorsed by, or connected to Opus Clip / Opus Pro in any way.

Screenshots

Dashboard

Projects

Generated clips

Features

  • Local video upload: drag and drop or browse. Supports MP4, MOV, M4V, WEBM, MKV and AVI, with a configurable size limit (5 GiB by default).
  • Local speech-to-text: Faster-Whisper produces timestamped, word-level transcripts on your machine.
  • Automatic highlight selection: finds candidate moments inside your chosen duration range (8-15, 15-30, 30-60 or 60-90 seconds) and picks the best non-overlapping ones.
  • Vertical clips with captions: FFmpeg renders 9:16 MP4s (center-cropped, never stretched) with captions burned in, timed to the spoken words.
  • Project dashboard: live processing stage and progress, retry failed jobs, preview and download clips, and delete projects or individual clips. Downloading a whole project as a ZIP and editing clip titles/captions are available through the API today and are coming to the UI.
  • Resilient jobs: if the server stops mid-processing, your upload is kept and the project becomes a retryable error instead of vanishing.
  • Optional Gemini analysis: add a GEMINI_API_KEY to let Gemini rank highlights from the transcript. Without a key, the built-in local ranking is used.
  • Honest by design: the app never invents clips or pretends processing has run. If a dependency is missing, you see a real error.

How it works

Browser ── upload / API calls ──► FastAPI (backend/main.py)
                                    ├── SQLite ........ data/clipforge.sqlite3
                                    ├── Source videos . data/uploads/
                                    ├── Faster-Whisper  local timestamped transcript
                                    ├── Gemini (opt.) . transcript-based highlight ranking
                                    └── FFmpeg ........ 9:16 clips + burned-in captions
  1. You upload a video; the backend validates it with ffprobe and queues a background job.
  2. Faster-Whisper transcribes the audio locally (the first run downloads the Whisper model).
  3. The transcript is scanned for candidate windows in your chosen length range, then ranked.
  4. FFmpeg renders each selected moment as a vertical clip with captions.

Only transcript text and timestamps are ever sent to Gemini, and only if you configure a key. The video itself never leaves your computer.

Quick start (Windows)

You do not need a Gemini key to get started. This is a local project setup, not a one-click installer, so each PC needs its own Python and FFmpeg.

What you need

  • Windows 10 or 11 (64-bit)
  • 64-bit Python 3.14 with the Python Launcher (py)
  • FFmpeg, with both ffmpeg.exe and ffprobe.exe on your PATH
  • An internet connection for installing packages and for the first Whisper model download
  • Free disk space for the Python environment, the Whisper model, your videos and rendered clips

1. Install Python

Download 64-bit Python 3.14 from python.org. In the installer, enable Add Python to PATH and install the Python Launcher. Close and reopen PowerShell afterwards.

Python 3.15 is too new for some dependency wheels (such as onnxruntime), so use 3.14 for this project. You can keep 3.15 installed alongside it.

2. Install FFmpeg

Download a Windows build from the FFmpeg download page, extract it, and add the folder containing ffmpeg.exe and ffprobe.exe (usually bin) to your user Path in Windows Environment Variables. Close and reopen PowerShell.

Verify everything:

py -3.14 --version
ffmpeg -version
ffprobe -version

Each command should print version info. If Windows says a command is not recognized, fix that install or PATH entry before continuing.

FFmpeg must be a full build with libass enabled (needed for captions). The common "full" Windows builds include it.

3. Get the project and install dependencies

git clone https://github.com/YOUR-USERNAME/OpusClips-Clone.git
cd OpusClips-Clone

py -3.14 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install -r requirements.txt

The first install can take a while because the video and speech libraries are large. If a command fails, fix that before moving on.

4. (Optional) Configure Gemini

Copy-Item .env.example .env
notepad .env

Paste your key into GEMINI_API_KEY. Keep .env private; it is already in .gitignore. The browser never sees the key.

5. Start the app

.\.venv\Scripts\python.exe -m uvicorn backend.main:app --host 127.0.0.1 --port 8000

Open http://127.0.0.1:8000 in your browser. Keep the terminal open while you use the app. Press Ctrl+C to stop it.

6. Make your first clips

Click New project (or drag a video onto the dashboard), choose a clip length (default 15-30 seconds), and upload. Watch the stage and progress on the project card. When it finishes, open Generated clips to preview and download.

Don't close the terminal while a video is processing. Jobs don't resume automatically after a restart, but your upload is kept and you can press Retry processing on the project card.

macOS / Linux

Developed on Windows. Every dependency is cross-platform, so this should work, but it hasn't been tested yet (reports welcome):

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn backend.main:app --host 127.0.0.1 --port 8000

Configuration

Copy .env.example to .env and adjust. All settings are optional.

Variable Default Description
CLIPFORGE_DATA_DIR ./data Where uploads, rendered clips and the SQLite database are stored
CLIPFORGE_MAX_UPLOAD_BYTES 5368709120 (5 GiB) Maximum accepted source-file size
WHISPER_MODEL small base uses less memory; medium is more accurate but needs more RAM
WHISPER_DEVICE cpu Use cuda only if you have a verified Faster-Whisper/CUDA setup
WHISPER_COMPUTE_TYPE int8 Conservative default for CPU-only machines
GEMINI_API_KEY (unset) Enables Gemini highlight ranking. Backend only, never put it in frontend code
GEMINI_MODEL see backend/main.py Gemini model name. Model names get retired, so check Google's deprecations page
FFMPEG_PRESET veryfast x264 speed/quality trade-off for rendering

The first run downloads the selected Whisper model, which requires an internet connection.

API

The dashboard talks to a small local REST API (interactive docs at /docs while the server is running).

Method Endpoint Purpose
GET /api/health Check FFmpeg, Faster-Whisper and Gemini status
GET /api/projects List projects
POST /api/projects Upload a video (multipart) and start processing
GET /api/projects/{id} Project status (queued, processing, complete, error), stage, progress and clips
POST /api/projects/{id}/process Re-run processing (Retry), optionally with new settings
DELETE /api/projects/{id} Delete a project, its source video and all its clips
GET /api/projects/{id}/download.zip Download all clips as a ZIP
GET /api/clips List all generated clips
GET /api/clips/{id}/download Download one clip
PATCH /api/clips/{id} Edit a clip's title or caption
DELETE /api/clips/{id} Delete one rendered clip

Upload from the command line with custom bounds:

curl.exe -F "file=@C:\videos\interview.mp4" -F "title=My interview" -F "min_duration=30" -F "max_duration=60" -F "max_clips=8" http://127.0.0.1:8000/api/projects

Deleting a clip removes only that rendered clip. Deleting a project removes its source video and all its clips, and is blocked while the project is processing.

Project structure

OpusClips-Clone/
├── index.html           # Dashboard, upload dialog, projects, clips, settings
├── styles.css           # Responsive dark creator-studio design
├── app.js               # Browser interactions and preview-only fallback
├── backend/
│   └── main.py          # FastAPI: uploads, jobs, processing and downloads
├── docs/
│   └── screenshots/     # README images (1.png, 2.png, 3.png)
├── requirements.txt     # Python dependencies
├── .env.example         # Optional Whisper, Gemini and storage settings
├── .gitignore
├── README.md
└── data/                # Created automatically: videos, clips, SQLite DB (git-ignored)

Troubleshooting

  • ffmpeg or ffprobe not found: add the FFmpeg bin folder to your user PATH, reopen the terminal, and run ffmpeg -version and ffprobe -version.
  • Package installation errors: use 64-bit Python 3.14, create a fresh virtual environment, and upgrade pip inside it. Don't reuse a partially failed environment. PyTorch is not required; Faster-Whisper uses CTranslate2.
  • open() got an unexpected keyword argument 'metadata_errors': Faster-Whisper is running with PyAV 19, which removed that argument (see the upstream issue). This project pins av<19. Stop the server, run pip install -r requirements.txt in your environment, restart, then choose Retry processing. Your upload is preserved.
  • Subtitles filter missing: use a full FFmpeg build with libass. Check with ffmpeg -filters | findstr subtitles.
  • Whisper download or a slow first run: the first run downloads the model, so you need an internet connection, disk space and RAM. Processing time depends on your hardware and video length.
  • Project seems stuck at 12%: transcription takes time while the model loads or processes audio. The dashboard shows the current stage and how much source audio has been covered. If the server restarted, the project becomes a retryable error.
  • "No clip window matches the requested length": not enough detected speech fit the chosen range, so no clip was made rather than faking one. Try the 8-15 second option or check that the source has clear speech.
  • Zero generated clips: a project must finish processing successfully first. Check its status, stage and error on the dashboard or at GET /api/projects/{id}.
  • Gemini isn't doing anything: on any Gemini error the backend logs it and silently falls back to local ranking. Check the terminal output, confirm your key, and make sure GEMINI_MODEL is a model that still exists.
  • Large uploads: raise CLIPFORGE_MAX_UPLOAD_BYTES if you have the disk space. Sources and rendered clips both use local storage.
  • Windows path problems: uploads are stored under generated unique filenames, never the original names. Avoid putting the data folder inside a synced or permission-restricted directory.

Privacy and safety

  • The server binds to 127.0.0.1 by default. There are no user accounts or authentication, so do not expose it to a public network or run it with --host 0.0.0.0 on an untrusted network.
  • Videos, clips and the database stay in your local data/ folder.
  • Gemini, if enabled, receives transcript text and timestamps only, never the video file.
  • Gemini keys belong in the backend .env file only.
  • Uploaded filenames are never used as server file paths.
  • The dashboard loads its fonts from Google Fonts, so the browser makes that one request. Everything else runs locally.

Roadmap

This is the first version. Planned and possible next steps:

Smarter clip selection with Gemini (in progress)

Today, Gemini can optionally re-rank highlights using the transcript only. The goal is a much smarter selection system, where you supply a Gemini API key and the app uses it to understand what makes a moment worth clipping:

  • Analyze the video and audio itself (not just the words) to catch visual and tonal moments a transcript can't show
  • Score each candidate for hook strength, emotional peak, self-contained story and "shareability", with a short explanation of why it was picked
  • Detect topic boundaries so clips start and end on natural, complete thoughts
  • Let you steer the AI ("funny moments", "key takeaways", "questions and answers") before processing
  • Suggest titles, captions and hashtags for each clip

Other ideas

  • Clip editor (trim, re-caption, restyle) so you can adjust results without leaving the app
  • Speaker and face tracking for smart cropping, instead of a plain center crop
  • Animated caption templates where the highlight follows the spoken word
  • A persistent job queue so processing survives a server restart
  • Docker setup for one-command installs
  • Automated tests and CI

Ideas and pull requests are welcome.

Contributing

Issues and PRs are welcome. For larger changes, please open an issue first to discuss what you'd like to change.

License

Released under the MIT License.

About

A basic, free and open-source Clone for Opus Clips, makes for a decent project for your university or if you want to build upon it. Future Improvements to come, maybe.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages