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.3.tar.gz
(40.9 kB
view details)
Built Distribution
File details
Details for the file ts-cc-extractor-0.0.3.tar.gz
.
File metadata
- Download URL: ts-cc-extractor-0.0.3.tar.gz
- Upload date:
- Size: 40.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a026a27f1fe4c97e80cfb6b98339a77f494eb3a54dda83a9690c6ec31b1a8c0d |
|
MD5 | 8589ede002ae3aa81802a79f0309a2f9 |
|
BLAKE2b-256 | 46f95e185e34b271085afe24e44d3cc1d0dd40d105e9913acab92cc6b76d5120 |
File details
Details for the file ts_cc_extractor-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: ts_cc_extractor-0.0.3-py3-none-any.whl
- Upload date:
- Size: 43.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aab4c5eee575e89abfc9f9e7899412277058a56400dbc3a794142a042cb0011 |
|
MD5 | 83b300b1c4dce5b9de916d42b365b61b |
|
BLAKE2b-256 | 5812ec063e08e7751ceec3c40aa9aefac303681b61edc1025471cf2e0971bfbe |