pixop / video-compare

Split screen video comparison tool using FFmpeg and SDL2
GNU General Public License v2.0
889 stars 41 forks source link

Solution for Odd Scaling Behaviour #41

Closed Razor54672 closed 11 months ago

Razor54672 commented 1 year ago

I have a 2880 x 1800 Laptop Screen and was trying to play 1080p video file.

However, even after supplying the dimension via -w 2880x, I was getting cropped video. For some reason, it scaled right with -w 1440x, but with visible pixelation. As such, I figured it was the scaling behavior problem mentioned in readme.md but I couldn't find a setting for "disallow high DPI mode".

You need to do the following for it to work well :

Go to video-compare.exe, right-click and select its Properties. Navigate to the Compatibility tab, select Change high-DPI settings > High DPI scaling override Select the Override high DPI scaling behaviour option and choose Application in the menu.

This should solve this issue.

image

jonfryd commented 1 year ago

Hi @Razor54672,

Thanks for sharing your workaround.

I'll see if there is something we can do to auto-detect the current high-DPI setting via SDL2 so this extra step won't be necessary in the future.

jonfryd commented 1 year ago

@Razor54672: Did passing -d to the program produce a correctly scaled image on your laptop screen (i.e. without applying your workaround)?

woshitoutouge commented 1 year ago

@Razor54672 Thanks a lot! The unexpectd scaling really bothers me, and now it is good.

pldavid2 commented 1 year ago

Thanks @Razor54672, you trick works

@jonfryd, the -d parameter didn't work for me.

jonfryd commented 1 year ago

@pldavid2: OK, interesting. Thanks!

I guess you use some sort of high DPI display, as well?

pldavid2 commented 1 year ago

@jonfryd I was testing the player in a 4k monitor to compare two files, one in 1080p and the other 4k. Without the tweak, video compare was showing a smaller windows using the -d flag.

Something related, would it be possible to add some kind of launch parameter to make video-compare open in specific display instead of main one in a multi monitor setup?

I never use SDL directly and have almost zero knowledge of C. But did a quick check on the SDL repository and found this comment https://github.com/libsdl-org/SDL/issues/1176 So it seems that the display can be tweaked on the _SDLCreateWindow call using for example _SDL_WINDOWPOS_UNDEFINEDDISPLAY(1) for a secondary monitor, instead of the default _SDL_WINDOWPOS_UNDEFINEDDISPLAY

jonfryd commented 1 year ago

@pldavid2: Sure, this looks trivial to do. I can't tell when the next updates are out, but I'll your suggestion to my TODO list for now.

Cheers!

jonfryd commented 12 months ago

@pldavid2: Check out the -n option in the latest release which allows you to open video-compare on a specific display. Numbering starts at 0.

pldavid2 commented 11 months ago

@pldavid2: Check out the -n option in the latest release which allows you to open video-compare on a specific display. Numbering starts at 0.

working great, very useful thank you!

jonfryd commented 11 months ago

@pldavid2 and @woshitoutouge,

I have released a new version just now (20230713), which I believe resolves the scaling issue on high DPI displays in Windows, eliminating the need for the workaround provided by @Razor54672 above. Could you kindly test it out and let me know if it works for you?

If it doesn't work, I would appreciate it if you could provide me with the output values of SDL GL drawable size and SDL window size. These values are displayed in the console when the tool is launched.

Thanks.

pldavid2 commented 11 months ago

@jonfryd, it's weird, but on my system the old version having this odd behaviour, is now working fine without the tweak/trick. Not sure if some other windows update change something on my system, so I can't confirm if was really a video-compare problem or not. You may wait @woshitoutouge or @Razor54672 or just close the issue. Thanks

jonfryd commented 11 months ago

OK, thanks for getting back to me, @pldavid2. Much appreciated.