Anki crashes because of MPV

@dae thank you, I’ll try to do what I can.

@influencia @mysaturnday thank you, that was very helpful. I could reproduce the issue with mpv video player on Windows when Anki is no longer responding and can only be closed with the Task Manager.

I could reproduce it with the packaged mpv version and with the latest mpv version. It’s a bit random, though with the latest mpv version it seems to happen more frequently. I used a deck with one card and ~3 seconds video for testing. I clicked the audio play button, the video file started playing, went back to Google Chrome, and when the video file stopped playing clicked Anki icon in the taskbar, and if Anki was still responding clicked the audio play button again and went back to Google Chrome. Sometimes it happened on the 3rd try, sometimes on 5th or 10th, but sometimes I couldn’t reproduce it and restarted Anki to try again.

@influencia I believe you’re talking about the same problem as @mysaturnday , i.e. the main Anki window is still there, but it’s greyed out and you can’t click on anything. It should be scenario 1 (“when the video is over”) and scenario 3 (“use the X button to close the video”).

@influencia and @mysaturnday for now please try to install the add-on “Video Fix 1” - https://ankiweb.net/shared/info/1006287781 - restart Anki and let me know if it still happens. The add-on will tell Anki to create a new mpv.exe process every time to play the audio or video file. It seems to work for me but I haven’t tested it very much.


@influencia If mpv crashes in the middle of the video playback (probably scenario 2), try to update your graphics card driver, restart your PC and install the latest mpv version.

  • Download mpv from mpv player (Windows) - Browse /64bit at SourceForge.net

  • Unpack it somewhere with 7-Zip

  • Move mpv.exe, mpv.com, d3dcompiler_43.dll, or all files, to C:\Program Files\Anki

  • Open Anki and press Ctrl+Shift+; to open the debug console and check mpv version

    Introduction - Anki Manual

  • Copy-paste the following code and press Ctrl+Enter

    from aqt.sound import mpvManager
    print(mpvManager.get_property("mpv-version"))
    
  • The output will be something like

    mpv 0.32.0-723-g49f5c9b482

If it won’t help, we could try then to tell mpv to enable or disable hardware decoding or try a different video output driver or maybe some other mpv options.

3 Likes