Skip to main content

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
Open In Colab Open In Colab

(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

  1. Python >= 3.10
  2. FFmpeg (skip if already installed):
    • Windows: winget install ffmpeg
    • Linux (Debian/Ubuntu): sudo apt install ffmpeg
  3. Install CUDA on your system.
  4. Install cuDNN to your CUDA dir if you want to use Faster-Whisper.
  5. Install PyTorch (with CUDA) to your Python.
  6. Create a Google API key if you want to use Gemini API for translation.
  7. Create a OpenAI API key if you want to use OpenAI Transcription API for transcription or GPT API for translation.

Installation

WebUI

pip install stream-translator-gpt[webui] -U

Command Line

pip install stream-translator-gpt -U

Usage

The commands on Colab Open In Colab are the recommended usage, below are some other commonly used options.

  • Transcribe live streaming (default use Whisper):

    stream-translator-gpt {URL} --language {input_language}

  • Transcribe by Faster-Whisper:

    stream-translator-gpt {URL} --language {input_language} --use_faster_whisper

  • Transcribe by SimulStreaming:

    stream-translator-gpt {URL} --language {input_language} --use_simul_streaming

  • Transcribe by SimulStreaming with Faster-Whisper as the encoder:

    stream-translator-gpt {URL} --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}

  • Transcribe by a HuggingFace ASR model (requires pip install stream-translator-gpt[hf_asr]):

    stream-translator-gpt {URL} --model {hf_model_name} --use_hf_asr

    Only models with pipeline_tag: automatic-speech-recognition on Hugging Face Hub are supported.

  • Translate to other language by Gemini:

    stream-translator-gpt {URL} --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} --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 --language {input_language}

  • Record system audio as input:

    stream-translator-gpt device --language {input_language}

  • Record microphone as input:

    stream-translator-gpt device --language {input_language} --mic

  • Sending result to Discord:

    stream-translator-gpt {URL} --language {input_language} --discord_webhook_url {your_discord_webhook_url}

  • Sending result to Telegram:

    stream-translator-gpt {URL} --language {input_language} --telegram_token {your_telegram_token} --telegram_chat_id {your_telegram_chat_id}

  • Sending result to Cqhttp:

    stream-translator-gpt {URL} --language {input_language} --cqhttp_url {your_cqhttp_url} --cqhttp_token {your_cqhttp_token}

  • Saving result to a .srt subtitle file:

    stream-translator-gpt {URL} --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

stream_translator_gpt-2026.7.26.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

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

stream_translator_gpt-2026.7.26-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

Details for the file stream_translator_gpt-2026.7.26.tar.gz.

File metadata

File hashes

Hashes for stream_translator_gpt-2026.7.26.tar.gz
Algorithm Hash digest
SHA256 c99b867259d3b4750ac0a2aa68ca82c9d33ac9168ba0dd45a62437b26c1c0be1
MD5 53994b9afc6c6e41872100fa15d0e986
BLAKE2b-256 12605843268e1982343adfb54a868740e5dda20e641c094b973885b583282b4c

See more details on using hashes here.

File details

Details for the file stream_translator_gpt-2026.7.26-py3-none-any.whl.

File metadata

File hashes

Hashes for stream_translator_gpt-2026.7.26-py3-none-any.whl
Algorithm Hash digest
SHA256 efe4d8839cfa551a4ef9d0b9e03303c656a05b21af7c36a0b7507a89029d5a24
MD5 41fb660c5b6639871576ff5f7709979c
BLAKE2b-256 e93f2f3069588a22454f2d4e24dfcf9515d88e052d1d00ce7830f360507ab6ac

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