mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Wrong scaling with different monitor dpi settings on Windows

Open christianduerselen opened this issue 2 years ago • 0 comments

Important Information

  • mpv version - mpv-x86_64-v3-20221030-git-f594482
  • Windows Version - Microsoft Windows 10 Pro Version 10.0.19045 Build 19045
  • Source of the mpv binary - Windows builds by shinchiro @ https://sourceforge.net/projects/mpv-player-windows/files

Reproduction steps

Setup:

  • screen 0 (default) = dpi 125% (120)
  • screen 1 = dpi 100% (96)

Screen 0 is the internal laptop screen (resolution 2256x1504 px) and screen 1 is an external 4k TV (3840x2160 px).

The goal is to play a video on screen 1 via batch with a window-scaling of 1 (100%). Test picture (3840x1080px) is attached.

mpv --log-file=log.txt --no-config --screen=1 --loop-playlist --no-osc --no-osd-bar --no-border "Test.png"

Expected behavior

Test picture is shown on screen 1 with a resolution of 3840x1080px and scaling of 1 (100%).

Actual behavior

Test picture is shown on screen 1 with a resolution of 3072:864px and scaling of 0.8 (80%). Note 1: If the laptop screen 0 is closed, the same script runs OK with a resolution of 3840x1080px and scaling of 1 (100%). Note 2: If the laptop screen 0 DPI is set to 100% (96) the same script runs OK as well. Note 3: I have tried "--no-hidpi-window-scale" but the symptom doesn't change.

Per the log, it looks like mpv starts with the DPI setting of screen 0 (120) with the intended resolution and then changes to the DPI of screen 1 (96) with a downscale to 80%.

Log file

log_NOK.txt This log was produced with both screens active and the command being started from screen 0. The DPI changes from 120 to 96 and the final video scale is 0.8.

log_OK.txt This log was produced with screen 0 inactive (laptop lid closed) and the command being started from screen 1. The DPI stays at 96 and the final video scale is 1.

Sample files

Test

christianduerselen avatar Oct 31 '22 14:10 christianduerselen