Self-hosted Opus Clip alternative — reels.biba.live
Go to file
Sebastjan Artič dc1cb1ad27 Fix SRT subtitle timing: use word-level timestamps for chunk boundaries
Bug: BRAJDE reel showed subtitles 2-3 seconds out of sync with audio.

Soniox returned correct word timestamps:
- 'Ajmo,' at 41.82s
- 'Janezi!' at 42.18s
- 'Pejd' greva, ajde,' at 43.44-44.40s

But generate_srt_from_segments() ignored word timestamps and split long
segments into evenly-spaced 2.5s chunks based on segment duration:

  chunk_dur = duration / n_parts   ← assumes even pacing
  for i in range(n_parts):
      cs = rel_start + i * chunk_dur

This produces wrong timing because singers don't sing evenly. Real audio
had 'Ajmo, Janezi!' in 0.9s and 'Pejd' greva, ajde, na traktorju od Majde'
in 6s — the 2.5s chunks didn't align with vocals.

Fix: when word-level timestamps are available (Soniox/Scribe), group
words into chunks where each chunk's start/end match the actual first/last
word timestamps. Each chunk is at most MAX_CHUNK_DURATION (2.5s) but
respects natural word boundaries.

Before:
  00:00.000 → 01.900  AJMO, JANEZI! PEJD' GREVA, AJDE, NA TRAKTORJU OD
  00:01.900 → 03.800  MAJDE, NOBEN NAJU NE NAJDE, KO PELJEM TE

After:
  00:00.020 → 02.120  AJMO, JANEZI! PEJD' GREVA,
  00:02.360 → 04.820  AJDE, NA TRAKTORJU OD MAJDE, NOBEN

Subtitles now perfectly align with vocals.
2026-04-30 04:02:09 +00:00
app Fix SRT subtitle timing: use word-level timestamps for chunk boundaries 2026-04-30 04:02:09 +00:00
scripts Integrate Soniox stt-async-v4 as primary STT provider 2026-04-30 03:06:38 +00:00
templates Default 'no subtitles' mode: cleaner reels without text issues 2026-04-29 19:38:35 +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)