Skip to main content

Convert STT result (Azure or fast-whisper JSON) to WebVTT

Project description

stt2vtt

Convert STT (speech-to-text) results with timestamps to WebVTT. Input can be JSON from Azure Speech-to-Text or fast-whisper (or compatible segment + word timestamps). Output is VTT text.

No audio processing or ML models — this repo only converts existing STT JSON to VTT.

Installation

pip install stt2vtt

Dev dependencies:

pip install stt2vtt[dev]

Usage

CLI

# From file
stt2vtt result.json -o output.vtt

# To stdout
stt2vtt result.json

# From stdin
cat result.json | stt2vtt -o output.vtt

Python

from src.stt_to_vtt import stt_to_vtt

# JSON string or parsed list/dict
vtt = stt_to_vtt('{"phrases": [...]}')   # Azure style
vtt = stt_to_vtt([{"id": 1, "start": 0, "end": 1, "text": "...", "words": [...]}])  # fast-whisper style

print(vtt)  # "WEBVTT\n\n00:00:00.000 --> ..."

Input formats

  • fast-whisper: List of segments, each with start, end, text, and words (list of {start, end, word}).
  • Azure: Object with phrases (or recognizedPhrases), each phrase with offsetMilliseconds, durationMilliseconds, and words with text, offsetMilliseconds, durationMilliseconds.

Output

WebVTT subtitle content: WEBVTT header plus timestamped cues with capitalized text.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stt2vtt-0.0.1.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stt2vtt-0.0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file stt2vtt-0.0.1.tar.gz.

File metadata

  • Download URL: stt2vtt-0.0.1.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for stt2vtt-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a44ed089a2dfa8fe5f341cb5180c8f2d950077633ead5042bc2afb0211bda903
MD5 b8ba61191abf83fc5c16d8c97a661901
BLAKE2b-256 c5129fc5108f01203d56af3d3d6e03daf4f5f4721da04c349c8806161eea3e2f

See more details on using hashes here.

File details

Details for the file stt2vtt-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: stt2vtt-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for stt2vtt-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3ad8a6b181153c0ab6428e0e984085a2e667a62a5f01e23d8e98dabdb33cd713
MD5 01136a799a324a077d1e18ffe142bcb8
BLAKE2b-256 b22a9326fc857f2a3e6972c9ccc81e6a6b48405f4c827e2d1fd994cc305912e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page