Scripts to tune MPV into the video player for language learners.
- Key to switch subtitles between language you learn and language you
know. Very useful when there are 30 languages in
.mkv.
Default:b - Cycle prefered languages you know if there are any.
Default:B - Key to AB loop current sutitle, and reset.
Default:F5 - Auto AB loop mode that will loop each subtitle. Use key above or
l(default) to move forward.
Default:g - Quick seek to begining of current subtitle (addition to standard
Ctrl+leftandCtrl+right).
Default:c - Open subtitle in browser. 3 possible URLs.
Default URLs: Jisho and google translate
Default:F1,F2,F3. - Store current subtitle in
to_learnfolder. It stores text (.txt), meta info (.json) and audio (.mp3). For later adding into flash cards and so on. (ffmpegis needed for audio).
Default:F6 - Call external script with current subtitle, file, start, stop
timestamps.
Default:F7
- Use
bto cycle between language you know and language you learn. - If there are several languages you know, use
Bto cycle between them. After thatbwill use selected language. Ctrl+left/Ctrl+right(native bindings) to find needed subtitle. (notice it work well only for subtitles that were already shown)- Use
F1orF2to quickly lookup current text in dictionaries or transators. It will also pause the video. May be default bindingsf(full screen) andT(on top) will be useful when working with multiple windows. - Use
F6to save current subtitle into_learnfolder. It's for good phrases or frequent words you want to learn separately. - You can prepare a script and setup it for
F7to (for example) automatically create flash cards in Anki.
(tip: it also dumps current subtitile into console, for the case if you want to copy-paste something!)
- Important button -
v(native binding). It will show/hide subtitle, but it's still there! All saving/repeating and so on for that subitile should work. So right from the begining, switch to lang you want to learn (onceb) and pressvto hide it. - Use
cto seek to the begining of current subtitle, or (for listeners) to repeat the phrase. - Use
gto AB loop current subtitle (phrase). Pressgagain to move forward. - If everything gets complex, use
F5to AB loop each phrase automatically. Each time you understand it, pressgto move forward. If you give up, pressvto show answer, andborF1/F2/F3to show translation. - Again use
F6orF7to remember good phrases for later learning. - Use
[,](native) to change the speed. UseBackspaceto reset speed to normal. (tip:Shift+[will half the speed)
Look at lang-learner.conf for example and description of options.
Find movie/anime with switchable subtitles. Look for .mkv files and
sources that embedds a lot of subtitles in one file. If you are lucky,
you can find media with needed subtitles right inside.
If you miss some subtitle, look at sites like https://kitsunekko.net/ (for anime). Download and rename them to match movie/episode name.
(tip: to make external subtitle to have lang id, use following template
for naming: <mkv file name>.<lang>.ass.
For instance: Some anime - 02.jpn.ass)
Usually you have to sync external subtitles. Use GUI tools to edit subs like Aegisub, subtitlecomposer or magic syncers like ffsubsync. Don't forget to share your work for others!
Follow MPV instructions to install. (usually .lua should go into
~/.config/mpv/scripts/ and .conf into ~/.config/mpv/scrip-opts/).
- doesn't load Check script path. Try to call
mpvfrom shell, some frontends known to disable script loading. Uncomment lineprint("LOADED")at the begining of the script as a sign that it's loaded for easier debugging. - suddenly stops working. Run in terminal, try to reproduce, look in terminal for possible stack traces. If script crashes, then MPV disables it and disables all bindings.
- configuration option doesn't work. Run in console and watch for
warnings about unknown options. Add wrong option (
abc=123) in config file, and start mpv. If there is no warning, then MPV doesn't load config file at all. Check paths and naming.