Към съдържанието

Български субтитри от изкуствен интелект, без облак

Bulgarian AI Subtitles е започнат и направен в първоначалната си версия от Юлиян Маринов, Flashgate Ltd. След това аз го преработих и го интегрирах в Jellyfin. Резултатът е плъгин за Jellyfin, който намира видеата без български субтитри и ги прави сам. Разпознава речта, превежда всеки ред на български и записва .bg.srt до видеото. Нито кадър, нито звук излиза от сървъра.

Видео без .bg.srtплъгинът го намира и го нарежда
Разпознаванеfaster-whisper: реч в текст с тайминг
Преводлокален модел в Ollama
Филм.bg.srtзаписан до видеото
Jellyfinсубтитрите се появяват сами

Защо

За популярните филми субтитри има навсякъде. За по-стари филми, документални или семейни видеа на други езици често няма нищо на български. Исках сървърът да се справя сам, без да качвам нищо в облачна услуга.

Как работи

  1. Плъгинът в Jellyfin търси филми и епизоди без .bg.srt и ги праща на опашка. Проверява на всеки 6 часа или когато го пусна ръчно.
  2. Отделен worker в Docker разпознава речта с faster-whisper. Той сам познава езика и пази точния тайминг на всеки ред.
  3. Всеки ред се превежда на български от локален модел в Ollama. Таймингите остават същите, сменя се само езикът.
  4. Ако филмът е на български, преводът се прескача.

Предпазителите

Какво пази сървъра

  • Обработва се само един файл наведнъж.
  • Worker-ът е ограничен до 3 процесорни ядра и 6 GB памет.
  • Слуша само локално и иска таен ключ.
  • Отказва пътища извън медийната папка.

Какво пази файловете

  • Съществуващ .bg.srt никога не се презаписва без изрична заявка.
  • Записът е атомарен: или целият файл, или нищо.
  • Нищо не се качва в облак.

Честно за качеството

Машинният превод не е преводач. Разбираш всичко, но понякога някоя фраза звучи странно. И на процесора е бавно: филм отнема време. Следващата стъпка е видеокартата, която ще го ускори многократно. Засега е прототип, изпитан с тестови видеа, и точно така го представям.

Bulgarian AI Subtitles was started, and its first version built, by Yuliyan Marinov, Flashgate Ltd. I then reworked it and integrated it into Jellyfin. The result is a Jellyfin plugin that finds videos without Bulgarian subtitles and makes them itself. It recognises the speech, translates every line into Bulgarian and saves .bg.srt next to the video. Not a frame and not a sound leaves the server.

Video without .bg.srtthe plugin finds and queues it
Recognitionfaster-whisper: speech to timed text
Translationa local model in Ollama
Film.bg.srtsaved next to the video
Jellyfinthe subtitles just appear

Why

Popular films have subtitles everywhere. For older films, documentaries or home videos in other languages there's often nothing in Bulgarian. I wanted the server to manage on its own, without uploading anything to a cloud service.

How it works

  1. The plugin in Jellyfin looks for films and episodes without .bg.srt and queues them. It checks every 6 hours, or when I start it by hand.
  2. A separate worker in Docker recognises the speech with faster-whisper. It detects the language itself and keeps the exact timing of every line.
  3. Every line is translated into Bulgarian by a local model in Ollama. The timing stays the same, only the language changes.
  4. If the film is in Bulgarian, translation is skipped.

The safeguards

What protects the server

  • Only one file is processed at a time.
  • The worker is limited to 3 CPU cores and 6 GB of memory.
  • It listens only locally and needs a secret key.
  • It refuses paths outside the media folder.

What protects the files

  • An existing .bg.srt is never overwritten without an explicit request.
  • Writes are atomic: the whole file or nothing.
  • Nothing is uploaded to a cloud.

Honestly about quality

Machine translation isn't a translator. You understand everything, but now and then a phrase sounds odd. And on the CPU it's slow: a film takes a while. The next step is the graphics card, which will speed it up many times over. For now it's a prototype, tested on sample videos, and that's exactly how I present it.

Built to create. Not to obey.

// more

Още от „Проекти“

Всички публикации →