How to use Free Software to learn Japanese, and more.

Mining from movies and TV-shows

June 05, 2021 — Tatsumoto

Sentence mining is the process of picking sentences from your immersion and making Anki cards. Each sentence has one unknown piece of information, which is referred to as target word.

To mine sentences from movies and TV-shows you are going to need the mpv video player, and a plugin for mpv called mpvacious.


mpv is the best video player for language learners. It is fast, minimal, extensible and compatible with all video formats. mpv is available on most distributions of GNU/Linux. To install it on Arch Linux, execute the following command:

$ sudo pacman -S mpv

Make sure you have version 0.33.0 or later. If such a version is not available on your distribution, see here for different installation options.

Start mpv at least once to create the config folder which will be located at ~/.config/mpv/.

To configure mpv, create and open ~/.config/mpv/mpv.conf. This step is not strictly necessary.

Example configuration file
# Define language preferences
# mpv will resume where you left off when you reopen a media file
# Automatically use external subtitle files that contain the name of the media file
# Additional folders for storing subtitle files.
# You can drop all subs in the "subs" folder to keep files organized.
# Subtitle font. Make sure the font you select is installed
# and contains all characters that are included in your subtitle files.
sub-font="Noto Sans CJK JP Regular"
# Change subtitle font size.
# Uncomment this if you want mpv to override styles from SubStation Alpha (.ssa/.ass) subtitles
# sub-ass-override=force
# Improves audio when the playback speed is changed.
# Screenshots

Note: To tell mpv to show subtitles in the font you selected in the config, press u. If you want to make the setting permanent, add sub-ass-override=force to mpv.conf.

~/.config/mpv/input.conf contains key bindings. For all available bindings, see /usr/share/doc/mpv/input.conf.

Example input.conf
# Increase / decrease subtitle font size
# Works only when sub-ass-override=force
/ add sub-scale +0.1
? add sub-scale -0.1
# Cycle video aspect ratios; "-1" is the container aspect
A cycle-values video-aspect "16:9" "16:10" "4:3" "2.35:1" "-1"
# Vim-like seeking
l seek  5
h seek -5
j seek -60
k seek  60
# Cycle between subtitle files
K cycle sub
J cycle sub down
# Skip to previous/next subtitle line (disabled - use mpvacioius)
#H no-osd sub-seek -1
#L no-osd sub-seek 1
# Search sub-text on
Ctrl+j run "/bin/sh" "-c" "xdg-open '${sub-text}'"
# skip to next/previous file
> playlist-next
< playlist-prev
# Add/subtract 50 ms delay from subs
Z add sub-delay +0.05
z add sub-delay -0.05
# Adjust timing to previous/next subtitle
X sub-step 1
x sub-step -1
# Toggle OSD visibility
V script-binding visibility

Download content

Always download what you watch. This way it's easier to work with the files, make Anki cards, take screenshots, cut clips, make condensed audio, and so on. Don't use "services" that spy on you such as Netflix, Hulu, VRV, Funimation or Crunchyroll.

Attempts to create flashcards from streamed video files often fail. As a workaround the user can record audio and take a screenshot manually, but it is not convenient at all.

Explore Immersion material to find Japanese content and Download tools for a ways to download it.

Obtain subtitles

To learn Japanese from visual content such as anime or jdramas you need Japanese subtitles. Subtitles can be found on Kitsunekko and on our Resources page. If you want to synchronize the subtitles, see the autosubsync-mpv page.

Sometimes the only subtitle files available for a particular video are image-based (.sup or .sub). Often this is the case with subtitles for movies. They don't contain any text and by themselves are not very useful. SUP files can be converted to plain text (.srt) using OCR (Optical Character Recognition) programs such as subtitleedit.

Don't forget that if you have English subtitles enabled, at best you're going to improve your English, but your Japanese is not going to get any better.


mpvacious is a plugin for the mpv video player that allows you to make Anki cards while watching movies and TV shows in your target language.

mpvacious can update Anki cards you add with Yomichan by filling the audio and screenshot fields. Here is a video demonstration:


mpvacious needs AnkiConnect and xclip to work.


mpvacious can be installed with git:

$ git clone '' ~/.config/mpv/scripts/subs2srs


Download the example config file and save it to ~/.config/mpv/script-opts/subs2srs.conf. If you use the Note Type from the recommended mining deck, you don't need to change any settings at all. If you don't, make sure to adjust at least the following variables:

  • sentence_field
  • audio_field
  • image_field


  1. Make sure Anki is running.
  2. Open a video in mpv.
  3. Press Ctrl+t to activate clipboard autocopy.
  4. Open your web browser and activate Yomichan Search by pressing Alt+Insert.
  5. Enable clipboard monitor in Yomichan Search.
  6. When there is a word you want to mine, create a card with Yomichan.
  7. Go back to the mpv window and press Ctrl+m. If you want to grab a sentence that spans multiple lines, press a to open the advanced menu. Then mark the lines you want to appear on the card by pressing c and moving the position with Shift+h and Shift+l. Finish by pressing m.
  8. The Anki Browser window should appear with the card updated.

You can save sentences for later without adding definitions. To do so, press Ctrl+n.


To update mpvacious, run the command below:

$ cd ~/.config/mpv/scripts/subs2srs && git pull

Should I use a "text hooker" page?


Though you often see such recommendations, I think it unnecessarily complicates your setup. Yomichan Search can do the same thing simpler.

Tags: guide, mpv