Crates.io | submerger |
lib.rs | submerger |
version | 0.1.2 |
source | src |
created_at | 2024-09-20 14:25:34.71476 |
updated_at | 2024-09-20 14:25:34.71476 |
description | Submerger combines subtitles from two files into one, with customizable position and color settings |
homepage | |
repository | https://github.com/rasmus-kirk/submerger.git |
max_upload_size | |
id | 1381295 |
size | 45,405 |
Submerger is a simple tool designed to merge subtitles from two different files into a single output file. It's especially useful for language learners who want to watch content with subtitles in multiple languages simultaneously.
The tool offers two main functionalities: Direct merging of two subtitle files for quick, one-time use, and a more advanced recursive search feature that scans entire directories for subtitle files matching specific language preferences.
.srt
and .vtt
subtitle formats for inputs, only outputs
.srt
however.To install using cargo:
cargo install submerger
One way to build this project is using Rust.
Clone the repository:
git clone https://github.com/rasmus-kirk/submerger.git
cd submerger
Build the project:
cargo build --release
nix profile install github:rasmus-kirk/submerger
This project has a nix flake, so it can be built using nix:
nix build github:rasmus-kirk/submerger
If you just wish to run the program using nix:
nix run github:rasmus-kirk/submerger -- --help
To enter a developement shell with the correct rust-toolchain and rust analyzer using nix:
nix develop github:rasmus-kirk/submerger
If you use a shell other than bash:
nix develop github:rasmus-kirk/submerger -c $SHELL
You can either merge two files directly or recursively search a directory for matching subtitle pairs.
Merge two subtitle files into a single output:
submerger simple [OPTIONS] <SUB1> <SUB2> <OUT>
Required:
<SUB1>
: Path to the first subtitle file<SUB2>
: Path to the first subtitle file<OUT>
: Output file where the merged subtitles will be savedOptional:
--color <COLOR>
Sets the color for the second subtitle track--position <POSITION>
Sets the position of the second subtitle track (default: top-center)--log-level <LOG_LEVEL>
Sets the level of logging [default: warn] [possible values: error, warn, info, debug, trace]--help
Print helpsubmerger simple movie.en.srt movie.ja.srt --out merged.srt --color "#fbf1c7" --position top-center
Search a directory for subtitle files matching given language codes and merge them:
submerger recursive [OPTIONS] <SUB1_LANG> <SUB2_LANG> <PATH>
Required:
<SUB1_LANG>
: Language code for the first subtitle file (e.g., en
for English)<SUB2_LANG>
: Language code for the second subtitle file (e.g., ja
for Japanese)<PATH>
: Root directory to recursively search for subtitle filesOptional:
--out-ext <OUT_EXT>
: The file extension for the output file (e.g. file.en.srt
-> file.merged.srt
if set to merged.srt
) (Default: srt
)--vtt
: Also match and convert VTT files. Note, this will not output VTT files, only SRT is supported as output (Default: true
)--color <COLOR>
: Sets the color for the second subtitle track--position <POSITION>
: Sets the position of the second subtitle track (Default: top-center
)--log-level <LOG_LEVEL>
: Sets the level of logging (Default: warn
)en
, ja
).en.hi
), they will be
preferred only if normal subtitles (en
) aren't available.ORIGINAL_FILE_NAME.OUT_EXTENSION$
in the directory where
the matching subs were found.submerger recursive en ja ./movies --color "#fbf1c7" --position top-center
This project is licensed under the MIT License. See the LICENSE file for details.