README.md

October 12, 2025 ยท View on GitHub

mpv2anki


Demo of MPV to Anki

Description

A simple script to assist your language learning journey in any language by automatically capturing multimedia content from mpv to Anki. It extracts the current subtitles (target language and native/secondary language), corresponding audio, and screenshot when triggered, making it easy to create flashcards.

Need help? Want to raise an issue? Looking for documentation? See Contributing & Support

Features

  1. Automatically create Anki cards with extracted content
    1. Extract current subtitle text from MPV
    2. Capture audio segment corresponding to subtitle timing
    3. Take screenshots at current playback position
  2. Field mapping configurations

Planned Features

FeatureSub-featureNotes
Custom audio segment selectionSet custom start and end points for audio clips independent of subtitle timing1
Quick card creationCreate cards directly without opening the editor window
DocumentationIINA set-up
Audio extractionURL/Video stream support (platforms supported by yt-dlp)2
Field mappingVideo filename mapping for [config.ANKI.FIELDS.SOURCE]

Note 1: Currently, the audio extraction strictly follows subtitle timing.

Note 2: Audio extraction currently only works with local video files. For video streams I recommend using free tools like Abs Player that work directly in the web browser.

Requirements

(all open-source)

  • mpv (or any software built on mpv like IINA) - cross-platform media player
  • ffmpeg - a suite of libraries to handle multimedia files
  • Anki - powerful SRS flashcard app
  • AnkiConnect - Anki add-on

Note: AnkiConnect add-on must be installed in Anki and Anki must be running while using this script.

Demo


Demo of MPV to Anki

Contributing & Support

TypeDescription
Issues & RequestsBug reports or feature requests
ContributingFork the repo and submit a PR
DiscussionsGetting help and questions
SupportSupport
Quick Start GuideQuick Start Guide
Technical documentationTechnical documentation
Help WantedNeed help with OS-specific testing

This script has been primarily tested on macOS. I currently don't have access to a Linux and Windows machine for thorough testing.

Acknowledgements

While not a direct fork, this project acknowledges mpv2anki, an earlier Linux-specific implementation with similar goals that appears to be no longer maintained.