Updating to latest mpv version

Is your feature request related to a problem? Please describe.
I use AAC files because its universal - every anki client can play them, and they produce smaller audio files than mp3 with better quality.

This itself is fine, but I want to go smaller. I want to use xHE-AAC. Which I believe is also just as universally supported by default on all OS except Windows mpv. I do not have mac so I can’t comment on mac but from the anki-bundle-extras/mac/arm64/mpv.rb at main · ankitects/anki-bundle-extras · GitHub seems to be the same exact version that Windows uses as well.

The support for xHE-AAC is already added in FFmpeg 7.1 by default.

The current mpv version that is being used for anki Windows is 0.34.0 - which uses FFmpeg 4.0 I believe from Nov 2021.

Describe the solution you’d like
Please use the latest release of mpv. I tried to see if I could contribute on github but I believe you manually add it into the anki-audio wheel yourself? anki-bundle-extras/win at main · ankitects/anki-bundle-extras · GitHub

Describe alternatives you’ve considered
For the time being I just swapped out the default mpv.exe from %USERPROFILE%\AppData\Local\AnkiProgramFiles.venv\Lib\site-packages\anki_audio\mpv.exe to the latest mpv.exe by shinchiro mpv player (Windows) - Browse /release at SourceForge.net. I haven’t tested any other Windows build for mpv yet. Seeing as the current latest version of mpv only requires ffmpeg 6.1 or above, I guess it is not a guarantee that all different variants of the current latest mpv will necessarily support xHE-AAC.

I understand if you are opposed to updating it because if it work it works yknow. I’ll just leave this post for anyone else who wants xHE-AAC support on Windows.
I do not wish to be a burden on the anki servers, so I try to make my files as small as possible.

PS. Yes I would’ve use opus but iOS doesn’t support it.

1 Like

I logged it here: Update to latest mpv? · Issue #4521 · ankitects/anki · GitHub

2 Likes

Just wondering: Why do we need mpv in the first place? Can’t the webengine handle the audio/video playback as it does in the web browsers like Chrome?

I don’t use cards with audio/video, though.

1 Like

The web engine supports very few formats out of the box:

2 Likes

Anki’s architecture is pretty good.
They’ve decoupled their backend and their frontend very well. Anki’s rslib is awesome. The fact its Rust made generating the docs really easy so I could see the APIs I needed.

I made a lil prototype Rust Tauri frontend for Anki. Just the reviewing part was all I cared about.
So this baby can run on linux, windows, what have you. It’s nice and small and isn’t a mess of python and Qt. I initially made it because I wanted to maximize battery usage by getting rid of shit I didn’t need in the desktop Anki client. Since it’s Tauri it takes the webview of your OS. And here-in lies the problem. It’s not going to be consistent and thats fine.

BUT I wanted xHE-AAC support and boy linux doesn’t make it easy. I’m just not familiar enough on how to get linux’s webkit to play my xHE-AAC files. I know its a proprietary format but c’mon I’ve installed every single thing and enabled every single config that would let me play xHE-AAC in webkitgtk but nope, nada. So I gave up - maybe cause I was in WSL. I can’t be bothered installing a real linux environment. And I really didn’t wanna go to the spawn mpv or ffmpeg route lel. That defeats the whole purpose of using the webview. But it wouldve made it like actually production release viable if there were ever a roadmap to moving away from Qt.

but if your media files were just normal shit and not what I’m doing. Yea the lil’ Tauri app I wrote works well enough. Works on Windows 11 cause they have xHE-AAC support so thats cool. But I mainly use Linux for anki so that sucks.