{"id":13580553,"url":"https://github.com/kaegi/alass","last_synced_at":"2025-05-15T07:04:27.125Z","repository":{"id":47776511,"uuid":"82329341","full_name":"kaegi/alass","owner":"kaegi","description":"\"Automatic Language-Agnostic Subtitle Synchronization\"","archived":false,"fork":false,"pushed_at":"2023-12-28T02:07:02.000Z","size":4053,"stargazers_count":1165,"open_issues_count":35,"forks_count":58,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-14T16:57:18.038Z","etag":null,"topics":["algorithm","alignment","api","incorrect-subtitles","subtitle","tool"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaegi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-17T19:09:42.000Z","updated_at":"2025-05-11T22:11:51.000Z","dependencies_parsed_at":"2024-12-06T13:02:55.521Z","dependency_job_id":"f702d9b3-4af6-490e-8873-ffd378346153","html_url":"https://github.com/kaegi/alass","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":"0.020000000000000018","last_synced_commit":"874f02d9577182752a0f969b6d6b98fd65bdf1fc"},"previous_names":["kaegi/aligner"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaegi%2Falass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaegi%2Falass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaegi%2Falass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaegi%2Falass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaegi","download_url":"https://codeload.github.com/kaegi/alass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292039,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","alignment","api","incorrect-subtitles","subtitle","tool"],"created_at":"2024-08-01T15:01:52.993Z","updated_at":"2025-05-15T07:04:22.091Z","avatar_url":"https://github.com/kaegi.png","language":"Rust","funding_links":[],"categories":["HarmonyOS","Rust"],"sub_categories":["Windows Manager"],"readme":"# Introduction\n\n`alass` is a command line tool to synchronize subtitles to movies.\n\nIt can automatically correct\n\n - constant offsets\n - splits due to advertisement breaks, directors cut, ...\n - different framerates\n\nThe alignment process is not only fast and\naccurate, but also language-agnostic. This means\nyou can align subtitles to movies in different\nlanguages.\n\n`alass` stands for  \"Automatic Language-Agnostic Subtitle Synchronization\". The theory and algorithms\nare documented in my [bachelor's thesis](documentation/thesis.pdf)\nand summarized in my [bachelor's presentation](documentation/slides.pdf).\n\n\n## Executable for Windows (64-bit)\n\nGet the latest executable from [here](https://github.com/kaegi/alass/releases)! Just download and extract the archive. The file `alass.bat` is the command line tool.\n\n## Executable for Linux (64-bit)\n\nGet the latest executable from [here](https://github.com/kaegi/alass/releases)! To run the executable, `ffmpeg` and\n`ffprobe` have to be installed.\nYou can change their paths with the environment variables\n`ALASS_FFMPEG_PATH` (default `ffmpeg`) and `ALASS_FFPROBE_PATH` (default `ffprobe`). \n\n## Usage\n\nThe most basic command is:\n\n```bash\n$ alass movie.mp4 incorrect_subtitle.srt output.srt\n```\n\nYou can also use `alass` to align the incorrect subtitle to a different subtitle:\n\n```bash\n$ alass reference_subtitle.ssa incorrect_subtitle.srt output.srt\n```\n\nYou can additionally adjust how much the algorithm tries to avoid introducing or removing a break:\n\n```bash\n# split-penalty is a value between 0 and 1000 (default 7)\n$ alass reference_subtitle.ssa incorrect_subtitle.srt output.srt --split-penalty 10\n```\n\nValues between 5 and 20 are the most useful. Anything above 20 misses some important splits and anything below 5 introduces many unnecessary splits.\n\nIf you only want to shift the subtitle, without introducing splits, you can use `--no-splits`:\n\n```bash\n# synchronizing the subtitles in this mode is very fast\n$ alass movie.mp4 incorrect_subtitle.srt output.srt --no-splits\n```\n\nCurrently supported are `.srt`, `.ssa`/`.ass` and `.idx` files. Every common video format is supported for the reference file.\n\n\n## Performance and Results\n\nThe extraction of the audio from a video takes about 10 to 20 seconds. Computing the alignment usually takes between 5 and 10 seconds.\n\nThe alignment is usually perfect -\nthe percentage of \"good subtitles\" is about 88% to 98%, depending on how strict you classify a \"good subtitle\".\nDownloading random subtitles\nfrom `OpenSubtitles.org` had an error rate of about 50%\n(sample size N=118).\nOf all subtitle _lines_ (not subtitle files) in the tested database,\nafter synchronization\n\n - 50% were within 50ms of target position\n - 80% were within 100ms of target position\n - 90% were within 400ms of target position\n - 95% were within 800ms of target position\n\ncompared to a (possibly not perfect) reference subtitle.\n\n## How to compile the binary\n\nInstall [Rust and Cargo](https://www.rust-lang.org/en-US/install.html) then run:\n\n```bash\n# this will create the lastest release in ~/.cargo/bin/alass-cli\n$ cargo install alass-cli\n```\n\n\nThe voice-activity module this project uses is written in C. Therefore a C compiler (`gcc` or `clang`) is needed to compile this project.\n\nTo use `alass-cli` with video files, `ffmpeg` and `ffprobe` have to be installed. It is used to extract the raw audio data. You can set the paths used by `alass` using the environment variables `ALASS_FFMPEG_PATH` (default `ffmpeg`) and `ALASS_FFPROBE_PATH` (default `ffprobe`). \n\n### Building from Source \n\nIf you want to build and run the project from source code:\n\n```bash\n$ git clone https://github.com/kaegi/alass\n$ cd alass\n$ cargo build\n$ cargo run -- movie.mp4 input.srt output.srt\n```\n\n### Configuration\n\nAll parameters are shown for `cargo build` can also be used for `cargo install` and `cargo run`.\n\n#### FFmpeg as a library\n\nYou can also link `ffmpeg` as a dynamic library during compile time. The library implementation can extract the audio about 2 to 3 seconds faster. Unfortunately it is harder to compile, the error handling is only very basic and might still have bugs.\n\nYou have to remove \"`# FFMPEG-LIB`\" from every line that starts with it in `alass-cli/Cargo.toml`. Then use:\n\n```bash\n# Important: you have to be inside `alass-cli`! Otherwise the parameters get ignored.\n$ cargo build --no-default-features --features ffmpeg-library\n```\n\n\n### Alias Setup\n\n*For Linux users:* It is recommended to add the folder path to your system path as well as setup an alias for `alass` to `alass-cli`. Add this to your `~/.bashrc` (or the setup file of your favorite shell):\n\n```bash\nexport PATH=\"$PATH:$HOME/.cargo/bin\"\nalias alass=\"alass-cli\"\n```\n\n## Folder structure\n\nThis `cargo` workspace contains two projects:\n\n  - `alass-core` which provides the algorithm\n  \n    It is targeted at *developers* who want to use the same algorithm in their project.\n\n  - `alass-cli` which is the official command line tool\n\n    It is target at *end users* who want to correct their subtitles.\n\n## Library Documentation\n\n[Open README](./alass-core/README.md) from `alass-core`.\n\n## Notes\n\nThis program was called `aligner` in the past. This made it nearly impossible to find on a search engine, so `alass` was chosen instead.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaegi%2Falass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaegi%2Falass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaegi%2Falass/lists"}