Extract EIA-608 captions from Video Transport Stream (*.ts) fileand convert them to SubRip (*.srt) or Video Text Tracks (*.vtt) subtitles
Project description
TS-CC Extractor
With this pure-python utility you can extract EIA-608 captions from Video Transport Stream (*.ts) file and convert them to SubRip (*.srt) or Video Text Tracks (*.vtt) subtitles.
Installation
pip install ts-cc-extractor
Usage
usage: ts-cc-extractor -i PATH -o PATH [-f {SRT,VTT}] [-v] [-h]
required arguments:
-i PATH Path to *.ts file
-o PATH Output subtitles file
optional arguments:
-f {SRT,VTT} Subtitles format (default: SRT)
-v, --version show program's version number and exit
-h, --help show this help message and exit
API example
from ts_cc_extractor import extract_subtitles
with open('video1.ts') as f:
subs_text = extract_subtitles(f, fmt='VTT')
print(subs_text)
WEBVTT
00:01.705 --> 00:03.974 align:left position:10% line:5% size:80%
THAT'S JUST THE WAY IT GOES.
I DONE SEEN IT TOO MANY TIMES.
00:03.974 --> 00:05.609 align:left position:30% line:89% size:60%
HEY, Y'ALL READY?
...
CLI example
$ ts-cc-extractor -i video2.ts -o subs.srt -f SRT
$ cat subs.srt
1
00:00:01,967 --> 00:00:05,633
>> HARRY AND MEGHAN WERE IN THE
MAJOR GENERAL'S OFFICE
2
00:00:05,633 --> 00:00:10,533
OVERLOOKING THE PAGEANTLY OF THE
HORSE GUARDS PARADE AND THE
3
00:00:10,533 --> 00:00:10,800
TROOPING.
...
License
BSD
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ts-cc-extractor-0.0.1.tar.gz
(40.9 kB
view hashes)
Built Distribution
Close
Hashes for ts_cc_extractor-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4111cb8e14c2fe168a26d7a7026be4a1e2300211b9850d0f41a60ecb57a31b7 |
|
MD5 | 1354e052ad826b14d2ab3a13e5095bd3 |
|
BLAKE2b-256 | 1fbbcfd7068fecf57217b01c9d10223d0319e3203567b56d60994037ceb337ef |