Repository navigation
Releases
v0.6.0: feature films 3x faster, no more ffmpeg hangs
Feature films now sync in about a third of the time, and ffmpeg can no longer hang a batch run.
- About three times faster on feature films. Decoding the soundtrack was nearly all of suba's run time, and ffmpeg does it on one core. suba now decodes the film in several stretches at once and joins them exactly where they belong. On the benchmark the median 2-hour film went from 63 s to 22 s, and the 12-minute film from 15 s to 9 s. Every case kept its result.
--jobs Nsets how many ffmpeg processes run at once (default: your cores, up to 8; on a spinning hard disk, 1 may be faster). - No decoding twice. When suba switches to speech timing partway through (a different language, a recut, or Whisper unsure), it reuses the audio it already has. A recut feature film went from 152 s to 47 s.
- ffmpeg can no longer hang suba (#1). On some files ffmpeg reaches the very end of the audio and then keeps running without producing anything more, which stopped a batch run for good. suba now stops it after 120 s without new audio and carries on with what it read: in the reported cases that was 99.9% of the film, so those files now sync. If ffmpeg produced no audio at all, suba exits with an error and batch mode moves on, leaving the subtitle untouched.
--ffmpeg-timeout SECONDSsets the limit (0waits forever). ffmpeg and ffprobe no longer read from stdin, which can cause trouble when suba runs in the background on Windows. - Sturdier recut detection. On a recut, suba's two speech detectors can score almost exactly alike, and the cut only showed on one of them. Before refusing, suba now looks for the cut with both. Each cut still has to hold up on both sides of it, so subtitles from another film are still refused.
- Benchmark against lapse. lapse joins ffsubsync and alass in the comparison, and the README now shows a summary table. See How it compares.
v0.5.0: recut releases
suba now handles recut releases: subtitles from a version of the film with a scene added or removed.
- Recut releases. A show re-released for streaming loses a scene to music rights; a director's cut gains one. Subtitles for the other release are right until that point and wrong after it. suba now looks across the whole film for the point where the offset jumps, and shifts each side on its own:
On five recut cases built from real tracks (Tears of Steel, Charade), suba got every line within half a second. ffsubsync can only shift the whole file and got none fully right; alass got one. A cut only counts if each side, aligned on its own, clearly confirms its offset, so another film's subtitles still get refused. It finds up to three cuts. Lines for footage the video doesn't have are left out, and suba says how many.
cut found at 01:00:04.565: +7.070 s before it, +37.001 s after it - Benchmark now includes alass (2.0.0, default settings) alongside ffsubsync. See How it compares.
Behaviour changes
Cut detection is on by default. On files with one offset nothing changes: every existing benchmark case gave the same result as in 0.4.1, and on all 14 untouched official tracks suba found no cut. Two new checks can make suba refuse (exit 1) a file it used to sync:
- part of the film clearly fits a different offset, but no clean cut explains it;
- Whisper's word match fits the minute it heard, but not the film as a whole, and speech timing over the whole film can't settle it either.
In both cases the old output would have been wrong for part of the film. --no-cuts restores 0.4.1's behaviour.
v0.4.1: runs without Whisper (fits in Bazarr's container)
suba now runs without Whisper, so it fits inside Bazarr's container.
- No Whisper, no problem. If openai-whisper isn't installed, suba aligns same-language subtitles on speech timing instead of stopping. On the benchmark's same-language cases without Whisper, it fixed all 8 at the same precision and refused all 3 wrong-film subtitles.
pip install subais now a complete install (numpy and a small voice detector, no PyTorch). Whisper still adds a second check on the words when present. - Bazarr in Docker. linuxserver's Bazarr image already has everything suba needs. Add two environment variables and restart:
Then use the post-processing command from the README.
- DOCKER_MODS=linuxserver/mods:universal-package-install - INSTALL_PIP_PACKAGES=suba
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