feat(subsync): integrate built-in automatic subtitle syncing

This commit is contained in:
sudacode committed 2026-11-25 19:47:56 -08:00
1 parent 926e6b047e
commit 05bdb64880
44 files changed
+6498 -135

No files matched your search

+9 -8
View File
@@ -521,16 +521,17 @@ Transcribes Japanese subtitles locally with whisper.cpp. Open it with `Ctrl+Shif
### Subtitle sync
Retimes a subtitle track with [`alass`](https://github.com/kaegi/alass) (against another subtitle or the video) or [`ffsubsync`](https://github.com/smacke/ffsubsync) (against the video's audio). Install them yourself. Open the picker with `Ctrl+Alt+S` (`shortcuts.triggerSubsync`).
Built-in alass-based subtitle alignment works out of the box with no extra sync binary required. Press `Ctrl+Alt+S` (`shortcuts.triggerSubsync`) or click **Sync** in the [subtitle sidebar](/subtitle-sidebar) to sync automatically: SubMiner inspects loaded, embedded, and sidecar subtitle tracks, strips signs and songs, checks reference alignment against the video's audio (falling back to built-in speech detection when no aligned reference subtitle is available), and opens the guided modal whenever it cannot finish cleanly on its own.
| Key | Default | What it does |
| ------------------------ | ------- | ------------------------------------------------------------------- |
| `subsync.alass_path` | `""` | `alass` path. Empty uses `/usr/bin/alass` |
| `subsync.ffsubsync_path` | `""` | `ffsubsync` path. Empty uses `/usr/bin/ffsubsync` |
| `subsync.ffmpeg_path` | `""` | `ffmpeg` path. Empty uses `/usr/bin/ffmpeg` |
| `subsync.replace` | `true` | Overwrite the subtitle file. When off, write `<name>_retimed.<ext>` |
Optional external [`alass`](https://github.com/kaegi/alass) and [`ffsubsync`](https://github.com/smacke/ffsubsync) binaries are also supported in the guided modal when installed.
If a tool lives somewhere else, such as on macOS or Windows, set its path.
| Key | Default | What it does |
| ------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------- |
| `subsync.mode` | `"auto"` | `"auto"` syncs immediately and opens the guided modal only when needed; `"manual"` always opens the modal |
| `subsync.alass_path` | `""` | Optional external `alass` path. Empty auto-discovers from `PATH` |
| `subsync.ffsubsync_path` | `""` | Optional external `ffsubsync` path. Empty auto-discovers from `PATH` |
| `subsync.ffmpeg_path` | `""` | `ffmpeg` path used to extract embedded tracks and audio speech. Empty auto-discovers from `PATH` |
| `subsync.replace` | `true` | Overwrite the subtitle file. When off, write `<name>_retimed.<ext>` |
### AniList
+1 -1
View File
@@ -66,7 +66,7 @@ features:
src: /assets/subtitle-download.svg
alt: Subtitle download icon
title: Subtitle download and sync
details: Search Jimaku or TsukiHime and download a track, then retime it with alass or ffsubsync. Both run from the overlay.
details: Search Jimaku or TsukiHime and download a track, then sync it automatically with SubMiner's built-in alass-based aligner and speech fallback (or optional external alass/ffsubsync). Both run from the overlay.
link: /jimaku-integration
linkText: Jimaku integration
- icon:
+2 -2
View File
@@ -18,12 +18,12 @@ Only mpv is required. Install ffmpeg too unless you are fine with cards that hav
| ------------------------ | -------------------------------------------------------------------------------------------------------------------- | ------------ |
| mpv | Required. The player SubMiner draws over. | All |
| fuse2 | Required to run the AppImage. | Linux |
| ffmpeg | Recommended. Audio clips and screenshots on cards. Without it those fields stay empty. | All |
| ffmpeg | Recommended. Audio clips and screenshots on cards, plus embedded subtitle extraction and built-in audio subtitle sync/verification. | All |
| MeCab + mecab-ipadic | Recommended. More accurate N+1, JLPT, and frequency highlighting. | All |
| yt-dlp | YouTube playback. | All |
| xz | [TsukiHime](/tsukihime-integration) subtitle downloads. Most Linux distros already have it. | All |
| guessit | Better title, season, and episode detection for [AniSkip](/aniskip-integration) and [AniList](/anilist-integration). | All |
| alass or ffsubsync | Subtitle syncing. You need at least one to use it. | All |
| alass or ffsubsync | Optional external subtitle sync engines. SubMiner includes built-in alass-based syncing and speech detection. | All |
| fzf, rofi | The file pickers in the `subminer` command (rofi is Linux only). | Linux, macOS |
| chafa, ffmpegthumbnailer | Thumbnail previews in the pickers. | Linux, macOS |
+1
View File
@@ -730,6 +730,7 @@
// Hot-reload: subsync changes apply to the next subtitle sync run.
// ==========================================
"subsync": {
"mode": "auto", // Automatic subtitle sync mode ("auto" syncs immediately and opens the guided modal only when needed; "manual" always opens the modal). Values: auto | manual
"alass_path": "", // Optional absolute path to the alass binary used by subsync. Leave empty to auto-discover from PATH.
"ffsubsync_path": "", // Optional absolute path to the ffsubsync binary used by subsync. Leave empty to auto-discover from PATH.
"ffmpeg_path": "", // Optional absolute path to the ffmpeg binary used by subsync. Leave empty to auto-discover from PATH.
+1 -1
View File
@@ -81,7 +81,7 @@ Built into the overlay, not configurable:
| `Ctrl+Shift+J` | Open Jimaku subtitle search | `shortcuts.openJimaku` |
| `Ctrl+Shift+T` | Open TsukiHime subtitle search | `shortcuts.openTsukihime` |
| `Ctrl+Shift+G` | Open Japanese subtitle generation | `shortcuts.openSubtitleGeneration` |
| `Ctrl+Alt+S` | Open subtitle sync (subsync) | `shortcuts.triggerSubsync` |
| `Ctrl+Alt+S` | Sync active subtitle automatically (guided modal on fallback) | `shortcuts.triggerSubsync` |
| `g` then `s` | Pick primary and secondary subtitles (when enabled) | `shortcuts.openSubtitleSelection` |
| `\` | Toggle subtitle sidebar | `subtitleSidebar.toggleKey` |
| `` ` `` | Toggle stats overlay | `stats.toggleKey` |
+1
View File
@@ -7,6 +7,7 @@ The subtitle sidebar lists every line of the current subtitle file in a scrollab
Press `\` to open or close it. The sidebar is on by default. Set `subtitleSidebar.enabled` to `false` to turn it off, or `subtitleSidebar.autoOpen` to `true` to open it at startup.
- Click a line to seek to it. With a line focused from the keyboard, `Enter` seeks to it.
- Click **Sync** in the sidebar header to automatically sync the active subtitle track (`Shift+click` opens the guided sync modal directly).
- The current line is highlighted and kept in view as playback moves (`autoScroll`).
- Hovering the list pauses playback (`pauseVideoOnHover`).
- Switching media or subtitle track updates the list.
+9 -7
View File
@@ -144,18 +144,20 @@ Audio clips and screenshots need FFmpeg. Without it, cards are still created wit
## Subtitle sync (subsync)
Subtitle sync needs at least one of alass or ffsubsync. Neither ships with SubMiner.
SubMiner includes a built-in alass-based aligner and speech-activity fallback (using `ffmpeg`, or Silero VAD if configured for [subtitle generation](/subtitle-generation)), so external `alass` and `ffsubsync` are optional.
**"Configured alass executable not found"**: install it (`paru -S alass` or `cargo install alass-cli`), or set `subsync.alass_path`.
**Automatic sync opens the guided modal instead of applying immediately**:
**"Configured ffsubsync executable not found"**: install it (`paru -S python-ffsubsync` or `pip install ffsubsync`), or set `subsync.ffsubsync_path`.
- SubMiner pauses for guidance when confidence is low (for example, a mismatched episode), when a reference subtitle track is itself misaligned with the audio and audio-only alignment is uncertain, or when a remote stream has no usable reference track.
- In the guided modal you can switch to another embedded/sidecar track, browse for a local reference subtitle file, switch to built-in video audio speech detection, toggle **Ignore signs & songs** or **Allow scene cuts & ad-break splits**, try external `alass`/`ffsubsync`, or apply a **Manual offset**.
**"Configured alass executable not found"** / **"Configured ffsubsync executable not found"**: only applies when selecting the optional external engines. Install them (`paru -S alass`, `cargo install alass-cli`, or `pip install ffsubsync`), set `subsync.alass_path` / `subsync.ffsubsync_path`, or use the **Built-in (alass)** engine.
**"alass synchronization failed" / "ffsubsync synchronization failed"**:
- alass needs a reference: a second subtitle track or the local video file. It cannot use the track being retimed.
- `ffmpeg` must be installed to extract internal subtitle tracks.
- ffsubsync only works on local files, not streams.
- Run the tool by hand to see its full error output.
- `ffmpeg` must be installed to extract internal subtitle tracks or run audio-based sync/verification.
- Audio-based sync and `ffsubsync` require a local video file, not a remote stream URL.
- Run the external tool by hand to see its full error output if you are using an external engine.
## "xz binary not found"