Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chetanxpro/autosub

Automatically generate and overlay subtitles for any video.
https://github.com/chetanxpro/autosub

ai ffmpeg nodejs-whisper openai-whisper subtitles subtitles-generator whisper

Last synced: about 2 hours ago
JSON representation

Automatically generate and overlay subtitles for any video.

Awesome Lists containing this project

README

        

# autosub

autosub uses ffmpeg and [OpenAI Whisper's nodejs bindings](https://github.com/ChetanXpro/nodejs-whisper) 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:

```bash
# 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](https://github.com/ChetanXpro/nodejs-whisper) repository.

```bash
npm install -g autosub
```

## Usage

Generate subtitles for a video:

```bash
autosub generate -i -o
```

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:

```bash
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

| Model | Disk | Mem |
|----------|---------|------------|
| tiny | 75 MB | ~390 MB |
| tiny.en | 75 MB | ~390 MB |
| base | 142 MB | ~500 MB |
| base.en | 142 MB | ~500 MB |
| small | 466 MB | ~1.0 GB |
| small.en | 466 MB | ~1.0 GB |
| medium | 1.5 GB | ~2.6 GB |
| medium.en| 1.5 GB | ~2.6 GB |
| large-v1 | 2.9 GB | ~4.7 GB |
| large-v2 | 2.9 GB | ~4.7 GB |
| large | 2.9 GB | ~4.7 GB |

## Todo List

- [ ] Command line interface support.
- [ ] Give options to change subtitle styles