suba
Fix subtitle sync with Whisper, because
handgare for cowards.
You downloaded subtitles. The first line pops up during the studio logo. By the third act, characters are reacting to things that haven't happened yet. You've spent 20 minutes in VLC tapping keys and you're 90% sure you made it worse.
Suba rips a minute of audio from a dialogue-heavy part of your video, transcribes it with Whisper, matches the transcription against the subtitle file, and tells you the offset. Then it writes out a corrected SRT so you can stop thinking about this.
Install
You need ffmpeg and uv. Then:
uv tool install git+https://github.com/xy3/suba --with openai-whisper
That's it. One command — no clone, no build step.
Use
suba subs.srt movie.mkv -o fixed.srt
suba <subtitles> <video> -o <output.srt|vtt>
| Flag | What |
|---|---|
-o, --output |
Write corrected SRT/VTT |
-m, --model |
Whisper model (base, small, medium, large) |
-d, --duration |
Audio duration in seconds (default 60) |
-t, --start |
Manual start time in seconds |
--threshold |
Minimum similarity to accept a match (default 0.2) |
How it works
- Finds the densest 60 seconds of subtitles (more lines = more talking, probably)
- Extracts that audio with ffmpeg
- Transcribes it with Whisper
- Slides windows of the transcription over each candidate subtitle line, scoring by text similarity and timestamp proximity
- Shifts all timestamps by the detected offset and writes a fixed SRT
Metadata
Release files for suba 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| suba-0.1.1.tar.gz | 9.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| suba-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.9 kB
Release files / suba-0.1.1.tar.gz
| Download URL | suba-0.1.1.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
877e189082a70c0c86c30b94ec850508e3443ead711823051e6a5374d8ed46f2
|
|
BLAKE2b-256 checksum How to use checksums |
59e973dfb8f454b23cbc548095ed27a02079c639a8dcb215b47cf488d16417c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / suba-0.1.1-py3-none-any.whl
| Download URL | suba-0.1.1-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8797799ce7cbb4e691a63519413942c7d595002cac609f78cb2786f121c4391d
|
|
BLAKE2b-256 checksum How to use checksums |
6f6315de56bb43003afc06a764fcba86b0d580441f2f974f343cd691d8377662
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for suba 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.