Whether you’re watching a local video on your computer or streaming content from a service, you can easily generate subtitles through MPV.
Dependencies
- Whisper.cpp
- yt-dlp
- ffmpeg
- WhisperSubs (Lua script): GhostNaN/whisper-subs
Using CUDA Cores with an Nvidia Graphics Card (For Arch)
You can increase subtitle generation speed by utilizing CUDA support. Follow these steps:
- Install CUDA:
- Download Whisper.cpp
Supported Model Names
tiny.en
, tiny
, tiny
, base.en
, base
, small.en
, small
, medium.en
, medium
, large-v1
, large-v2
, large-v3
Running with CPU
To run without CUDA support, using CPU:
- Clone Whisper.cpp
Lua Script Setup
- Place the whispersubs.lua file in the
~/.config/mpv/scripts folder.
- Edit the WHISPER_CMD line in the script to reflect the installation path of Whisper.cpp:
Open the video and press CTRL + .
to generate subtitles.