Repository navigation
v0.4.0: ffsubsync-level precision
suba now matches ffsubsync's precision, while still fixing the cases ffsubsync gets wrong.
Precision. Once suba has an offset, it now nudges it by up to 2 s against the whole film's voice track, using WebRTC's voice detector. On every ordinary case in the benchmark (plain shifts, other languages, PAL drift), suba's median error now matches ffsubsync's to within 0.01 s. Before, it was 0.2–0.4 s off on full-length films. The sharp detector is used only to nudge an answer that's already found: searching a whole film with it is what fails when the music is louder than the dialogue.
Also new
- Frame-rate conversions that are close together (25→24 vs 25→23.976 fps) are now chosen by how well the whole film fits, not by five minutes of dialogue.
- If the text match can't settle on an offset (for example, Whisper hears little under a loud score), suba falls back to timing alignment. That has its own refusal check, so subtitles from another film are still refused.
- Fixed: on WebM files, ffmpeg dropped about 83 ms of audio when reading from 0:00, which skewed every timestamp.
- New dependency:
webrtcvad-wheels(prebuilt wheels for Linux, macOS and Windows).
Benchmark (three films, real subtitle tracks broken in known ways; full tables in the README):
- Ordinary cases: a tie with ffsubsync.
- Offsets over a minute: suba fixed 11 of 11; ffsubsync got at most 1% of lines right.
- Another film's subtitles: suba refused 5 of 5; ffsubsync wrote a broken file every time.
Install: pip install suba openai-whisper, or docker pull ghcr.io/xy3/suba:0.4.0