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
- Chocolatey:
- 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๋ฅผ ๋ฐ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.
๐ ์ฌ์ฉ๋ฒ:
ch-srtgen-gui # GUI ์คํ
ch-srtgen # CLI ์คํ
๐ ํ๋ก์ ํธ ๊ตฌ์กฐ:
input/ - ์
๋ ฅ ํ์ผ (๋น๋์ค/์ค๋์ค)
output/ - ์ถ๋ ฅ ํ์ผ (SRT ์๋ง)
1. Run the integrated GUI (recommended)
ch-srtgen-gui
2. Run CLI
# Help
ch-srtgen --help
# Process video file
ch-srtgen input.mp4
๐ Usage
Using the integrated GUI
-
Settings
- Select Whisper model (tiny ~ large-v3)
- Select language (auto, ko, en, ja, etc.)
- Enter OpenAI API key
-
File selection
- Input file: target video/audio file
- Output folder: where to save result files
-
Actions
- Start full process: Transcription โ Translation โ SRT generation
- Transcription only: Generate JSON file
- Translation only: Convert existing JSON to Korean SRT
Workflow
-
Transcription (Whisper)
- Video/Audio โ JSON (timestamp + text)
-
Korean translation (OpenAI GPT)
- English text โ Korean translation
-
SRT generation (Formatter)
- Translated text โ SRT subtitle file
๐ง Configuration
API key setup
Method 1: Environment file (.env) [recommended]
- Copy
env.templateto.env - 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
.envto 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
- FFmpeg error: Install FFmpeg
- API key error: Check OpenAI API key
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ch_srtgen-1.0.9.tar.gz.
File metadata
- Download URL: ch_srtgen-1.0.9.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd2057b9359d07dcd2e7496163a3f4d25e86d55471bb64f68470e01e8c3fe038
|
|
| MD5 |
f02743f2f1a4ea2b7411b530bbf87a6a
|
|
| BLAKE2b-256 |
2354806a2121a6f99cfbec834825c62c9a106962adee9f55d8d465855e2a67e2
|
File details
Details for the file ch_srtgen-1.0.9-py3-none-any.whl.
File metadata
- Download URL: ch_srtgen-1.0.9-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
780a77677ea9f99ed9f261a75acc84216aeb49cc582759e5c551e23129859572
|
|
| MD5 |
d539e4383e8259e10d56548bcf066c2b
|
|
| BLAKE2b-256 |
70be43f6ae954a8c73984ee353dc56f9c40657b34102408fcb4a570e7ea4a8e9
|