I did something similar for myself using mpv's scripting interface (for Japanese immersion).
I can press a button and have the current subtitle analyzed for words with mecab, or press another button and have audio + screenshot + text sent to Anki for review.
mpv allows to seek previous/next subtitle, so even relistening a particular phrase is really convenient.
It makes language learning really fun.