1.0.9 • Published 12 months ago

@lordofmax/subtitle-generator v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

Subtitles Generator

Simple module written in Javascript with ECMAScript module format.

Exports one function that uses FFmpeg and OpenAI Whisper API to generate an English subtitle file for a video in a foreign language.

FFmpeg must be installed.

Input:

  • The path of the video file
  • A valid OpenAI API key
  • A comma-separated list of words helpful for correcting specific words or acronyms that the model may misrecognize. The string will be used as-is in the OpenAI Whisper prompt. Should be in English.

Output:

  • A subtitle file in the desired language, created in the same folder as the video folder.

Installation

$ npm install @lordofmax/subtitle-generator

Example

import {generateSubtitles} from "@lordofmax/subtitle-generator";

const videoFilePath = './movie.mp4';
const openaiApiKey = 'YOUR_OPENAI_API_KEY';

await generateSubtitles(videoFilePath, openaiApiKey, null);

Command Line Interface

This package can also be used as a command line

$ npm install -g @lordofmax/subtitle-generator
$ sub -file path/to/video/file -apikey your_openai_api_key
1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago