Self-hosted Opus Clip alternative — reels.biba.live
Go to file
Sebastjan Artič e06c3efb8e Add audio amplitude defense (Layer 3) for first-word cut prevention
Žena problem persists: even after word-level extension, some cases where
Scribe doesn't transcribe the very first word still result in clip cutting
the vocal start.

Layer 3 defense: after word-level start extension, probe the FIRST 150ms
of audio at clip start with ffmpeg volumedetect. If mean_volume > -35 dB
(threshold for vocal/music vs silence), extend clip start back 0.5s as a
safety buffer.

This catches cases where:
- Scribe missed the word entirely (no word-level timestamp to extend to)
- LLM picked a start that's already inside vocal energy
- Word-level extension didn't trigger because no nearby word matched

The check is fast (<100ms) and conservative (only triggers if audio is
clearly NOT silent). If it's a true musical break (silence before chorus),
mean_volume will be < -40 dB and extension is skipped.

Three layers of defense now:
1. Claude prompt: 'start ~0.3s before first chorus word'
2. Word-level boundary detection (Scribe word timestamps)
3. Audio amplitude check (catches cases 1-2 missed)
2026-04-29 15:23:37 +00:00
app Multi-upload batch queue + Telegram notifications 2026-04-29 15:12:38 +00:00
scripts Add audio amplitude defense (Layer 3) for first-word cut prevention 2026-04-29 15:23:37 +00:00
templates Two fixes: clip end overflow into instrumental + UI cleanup 2026-04-29 15:14:42 +00:00
.env.example Initial: reels clipper app 2026-04-28 15:28:22 +00:00
.gitignore Initial: reels clipper app 2026-04-28 15:28:22 +00:00
docker-compose.yml Initial: reels clipper app 2026-04-28 15:28:22 +00:00
Dockerfile Add Deno runtime for yt-dlp YouTube nsig challenge solving 2026-04-28 16:05:09 +00:00
README.md Initial: reels clipper app 2026-04-28 15:28:22 +00:00
requirements.txt ACRCloud auto-recognition: never block uploads, fall back to fingerprinting 2026-04-29 14:24:53 +00:00

Reels Clipper · biba.live

Self-hosted Opus Clip alternativa za FOLX TV / PTC. Pretvori 16:9 video v 9:16 reels/shorts/tiktok format z auto face tracking, podnapisi (sl/de/en) in avto-detekcijo refrena v glasbenih pesmih.

Features

  • 📤 Drag & drop upload (do 2 GB)
  • 📺 YouTube URL paste (yt-dlp)
  • 🎯 Smart reframe: track (face follow), center, blur (za glasbo)
  • 🎵 Auto-chorus detection (Whisper + energy hibrid)
  • 📝 Burned-in podnapisi (faster-whisper, multi-jezik)
  • 🎨 3 stili podnapisov: reels, yellow (MrBeast), minimal
  • 🔐 HTTP Basic Auth
  • 📊 Real-time progress (Server-Sent Events)
  • 📦 Docker / Coolify ready

Quick start (lokalno)

docker compose up --build
# odpri http://localhost:8000

Default login: sebastjan / nastavi AUTH_PASS v .env.

Coolify deploy

  1. V Coolify ustvari nov projekt → Docker Compose iz tega repoja
  2. Domena: reels.biba.live
  3. Env vars:
    AUTH_USER=sebastjan
    AUTH_PASS=<močno geslo>
    MAX_UPLOAD_MB=2000
    
  4. Volume reels_data se ustvari avtomatsko
  5. Deploy → Coolify postavi Traefik reverse proxy + SSL via Let's Encrypt

Pipeline

Upload / YouTube
       ↓
[ yt_download.py ]    ← samo če YouTube
       ↓
[ find_chorus.py ]    ← samo če auto_chorus=true (Whisper + RMS analiza)
       ↓
[ reframe.py ]        ← 16:9 → 9:16 (track / center / blur)
       ↓
[ subtitle.py ]       ← Whisper transkripcija + burn-in
       ↓
   reel.mp4

API

  • POST /api/upload — multipart file upload, vrne job_id
  • POST /api/youtube — JSON {url, mode, lang, ...}
  • POST /api/process — start processing za uploaded job
  • GET /api/jobs — list vseh
  • GET /api/jobs/{id} — status
  • GET /api/stream/{id} — SSE stream progress
  • GET /api/download/{id} — final reel
  • DELETE /api/jobs/{id} — pobriši

Dependencies

  • FFmpeg (system)
  • faster-whisper (transkripcija)
  • OpenCV (face detection)
  • yt-dlp (YouTube)
  • FastAPI + uvicorn (server)