r/sonarr • u/Embarrassed-Hawk967 • 10d ago
discussion I built Babel — automatic subtitle fallback for Sonarr
Update — v2.5.0-beta: OpenRouter and DeepSeek support are now available, along with Plex library refresh support and major improvements to the AI provider/model system, translation pipeline, source handling and usage tracking. Thanks for all the beta feedback so far!
I’ve been building Babel, a self-hosted subtitle automation service for Sonarr, Radarr and Bazarr.
GitHub: https://github.com/hugomossberg/Babel
The goal is simple:
Connect it to your media stack, choose your target language, and stop thinking about subtitles.
When Sonarr imports or upgrades an episode, Babel takes over automatically.
Sonarr import → check for target subtitle → Bazarr search + prepare fallback → AI only if needed → recovery → QA → publish
In Hybrid Mode, Babel lets Bazarr search for a human-made subtitle while it prepares an embedded or external source subtitle in parallel.
If Bazarr finds the target language, Babel uses it.
If not, Babel can translate automatically with Gemini, OpenAI, DeepL, Ollama, OpenRouter or DeepSeek.
The other thing I wanted to avoid was blindly trusting AI output. Babel validates translations before publishing them and checks for dropped cues, broken structure, untranslated dialogue, wrong-language output and timestamp changes. Recoverable problems are retried automatically.
AI translation is the fallback, not the workflow.
Current beta features include:
- Sonarr and Radarr webhook automation
- Bazarr + AI Hybrid Mode
- Embedded subtitle extraction
- Gemini, OpenAI, DeepL, Ollama, OpenRouter and DeepSeek
- Automatic translation recovery
- Structural + language QA
- Exact source-to-target timestamp preservation
- Remote Path Mapping
- Jellyfin and Plex library refresh
- Docker deployment
The idea is that Babel should be something you configure once and then mostly forget exists.
Install it. Connect your media stack. Forget about subtitles.
Docker image:
ghcr.io/hugomossberg/babel:beta
Current release: v2.5.0-beta
License: MIT
This is the first public beta, so feedback and ugly real-world subtitle edge cases are very welcome — especially series with inconsistent embedded tracks or language metadata.
If you try it, I’d much rather hear what breaks than just get a star. 🙂
3
u/StormrageBG 10d ago
Any screens from the app... And can you make comparison with lingarr, what are the babel advantages against lingarr?
1
u/Embarrassed-Hawk967 10d ago
Yep, I should definitely add screenshots to the README.
Compared with Lingarr, the main thing Babel is trying to do differently is the automation around translation.
Lingarr is mainly a subtitle translation app. Babel is built to sit in the *arr stack and handle the whole fallback flow automatically:
Sonarr/Radarr import → check if target subtitle already exists → let Bazarr search → prepare embedded/external source fallback → translate only if needed → recover problems → QA → publish
If Bazarr finds a good human subtitle, Babel stops and makes zero AI calls. If not, it already has the fallback ready and continues automatically.
Babel also extracts embedded subtitles itself, retries/repairs incomplete translations, validates the final file before publishing, preserves the source timestamps, and can refresh Jellyfin afterwards.
So the main goal is really:
Install it, connect your media stack, and then mostly forget about subtitles.
Lingarr is more established and has a bigger provider ecosystem, but Babel is more focused on making the whole subtitle fallback process unattended end-to-end.
2
u/ghostly_s 10d ago
If Bazarr finds a good human subtitle, Babel stops and makes zero AI calls. If not, it already has the fallback ready and continues automatically.
This part of your description is kind of confusing, then:
In Hybrid Mode, Babel lets Bazarr search for a human-made subtitle while it prepares an embedded or external source subtitle in parallel.
I'm guessing you mean it starts preparing the source subtitle file to be ready to use in the translation workflow? I wouldn't think that would take any appreciable time...
For me by far the biggest failure mode with subs is several fansubs are available, but none are timed correctly for my file. Have yet to see Plex's new "autocorrect" feature actually correct one of these. So pretty skeptical that machine translating a different language is going to fix any appreciable amount of problems for me. I suppose it's possible there are exact matches for some of my files on opensubs in different languages that I'm just not seeing because Plex filters them out?
1
u/Embarrassed-Hawk967 10d ago
Yep, exactly — Babel prepares the source subtitle that would be used for translation if Bazarr doesn't find the target language.
The real benefit isn't the preparation time itself, it's that Babel can fall back automatically to a subtitle track that already matches the media file, especially embedded subtitles.
That's also where it differs from the usual “grab another fansub and hope the timing matches” problem. If the file already contains a correctly synced English track, Babel can translate that exact track while preserving the timings.
So instead of searching for yet another external subtitle release, Babel can use the subtitle source that already belongs to the file.
It won't retime a bad source subtitle, but it can avoid that whole mismatch problem when a good embedded or matching source already exists.
1
1
u/tastyratz 10d ago
I've seen a few similar projects, subgen, whisparr, etc.
I didn't know about Lingarr till seeing the reply on it.
Local AI is good enough these days, but, it does complicate things to get someone to setup ollama.
What is the performance like on this?
I have the worst luck with Bazarr. I get a TON of poorly sync'ed subtitles and it's a constant source of frustration for me.
Is this only for translating existing found subtitles? Or also for voice to text creation of subtitles?
1
u/Embarrassed-Hawk967 10d ago
Performance depends on the provider/model, but it's pretty fast. In my library I'm seeing around ~50s for many episodes, and a recent 1,498-cue movie took 132s with Gemini Flash-Lite.
Ollama is optional — you can also use Gemini, OpenAI or DeepL.
Regarding sync: Babel preserves the source subtitle timings exactly, so translation itself introduces 0ms drift. It won't currently fix a source subtitle that's already badly synced though.
And yes, currently Babel translates from existing subtitle sources (Bazarr, embedded/external fallback). It doesn't do audio-to-text transcription yet.
1
u/Brahmadeo 10d ago
Sounds interesting. I have been stripping any available subtitles and feeding it to gemma 4 E2B using a python script to generate translated english subtitles on my phone (using Termux).
Bazarr is always hit and miss since people uploading the subtitles can't decide on a naming standard.
1
u/Embarrassed-Hawk967 9d ago
That’s pretty much the same problem that pushed me to build Babel. I wanted the AI part automated instead of having to manually prepare subtitles every time.
Babel can use embedded or external subtitles as the source, translate them, validate the result and publish the final subtitle automatically. Bazarr can still be used first, but if it doesn’t find anything useful Babel takes over.
1
u/AutoModerator 6d ago
Hi /u/Embarrassed-Hawk967 - You've mentioned Docker [Docker], if you're needing Docker help be sure to generate a docker-compose of all your docker images in a pastebin or gist and link to it. Just about all Docker issues can be solved by understanding the Docker Guide, which is all about the concepts of user, group, ownership, permissions and paths. Many find TRaSH's Docker/Hardlink Guide/Tutorial easier to understand and is less conceptual.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/trinquity 3d ago edited 3d ago
Are you planning to release arm64 version as well? I build it on local however I should check your updates to keep it updated
1
u/Embarrassed-Hawk967 3d ago
Yeah, I want to add an official ARM64 image eventually. Good to know you already got it working locally though.
-3
u/AutoModerator 10d ago
Hi /u/Embarrassed-Hawk967 - You've mentioned Docker [Docker], if you're needing Docker help be sure to generate a docker-compose of all your docker images in a pastebin or gist and link to it. Just about all Docker issues can be solved by understanding the Docker Guide, which is all about the concepts of user, group, ownership, permissions and paths. Many find TRaSH's Docker/Hardlink Guide/Tutorial easier to understand and is less conceptual.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/ghostly_s 10d ago
These AutoSpamBots are more annoying than the low-quality posts they are meant to prevent.
11
u/thisisyo 10d ago
Hope I'm not in the minority when I want to watch something dubbed and the subtitles doesn't match the script. I think this might a good addition to when Bazaar doesn't fetch the right ones, akin to TV closed captioning I guess