1.0.9 • Published 1 year ago

@lordofmax/subtitle-generator v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year 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

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago