SerpentAI / D3DShot

Extremely fast and robust screen capture on Windows with the Desktop Duplication API
MIT License
323 stars 73 forks source link

Benchmark results #25

Open guillermoAlv opened 4 years ago

guillermoAlv commented 4 years ago

Im getting the dame results un benchmarks when i run It with numpy and when i run It with default PIL. Both configurations achieve 78 FPS. Is this working as expected? Thanks in advanced.

nbrochu commented 4 years ago

I'm doing a D3DShot day tomorrow, I will look into it. Thanks!

nbrochu commented 4 years ago

I can't seem to reproduce the issue and I see nothing wrong with the benchmark function either.

PIL:
image

NumPy: image

Are you perhaps capturing at a smaller resolution on good hardware? The gap between PIL and NumPy shrinks as the resolution gets smaller.

The other very likely explanation: You weren't capturing a display with changes from one frame to the other. As outlined in the the README:

Measuring the exact performance of the Windows Desktop Duplication API proves to be a little complicated because it will only return new texture data if the contents of the screen has changed. This is optimal for performance but it makes it difficult to express in terms of frames per second, the measurement people tend to expect for benchmarks. Ultimately the solution ended up being to run a high FPS video game on the display to capture to make sure the screen contents is different at all times while benchmarking.

So when I do my benchmarks, I do it with a windowed video game somewhere on the screen like this:
image

MohiuddinM commented 3 years ago

I have the same problem:

Capture Output: PILCaptureOutput
Display: <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 resolution=3840x2160 rotation=0 scale_factor=1.5 primary=True>

Capturing as many frames as possible in the next 60 seconds... Go!
Done! Results: 41.367 FPS
Capture Output: NumpyCaptureOutput
Display: <Display name=Generic PnP Monitor adapter=NVIDIA GeForce GTX 1060 resolution=3840x2160 rotation=0 scale_factor=1.5 primary=True>

Capturing as many frames as possible in the next 60 seconds... Go!
Done! Results: 43.867 FPS