Skip to content

Simple MPV script for Anki flashcards creation. Automatically capture subtitles, audio clips, and screenshots while watching videos in MPV.

License

Notifications You must be signed in to change notification settings

alyssabedard/mpv2anki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Feature Sub-feature Notes
Custom audio segment selection Set custom start and end points for audio clips independent of subtitle timing 1
Quick card creation Create cards directly without opening the editor window
Documentation IINA set-up
Audio extraction URL/Video stream support (platforms supported by yt-dlp) 2
Field mapping Video 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

Type Description
Issues & Requests Bug reports or feature requests
Contributing Fork the repo and submit a PR
Discussions Getting help and questions
Support Support
Quick Start Guide Quick Start Guide
Technical documentation Technical documentation
Help Wanted Need help with OS-specific testing

This script has been primarily tested on macOS and Windows. I currently don't have access to a Linux 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.