mpv-plugin-xrandr icon indicating copy to clipboard operation
mpv-plugin-xrandr copied to clipboard

High refresh rate support

Open Druneau opened this issue 9 years ago • 4 comments

With the script as is it wouldn't select some of my higher refresh rates. My current refresh rate setup consists of:

  • 100Hz for 25/50fps
  • 96Hz for 24fps
  • 95.904Hz for 23.976fps
  • 90Hz for 30fps
  • 89.991Hz for 29.997fps
  • 60Hz for 60fps
  • 59.994Hz for 59.994fps

First problem I had was that the script only tries matching with a 3x multiplier. Because of this it was never able to choose the highest refresh rates. Then I realized the for loop was testing "1 x fps" before 2x.. which made it return the lowest matching refresh rate.

So I changed it from:

for m=1, 3 do

to;

for m=4, 1, -1 do

This allows your script to work beautifully with high refresh rates.

Thanks for posting it.

Druneau avatar Apr 03 '15 21:04 Druneau

I would like to understand why you want the script to prefer higher refresh rates in general. As long as two refresh rates are both even multipliers of the video frame rate, I can only see disadvantages with using the higher frame rate:

  • If your display is a TV capable of computing "in-between" frames to achieve smoother movements, it will do so much better if you don't give it the same image multiple times, but provide only differing frames with the original rate.
  • If your player is operating on battery - like a notebook - it will use up more power when using a higher refresh rate. (Which is why many notebooks support a lower-than-60Hz rate to save power.)

What benefit do you see from higher-than-original refresh rates?

lvml avatar Apr 04 '15 17:04 lvml

Agreed that on a TV you'd want to match video refresh rate. However I'm running MPV on a desktop and not always fullscreen (usually if following tutorials and such). Using a desktop at higher refresh rates is much more pleasant than 24-30hz.

Druneau avatar Apr 04 '15 20:04 Druneau

Ok, I see. For some partial-screen tutorial view I would probably not bother to set any but the default refresh rate, but if you think it's worth it, we can add some "prefer_higher_rates" script option to invert the selection order when this is desired.

lvml avatar Apr 05 '15 06:04 lvml

I guess if someone gets to the point where they have all those custom resolutions they kind of know what they'd like. They could probably figure out and change script to suit.

And yes I should probably start using folder-config flag/option in order to use xrandr.lua on specific media type (skipping internet stuff).

So I'm on the fence on if its really needed in the script.

Thanks,

Druneau avatar Apr 07 '15 00:04 Druneau