subtitles-generator
v0.0.5
Published
Generate subtitles easily with ffmpeg and whisper
Downloads
19
Maintainers
Readme
📖 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