subtitles-generator
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

subtitles-generator

Generate subtitles easily with ffmpeg and whisper.

NPM GitHub

Report Bug · Request Feature


📖 Table of Contents

✨ Features

✅ Can be used via CLI or in code

✅ Support video or audio files as input

🎯 Prerequisites

  • ffmpeg (ffmpeg will be used as to generate wav file from the video file)

🛠️ Installation

Using via code (for CLI no need to install locally).

NOTE: The package is using esm modules!

Install the package locally.

npm i subtitles-generator

Basic example.

import { subtitlesGenerator } from 'subtitles-generator';

await subtitlesGenerator('something.mp4');

With options.

import { subtitlesGenerator } from 'subtitles-generator';

const srtFilePath = await subtitlesGenerator('something.mp4', {
  outputFilePath: './',
  modelType: 'base.en',
  shouldTryToDownloadModel: true,
  language: 'en',
  translateToEnglish: false,
});

console.log(srtFilePath); // 'something.srt'

⚡️ Usage

Using via CLI.

npx subtitles-generator --help

Create srt file from mp4 file.

npx subtitles-generator -i something.mp4 -m base.en

📜 License

MIT

Package Sidebar

Install

npm i subtitles-generator

Weekly Downloads

26

Version

0.0.5

License

MIT

Unpacked Size

9.64 MB

Total Files

466

Last publish

Collaborators

  • avivharuzi