mpv-player/mpv-build

vd-lavc-dr is very slow.

tsjnachos117 opened this issue · 6 comments

I've noticed that my CPU usage with newer (custom) builds of mpv has been really slow lately. With some decoders, the computer is almost unusable. I narrowed the problem down to the default vd-lavc-dr. Setting this option to "no" brings my CPU back down to something usable. I wonder why this is? I have multiple computers, but only one specific laptop (Dell Latitude e6410) seems to be affected.

PS: Is there a way to disable this system-wide? I know I can change /etc/mpv/mpv.conf, but that doesn't seem to affect Celluloid (which uses libmpv). Perhaps there's some configuration switch I can use when compiling?

OS: Linux Mint 20. CPU: Interl Core i5 M 520 @ 2.40GHz

OK, I've just found a good (albiet temporary) workaround: I made a shell script in the source directory called "set_vd_dr". Here are it's contents:

\#\!/bin/sh

exec sed -i '/^ \{8\}\.dr = 1,$/ s/1/0' mpv/video/decode/vd_lavc.c

This will set the .dr = 1, declariation in mpv/video/decode/vd_lavc.c to 0. I guess it's a boolean operator? I have verified that mpv still builds, and runs OK. Compiling with --enable-libmpv-shared in mpv_options, I got a library version that seems to make Celluloid disable the vd-lavc-dr option by default as well.

Of course, this is just a workaround until a real solution is found, but it will still due just fine for now.

I think you just want to set --vd-lavc-dr=no. It's an option.

sfan5 commented

Low end Intel iGPUs are known to have severe performance issues with DR (though maybe yours is just too old in general?). I have considered adding a blacklist of GPU models so DR would automatically be turned off but that's a bit suboptimal.

@Dudemanguy There's no easy way to do this system-wide with libmpv. I share this computer with a couple of people, and talking all of them through the process of adding a command-line option in Celluloid's options is a pain in the butt. Hacking the build as I have seems easier.

(For regular mpv, adding the aforementioned line to /etc/mpv/mpv.conf works just fine.)

It's up to the libmpv API user (or Celluloid in this case) to expose easy ways for users to configure things. Not an mpv in any case however, so I'll close this.

Oops! I only just realized I posted this in the mpv-build repo. This was meant to be in the mpv-player repo. My bad. Anyway, my main point was "this option makes mpv slow", not "help me hack this plz". I guess it being closed was for the best, especially given the workarounds already discussed.