{"id":13648218,"url":"https://github.com/baxtree/subaligner","last_synced_at":"2026-01-21T01:39:18.857Z","repository":{"id":36910798,"uuid":"228440472","full_name":"baxtree/subaligner","owner":"baxtree","description":"Automatically synchronize and translate subtitles, or create new ones by transcribing, using pre-trained DNNs, Forced Alignments and Transformers. https://subaligner.readthedocs.io/","archived":false,"fork":false,"pushed_at":"2025-10-22T19:29:41.000Z","size":107814,"stargazers_count":493,"open_issues_count":2,"forks_count":20,"subscribers_count":14,"default_branch":"master","last_synced_at":"2026-01-12T16:36:38.470Z","etag":null,"topics":["advanced-substation-alpha","alignment","captions","ebu-stl","microdvd","mpl2","sami","sbv","scc","subrip","substation-alpha","subtitle-conversion","subtitle-synchronization","subtitle-translation","subtitles","tmp","transcription","ttml","voice-activity-detection","webvtt"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/baxtree/subaligner","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baxtree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-16T17:34:23.000Z","updated_at":"2026-01-11T15:31:28.000Z","dependencies_parsed_at":"2024-05-10T19:41:27.121Z","dependency_job_id":"0b7a01cb-1399-45a8-80f8-8ed550cc1c81","html_url":"https://github.com/baxtree/subaligner","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/baxtree/subaligner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxtree%2Fsubaligner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxtree%2Fsubaligner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxtree%2Fsubaligner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxtree%2Fsubaligner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baxtree","download_url":"https://codeload.github.com/baxtree/subaligner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baxtree%2Fsubaligner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28622036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"ssl_error","status_checked_at":"2026-01-20T23:47:29.996Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["advanced-substation-alpha","alignment","captions","ebu-stl","microdvd","mpl2","sami","sbv","scc","subrip","substation-alpha","subtitle-conversion","subtitle-synchronization","subtitle-translation","subtitles","tmp","transcription","ttml","voice-activity-detection","webvtt"],"created_at":"2024-08-02T01:04:03.912Z","updated_at":"2026-01-21T01:39:18.851Z","avatar_url":"https://github.com/baxtree.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/baxtree/subaligner/master/figures/subaligner.png\" alt=\"subaligner\" width=\"300\" /\u003e\n\u003c/div\u003e\n\n[![Build Status](https://github.com/baxtree/subaligner/actions/workflows/ci-pipeline.yml/badge.svg?branch=master)](https://github.com/baxtree/subaligner/actions/workflows/ci-pipeline.yml?query=branch%3Amaster) ![Codecov](https://img.shields.io/codecov/c/github/baxtree/subaligner)\n[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/) [![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/) [![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)](https://www.python.org/downloads/release/python-390/) [![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)\n[![Documentation Status](https://readthedocs.org/projects/subaligner/badge/?version=latest)](https://subaligner.readthedocs.io/en/latest/?badge=latest)\n[![GitHub license](https://img.shields.io/github/license/baxtree/subaligner)](https://github.com/baxtree/subaligner/blob/master/LICENSE)\n[![PyPI](https://badge.fury.io/py/subaligner.svg)](https://badge.fury.io/py/subaligner)\n[![Docker Pulls](https://img.shields.io/docker/pulls/baxtree/subaligner)](https://hub.docker.com/r/baxtree/subaligner)\n[![Citation](https://zenodo.org/badge/228440472.svg)](https://doi.org/10.5281/zenodo.5603083)\n\n## Supported Formats\nSubtitle: SubRip, TTML, WebVTT, (Advanced) SubStation Alpha, MicroDVD, MPL2, TMP, EBU STL, SAMI, SCC and SBV.\n\nVideo/Audio: MP4, WebM, Ogg, 3GP, FLV, MOV, Matroska, MPEG TS, WAV, MP3, AAC, FLAC, etc.\n\n:information_source: \u003csmall style=\"line-height: 1.2;\"\u003eSubaligner relies on file extensions as default hints to process a wide range of audiovisual or subtitle formats. It is recommended to use extensions widely acceppted by the community to ensure compatibility.\u003c/small\u003e\n\n## Dependant package\nRequired by the basic installation: [FFmpeg](https://www.ffmpeg.org/)\n\u003cdetails\u003e\n\u003csummary\u003eInstall FFmpeg\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003eapt-get install ffmpeg\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003ebrew install ffmpeg\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n## Basic Installation\n\u003cdetails\u003e\n\u003csummary\u003eInstall from PyPI\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epip install -U pip \u0026\u0026 pip install -U setuptools wheel\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epip install subaligner\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eInstall from source\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003egit clone git@github.com:baxtree/subaligner.git \u0026\u0026 cd subaligner\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epip install -U pip \u0026\u0026 pip install -U setuptools\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epip install .\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n:information_source: \u003csmall style=\"line-height: 1.2;\"\u003eIt is highly recommended creating a virtual environment prior to installation.\u003c/small\u003e\n\n## Installation with Optional Packages Supporting Additional Features\n\u003cdetails\u003e\n\u003csummary\u003eInstall dependencies for enabling translation and transcription\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epip install 'subaligner[llm]'\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall dependencies for enabling forced alignment\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epip install 'setuptools\u003c65.0.0'\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epip install 'subaligner[stretch]'\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall dependencies for setting up the development environment\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epip install 'setuptools\u003c65.0.0'\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epip install 'subaligner[dev]'\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall all extra dependencies\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epip install 'setuptools\u003c65.0.0'\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epip install 'subaligner[harmony]'\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\nNote that `subaligner[stretch]`, `subaligner[dev]` and `subaligner[harmony]` require [eSpeak](https://espeak.sourceforge.net/) to be pre-installed:\n\u003cdetails\u003e\n\u003csummary\u003eInstall eSpeak\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003eapt-get install espeak libespeak1 libespeak-dev espeak-data\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003ebrew install espeak\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\nAlso, if Python 3.12+ is used, you will need to install the following patch for those extras to fully function:\n\u003cdetails\u003e\n\u003csummary\u003eInstall patched aeneas\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epip install git+https://github.com/baxtree/aeneas.git@v1.7.3.1#egg=aeneas\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n## Container Support\nIf you prefer using a containerised environment over installing everything locally:\n\u003cdetails\u003e\n\u003csummary\u003eRun subaligner with a container\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003edocker run -v `pwd`:`pwd` -w `pwd` -it baxtree/subaligner bash\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\nFor Windows users, you can use Windows Subsystem for Linux ([WSL](https://learn.microsoft.com/en-us/windows/wsl/install)) to install Subaligner.\nAlternatively, you can use [Docker Desktop](https://docs.docker.com/docker-for-windows/install/) to pull and run the image.\nAssuming your media assets are stored under `d:\\media`, open built-in command prompt, PowerShell, or Windows Terminal:\n\u003cdetails\u003e\n\u003csummary\u003eRun the subaligner container on Windows\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003edocker pull baxtree/subaligner\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003edocker run -v \"/d/media\":/media -w \"/media\" -it baxtree/subaligner bash\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n## Usage\n\u003cdetails\u003e\n\u003csummary\u003eSingle-stage alignment (high-level shift with lower latency)\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m single -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m single -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDual-stage alignment (low-level shift with higher latency)\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGenerate subtitles by transcribing audiovisual files\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m transcribe -v video.mp4 -ml eng -mr whisper -mf small -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m transcribe -v video.mp4 -ml zho -mr whisper -mf medium -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePass in a global prompt for the entire audio transcription\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m transcribe -v video.mp4 -ml eng -mr whisper -mf turbo -ip \"your initial prompt\" -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUse the full subtitle content as a prompt\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m transcribe -v video.mp4 -s subtitle.srt -ml eng -mr whisper -mf turbo -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUse the previous subtitle segment as the prompt when transcribing the following segment\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m transcribe -v video.mp4 -s subtitle.srt --use_prior_prompting -ml eng -mr whisper -mf turbo -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n(For details on the prompt crafting for transcription, please refer to [Whisper prompting guide](https://cookbook.openai.com/examples/whisper_prompting_guide).)\n\n\u003cdetails\u003e\n\u003csummary\u003eAlignment on segmented plain texts (double newlines as the delimiter)\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m script -v video.mp4 -s subtitle.txt -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m script -v https://example.com/video.mp4 -s https://example.com/subtitle.txt -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGenerate JSON raw subtitle with per-word timings\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m transcribe -v video.mp4 -ml eng -mr whisper -mf turbo -ip \"your initial prompt\" --word_time_codes -o raw_subtitle.json\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m script -v video.mp4 -s subtitle.txt --word_time_codes -o raw_subtitle.json\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eAlignment on multiple subtitles against the single media file\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m script -v video.mp4 -s subtitle_lang_1.txt -s subtitle_lang_2.txt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m script -v video.mp4 -s subtitle_lang_1.txt subtitle_lang_2.txt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAlignment on embedded subtitles\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m single -v video.mkv -s embedded:stream_index=0 -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v video.mkv -s embedded:stream_index=0 -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eTranslative alignment with the ISO 639-3 language code pair (src,tgt)\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner --languages\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m single -v video.mp4 -s subtitle.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v video.mp4 -s subtitle.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m script -v video.mp4 -s subtitle.txt -o subtitle_aligned.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v video.mp4 -s subtitle.srt -tr helsinki-nlp -o subtitle_aligned.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v video.mp4 -s subtitle.srt -tr facebook-mbart -tf large -o subtitle_aligned.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v video.mp4 -s subtitle.srt -tr facebook-m2m100 -tf small -o subtitle_aligned.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m dual -v video.mp4 -s subtitle.srt -tr whisper -tf small -o subtitle_aligned.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eTranscribe audiovisual files and generate translated subtitles\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m transcribe -v video.mp4 -ml src -mr whisper -mf small -tr helsinki-nlp -o subtitle_aligned.srt -t src,tgt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003eShift subtitle manually by offset in seconds\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m shift --subtitle_path subtitle.srt -os 5.5\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner -m shift --subtitle_path subtitle.srt -os -5.5 -o subtitle_shifted.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRun batch alignment against directories\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner_batch -m single -vd videos/ -sd subtitles/ -od aligned_subtitles/\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner_batch -m dual -vd videos/ -sd subtitles/ -od aligned_subtitles/\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner_batch -m dual -vd videos/ -sd subtitles/ -od aligned_subtitles/ -of ttml\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRun alignments with pipx\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epipx run subaligner -m single -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epipx run subaligner -m dual -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRun the module as a script\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003epython -m subaligner -m single -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003epython -m subaligner -m dual -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRun alignments with the docker image\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003edocker pull baxtree/subaligner\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003edocker run -v `pwd`:`pwd` -w `pwd` -it baxtree/subaligner subaligner -m single -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003edocker run -v `pwd`:`pwd` -w `pwd` -it baxtree/subaligner subaligner -m dual -v video.mp4 -s subtitle.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003edocker run -it baxtree/subaligner subaligner -m single -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003cpre\u003e\u003ccode\u003edocker run -it baxtree/subaligner subaligner -m dual -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\n![](figures/screencast.gif)\n\nThe aligned subtitle will be saved at `subtitle_aligned.srt`. To obtain the subtitle in raw JSON format for downstream\nprocessing, replace the output file extension with `.json`. For details on CLIs, run `subaligner -h` or `subaligner_batch -h`,\n`subaligner_convert -h`, `subaligner_train -h` and `subaligner_tune -h` for additional utilities. `subaligner_1pass` and `subaligner_2pass` are shortcuts for running `subaligner` with `-m single` and `-m dual` options, respectively.\n\n## Advanced Usage\nYou can train a new model with your own audiovisual files and subtitle files,\n\u003cdetails\u003e\n\u003csummary\u003eTrain a custom model\u003c/summary\u003e\n\u003cpre\u003e\u003ccode\u003esubaligner_train -vd VIDEO_DIRECTORY -sd SUBTITLE_DIRECTORY -tod TRAINING_OUTPUT_DIRECTORY\u003c/code\u003e\u003c/pre\u003e\n\u003c/details\u003e\n\nThen you can apply it to your subtitle synchronisation with the aforementioned commands. For more details on how to train and tune your own model, please refer to [Subaligner Docs](https://subaligner.readthedocs.io/en/latest/advanced_usage.html).\n\nFor larger media files taking longer to process, you can reconfigure various timeouts using the following:\n\u003cdetails\u003e\n\u003csummary\u003eOptions for tuning timeouts\u003c/summary\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003ccode\u003e-mpt\u003c/code\u003e [Maximum waiting time in seconds when processing media files]\u003c/li\u003e\n  \u003cli\u003e\u003ccode\u003e-sat\u003c/code\u003e [Maximum waiting time in seconds when aligning each segment]\u003c/li\u003e\n  \u003cli\u003e\u003ccode\u003e-fet\u003c/code\u003e [Maximum waiting time in seconds when embedding features for training]\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/details\u003e\n\n## Anatomy\nSubtitles can be out of sync with their companion audiovisual media files for a variety of causes including latency introduced by Speech-To-Text on live streams or calibration and rectification involving human intervention during post-production.\n\nA model has been trained with synchronised video and subtitle pairs and later used for predicating shifting offsets and directions under the guidance of a dual-stage aligning approach. \n\nFirst Stage (Global Alignment):\n![](figures/1st_stage.png)\n\nSecond Stage (Parallelised Individual Alignment):\n![](figures/2nd_stage.png)\n\n## Acknowledgement\nThis tool wouldn't be possible without the following packages:\n[librosa](https://librosa.github.io/librosa/)\n[tensorflow](https://www.tensorflow.org/)\n[scikit-learn](https://scikit-learn.org)\n[pycaption](https://pycaption.readthedocs.io)\n[pysrt](https://github.com/byroot/pysrt)\n[pysubs2](https://github.com/tkarabela/pysubs2)\n[aeneas](https://www.readbeyond.it/aeneas/)\n[transformers](https://huggingface.co/transformers/)\n[whisper](https://openai.com/index/whisper/).\n\nThanks to Alan Robinson and Nigel Megitt for their invaluable feedback.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaxtree%2Fsubaligner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaxtree%2Fsubaligner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaxtree%2Fsubaligner/lists"}