1.0.4 • Published 3 months ago

autosub v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

autosub

autosub uses ffmpeg and OpenAI Whisper's nodejs bindings to automatically generate and overlay subtitles on any video.

Installation

Before using autosub, you need to have ffmpeg installed. You can install ffmpeg using your package manager:

# On Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

# On macOS using Homebrew (https://brew.sh/)
brew install ffmpeg

# On Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg

Install Package

  • Note: When you run this project for the first time, it will automatically download an AI model and then compile it. If you encounter any errors during this process, please raise an issue in the Nodejs-Whisper repository.
npm install -g autosub

Usage

Generate subtitles for a video:

autosub generate -i <Absolute path to video> -o <output path>

Options:

  • -i, --input: Absolute path to the input video file.
  • -o, --output: (Optional) Output path for the subtitled video. If not provided, the output will be saved in the same directory as the input file.

Example:

autosub generate -i User/chetan/Developer/video.mp4 -o  User/chetan/Developer/output.mp4

Development

Available AI models to generate subtitles for video (bigger model will give better result)

  • For me tiny.en model works fine.
  • To changes AI model you need to change "modelName" value in transcription.ts
ModelDiskMem
tiny75 MB~390 MB
tiny.en75 MB~390 MB
base142 MB~500 MB
base.en142 MB~500 MB
small466 MB~1.0 GB
small.en466 MB~1.0 GB
medium1.5 GB~2.6 GB
medium.en1.5 GB~2.6 GB
large-v12.9 GB~4.7 GB
large-v22.9 GB~4.7 GB
large2.9 GB~4.7 GB

Todo List

  • Command line interface support.
  • Give options to change subtitle styles