Skip to main content

AI-powered SRT subtitle generator with Whisper and OpenAI translation

Project description

Integrated SRT Subtitle Generator

A tool that uses Whisper speech recognition and OpenAI GPT to generate Korean SRT subtitles.

โš ๏ธ Requirements (read first)

  • Python >= 3.10
  • OpenAI API key set to OPENAI_API_KEY
  • FFmpeg installed and available on PATH (for transcription/whisper features)
  • Optional: install extras for whisper/torch

FFmpeg installation (per OS)

  • Windows (one of)
    • Chocolatey: choco install ffmpeg
    • Scoop: scoop install ffmpeg
    • Winget: winget install --id=Gyan.FFmpeg -e
  • macOS: brew install ffmpeg
  • Ubuntu/Debian: sudo apt update && sudo apt install -y ffmpeg
  • Fedora: sudo dnf install -y ffmpeg
  • Arch: sudo pacman -S ffmpeg

Verify: ffmpeg -version should print version info.

๐Ÿš€ Features

  • Integrated workflow: Speech-to-text โ†’ Korean translation โ†’ SRT generation
  • Flexible execution: Run full process or individual steps
  • User-friendly GUI: Intuitive interface
  • Simplified structure: Minimal dependencies

๐Ÿ“ Project Structure

SRT_Generator/
โ”œโ”€โ”€ src/                           # Integrated GUI
โ”‚   โ”œโ”€โ”€ integrated_srt_generator.py
โ”‚   โ”œโ”€โ”€ requirements.txt
โ”‚   โ””โ”€โ”€ run_integrated.bat
โ”œโ”€โ”€ translator/                    # Translation tools
โ”‚   โ””โ”€โ”€ src/local_whisper_korean_subtitle_generator/
โ”‚       โ””โ”€โ”€ tools/
โ”‚           โ”œโ”€โ”€ korean_translation_tool.py
โ”‚           โ””โ”€โ”€ srt_formatter_tool.py
โ”œโ”€โ”€ input/                         # Input files
โ”œโ”€โ”€ output/                        # Output files
โ””โ”€โ”€ README.md

๐Ÿ› ๏ธ Installation and Run

๋น ๋ฅธ ์„ค์น˜ (๋ชจ๋“  ๊ธฐ๋Šฅ ํฌํ•จ)

๋ฐฉ๋ฒ• 1: pip install๋กœ ์„ค์น˜

# ๊ธฐ๋ณธ ์„ค์น˜ (whisper ํฌํ•จ)
pip install ch_srtgen

# ๋˜๋Š” ๊ฐœ๋ฐœ ๋ชจ๋“œ๋กœ ์„ค์น˜
pip install -e .

# ๊ฐœ๋ฐœ์šฉ ๋„๊ตฌ ํฌํ•จ
pip install -e .[dev]

๋ฐฉ๋ฒ• 1-1: Python ์Šคํฌ๋ฆฝํŠธ๋กœ ์ž๋™ ์„ค์น˜

python quick_install.py

๋ฐฉ๋ฒ• 2: ์„ค์น˜ ์Šคํฌ๋ฆฝํŠธ ์‚ฌ์šฉ

# Windows
install_all.bat

# Linux/macOS
./install_all.sh

Install from PyPI (์ž๋™ ์ข…์†์„ฑ ์„ค์น˜ ํฌํ•จ)

pip install ch-srtgen

๐ŸŽฏ ์„ค์น˜ ์™„๋ฃŒ ๋ฉ”์‹œ์ง€:

============================================================
๐ŸŽฏ SRT Generator ์„ค์น˜ ์™„๋ฃŒ!
============================================================

โœ… ๋ชจ๋“  ์ข…์†์„ฑ์ด ์„ค์น˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค!
๐ŸŽ‰ SRT Generator๋ฅผ ๋ฐ”๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ“– ์‚ฌ์šฉ๋ฒ•:
  srt-generator-gui    # GUI ์‹คํ–‰
  srt-generator        # CLI ์‹คํ–‰

๐Ÿ“ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ:
  input/     - ์ž…๋ ฅ ํŒŒ์ผ (๋น„๋””์˜ค/์˜ค๋””์˜ค)
  output/    - ์ถœ๋ ฅ ํŒŒ์ผ (SRT ์ž๋ง‰)

1. Run the integrated GUI (recommended)

cd src
run_integrated.bat

2. Run individual steps (from source)

# Transcription only
cd src
python integrated_srt_generator.py

# Translation only (when JSON file already exists)
cd src
python integrated_srt_generator.py

๐Ÿ“‹ Usage

Using the integrated GUI

  1. Settings

    • Select Whisper model (tiny ~ large-v3)
    • Select language (auto, ko, en, ja, etc.)
    • Enter OpenAI API key
  2. File selection

    • Input file: target video/audio file
    • Output folder: where to save result files
  3. Actions

    • Start full process: Transcription โ†’ Translation โ†’ SRT generation
    • Transcription only: Generate JSON file
    • Translation only: Convert existing JSON to Korean SRT

Workflow

  1. Transcription (Whisper)

    • Video/Audio โ†’ JSON (timestamp + text)
  2. Korean translation (OpenAI GPT)

    • English text โ†’ Korean translation
  3. SRT generation (Formatter)

    • Translated text โ†’ SRT subtitle file

๐Ÿ”ง Configuration

API key setup

Method 1: Environment file (.env) [recommended]

  1. Copy env.template to .env
  2. Put your real API key in .env:
    OPENAI_API_KEY=your_actual_api_key_here
    

Method 2: Enter via GUI

  • Enter the API key in the GUI after launching the app

Method 3: System environment variable

# Windows
set OPENAI_API_KEY=your_actual_api_key_here

# Linux/Mac
export OPENAI_API_KEY=your_actual_api_key_here

โš ๏ธ Security notes:

  • Never commit .env to Git
  • Do not hardcode API keys in code
  • Do not upload API keys to public repos

Model selection

  • tiny: Fastest, lower accuracy
  • base: Balanced (recommended)
  • small: Good accuracy
  • medium: Higher accuracy
  • large: Highest accuracy, slowest

๐Ÿ“ Output files

  • JSON file: filename.json (Whisper result)
  • SRT file: filename.srt (final subtitles)

๐Ÿ› Troubleshooting

Common issues

  1. FFmpeg error: Install FFmpeg
  2. API key error: Check OpenAI API key
  3. Out of memory: Use a smaller Whisper model

Logs

You can check detailed progress and errors in the GUI log panel.

๐Ÿ“„ License

This project is distributed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ch_srtgen-1.0.8.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ch_srtgen-1.0.8-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file ch_srtgen-1.0.8.tar.gz.

File metadata

  • Download URL: ch_srtgen-1.0.8.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ch_srtgen-1.0.8.tar.gz
Algorithm Hash digest
SHA256 621f99107d879f6796191b5c0070611197b7b9ac79631ca9c3dabe8efab0d371
MD5 aa476538e08db09f959e43464360ad2e
BLAKE2b-256 821e1b124930bca99aed82756a4cda748aebee86306a8febbf4d3fc2ee743653

See more details on using hashes here.

File details

Details for the file ch_srtgen-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: ch_srtgen-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ch_srtgen-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 396c3e8ebaf5573d9b4b586f770e12fc2959c89ed680b96664a5ab446c167341
MD5 421ef3e98519e81a82232e942af789e1
BLAKE2b-256 bd91b38c67947d9ed7f51611f706623543614d760934f46f7568e7c0c6220528

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page