All Projects → baxtree → Subaligner

baxtree / Subaligner

Licence: mit
Automatically synchronize subtitles to audiovisual content with a pretrained deep neural network and forced alignments. https://subaligner.readthedocs.io/

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Subaligner

Ffsubsync
Automagically synchronize subtitles with video.
Stars: ✭ 5,167 (+2754.7%)
Mutual labels:  alignment, subtitles
Aeneas
aeneas is a Python/C library and a set of tools to automagically synchronize audio and text (aka forced alignment)
Stars: ✭ 1,942 (+972.93%)
Mutual labels:  alignment
Vertical Rhythm
Put some typographical vertical rhythm in your CSS. LESS, Stylus and SCSS/SASS versions included.
Stars: ✭ 83 (-54.14%)
Mutual labels:  alignment
Stfan
Code repo for "Spatio-Temporal Filter Adaptive Network for Video Deblurring" (ICCV'19)
Stars: ✭ 110 (-39.23%)
Mutual labels:  alignment
Caption
Get Caption, start watching.
Stars: ✭ 1,258 (+595.03%)
Mutual labels:  subtitles
Intersubs
Interactive subtitles for mpv. Instantly translate selected word/sentence.
Stars: ✭ 111 (-38.67%)
Mutual labels:  subtitles
Subed
Subtitle editor for Emacs
Stars: ✭ 77 (-57.46%)
Mutual labels:  subtitles
Autosubsync
Automatically synchronize subtitles with audio using machine learning
Stars: ✭ 179 (-1.1%)
Mutual labels:  subtitles
Vcf2phylip
Convert SNPs in VCF format to PHYLIP, NEXUS, binary NEXUS, or FASTA alignments for phylogenetic analysis
Stars: ✭ 126 (-30.39%)
Mutual labels:  alignment
Aegisub Motion
Lua plugin for Aegisub auto4 that parses motion tracking data and applies it to selected subtitles.
Stars: ✭ 109 (-39.78%)
Mutual labels:  subtitles
Sortmerna
SortMeRNA: next-generation sequence filtering and alignment tool
Stars: ✭ 108 (-40.33%)
Mutual labels:  alignment
Pasta
Audio & Subtitle Track Changer for Plex
Stars: ✭ 90 (-50.28%)
Mutual labels:  subtitles
3ddfa v2
The official PyTorch implementation of Towards Fast, Accurate and Stable 3D Dense Face Alignment, ECCV 2020.
Stars: ✭ 1,961 (+983.43%)
Mutual labels:  alignment
Subsync
Synchronize your subtitles using machine learning
Stars: ✭ 84 (-53.59%)
Mutual labels:  subtitles
Gaupol
Editor for text-based subtitle files
Stars: ✭ 159 (-12.15%)
Mutual labels:  subtitles
Beautifyr
RStudio addin for formatting Rmarkdown tables
Stars: ✭ 77 (-57.46%)
Mutual labels:  alignment
Awesome Image Alignment And Stitching
A curated list of awesome resources for image alignment and stitching ...
Stars: ✭ 101 (-44.2%)
Mutual labels:  alignment
Strings
A set of useful functions for transforming strings.
Stars: ✭ 111 (-38.67%)
Mutual labels:  alignment
Bili
A tool to download barrage/video from bilibili/acfun. Support English, Japanese and Chinese(China).一个Python编写的从Bilibili/Acfun下载弹幕/视频的工具。支持英语、日语和中文(中国)。(WEBGUI正在路上)
Stars: ✭ 179 (-1.1%)
Mutual labels:  subtitles
Rapidbay
Self-hosted torrent video streaming service compatible with Chromecast and AppleTV deployable in the cloud
Stars: ✭ 163 (-9.94%)
Mutual labels:  subtitles

Build Status Codecov Python 3.8 Python 3.7 Python 3.6 Documentation Status GitHub license PyPI Docker Hub

Dependencies

FFmpeg and eSpeak

$ apt-get install ffmpeg espeak libespeak1 libespeak-dev espeak-data

or

$ brew install ffmpeg espeak

Installation

# Install from PyPI (pre-emptive NumPy)
$ pip install -U pip
$ pip install numpy 
$ pip install subaligner

or

# Install via pipx
$ pip install -U pip pipx
$ pipx install numpy
$ pipx install subaligner

or

# Install from GitHub via Pipenv
...
[packages]
numpy = "*"
subaligner = {git = "ssh://[email protected]/baxtree/subaligner.git", ref = "<TAG>"}
...

or

# Install from source

$ git clone [email protected]:baxtree/subaligner.git
$ cd subaligner
$ pip install numpy
$ python setup.py install

or

# Use dockerised installation

$ docker run -v `pwd`:`pwd` -w `pwd` -it baxtree/subaligner bash

For users on Windows 10: Docker Desktop is the only option at the present. Assume your media assets are stored under d:\media. Open built-in command prompt, PowerShell, or Windows Terminal and run:

docker pull baxtree/subaligner
docker run -v "/d/media":/media -w "/media" -it baxtree/subaligner bash

Usage

# Single-stage alignment (high-level shift with lower latency)

$ subaligner_1pass -v video.mp4 -s subtitle.srt
$ subaligner_1pass -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt
# Dual-stage alignment (low-level shift with higher latency)

$ subaligner_2pass -v video.mp4 -s subtitle.srt
$ subaligner_2pass -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt

or

# Pass in single-stage or dual-stage as the alignment mode

$ subaligner -m single -v video.mp4 -s subtitle.srt
$ subaligner -m dual -v video.mp4 -s subtitle.srt
$ subaligner -m single -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt
$ subaligner -m dual -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt
# Run alignments with pipx

$ pipx run subaligner -m single -v video.mp4 -s subtitle.srt
$ pipx run subaligner -m dual -v video.mp4 -s subtitle.srt
# Run the module as a script
$ python -m subaligner -m single -v video.mp4 -s subtitle.srt
$ python -m subaligner -m dual -v video.mp4 -s subtitle.srt
$ python -m subaligner.subaligner_1pass -v video.mp4 -s subtitle.srt
$ python -m subaligner.subaligner_2pass -v video.mp4 -s subtitle.srt
# Run alignments with the docker image

$ docker pull baxtree/subaligner
$ docker run -v `pwd`:`pwd` -w `pwd` -it baxtree/subaligner subaligner_1pass -v video.mp4 -s subtitle.srt
$ docker run -v `pwd`:`pwd` -w `pwd` -it baxtree/subaligner subaligner_2pass -v video.mp4 -s subtitle.srt
$ docker run -it baxtree/subaligner subaligner_1pass -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt
$ docker run -it baxtree/subaligner subaligner_2pass -v https://example.com/video.mp4 -s https://example.com/subtitle.srt -o subtitle_aligned.srt

The aligned subtitle will be saved at subtitle_aligned.srt. For details on CLI, run subaligner_1pass --help, subaligner_2pass --help or subaligner --help.

Supported Formats

Subtitle: SubRip, TTML, WebVTT, (Advanced) SubStation Alpha, MicroDVD, MPL2, TMP, EBU STL, and SAMI.

Video/Audio: MP4, WebM, Ogg, 3GP, FLV, MOV, Matroska, MPEG TS, WAV, MP3, AAC, FLAC, etc.

Advanced Usage

You can train a new model with your own audiovisual files and subtitle files:

$ subaligner_train -vd VIDEO_DIRECTORY -sd SUBTITLE_DIRECTORY -tod TRAINING_OUTPUT_DIRECTORY

Then 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.

Anatomy

Subtitles 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.

A 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.

First Stage (Global Alignment):

Second Stage (Parallelised Individual Alignment):

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].