All Projects → yuppity → ttml2srt

yuppity / ttml2srt

Licence: Unlicense license
Convert TTML subtitles used by Netflix, HBO, CMore and others to SRT format

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ttml2srt

video-subtitle-extractor
视频硬字幕提取,生成srt文件。无需申请第三方API,本地实现文本识别。基于深度学习的视频字幕提取框架,包含字幕区域检测、字幕内容提取。A GUI tool for extracting hard-coded subtitle (hardsub) from videos and generating srt files.
Stars: ✭ 1,763 (+3356.86%)
Mutual labels:  subtitles, srt, subrip
Netflix To Srt
Rip, extract and convert subtitles to .srt closed captions from .xml/dfxp/ttml and .vtt/WebVTT (e.g. Netflix, YouTube)
Stars: ✭ 387 (+658.82%)
Mutual labels:  subtitles, netflix, srt
Ffsubsync
Automagically synchronize subtitles with video.
Stars: ✭ 5,167 (+10031.37%)
Mutual labels:  subtitles, srt, srt-subtitles
Elgindy-VTT-to-SRT-Subtitle-Converter
A tool for converting Web Video Text Tracks Format (WebVTT) subtitle to srt one. As most of video players support srt subtitles and can't open vtt subtitles, We should convert vtt to srt or sub subtitles but it's not easy to do that.
Stars: ✭ 68 (+33.33%)
Mutual labels:  subtitles, srt-subtitles
ttml2srt
convert TTML subtitles to SRT subtitles
Stars: ✭ 46 (-9.8%)
Mutual labels:  subtitles, srt
subed
Subtitle editor for Emacs
Stars: ✭ 143 (+180.39%)
Mutual labels:  subtitles, srt
Hulusubs dl
Command line script that downloads subtitles from hulu.com
Stars: ✭ 42 (-17.65%)
Mutual labels:  srt, srt-subtitles
subadub
Chrome+Firefox extension for studying foreign languages using Netflix subtitles
Stars: ✭ 103 (+101.96%)
Mutual labels:  subtitles, netflix
ccaptioner
An extension to assign a text track to a video element in a web page
Stars: ✭ 45 (-11.76%)
Mutual labels:  subtitles, srt
pysubs2
A Python library for editing subtitle files
Stars: ✭ 174 (+241.18%)
Mutual labels:  subtitles, srt
Parsing With Haskell Parser Combinators
🔍 A step-by-step guide to parsing using Haskell parser combinators.
Stars: ✭ 72 (+41.18%)
Mutual labels:  subtitles, srt
Pgstosrt
PGS to Srt converter
Stars: ✭ 21 (-58.82%)
Mutual labels:  subtitles, srt
Subed
Subtitle editor for Emacs
Stars: ✭ 77 (+50.98%)
Mutual labels:  subtitles, srt
pysub-parser
Library for extracting text and timestamps from multiple subtitle files (.ass, .ssa, .srt, .sub, .txt).
Stars: ✭ 40 (-21.57%)
Mutual labels:  subtitles, srt
libgosubs
golang library to read and write various subtitle formats
Stars: ✭ 20 (-60.78%)
Mutual labels:  subtitles, srt
VTT-to-SRT-Converter
Convert WebVTT subtitles to SubRip.
Stars: ✭ 29 (-43.14%)
Mutual labels:  srt, subrip
Srt
A simple library for parsing, modifying, and composing SRT files.
Stars: ✭ 210 (+311.76%)
Mutual labels:  subtitles, srt
Submerger
SRT Subtitles Merger
Stars: ✭ 92 (+80.39%)
Mutual labels:  subtitles, srt
Subtitle.js
Stream-based library for parsing and manipulating subtitle files
Stars: ✭ 234 (+358.82%)
Mutual labels:  subtitles, srt
IMDb-Scout-Mod
Auto search for movie/series on torrent, usenet, ddl, subtitles, streaming, predb and other sites. Adds links to IMDb pages from hundreds various sites. Adds movies/series to Radarr/Sonarr. Adds external ratings from Metacritic, Rotten Tomatoes, Letterboxd, Douban, Allocine. Media Server indicators for Plex, Jellyfin, Emby. Dark theme/style for …
Stars: ✭ 177 (+247.06%)
Mutual labels:  subtitles

ttml2srt

Convert TTML subtitles used by Netflix, HBO, CMore and others to SRT format.

Note: ttml2srt is not a full-featured TTML-to-SRT converter and only works on a small subset of TTML documents. Namely, documents that follow the formats seen on the aforementioned streaming services.

Usage

positional arguments:
  ttml-file             TTML subtitle file
  output-file           file to write resulting SRT to

optional arguments:
  -h, --help            show this help message and exit
  -s [ms], --shift [ms]
                        shift
  -f [fps], --fps [fps]
                        frames per second (default: 23.976)
  --t-dur [sec]         target duration
  --s-dur [sec]         source duration

Common use cases

Simple conversion:

./ttml2srt.py subtitle_from_netflix.xml > subtitle.srt

or

./ttml2srt.py subtitle_from_netflix.xml subtitle.srt

Shift everything forward by 2 secs:

./ttml2srt.py -s 2000 subtitle_from_netflix.xml > subtitle.srt

Convert with specific frame rate (only has an effect when input timestamps have frames):

./ttml2srt.py -f 25 subtitle_from_hbo_nordic.xml > subtitle.srt

You'll probably run into a situation where your target is playing at either slower or faster speed compared to a streaming service. You can scale timestamps to fit a source to a target by picking the same frame from both the target and source and comparing the timestamp.

Here's an example cmd for when the first piece of dialogue from a streaming service is starting two seconds behind the target audio and where a frame towards the end has a timestamp of 00:15:39 (939s) in the target and 00:16:23 (983s) in the source:

./ttml2srt.py -s -2000 --t-dur 939 --s-dur 983 subtitle.xml

Run tests:

python3 tests/test01.py
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].