VVEIRD/OverCollect

Full-Screen Capture

Opened this issue · 17 comments

So I see you mention it in your reddit post that your app cannot capture fullscreen programs unless the user is in borderless-fullscreen. Which is correct. The awt Robot class is incapable of interfacing with a direct X game while in fullscreen. Borderless-fullscreen works simply because the it behaves just like a normal window as opposed to fullscreen where capturing the pixels isn't as easy.

Now to get to my main point. The problem with running the game in borderless-fullscreen is that the framerate is capped at whatever your desktop framerate is. Now, you may ask why is this a problem? The problem is that windows forces your desktop framerate to be equal to that of your lowest framerate monitor which effectively means that anyone running a multi-monitor setup with a framerate greater than 60hz and a 60hz monitor is forced to play the game at 60hz if in borderless-fullscreen making that not an option for a lot of players.

What I propose to fix this is to either rewrite this entire program in c++ or c# (highly unlikely and a lot of effort) or to simply write a library in c++ or c# with screencapture capabilities and wrap said library with the JNI which is a lot less work than what it sounds like. Here is an example of what I am referring to: https://github.com/caoym/WinRobot. I haven't tested that library yet to see if it works but I'm going to investigate and see if I can use it in your app. If it doesn't work I will gladly fork your project and begin working on it myself.

The problem is that windows forces your desktop framerate to be equal to that of your lowest framerate monitor

This isn't the case for Windows 10, although I believe that its new to this version.

Settings > System > Display > Display adapter properties > Monitor Tab > Screen refresh rate

I'm currently running a 144hz and a 60hz at their different rates.

I'm not sure you understand what I'm trying to convey. I have my 144hz monitor running 144hz however it runs in 60hz if I am not actively in a fullscreen game. In a fullscreen game it runs 144hz perfectly fine. The windows desktop is locked to 60hz unless I disconnect my 60hz monitor. At that point then and only then am I able to use my desktop at 144hz on my higher framerate monitor. When you run a game in borderless fullscreen the game runs at whatever your desktop framerate is which means bye bye 144hz. I am running windows 10 and have confirmed this behavior with quite a few friends.

Osyx commented

He's talking about Window's setting for setting your desktop frame rate.
This setting.
And for example, my settings right now looks like this:
Image

I am aware. My desktop still remains 60hz unless my 60hz monitor is unplugged. https://i.gyazo.com/0fe1346b973156e7fd61a1172c023634.png

https://i.gyazo.com/92ffac41766982a7f3204fdc1b20c680.png

If you want to test this out run a game in borderless fullscreen and see if it is actually in 144hz at that point.

I am and I do frequently with Overwatch and other games in borderless fullscreen.

Osyx commented

Like this?
Overwatch in windowed. With one screen on 144Hz and the others in 60Hz.

@Osyx I can still get that same framerate; however, my display doesn't display all 144 fps. It's as if it's locked at 60 unless I go fullscreen or unplug the second monitor. I've confirmed this with several friends before.

Osyx commented

@BI00dsh0t Now I don't really get what you mean. Are you saying that the game tells you it's 144 fps but it's false as it actually is 60 fps until you plug out your other display? Are you sure it's not simply the input lag you're feeling if that's the case?

I mean I do understand where you come from, because I would love to be able to have OW in fullscreen and use this app. Because the performance is worse in windowed/borderless regarding the amount of power it needs to run the same fps and the input lag is bigger.

Yes you're correct it will do that if you do not change the setting I mentioned. Maybe it is a hardware limitation, I just build this PC and have a new 1070, or maybe its a feature new to windows 10. But I have confirmed with at least 2 games in borderless fullscreen that I can have the two monitors at their own native refresh rates.

Either way your initial point still stands, I would love to be able to run this fullscreen over borderless for the performance boost and reduction in input lag.

The game isn't smooth as if it is 144hz. It's capped at 60 frames. And if you look at the pics I sent. My settings are correct.

@BI00dsh0t Hey, thanks for the hint. I did not know there was a bug/issue with 60 hz / 144 hz monitors. My setup has a similar configuration (144hz and 60hz monitors) and I don't have the bug you described. I assume you have the newest nvidea drivers installed?
I am currently looking into different solutions that uses JNI (OpenCV is one of them, WinRobot is now the second one) to solve the problem. I'll report back as soon as I have results trying different solutions.

@BI00dsh0t The new release uses ffmpeg to record the screenshots, would you please check on your system if it works on full screen: https://github.com/WElRD/OverCollect/releases/tag/v0.2.0-alpha

On my system the full screen capture worked.

Please respond if it works, so I can close the issue.

Does not function correctly. The logs claim that it recognizes the main screen however it is unable to recognize the start of a match. I'm currently doing a bit of debugging to figure out what exactly is failing.

Also yes, I have the latest drivers. I've formatted my PC and troubleshooted the problem however it's been persistent for well over a year now.

@BI00dsh0t What java version do you use? We could replicate the issue with 32bit java on a 64bit OS.
64bit java and 64bit Windows seems to work.

I am using 64bit Win10, 64bit Java and program starts, but nothing is detected when playing.