Subgen: Automatic Subtitles for Your Media Server Using Whisper
If you run a Plex or Emby server, you know the struggle: you find a great movie or show, but the subtitles are either missing, out of sync, or in a language you don't need. Manually searching for SRT files works sometimes, but it's tedious. What if your server could just generate them automatically?
Enter Subgen. It's a lightweight tool that hooks into Plex or Emby and uses OpenAI's Whisper model to generate subtitles on the fly. No more hunting down subtitle files. No more guessing if they match your release.
What It Does
Subgen listens for new media added to your Plex or Emby library. When a new video file appears (or you manually trigger it), Subgen runs Whisper against the audio track. The result is an SRT file placed right next to your video, ready to use.
You can specify the language (or let it auto detect), choose the Whisper model size (from tiny to large), and even decide whether to overwrite existing subtitles. It's designed to be a lightweight daemon that sits quietly in the background.
Why It's Cool
1. No More Subtitle Hunting
You know the drill: new episode drops, you load it up, and there are no subs. You spend five minutes searching for an SRT that matches your release group. With Subgen, it just works. Add the media, wait a bit, and subtitles appear.
2. Uses Your Own Hardware
Unlike cloud based solutions, Subgen runs everything locally. Whisper runs on your machine (GPU or CPU). That means privacy and zero API costs. You can also throttle the CPU/GPU usage so it doesn't choke your server during playback.
3. Smart Integration
Subgen connects directly to the Plex or Emby API. It knows when new media is added. It can also handle batch processing for existing libraries. Want to retroactively subtitle your entire collection? Just point it at your media folder and let it chew through files while you sleep.
4. Works Like a Standard Subtitle
The SRT files Subgen creates are plain text. You can edit them, move them, or sync them manually. They're not locked into any custom format. That means any player or server that supports SRT will work fine.
How to Try It
Getting started is straightforward:
-
Installation – You can use the prebuilt Docker image or run it directly with Python. The GitHub repo has clear steps.
-
Configuration – Edit a simple YAML file to point at your Plex or Emby server URL, API token, and media paths. You can also set the Whisper model size and language preferences.
-
Run – Start the daemon. It'll scan your library and begin generating subtitles for any missing ones.
# Example using Docker
docker run -d \
--name subgen \
-v /path/to/media:/media \
-v /path/to/config:/config \
ghcr.io/mcclouds/subgen:latest
Or if you prefer Python:
git clone https://github.com/McCloudS/subgen
cd subgen
pip install -r requirements.txt
python subgen.py
Make sure you have Whisper dependencies and a compatible GPU if you want faster processing. The repo includes a sample config.yaml to get you going.
Final Thoughts
Subgen is one of those tools that solves a real annoyance. No hype needed: it's a solid piece of glue between Whisper's powerful transcription and your media server. If you've ever been frustrated by missing subtitles, this is worth a try. For developers, the code is clean Python with good comments, and the Whisper integration is nicely abstracted. You could easily extend it to support other backends or custom formatting.
Just be aware that Whisper can be resource heavy. Start with a small model (tiny or base) and see how your server handles it. Larger models give better accuracy but take longer. For casual watching, even the small models do surprisingly well.
Give it a shot. Your future self (and your Plex users) will thank you.
Found via @githubprojects
Repository: https://github.com/McCloudS/subgen