Skip to content

SubgenAI is a command-line tool that uses OpenAI's Whisper model to transcribe video audio and generate SRT subtitles. It supports multiple models for varying speed/accuracy, optional translation to English, and provides progress tracking with timestamps. Simple to use and flexible for video-to-subtitle conversion.

Notifications You must be signed in to change notification settings

nfs-tech-bd/subgenAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎬 SUBGEN AI — Subtitle Generator (CLI)


🚀 Overview

SubgenAI is a lightweight and efficient command-line tool that uses OpenAI's Whisper model to automatically transcribe and generate subtitles (.srt) from video files.

✨ With a few simple commands, you can:

  • Extract audio from any video
  • Generate accurate subtitles
  • Optionally translate them into English
  • Save directly as .srt with automatic or custom file naming

✨ Features

  • 🎯 Simple CLI – Run directly from your terminal
  • 📝 Automatic Naming – Saves as video_name.srt if no output is specified
  • 🌍 Translate to English – From any source language
  • Clean & Efficient – Uses temporary storage and cleans up automatically
  • 🔄 Flexible Models – Choose from tiny, base, small, medium, large

🛠️ Tech Stack

  • Language: Python
  • Transcription: OpenAI Whisper
  • Audio Extraction: FFmpeg

📦 Prerequisites

Before using SubgenAI, make sure you have:

  • 🐍 Python 3.8+
  • 🎵 FFmpeg (required for audio extraction)

🔧 Installation Instructions

  • Windows: Download from the official FFmpeg site and add the bin folder to PATH
  • macOS (Homebrew):
    brew install ffmpeg
  • Linux (apt):
    sudo apt update && sudo apt install ffmpeg

⚙️ Installation & Setup

Clone the repository:

git clone https://github.com/nfs-tech-bd/subgenAI
cd subgenAI

Create and activate a virtual environment (recommended)

Windows:

python -m venv venv
.\env\Scripts\ctivate

macOS / Linux:

python3 -m venv venv
source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

⚠️ The first time you run the script, Whisper will download the chosen model (default = base).


▶️ Usage

Basic (Automatic Output Name)

python subgenai.py --video "my_video.mp4"

👉 Output: my_video.srt

Specify Output File

python subgenai.py --video "my_video.mp4" --output "custom_subs.srt"

Choose a Model

python subgenai.py --video "my_video.mp4" --output "custom_subs.srt" --model "medium"

📊 Model Trade-offs

Model Speed 🚀 Accuracy 🎯 Size 💾
tiny Fastest Lowest ~75 MB
base Fast Medium ~142 MB
small Balanced Good ~466 MB
medium Slower Very Good ~1.5 GB
large Slowest Best ~3 GB

📜 License

This project is licensed under the MIT License.


💡 Built with ❤️ by Nafis Fuad with python and a lot of curiosity.

About

SubgenAI is a command-line tool that uses OpenAI's Whisper model to transcribe video audio and generate SRT subtitles. It supports multiple models for varying speed/accuracy, optional translation to English, and provides progress tracking with timestamps. Simple to use and flexible for video-to-subtitle conversion.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages