Skip to main content

Transcribe and translate video content - audio in, subtitles out

Project description

GLOSSATE

GLOSSATE takes a video or audio file and hands you back what was said — either as subtitles to watch along with, or as clean notes to read. In the original language, translated, or both at once.

I built it because most of the things I wanted to learn from were talks in a language I only half-speak, and the captions were either missing or bad enough to make it worse. Subtitles scrolling past once were never really enough; what I wanted was a page I could read at my own pace and keep. So GLOSSATE does both — the captions for watching, and the page for reading.

It turned out to be useful past my own case, too: an accurate transcript to read if you're hard of hearing, original-and-translation stacked line by line if you're learning the language, or just a tidy set of notes instead of scrubbing back through an hour of audio.

It's a one-person project leaning hard on AI. Fork it and take it further.

Quick start

pip install "glossate[cuda,detect]"   # NVIDIA / Colab; use [apple,detect] on Apple Silicon
glossate info                          # confirm device, FFmpeg, models
glossate talk.mp4 --target en          # → English subtitles next to your file

You'll need FFmpeg on your PATH (already there on Colab; brew install ffmpeg or apt-get install -y ffmpeg otherwise). Translation runs on Gemma, whose weights are gated — accept the license on its model page and huggingface-cli login once. GLOSSATE is built CUDA-first and is happiest on a Colab GPU; there's a notebook that runs every feature end to end at colab_outputs_test.ipynb.

It always transcribes. It only translates when you pass --target. Everything past that is your call.

Watch it, or read it

That's really the one decision GLOSSATE asks you to make, and it maps to --format.

Subtitles (--format srt, the default). Timed captions for any player. With --target each line is translated where it sits and the timing is left alone. Add --burn and it bakes them into a copy of the video instead of leaving a sidecar file.

Notes (--format md). This is the part other subtitle tools don't do. Raw transcripts read like rubble — no punctuation, broken mid-thought. So for notes, Gemma reflows them into actual paragraphs (it reformats; it doesn't summarize or invent). You get notes in the original language by default, or in the target language with --target. Ask for both with --md-scope both, and choose how they sit together: --md-layout two-prose puts the original and the translation in separate sections, while --md-layout dual-stack pairs them sentence by sentence — which is what I use when I'm actually trying to learn:

**[1:15]** Bu cümleyi anlamak istiyorum.

> I want to understand this sentence.

Those [m:ss] markers come from the cue timings in code, not from the model, so they stay accurate even after the words around them have been reflowed. Turn them off with --no-md-timestamps for a clean reading copy. (Dual-stack goes a step further than the captions: it rebuilds whole sentences from the fragments and translates them one sentence at a time, so the pairs actually line up grammatically.)

It transcribes once

Transcription is the slow step, so GLOSSATE caches it per file. Run the same video again for a different language, a different format, or to burn it in, and it skips straight past the audio model to the cheap part. Disable with --no-cache, move it with GLOSSATE_CACHE_DIR (it lives in ~/.cache/glossate/transcripts by default).

Models and machines

Transcription is Whisper — turbo by default, down to tiny if you want it lighter (--asr-model). Translation and notes default to Gemma 4 (gemma-4-e4b); on a bigger GPU, --mt-model gemma-4-26b or gemma-4-31b buys you quality. On Apple Silicon the MLX path runs Gemma locally, and ollama/MODEL works if you'd rather serve a model through Ollama.

On --device auto it sorts out the backend itself: faster-whisper on CUDA/CPU, MLX on Apple Silicon, and the matching translation backend for each. After the weights download, nothing about your files leaves your machine. Outputs land in ~/Documents/GLOSSATE/, dated.

From Python

Same engine, for batch jobs or wiring into your own code. Open a Session so the models load once:

import glossate

with glossate.Session(device="cuda") as s:
    for path in ["a.mp4", "b.mp4", "c.mp4"]:
        s.subtitle(path, target="en", format="md", md_scope="both", md_layout="dual-stack")

If you want to look at the transcript between steps, glossate.transcribe() gives you the timed cues and glossate.translate() translates them while keeping each original in source_text. subtitle, subtitle_video, transcribe, translate, write, burn_subtitles, Session, and the GlossateError hierarchy are the whole public surface.

The edges

Things I'd rather you hear from me:

  • The notes are only as good as the model. Gemma reflows and translates well, but on a long or messy transcript you'll occasionally catch an awkward seam or a too-literal line. Skim before you trust it.
  • Sentence pairing in dual-stack is heuristic. It won't split a decimal or a google.com, but an abbreviation like Dr. can still end a sentence one word early.
  • It runs on CPU, but transcribing a real talk and then running Gemma on it will test your patience. A GPU is the intended home.
  • ASR mishears names, jargon, and crosstalk. Pass --source when you already know the language, and reach for a larger --asr-model when accuracy matters more than speed.

License & thanks

GLOSSATE's code is MIT (LICENSE). It stands on Whisper and faster-whisper (MIT) for transcription, Gemma for translation and notes (Google's Gemma Terms — gated, with use restrictions), and MLX on Apple Silicon. Read the model licenses yourself before anything commercial — this isn't legal advice.

Issues and PRs welcome at https://github.com/anaxoniclabs/GLOSSATE/issues; glossate --verbose <file> prints a stage-by-stage log that helps with bug reports.

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

glossate-0.0.1.tar.gz (67.0 kB view details)

Uploaded Source

Built Distribution

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

glossate-0.0.1-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file glossate-0.0.1.tar.gz.

File metadata

  • Download URL: glossate-0.0.1.tar.gz
  • Upload date:
  • Size: 67.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for glossate-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f4f866b5f5de6757a2e4e64743b7a821a21e4ea12577ef295beb5dd457421266
MD5 5b1e8f3b518c5e2d1b4fba028703b931
BLAKE2b-256 3f43bead51fbd681216363bfca37a02f0462aad182087e612dacd238adee66ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for glossate-0.0.1.tar.gz:

Publisher: publish.yml on anaxoniclabs/GLOSSATE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file glossate-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: glossate-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for glossate-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92e83bceca82c3c0280269363b364322e27e8b29f4200d2f6848cefad401c266
MD5 704e923c1914b0aa255e0ef90f3e26b9
BLAKE2b-256 061f215f2277ac79fe8e1e1296a6370f18c6d8bc0e060c670f6817f387d06603

See more details on using hashes here.

Provenance

The following attestation bundles were made for glossate-0.0.1-py3-none-any.whl:

Publisher: publish.yml on anaxoniclabs/GLOSSATE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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