mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
Set SubMiner mpv launch defaults and doc naming consistency
This commit is contained in:
@@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
Settings are stored in `$XDG_CONFIG_HOME/SubMiner/config.jsonc` (or `~/.config/SubMiner/config.jsonc` when `XDG_CONFIG_HOME` is unset). For backward compatibility, SubMiner also reads existing configs from lowercase `subminer` directories.
|
Settings are stored in `$XDG_CONFIG_HOME/SubMiner/config.jsonc` (or `~/.config/SubMiner/config.jsonc` when `XDG_CONFIG_HOME` is unset). For backward compatibility, SubMiner also reads existing configs from lowercase `subminer` directories.
|
||||||
|
|
||||||
### Configuration File
|
## Configuration File
|
||||||
|
|
||||||
See [config.example.jsonc](/config.example.jsonc) for a comprehensive example configuration file with all available options, default values, and detailed comments. Only include the options you want to customize in your config file.
|
See [config.example.jsonc](/config.example.jsonc) for a comprehensive example configuration file with all available options, default values, and detailed comments. Only include the options you want to customize in your config file.
|
||||||
|
|
||||||
Generate a fresh default config from the centralized config registry:
|
Generate a fresh default config from the centralized config registry:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
subminer.AppImage --generate-config
|
SubMiner.AppImage --generate-config
|
||||||
subminer.AppImage --generate-config --config-path /tmp/subminer.jsonc
|
SubMiner.AppImage --generate-config --config-path /tmp/subminer.jsonc
|
||||||
subminer.AppImage --generate-config --backup-overwrite
|
SubMiner.AppImage --generate-config --backup-overwrite
|
||||||
```
|
```
|
||||||
|
|
||||||
- `--generate-config` writes a default JSONC config template.
|
- `--generate-config` writes a default JSONC config template.
|
||||||
@@ -22,7 +22,6 @@ subminer.AppImage --generate-config --backup-overwrite
|
|||||||
|
|
||||||
Invalid config values are handled with warn-and-fallback behavior: SubMiner logs the bad key/value and continues with the default for that option.
|
Invalid config values are handled with warn-and-fallback behavior: SubMiner logs the bad key/value and continues with the default for that option.
|
||||||
|
|
||||||
|
|
||||||
### Configuration Options Overview
|
### Configuration Options Overview
|
||||||
|
|
||||||
The configuration file includes several main sections:
|
The configuration file includes several main sections:
|
||||||
@@ -43,7 +42,6 @@ The configuration file includes several main sections:
|
|||||||
- [**WebSocket Server**](#websocket-server) - Built-in subtitle broadcasting server
|
- [**WebSocket Server**](#websocket-server) - Built-in subtitle broadcasting server
|
||||||
- [**YouTube Subtitle Generation**](#youtube-subtitle-generation) - Launcher defaults for yt-dlp + local whisper fallback
|
- [**YouTube Subtitle Generation**](#youtube-subtitle-generation) - Launcher defaults for yt-dlp + local whisper fallback
|
||||||
|
|
||||||
|
|
||||||
### AnkiConnect
|
### AnkiConnect
|
||||||
|
|
||||||
Enable automatic Anki card creation and updates with media generation:
|
Enable automatic Anki card creation and updates with media generation:
|
||||||
@@ -170,8 +168,6 @@ Kiku extends Lapis with **field grouping** — when a duplicate card is detected
|
|||||||
</video>
|
</video>
|
||||||
|
|
||||||
<a :href="'/assets/kiku-integration.webm'" target="_blank" rel="noreferrer">Open demo in a new tab</a>
|
<a :href="'/assets/kiku-integration.webm'" target="_blank" rel="noreferrer">Open demo in a new tab</a>
|
||||||
|
|
||||||
|
|
||||||
| Mode | Behavior |
|
| Mode | Behavior |
|
||||||
| ---------- | -------------------------------------------------------------------------------------------------------------------------- |
|
| ---------- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `auto` | Automatically merges the new card's content into the original; duplicate deletion is controlled by `deleteDuplicateInAuto` |
|
| `auto` | Automatically merges the new card's content into the original; duplicate deletion is controlled by `deleteDuplicateInAuto` |
|
||||||
@@ -211,7 +207,6 @@ To copy multiple lines (current + previous):
|
|||||||
|
|
||||||
These shortcuts are only active when the overlay window is visible. They are automatically disabled when the overlay is hidden to avoid interfering with normal system clipboard operations.
|
These shortcuts are only active when the overlay window is visible. They are automatically disabled when the overlay is hidden to avoid interfering with normal system clipboard operations.
|
||||||
|
|
||||||
|
|
||||||
### Auto-Start Overlay
|
### Auto-Start Overlay
|
||||||
|
|
||||||
Control whether the overlay automatically becomes visible when it connects to mpv:
|
Control whether the overlay automatically becomes visible when it connects to mpv:
|
||||||
@@ -226,7 +221,7 @@ Control whether the overlay automatically becomes visible when it connects to mp
|
|||||||
| -------------------- | --------------- | ------------------------------------------------------ |
|
| -------------------- | --------------- | ------------------------------------------------------ |
|
||||||
| `auto_start_overlay` | `true`, `false` | Auto-show overlay on mpv connection (default: `false`) |
|
| `auto_start_overlay` | `true`, `false` | Auto-show overlay on mpv connection (default: `false`) |
|
||||||
|
|
||||||
The mpv plugin now controls startup per layer via `auto_start_visible_overlay` and `auto_start_invisible_overlay` in `subminer.conf` (`platform-default` for invisible means hidden on Linux, visible on macOS/Windows).
|
The mpv plugin controls startup per layer via `auto_start_visible_overlay` and `auto_start_invisible_overlay` in `subminer.conf` (`platform-default` for invisible means hidden on Linux, visible on macOS/Windows).
|
||||||
|
|
||||||
### Visible Overlay Subtitle Binding
|
### Visible Overlay Subtitle Binding
|
||||||
|
|
||||||
@@ -242,7 +237,6 @@ Control whether toggling the visible overlay also toggles MPV subtitle visibilit
|
|||||||
| --------------------------------------------- | --------------- | ----------- |
|
| --------------------------------------------- | --------------- | ----------- |
|
||||||
| `bind_visible_overlay_to_mpv_sub_visibility` | `true`, `false` | When `true` (default), visible overlay hides MPV primary/secondary subtitles and restores them when hidden. When `false`, visible overlay toggles do not change MPV subtitle visibility. |
|
| `bind_visible_overlay_to_mpv_sub_visibility` | `true`, `false` | When `true` (default), visible overlay hides MPV primary/secondary subtitles and restores them when hidden. When `false`, visible overlay toggles do not change MPV subtitle visibility. |
|
||||||
|
|
||||||
|
|
||||||
### Auto Subtitle Sync
|
### Auto Subtitle Sync
|
||||||
|
|
||||||
Sync the active subtitle track using `alass` (preferred) or `ffsubsync`:
|
Sync the active subtitle track using `alass` (preferred) or `ffsubsync`:
|
||||||
@@ -268,7 +262,6 @@ Sync the active subtitle track using `alass` (preferred) or `ffsubsync`:
|
|||||||
Default trigger is `Ctrl+Alt+S` via `shortcuts.triggerSubsync`.
|
Default trigger is `Ctrl+Alt+S` via `shortcuts.triggerSubsync`.
|
||||||
Customize it there, or set it to `null` to disable.
|
Customize it there, or set it to `null` to disable.
|
||||||
|
|
||||||
|
|
||||||
### Invisible Overlay
|
### Invisible Overlay
|
||||||
|
|
||||||
SubMiner includes a second subtitle mining layer that can be visually invisible while still interactive for Yomitan lookups.
|
SubMiner includes a second subtitle mining layer that can be visually invisible while still interactive for Yomitan lookups.
|
||||||
@@ -285,7 +278,6 @@ Invisible subtitle positioning can be adjusted directly in the invisible layer:
|
|||||||
- Press `Enter` or `Ctrl/Cmd+S` to save, or `Esc` to cancel.
|
- Press `Enter` or `Ctrl/Cmd+S` to save, or `Esc` to cancel.
|
||||||
- This edit-mode shortcut is fixed (not currently configurable in `shortcuts`/`keybindings`).
|
- This edit-mode shortcut is fixed (not currently configurable in `shortcuts`/`keybindings`).
|
||||||
|
|
||||||
|
|
||||||
### Jimaku
|
### Jimaku
|
||||||
|
|
||||||
Configure Jimaku API access and defaults:
|
Configure Jimaku API access and defaults:
|
||||||
@@ -306,7 +298,6 @@ Jimaku is rate limited; if you hit a limit, SubMiner will surface the retry dela
|
|||||||
|
|
||||||
Set `openBrowser` to `false` to only print the URL without opening a browser.
|
Set `openBrowser` to `false` to only print the URL without opening a browser.
|
||||||
|
|
||||||
|
|
||||||
### Keybindings
|
### Keybindings
|
||||||
|
|
||||||
Add a `keybindings` array to configure keyboard shortcuts that send commands to mpv:
|
Add a `keybindings` array to configure keyboard shortcuts that send commands to mpv:
|
||||||
@@ -357,7 +348,6 @@ See `config.example.jsonc` for detailed configuration options and more examples.
|
|||||||
|
|
||||||
**See `config.example.jsonc`** for more keybinding examples and configuration options.
|
**See `config.example.jsonc`** for more keybinding examples and configuration options.
|
||||||
|
|
||||||
|
|
||||||
### Runtime Option Palette
|
### Runtime Option Palette
|
||||||
|
|
||||||
Use the runtime options palette to toggle settings live while SubMiner is running. These changes are session-only and reset on restart.
|
Use the runtime options palette to toggle settings live while SubMiner is running. These changes are session-only and reset on restart.
|
||||||
@@ -376,7 +366,6 @@ Palette controls:
|
|||||||
- `Enter`: apply selected value
|
- `Enter`: apply selected value
|
||||||
- `Esc`: close
|
- `Esc`: close
|
||||||
|
|
||||||
|
|
||||||
### Secondary Subtitles
|
### Secondary Subtitles
|
||||||
|
|
||||||
Display a second subtitle track (e.g., English alongside Japanese) in the overlay:
|
Display a second subtitle track (e.g., English alongside Japanese) in the overlay:
|
||||||
@@ -407,7 +396,6 @@ See `config.example.jsonc` for detailed configuration options.
|
|||||||
|
|
||||||
**See `config.example.jsonc`** for additional secondary subtitle configuration options.
|
**See `config.example.jsonc`** for additional secondary subtitle configuration options.
|
||||||
|
|
||||||
|
|
||||||
### Shortcuts Configuration
|
### Shortcuts Configuration
|
||||||
|
|
||||||
Customize or disable the overlay keyboard shortcuts:
|
Customize or disable the overlay keyboard shortcuts:
|
||||||
@@ -455,7 +443,6 @@ See `config.example.jsonc` for detailed configuration options.
|
|||||||
|
|
||||||
Set any shortcut to `null` to disable it.
|
Set any shortcut to `null` to disable it.
|
||||||
|
|
||||||
|
|
||||||
### Subtitle Position
|
### Subtitle Position
|
||||||
|
|
||||||
Set the initial vertical subtitle position (measured from the bottom of the screen):
|
Set the initial vertical subtitle position (measured from the bottom of the screen):
|
||||||
@@ -472,7 +459,6 @@ Set the initial vertical subtitle position (measured from the bottom of the scre
|
|||||||
| ---------- | --------------- | ------------------------------------------------------------------ |
|
| ---------- | --------------- | ------------------------------------------------------------------ |
|
||||||
| `yPercent` | number (0 - 100) | Distance from the bottom as a percent of screen height (default: `10`) |
|
| `yPercent` | number (0 - 100) | Distance from the bottom as a percent of screen height (default: `10`) |
|
||||||
|
|
||||||
|
|
||||||
### Subtitle Style
|
### Subtitle Style
|
||||||
|
|
||||||
Customize the appearance of primary and secondary subtitles:
|
Customize the appearance of primary and secondary subtitles:
|
||||||
@@ -511,7 +497,6 @@ Secondary subtitle defaults: `fontSize: 24`, `fontColor: "#ffffff"`, `background
|
|||||||
|
|
||||||
**See `config.example.jsonc`** for the complete list of subtitle style configuration options.
|
**See `config.example.jsonc`** for the complete list of subtitle style configuration options.
|
||||||
|
|
||||||
|
|
||||||
### Texthooker
|
### Texthooker
|
||||||
|
|
||||||
Control whether the browser opens automatically when texthooker starts:
|
Control whether the browser opens automatically when texthooker starts:
|
||||||
@@ -526,7 +511,6 @@ See `config.example.jsonc` for detailed configuration options.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### WebSocket Server
|
### WebSocket Server
|
||||||
|
|
||||||
The overlay includes a built-in WebSocket server that broadcasts subtitle text to connected clients (such as texthooker-ui) for external processing.
|
The overlay includes a built-in WebSocket server that broadcasts subtitle text to connected clients (such as texthooker-ui) for external processing.
|
||||||
@@ -549,7 +533,6 @@ See `config.example.jsonc` for detailed configuration options.
|
|||||||
| `enabled` | `true`, `false`, `"auto"` | `"auto"` (default) disables if mpv_websocket is detected |
|
| `enabled` | `true`, `false`, `"auto"` | `"auto"` (default) disables if mpv_websocket is detected |
|
||||||
| `port` | number | WebSocket server port (default: 6677) |
|
| `port` | number | WebSocket server port (default: 6677) |
|
||||||
|
|
||||||
|
|
||||||
### YouTube Subtitle Generation
|
### YouTube Subtitle Generation
|
||||||
|
|
||||||
Set defaults used by the `subminer` launcher for YouTube subtitle extraction/transcription:
|
Set defaults used by the `subminer` launcher for YouTube subtitle extraction/transcription:
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
# Requirements
|
# Installation
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
@@ -25,23 +27,21 @@
|
|||||||
- yt-dlp (recommended for reliable YouTube playback/subtitles in mpv)
|
- yt-dlp (recommended for reliable YouTube playback/subtitles in mpv)
|
||||||
- bun (required to run the `subminer` wrapper script from source/local installs)
|
- bun (required to run the `subminer` wrapper script from source/local installs)
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### From AppImage (Recommended)
|
### From AppImage (Recommended)
|
||||||
|
|
||||||
Download the latest AppImage from GitHub Releases:
|
Download the latest AppImage from [GitHub Releases](https://github.com/ksyasuda/SubMiner/releases/latest):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Download and install AppImage
|
# Download and install AppImage
|
||||||
wget https://github.com/sudacode/subminer/releases/download/v1.0.0/subminer-1.0.0.AppImage -O ~/.local/bin/subminer.AppImage
|
wget https://github.com/ksyasuda/SubMiner/releases/download/v0.1.0/SubMiner-0.1.0.AppImage -O ~/.local/bin/SubMiner.AppImage
|
||||||
chmod +x ~/.local/bin/subminer.AppImage
|
chmod +x ~/.local/bin/SubMiner.AppImage
|
||||||
|
|
||||||
# Download subminer wrapper script
|
# Download subminer wrapper script
|
||||||
wget https://github.com/sudacode/subminer/releases/download/v1.0.0/subminer -O ~/.local/bin/subminer
|
wget https://github.com/ksyasuda/SubMiner/releases/download/v0.1.0/subminer -O ~/.local/bin/subminer
|
||||||
chmod +x ~/.local/bin/subminer
|
chmod +x ~/.local/bin/subminer
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: the `subminer` wrapper uses a Bun shebang (`#!/usr/bin/env bun`), so `bun` must be installed and available on `PATH`.
|
Note: the `subminer` wrapper uses a Bun shebang (`#!/usr/bin/env bun`), so [Bun](https://bun.sh) must be installed and available on `PATH`.
|
||||||
|
|
||||||
### macOS Installation
|
### macOS Installation
|
||||||
|
|
||||||
@@ -57,8 +57,8 @@ brew install mpv mecab mecab-ipadic
|
|||||||
Build from source:
|
Build from source:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/sudacode/subminer.git
|
git clone https://github.com/ksyasuda/SubMiner.git
|
||||||
cd subminer
|
cd SubMiner
|
||||||
pnpm install
|
pnpm install
|
||||||
cd vendor/texthooker-ui && pnpm install && pnpm build && cd ../..
|
cd vendor/texthooker-ui && pnpm install && pnpm build && cd ../..
|
||||||
pnpm run build:mac
|
pnpm run build:mac
|
||||||
@@ -100,8 +100,8 @@ Set these GitHub Actions secrets before creating a release tag:
|
|||||||
### From Source
|
### From Source
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/sudacode/subminer.git
|
git clone https://github.com/ksyasuda/SubMiner.git
|
||||||
cd subminer
|
cd SubMiner
|
||||||
make build
|
make build
|
||||||
|
|
||||||
# Install platform artifacts
|
# Install platform artifacts
|
||||||
@@ -227,8 +227,8 @@ The plugin auto-detects the binary location, searching:
|
|||||||
- `C:\Program Files\subminer\subminer.exe`
|
- `C:\Program Files\subminer\subminer.exe`
|
||||||
- `C:\Program Files (x86)\subminer\subminer.exe`
|
- `C:\Program Files (x86)\subminer\subminer.exe`
|
||||||
- `C:\subminer\subminer.exe`
|
- `C:\subminer\subminer.exe`
|
||||||
- `~/.local/bin/subminer.AppImage`
|
- `~/.local/bin/SubMiner.AppImage`
|
||||||
- `/opt/subminer/subminer.AppImage`
|
- `/opt/SubMiner/SubMiner.AppImage`
|
||||||
- `/usr/local/bin/subminer`
|
- `/usr/local/bin/subminer`
|
||||||
- `/usr/bin/subminer`
|
- `/usr/bin/subminer`
|
||||||
|
|
||||||
|
|||||||
@@ -31,22 +31,32 @@ subminer -p gpu-hq video.mkv # Override mpv profile
|
|||||||
subminer --yt-subgen-mode preprocess --whisper-bin /path/to/whisper-cli --whisper-model /path/to/model.bin https://youtu.be/... # Pre-generate subtitle tracks before playback
|
subminer --yt-subgen-mode preprocess --whisper-bin /path/to/whisper-cli --whisper-model /path/to/model.bin https://youtu.be/... # Pre-generate subtitle tracks before playback
|
||||||
|
|
||||||
# Direct AppImage control
|
# Direct AppImage control
|
||||||
subminer.AppImage --start --texthooker # Start overlay with texthooker
|
SubMiner.AppImage --start --texthooker # Start overlay with texthooker
|
||||||
subminer.AppImage --texthooker # Launch texthooker only (no overlay window)
|
SubMiner.AppImage --texthooker # Launch texthooker only (no overlay window)
|
||||||
subminer.AppImage --stop # Stop overlay
|
SubMiner.AppImage --stop # Stop overlay
|
||||||
subminer.AppImage --start --toggle # Start MPV IPC + toggle visibility
|
SubMiner.AppImage --start --toggle # Start MPV IPC + toggle visibility
|
||||||
subminer.AppImage --start --toggle-invisible-overlay # Start MPV IPC + toggle invisible layer
|
SubMiner.AppImage --start --toggle-invisible-overlay # Start MPV IPC + toggle invisible layer
|
||||||
subminer.AppImage --show-visible-overlay # Force show visible overlay
|
SubMiner.AppImage --show-visible-overlay # Force show visible overlay
|
||||||
subminer.AppImage --hide-visible-overlay # Force hide visible overlay
|
SubMiner.AppImage --hide-visible-overlay # Force hide visible overlay
|
||||||
subminer.AppImage --show-invisible-overlay # Force show invisible overlay
|
SubMiner.AppImage --show-invisible-overlay # Force show invisible overlay
|
||||||
subminer.AppImage --hide-invisible-overlay # Force hide invisible overlay
|
SubMiner.AppImage --hide-invisible-overlay # Force hide invisible overlay
|
||||||
subminer.AppImage --settings # Open Yomitan settings
|
SubMiner.AppImage --settings # Open Yomitan settings
|
||||||
subminer.AppImage --help # Show all options
|
SubMiner.AppImage --help # Show all options
|
||||||
```
|
```
|
||||||
|
|
||||||
### MPV Profile Example (mpv.conf)
|
### MPV Profile Example (mpv.conf)
|
||||||
|
|
||||||
Add a profile to `~/.config/mpv/mpv.conf`; `subminer` now launches mpv with `--profile=subminer` by default (or override with `subminer -p <profile> ...`):
|
`subminer` passes the following MPV options directly on launch by default:
|
||||||
|
|
||||||
|
- `--input-ipc-server=/tmp/subminer-socket` (or your configured socket path)
|
||||||
|
- `--slang=ja,jpn,en,eng`
|
||||||
|
- `--sub-auto=fuzzy`
|
||||||
|
- `--sub-file-paths=.;subs;subtitles`
|
||||||
|
- `--sid=auto`
|
||||||
|
- `--secondary-sid=auto`
|
||||||
|
- `--secondary-sub-visibility=no`
|
||||||
|
|
||||||
|
You can define a matching profile in `~/.config/mpv/mpv.conf` for consistency when launching `mpv` manually or from other tools. `subminer` launches with `--profile=subminer` by default (or override with `subminer -p <profile> ...`):
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[subminer]
|
[subminer]
|
||||||
|
|||||||
9
subminer
9
subminer
@@ -46,6 +46,14 @@ const DEFAULT_YOUTUBE_SUBGEN_OUT_DIR = path.join(
|
|||||||
"youtube-subs",
|
"youtube-subs",
|
||||||
);
|
);
|
||||||
const DEFAULT_YOUTUBE_YTDL_FORMAT = "bestvideo*+bestaudio/best";
|
const DEFAULT_YOUTUBE_YTDL_FORMAT = "bestvideo*+bestaudio/best";
|
||||||
|
const DEFAULT_MPV_SUBMINER_ARGS = [
|
||||||
|
"--sub-auto=fuzzy",
|
||||||
|
"--sub-file-paths=.;subs;subtitles",
|
||||||
|
"--sid=auto",
|
||||||
|
"--secondary-sid=auto",
|
||||||
|
"--secondary-sub-visibility=no",
|
||||||
|
"--slang=ja,jpn,en,eng",
|
||||||
|
] as const;
|
||||||
|
|
||||||
type LogLevel = "debug" | "info" | "warn" | "error";
|
type LogLevel = "debug" | "info" | "warn" | "error";
|
||||||
type YoutubeSubgenMode = "automatic" | "preprocess" | "off";
|
type YoutubeSubgenMode = "automatic" | "preprocess" | "off";
|
||||||
@@ -1723,6 +1731,7 @@ function startMpv(
|
|||||||
|
|
||||||
const mpvArgs: string[] = [];
|
const mpvArgs: string[] = [];
|
||||||
if (args.profile) mpvArgs.push(`--profile=${args.profile}`);
|
if (args.profile) mpvArgs.push(`--profile=${args.profile}`);
|
||||||
|
mpvArgs.push(...DEFAULT_MPV_SUBMINER_ARGS);
|
||||||
|
|
||||||
if (targetKind === "url" && isYoutubeTarget(target)) {
|
if (targetKind === "url" && isYoutubeTarget(target)) {
|
||||||
const subtitleLangs = uniqueNormalizedLangCodes([
|
const subtitleLangs = uniqueNormalizedLangCodes([
|
||||||
|
|||||||
Reference in New Issue
Block a user