npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quality-subtitles-generator

v0.1.8

Published

Generate high-quality subtitles for your videos effortlessly! This npm package combines the power of ffmpeg and the advanced whisper model to provide a seamless solution for converting videos into different quality formats with accurate subtitles.

Downloads

26

Readme

Quality Subs Generator

Effortlessly generate high-quality subtitles for your videos using the "quality-subs-generator" npm package. This powerful tool combines the capabilities of ffmpeg and the advanced Whisper model, providing a seamless solution for converting videos into various quality formats with precise subtitles.

Installation

Install the package easily using npm or Yarn:

Using npm

npm install quality-subs-generator

Using Yarn

yarn add quality-subs-generator

Usage

This package utilizes Docker for all processing, ensuring a hassle-free experience for users. You only need Docker; no need to deal with the tedious installation of components like the Whisper model, ffmpeg binaries, etc. The isolated environment also reduces the risk of system crashes.

During the initial run, the package will build a Docker image. This process includes heavy installations, such as ffmpeg, the OpenAI-Whisper model, transcription models, Node.js runtime, and more. Please note that it may take some time (approximately ~30 minutes) depending on internet speed and system resources, resulting in an image size of around ~10GB. Subsequent video processing will not rebuild the image; they will directly run a container.

Note: If you change modelName in whisperOptions, the image will rebuild. However, if you haven't deleted the Docker image created for building the required image, only the model downloading stage will run. In case you delete the image, the entire build process will restart. It's essential to note that after each change in modelName, new images will be created, but they won't consume significant space.

Example

import startProcessing from 'quality-subs-generator';

const processVideoWithSubtitles = async () => {
    try {
        await startProcessing({
            inputVideoPath: `${process.cwd()}/input/video.mp4`,
            outputDirectory: `${process.cwd()}/output`,
            qualities: ['144'],
            logs: true,
            imageBuildOptions: { logs: true },
            whisperOptions: { outputFormat: 'srt', modelName: 'tiny' }, // Default output format is srt, and the default model is 'tiny'
        });
        console.log('Service finished');
    } catch (error) {
        console.error(error);
    }
};

processVideoWithSubtitles();

Dependencies

Contributing

We welcome contributions! Feel free to contribute by raising issues or submitting pull requests. Please follow our contribution guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any inquiries or feedback, please reach out to Keshav Garg. Your input is valuable!