Hacker News new | past | comments | ask | show | jobs | submit login

If you're on Linux, don't forget to enable hardware acceleration by adding hwdec=auto to mpv.conf. Works with AMD/Intel/NVIDIA.

https://interfacinglinux.com/2024/01/10/hardware-acceleratio...




Huh. Apparently I've been watching videos on mpv for years without HW acceleration. Good thing I read this; thanks!


I do it like this:

    vo=gpu-next
    gpu-api=vulkan
    hwdec=vulkan
    gpu-context=waylandvk
You can replace hwdec=vulkan with hwdec=vaapi if Vulkan video doesn't work.


Is there a reason why one would prefer vulkan over vaapi, or the other way round?


Vulkan in theory should be more flexible, but in practice VAAPI still has some advantages when it comes to power efficiency due to Vulkan path lacking some needed features (I think something to do with color space conversions which in Vulkan now have to happen using regular GPU compute units which is inefficient). In the longer term, Vulkan should be preferable in all scenarios.

See also some details here: https://github.com/mpv-player/mpv/discussions/13909


Why would that be disabled by default?


Because if you don't have to enable a flag or two in a text config file what's the fun of using Linux after all :)


Hahaha yeah, that's why I don't like it.


Doesn't work on all systems, I presume. Better to default to something that definitely works everywhere.

https://github.com/mpv-player/mpv/blob/a3baf94ab9f3b43a8027d...

Would be appropriate to have true/false/auto instead of auto==true though, so auto wouldn't use it unless it confirmed to be working.


Still, isn't this bizarre? Over the last couple of decades using Windows and macOS across many machines, I've encountered one time I had to mess with settings like this. That's the time I temporarily disabled hw accel in chrome so I could screenshare and watch a show with someone.

Meanwhile on Linux you gotta configure every app one at a time because sane defaults and auto configuration weren't invented here.


In addition to what others have said, hardware decoding comes with other drawbacks. There’s occasionally decoding inaccuracies and there’s no support for most video filters (unless you’re using `auto-copy`)


Do you know if/why on apple silicon Macs there’s a difference between videotoolbox and videotoolbox-copy ? I thought the SoC memory is shared and that there wouldn’t be a need for copying data from VRAM to RAM.


Try watching UHD HDR on intel iGPU without accel, or AV1. MPV also supports vulkan decoders.


If you autodetect hw accel, even the slowest underpowered gpu might get returned, which could result in worstened user experience compared to just using cpu.


Just do a quick automatic benchmark surely?


That's never been an issue on Windows or macOS. Apps only use the GPU if it's new enough


It breaks on suspend-to-memory for my system with a nVIDIA GPU. I assume that's a driver problem, though.


Not sure why but I've had lots of issues with worse performance (lagging/stuttering) on Fedora (I think kernel 6.10) with a Vega 64. Every year or so I'll give it a try and it just won't work well and I give up again.


Yeah, I just pacman-installed mpv and tried running it on a 4k video. My CPU fan immediately kicked on, and top showed multiple cores getting involved. Kept scrolling this HN post to learn about hwdec=auto. Coming from mplayer and vlc my immediate question is, "What tradeoffs are the maintainers trying to make by not making this the default?"


great to know this. thanks!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: