reels-app/scripts
Sebastjan Artič 4efd726176 Extend clip end past chorus to capture outro/sustained notes
Problem: Claude was cutting clip exactly at last transcribed word of chorus,
but in real songs:
- Singer holds last note 1-3s longer (still meaningful)
- Outro 'ej-ej-ej' / 'oh' / 'yeah' may not be transcribed as words
- Result felt like 'incomplete chorus' even though SRT was correct

Fix has two parts:

1. Prompt enhancement:
   - Ask Claude to add 1-2s padding AFTER last chorus word
   - Explicit example with timing math
   - Mention outro fillers (ej-ej-ej, oh, yeah)

2. Post-LLM extension logic:
   - After Claude returns clip range, scan corrected_segments for
     segments overlapping or starting just after current end
   - If next segment is within 1s pause and ends within max_duration+5s,
     extend clip to include it (with 0.3s breathing room)
   - Hard cap at max_duration + 5s to prevent unbounded extension

This ensures chorus naturally trails off rather than being cut mid-emotional-peak.
2026-04-29 13:12:28 +00:00
..
analyze.py Extend clip end past chorus to capture outro/sustained notes 2026-04-29 13:12:28 +00:00
clip.py Upgrade default Whisper model: small/medium → large-v3 for much better Slovenian/Slavic transcription accuracy 2026-04-29 08:20:18 +00:00
find_chorus.py Find chorus: weight repetitive short phrases (like 'Ohne dich x5') as strong chorus signal 2026-04-28 16:57:45 +00:00
reframe.py Major: smart selection pipeline (analyze.py) + audio fade + multi-lang auto-detect 2026-04-29 06:21:35 +00:00
subtitle.py Upgrade default Whisper model: small/medium → large-v3 for much better Slovenian/Slavic transcription accuracy 2026-04-29 08:20:18 +00:00
yt_download.py Add cookies support to yt_download.py for YouTube bot detection bypass 2026-04-28 15:47:59 +00:00