Command line tool to transcribe & translate audio from livestreams in real time
Project description
stream-translator-gpt
stream-translator-gpt is a command-line tool for real-time transcription and translation of live streams. We have now added an easier-to-use WebUI entry point.
Try it on Colab:
| WebUI | Command Line |
|---|---|
(Due to frequent scraping and theft of API keys, we are unable to provide a trial API key. You need to fill in your own API key.)
Prerequisites
- Python >= 3.8 (Recommend >= 3.10)
- FFmpeg (skip if already installed):
- Windows:
winget install ffmpeg - Linux (Debian/Ubuntu):
sudo apt install ffmpeg
- Windows:
- Install CUDA on your system.
- Install cuDNN to your CUDA dir if you want to use Faster-Whisper.
- Install PyTorch (with CUDA) to your Python.
- Create a Google API key if you want to use Gemini API for translation.
- Create a OpenAI API key if you want to use OpenAI Transcription API for transcription or GPT API for translation.
WebUI
pip install stream-translator-gpt[webui] -U
stream-translator-gpt-webui
Command Line
Install release version from PyPI:
pip install stream-translator-gpt -U
stream-translator-gpt
or
Clone master version code from Github:
git clone https://github.com/ionic-bond/stream-translator-gpt.git
pip install -r ./stream-translator-gpt/requirements.txt -U
python3 ./stream-translator-gpt/stream_translator_gpt/main.py
Usage
The commands on Colab are the recommended usage, below are some other commonly used options.
-
Transcribe live streaming (default use Whisper):
stream-translator-gpt {URL} --model large --language {input_language} -
Transcribe by Faster-Whisper:
stream-translator-gpt {URL} --model large --language {input_language} --use_faster_whisper -
Transcribe by SimulStreaming:
stream-translator-gpt {URL} --model large --language {input_language} --use_simul_streaming -
Transcribe by SimulStreaming with Faster-Whisper as the encoder:
stream-translator-gpt {URL} --model large --language {input_language} --use_simul_streaming --use_faster_whisper -
Transcribe by OpenAI Transcription API:
stream-translator-gpt {URL} --language {input_language} --use_openai_transcription_api --openai_api_key {your_openai_key} -
Translate to other language by Gemini:
stream-translator-gpt {URL} --model large --language ja --translation_prompt "Translate from Japanese to Chinese" --google_api_key {your_google_key} -
Translate to other language by GPT:
stream-translator-gpt {URL} --model large --language ja --translation_prompt "Translate from Japanese to Chinese" --openai_api_key {your_openai_key} -
Using OpenAI Transcription API and Gemini at the same time:
stream-translator-gpt {URL} --language ja --use_openai_transcription_api --openai_api_key {your_openai_key} --translation_prompt "Translate from Japanese to Chinese" --google_api_key {your_google_key} -
Local video/audio file as input:
stream-translator-gpt /path/to/file --model large --language {input_language} -
Record system audio as input:
stream-translator-gpt device --model large --language {input_language} -
Record microphone as input:
stream-translator-gpt device --model large --language {input_language} --mic -
Sending result to Discord:
stream-translator-gpt {URL} --model large --language {input_language} --discord_webhook_url {your_discord_webhook_url} -
Sending result to Telegram:
stream-translator-gpt {URL} --model large --language {input_language} --telegram_token {your_telegram_token} --telegram_chat_id {your_telegram_chat_id} -
Sending result to Cqhttp:
stream-translator-gpt {URL} --model large --language {input_language} --cqhttp_url {your_cqhttp_url} --cqhttp_token {your_cqhttp_token} -
Saving result to a .srt subtitle file:
stream-translator-gpt {URL} --model large --language ja --translation_prompt "Translate from Japanese to Chinese" --google_api_key {your_google_key} --hide_transcribe_result --retry_if_translation_fails --output_timestamps --output_file_path ./result.srt
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 stream_translator_gpt-2026.3.12.tar.gz.
File metadata
- Download URL: stream_translator_gpt-2026.3.12.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94ff9d4124d6e7fec5e4e3ee49ce9747d7849036f0363001425d30547f2fdcb5
|
|
| MD5 |
f0430872638401827cf745a7c2a1dfeb
|
|
| BLAKE2b-256 |
40bd8899203e76f5f7b7cbdf817e8dcb61259dfc051c008c1b7b7449f546cf01
|
File details
Details for the file stream_translator_gpt-2026.3.12-py3-none-any.whl.
File metadata
- Download URL: stream_translator_gpt-2026.3.12-py3-none-any.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba0fdb1e1dc8be03b56c3d29f1bc5ec8460f1df893bd0598676721e53b07c0c5
|
|
| MD5 |
8e3026eeb3a70ae243afd2a071388690
|
|
| BLAKE2b-256 |
54ec3bb78b6e7511570a04c6dba659240cf550930fa9f2d6a74a361968dfc720
|