Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
generate-subtitles
Advanced tools
npm i generate-subtitles
This package parses video and audio files, to generate .vtt formatted subtitle files. The package is fully asynchronous and adds support for threads flag to run on lower powered systems complemented by file system support.
The package is built upon
[Openai-whisper](Introducing Whisper) | OpenAI's open source model
Whisper.cpp | A custom cpp implementation of whisper model in C++.
whisper-node | A similar package based on OpenAi-whisper and Whisper.cpp
Note- To run the script for first time the package needs to download the model which is then saved in /node_modules/generate-subtitles/lib/whisper.cpp/models
To do that, run
npx generate-subtitles download
and select an appropriate model.
import { generate } from "generate-subtitles";
const options = {
//required- where file must be placed
inputFile: '/path/to/the/file',
//optional- when not specified, it saves at the input Dir
outputDir: '/path/to/the/dir',
//required- (enum)Valid inputs are only 'audio' and 'video'
inputType: '/type_of_input(audio/video)',
//required
whisperFlags: {
//not required- currently supports vtt only
subFormat: 'vtt',
//required- default model is base
model: 'model_name',
//not required- when using a multilingual model
//default-english
language: 'language_name',
//not required- no of threads to run the model
//default- 7
threadCount: number,
}
}
try {
const getSubtiles= await generate(options);
//resolves with true
//An output file is generat
} catch(error) {
// rejects with an error
}
When using audio input file, it requires .wav format at 16KHz frequency
In windows based system, make(Make for Windows).
[Openai-whisper](Introducing Whisper)
FAQs
Takes media file input to generate .vtt subtile files with support for threads.
We found that generate-subtitles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.