This Deno project converts JSON transcription files from the whisper model to VTT (Web Video Text Tracks) format. It also provides validation for both JSON and VTT files.
- Deno 2 or later
curl -fsSL https://deno.land/install.sh | sh
irm https://deno.land/install.ps1 | iex
You don't need to install anything else if you're running the script remotely. If you want to run it locally:
-
Clone this repository:
git clone https://github.com/vlazic/json-verbose-to-vtt-converter.git cd json-verbose-to-vtt-converter
-
Install dependencies:
deno cache --reload main.ts
If you've cloned the repository, run the script with the following command:
deno run --allow-read --allow-write main.ts [OPTIONS]
You can run the script directly from GitHub without cloning the repository:
deno run --allow-read --allow-write https://raw.githubusercontent.com/vlazic/json-verbose-to-vtt-converter/main/main.ts [OPTIONS]
-i, --input <file>
: Specify the input file (JSON or VTT) (required)-v, --validate
: Validate the input file without conversion-s, --silent
: Suppress all console output-h, --help
: Show the help message
-
Convert a JSON file to VTT:
deno run --allow-read --allow-write main.ts -i path/to/your/input.json
-
Validate a JSON file without creating a VTT file:
deno run --allow-read --allow-write main.ts -i path/to/your/input.json --validate
-
Validate a VTT file:
deno run --allow-read --allow-write main.ts -i path/to/your/input.vtt --validate
-
Run silently (suppress all console output):
deno run --allow-read --allow-write main.ts -i path/to/your/input.json --silent
0
: Successful execution (conversion or validation)1
: Error occurred (e.g., invalid input, validation failed)
This project was created out of necessity when working with the Groq API for the https://github.com/vlazic/gozba project. The Groq API, which uses Whisper 3 model, only provides json
and json_verbose
output. However, for specific needs in the project, the VTT (Web Video Text Tracks) format was required. This converter bridges that gap, allowing easy transformation from the Groq API's JSON output to the needed VTT format.
This project is licensed under the MIT License. See the LICENSE file for details.
Whisper 3, Groq, JSON to VTT, transcription converter, Deno, validation, silent mode, VTT validation, JSON validation