Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vlazic/json-verbose-to-vtt-converter
Transform `json_verbose` transcriptions from OpenAI, Groq, or command-line tools into VTT files with this Deno converter.
https://github.com/vlazic/json-verbose-to-vtt-converter
converter groq json json-verbose openai vtt webvtt whisper
Last synced: 28 days ago
JSON representation
Transform `json_verbose` transcriptions from OpenAI, Groq, or command-line tools into VTT files with this Deno converter.
- Host: GitHub
- URL: https://github.com/vlazic/json-verbose-to-vtt-converter
- Owner: vlazic
- License: mit
- Created: 2024-10-11T11:58:38.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-11T15:03:06.000Z (2 months ago)
- Last Synced: 2024-11-26T10:34:25.470Z (28 days ago)
- Topics: converter, groq, json, json-verbose, openai, vtt, webvtt, whisper
- Language: TypeScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-verbose-to-vtt-converter
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.
## Requirements
- Deno 2 or later
## Installation
### Installing Deno
#### For macOS and Linux:
```
curl -fsSL https://deno.land/install.sh | sh
```#### For Windows (using PowerShell):
```
irm https://deno.land/install.ps1 | iex
```### Project Setup
You don't need to install anything else if you're running the script remotely. If you want to run it locally:
1. Clone this repository:
```
git clone https://github.com/vlazic/json-verbose-to-vtt-converter.git
cd json-verbose-to-vtt-converter
```2. Install dependencies:
```
deno cache --reload main.ts
```## Usage
### Running Locally
If you've cloned the repository, run the script with the following command:
```
deno run --allow-read --allow-write main.ts [OPTIONS]
```### Running Remotely
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]
```### Options
- `-i, --input `: 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### Examples
1. Convert a JSON file to VTT:
```
deno run --allow-read --allow-write main.ts -i path/to/your/input.json
```2. Validate a JSON file without creating a VTT file:
```
deno run --allow-read --allow-write main.ts -i path/to/your/input.json --validate
```3. Validate a VTT file:
```
deno run --allow-read --allow-write main.ts -i path/to/your/input.vtt --validate
```4. Run silently (suppress all console output):
```
deno run --allow-read --allow-write main.ts -i path/to/your/input.json --silent
```### Exit Codes
- `0`: Successful execution (conversion or validation)
- `1`: Error occurred (e.g., invalid input, validation failed)## Project Background
This project was created out of necessity when working with the Groq API for the 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.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Keywords
Whisper 3, Groq, JSON to VTT, transcription converter, Deno, validation, silent mode, VTT validation, JSON validation