Setting up mpv with mpvacious (sub2srs) and Yomitan

I couldn't really find any good guides on installing mpv with mpvacious, and getting it to work with Yomitan (Yomitan is the successor to Yomichan) and Anki on Windows, so I'm writing this in case anyone else struggles to combine all these tools into a workflow. These are tools developed to help with immersion based language-learning. There are a few different approaches to it, but they all largely boil down to the same thing: absorb as much content in your target language as you can, and create Anki flashcards with sentences in them that contain 1 word you don't know.

The goal is to setup mpv and Yomitan so that whatever subtitles are displayed in mpv also automatically show up in Yomitan. Then, using Yomitan, we can look up the definition of a word and add it to Anki. mpvacious will then add the audio, image and sentence from the video in mpv.

Yomitan works with all languages; you just need to find a dictionary for the language you're learning. I will be using the Japanese ones in this guide.

Installing mpv

mpv can be installed from their site. I heard the shinchiro version works best for windows. It's just a zip file that unzip somewhere on your computer. Download the FFMPEG release as well and place it in your mpv installation directory.

Installing mpvacious

To install mpvacious, follow the instructions in their README. However, instead of installing it in AppData\Roaming\mpv\scripts, install it in <mpv-install-dir>\portable_config\scripts. You can try installing it in AppData but I wasn't able to get it to work.

Next, the configuration needs to be installed. I used the default configuration file. Place this in <mpv-install-dir>\portable_config\script-opts.

I recommend changing the snapshot_quality=15 to a higher number because the screenshots will look terrible at that resolution. I use 100 but you can choose whatever number up to 100 that you'd like.

Setting up AnkiConnect

AnkiConnect allows other applications to send data to Anki. To install it, open Anki and go to Tools > Add-ons > Get Add-ons... Enter 2055492159 for the code, and click OK.

Setting up Yomitan

Yomitan can be installed from their site. Grab the one for your browser. Here's a quick primer on Yomitan.

Install the dictionaries for your language. I installed Jitendex and KANJIDIC.

Go to the settings for Yomitan. Enable the following:

Installing Kanjium pitch accent dictionary (optional)

People who learn Japanese usually take pitch accent seriously. Contrary to popular belief, Japanese is not a "flat" langauge, but it's not fully tonal either. Instead, it has pitch accents; parts of words are in different pitches than others. Learning pitch accent will help minize your accent.

You can download Kanjium from here and import it into Yomitan. Don't unzip the file; Yomitan requires a zip file for dictionaries.

Workflow

Now that all the pieces are setup, we can start sentence mining. You'll need a video with subtitles in your target language.

  1. Open Anki.
  2. Start Yomitan in your browser.
  3. Open mpv and load the video and subtitles.
  4. Press Ctrl+t to start clipboard autocopy for subtitles.
  5. Once you come across a sentence that has a word you don't know, pause the video and open Yomitan.
  6. Select the word, and click the little + sign on the far right side of the word. This will add it as an Anki note; it'll contain the word along with the definition.
  7. Go back to mpv, and press Ctrl+m. This will add a screenshot, audio, the full sentence with the word highlighted, and (if available as a subtitle) the English translation of the sentence to the note.
  8. Inspect the card in the Anki browser to make sure it got the right info.
  9. Continue watching the video and keep mining.

If there's a sentence that spans multiple lines, press a, then i to open the mpvacious advanced menu. Press Shift+s to start recording sentences, and Shift+e to finish. Then follow the above steps to add the card with Yomitan. Then go back to mpv and press Ctrl+m to update the Anki card.

Here's a demo of the whole thing in action. This has helped me speed up sentence mining tremendously, and the cards are of better quality than the ones I was making with Migaku. If you end up using these tools, considering donating to the authors to support development. At the moment only Tatsumoto is currently accepting donations.