oltodosel/interSubs
fork
Interactive subtitles for mpv, that was made to help study languages.
Easily tweaked and customizable.
- Supported dictionaries:
- Offline \t separated dictionary. pyglossary
- https://www.deepl.com/translator for whole sentences.
- http://linguee.com/ redirecting to browser by click.
- https://forvo.com/, https://pons.com/ or Google for pronouncing single words.
- Can use multiple dictionaries simultaneously.
- Reassigning mouse buttons functions in config.
- Doesn't work with DVD (picture based) subtitles, only the text-based ones.
- Script to convert picture based subtitles into *.srt; also extracts them from *.mkv
- Can extend time of subs showing; for slow readers
00:02:23,046 --> 00:02:25,990
bla bla
00:02:28,020 --> 00:02:33,084
waka waka
00:02:23,046 --> 00:02:28,020
bla bla
00:02:28,020 --> 00:02:33,084
waka waka
- mpv 0.27 (I don't know if it will work with mpv front-ends.)
- python => 3.6
- pyqt5 (pip/pacman/etc)
- composite manager; xcompmgr or sth.
- numpy (pip/pacman/etc)
- beautifulsoup4 (pip/pacman/etc)
- requests (pip/pacman/etc)
- python-lxml
- lua
- socat
- pkill
- xdotool (for hiding subtitles when minimizing mpv or switching window)
- optional: chromium (for external translation, other browser can be specified)
- optional: wget (for listening to pronunciation)
$ ./install.sh
- Edit configuration file interSubs_config.py
- Edit interSubs.lua to add option where interSubs will start automatically.
- For Mac also edit configuration at interSubs.lua
- On KDE(kwin) go to composite and uncheck "Allow applications to block compositing". Screenshot.
- For Windows - port it yourself.
- Start video with mpv & select subtitles.
- F5 to start/stop interSubs.
- Starts automatically with files/paths specified in interSubs.lua
- Point cursor over the word to get popup with translation.
- F6 to hide/show without exiting.
Buttons bellow may be reassigned in config
- Click on the word to look it up on another translator in the browser.
- Right-click on the word to hear its pronunciation.
- Wheel - scroll through transitions in popup.
- Wheel+Ctrl - resize subtitles.
- Wheel+Shift - change subtitles' vertical position.
- Wheel-click - cycle through auto_pause options.
- Wheel-click-left/right - +/- auto_pause_min_words. (fancy mouses)
- Back-click - translate whole sentence. (fancy mouses)
- May have issues working in a multi-monitor system. See the solution.
- On KDE subtitles might sometimes be invisible. See the solution.
- Instead of changing system settings you may change --x11-bypass-compositor
- Stuttering video during subtitles change might be solved by changing mpv's video output
mpv --vo gpu
.
$ echo "hello world" > /tmp/intersubs-test.txt
$ python3 intersubs/intersubs.py whatever /tmp/intersubs-test.txt testing