Self-hosted Opus Clip alternative — reels.biba.live
Go to file
Sebastjan Artič a30137f1f2 Strict 'chorus only' mode: respect include_prebuild in LLM prompt
Bug: 'Vključi pre-chorus' checkbox in UI was sent to backend but ignored
by Claude/Gemini analysis prompt. Both modes used same lenient rules
saying 'pre-chorus is optional' — Claude often included pre-chorus even
when user wanted just chorus.

Real-world failure: Lady Gaga 'Abracadabra' picked 54.7-84.6s, but actual
chorus 'Abracadabra, amor, ooh-na-na' starts at 85.2s. Claude included
the entire pre-chorus block ('Hold me in your heart tonight', 'Like a
poem said by a lady in red', 'With a haunting dance') and missed the
actual chorus completely.

Fix: include_prebuild parameter now flows all the way to the prompt:
- main.py → analyze.py CLI args → analyze_with_llm() → prompt builder
- Two distinct prompt rule sets:

  CHORUS ONLY (default, include_prebuild=False):
  - Strict: 'clip starts on FIRST WORD of chorus, never before'
  - Length: 12-25s typically
  - Explicit examples for pop songs (Abracadabra, Despacito, Shape of You)
  - List of common mistakes to avoid

  CHORUS + PRE-CHORUS (include_prebuild=True):
  - Optional pre-chorus before chorus, 4-10s
  - Length: 18-35s

This fixes the most common failure mode where Claude rationalizes
including verse/pre-chorus content even when user explicitly wants
just the chorus.
2026-04-29 14:03:40 +00:00
app Integrate ElevenLabs Scribe (best multilingual STT 2026) 2026-04-29 12:03:40 +00:00
scripts Strict 'chorus only' mode: respect include_prebuild in LLM prompt 2026-04-29 14:03:40 +00:00
templates Fix Preview button in jobs sidebar not opening modal 2026-04-29 13:39:04 +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 Upgrade yt-dlp to nightly for new YouTube nsig algorithm support 2026-04-28 15:48:39 +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)