MaKTaiL/gemini-srt-translator
Python tool for translating subtitles using Google Gemini AI
Gemini SRT Translator – a Python package that lets you translate, transcribe, and extract subtitles using Google’s Gemini models.
What it does
- Translate
.srtor.asssubtitle files into any language Gemini supports, keeping timestamps intact. - Transcribe audio/video files directly to subtitle format.
- Extract subtitles or audio from video (requires FFmpeg) and optionally feed the audio back to Gemini for better context.
- CLI (
gst …) for one‑liners and scripting, plus a Python API for programmatic use. - Supports Google’s standard Gemini API or the enterprise Agent Platform (Vertex AI) with ADC or API‑key auth.
- Features like batch processing, resumable runs, custom model parameters (temperature, service tier, etc.), logging, and token‑usage reports.
How you use it
- Install:
pip install -U gemini-srt-translator(prefer a virtualenv). - Set
GEMINI_API_KEY(or configure enterprise vars) – the tool will prompt if missing. - Run a simple translation:
Addexport GEMINI_API_KEY=YOUR_KEY gst translate -i movie.srt -l French-v movie.mp4 --extract-audioto pull subtitles from a video and give Gemini the audio for context. - For transcription:
gst transcribe -v lecture.mp4 -o lecture.srt - In Python you can do:
or work with the richerimport gemini_srt_translator as gst gst.gemini_api_key = "YOUR_KEY" gst.input_file = "movie.srt" gst.target_language = "French" gst.translate()SubtitleSession/TranscriptionSessionclasses for custom pipelines.
Who it’s for
- Content creators who need quick, high‑quality subtitle translations.
- Developers building automated video pipelines or AI agents that need subtitle handling.
- Researchers experimenting with Gemini’s “thinking” mode for more context‑aware translations.
Limits & requirements
- Requires a valid Gemini API key (or Google Cloud enterprise credentials).
- FFmpeg must be installed for video‑based extraction.
- Large files may need batch‑size tuning; the tool can auto‑reduce batch size on errors.
All details above are taken directly from the project’s README; no extra claims are added. ***
Key fields
- Category: subtitle translation / transcription tool powered by Gemini LLM.
- Installation:
pip install -U gemini-srt-translator(virtualenv recommended). - Primary interfaces:
gstCLI (translate,transcribe,extract,list-models,agent,skill), Python API (gst.translate(),SubtitleSession,TranscriptionSession). - Auth:
GEMINI_API_KEYenv var or enterprise vars (GOOGLE_GENAI_USE_ENTERPRISE,GOOGLE_CLOUD_PROJECT, etc.). - Dependencies:
ffmpeg(system), Gemini client library, standard Python packages. - License / status: Not specified in the excerpt, but the package is published on PyPI and has contributors.
End of explanation.
Related
- Project
- Dispatch
- Project
- Project
- Project