add-srt-next-to-videos
Generate .srt subtitle files next to video files. Point it at a file or folder, get subtitles.
Runs entirely on your Mac — MLX Whisper handles speech-to-text, a local LLM handles translation. Nothing leaves your machine.
Requirements
- Apple Silicon Mac (M1/M2/M3/M4) — MLX only runs on Apple Silicon
- Python 3.10+
- pipx for system-wide install
- For translation: any local LLM server with an OpenAI-compatible
/v1/chat/completionsendpoint — LM Studio, Ollama, etc.
Install
# Homebrew
brew install yuyangchee98/tap/add-srt-next-to-videos
# From PyPI
pip install add-srt-next-to-videos
# Or with pipx (isolated install, recommended)
pipx install add-srt-next-to-videos
# Or directly from GitHub
pipx install git+https://github.com/yuyangchee98/add-srt-next-to-videos.git
After install, create a .env file in the directory where you run the command (or your home directory):
cp .env.example .env
# edit .env with your model preferences
To uninstall: pipx uninstall add-srt-next-to-videos
For development:
git clone https://github.com/yuyangchee98/add-srt-next-to-videos.git
cd add-srt-next-to-videos
uv venv && uv pip install -e .
Configuration
Copy .env.example to .env and edit:
# Whisper model for speech-to-text (HuggingFace repo)
WHISPER_MODEL=mlx-community/whisper-large-v3-mlx
# LLM for translation (any server with an OpenAI-compatible /v1/chat/completions endpoint)
# Works with: LM Studio, Ollama, vLLM, llama.cpp server, etc.
LLM_URL=http://localhost:1234
LLM_MODEL=qwen3-32b-mlx
Whisper model weights (~3GB) download automatically on first run and cache in ~/.cache/huggingface/.
The LLM is only used for translation. If you only need transcription (source language subs), you don't need an LLM server running.
Usage
# Transcribe Japanese audio -> Japanese subtitles
add-srt-next-to-videos ./videos -l ja --subs ja
# Translate to English
add-srt-next-to-videos ./videos -l ja --subs en
# Multiple languages at once
add-srt-next-to-videos ./videos -l ja --subs ja,en,zh
# Dual-language subs (both languages in one file, for language learning)
add-srt-next-to-videos ./videos -l ja --subs ja-en
# Mix and match
add-srt-next-to-videos ./videos -l ja --subs ja,en,ja-en,ja-zh
# Single file
add-srt-next-to-videos ./episode01.mp4 -l ja --subs ja,en
Works on single files or entire directories (recursive). Existing .srt files are skipped unless you pass --overwrite.
Output files
The sub spec determines the filename:
video.mp4 -> video.ja.srt (transcription)
video.mp4 -> video.en.srt (translation)
video.mp4 -> video.ja-en.srt (dual: japanese on top, english below)
A dual-language .ja-en.srt looks like this:
1
00:00:05,000 --> 00:00:10,679
母ちゃん母ちゃん今日はどこ行くの
Mom, mom, where are we going today?
2
00:00:10,679 --> 00:00:12,060
美容院よ
The beauty salon.
How it works
- Whisper transcribes the audio once per video — timestamped segments in the source language
- LLM translates each segment's text to other languages (only if needed)
Whisper handles transcription only. All translation goes through your local LLM for better accuracy.
The tool transcribes once and caches the result per video, so --subs ja,en,ja-en runs Whisper once and translates to English once, even though two outputs use the English translation.
CLI reference
add-srt-next-to-videos [-h] [--language LANGUAGE] [--subs SUBS] [--overwrite] path
| Flag | Short | Default | What it does |
|---|---|---|---|
path |
(required) | Video file or directory (recursive) | |
--language |
-l |
auto-detect | Source language (ja, en, zh, etc.) |
--subs |
-s |
source lang | What to generate: ja, en, ja-en, or comma-separated |
--overwrite |
off | Regenerate existing .srt files |
Whisper model and LLM settings are configured in .env (see Configuration).
Supported video formats
.mp4 .mkv .avi .mov .webm .flv .wmv .m4v .mpg .mpeg .ts .vob
Notes
-
If a run gets interrupted, just re-run the same command — it skips videos that already have their
.srtfiles -
Language codes are ISO 639-1. Whisper supports these languages for transcription:
afAfrikaans,arArabic,hyArmenian,azAzerbaijani,beBelarusian,bsBosnian,bgBulgarian,caCatalan,zhChinese,hrCroatian,csCzech,daDanish,nlDutch,enEnglish,etEstonian,fiFinnish,frFrench,glGalician,deGerman,elGreek,heHebrew,hiHindi,huHungarian,isIcelandic,idIndonesian,itItalian,jaJapanese,knKannada,kkKazakh,koKorean,lvLatvian,ltLithuanian,mkMacedonian,msMalay,mrMarathi,miMaori,neNepali,noNorwegian,faPersian,plPolish,ptPortuguese,roRomanian,ruRussian,srSerbian,skSlovak,slSlovenian,esSpanish,swSwahili,svSwedish,tlTagalog,taTamil,thThai,trTurkish,ukUkrainian,urUrdu,viVietnamese,cyWelshTranslation to any language depends on your LLM's capabilities
License
MIT
Metadata
Release files for add-srt-next-to-videos 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| add_srt_next_to_videos-0.1.2.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| add_srt_next_to_videos-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.5 kB
Release files / add_srt_next_to_videos-0.1.2.tar.gz
| Download URL | add_srt_next_to_videos-0.1.2.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dda34bd6e7151fe0abe3c7c7b901c700d6bc44f34e4b6aceda87ffbc4913ad7
|
|
BLAKE2b-256 checksum How to use checksums |
f9e916bb69531c7f9e8a9725ca16482036e76d974c8be4b79a1caa7595ec69ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / add_srt_next_to_videos-0.1.2-py3-none-any.whl
| Download URL | add_srt_next_to_videos-0.1.2-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
670d80fef3ed40f471440f951294ce2e8966223ecaf43894e793ac73d4feaa1f
|
|
BLAKE2b-256 checksum How to use checksums |
2340996e173776bd1887b19566a7e365b53fa40aab09645bfc82075800c73af3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|