Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Bug? D3Dshot continously giving lower frames when benchmarked #53

@Avnsx

Description

@Avnsx

Out of d3dshot's ReadMe Is robust and very stable. You can run it for hours / days without performance degradation

I was trying to compare d3dshot to python mss and pyautogui (backend pillow). My frametest works fine for these other two libraries, but when I try to apply it onto d3dshot, my average frames continously get lower the longer the while loop runs ... Why?

Hardware:
monitor 2560 x 1440p 144hz
cpu amd ryzen 5 5600x 6x core @ 4.3 ghz

meaning optimal results would be 144 frames per second

import time, cv2, mss, numpy, d3dshot, pyautogui

# d3dshot (supports capture outputs: pil, numpy, numpy_float, pytorch, pytorch_float)
img = d3dshot.create(capture_output='numpy')

number_list = []

while True:
    last_time = time.perf_counter()

    # MSS get raw pixels from the screen, save it to a Numpy array
    # img = numpy.array(mss.mss().grab({"top": 40, "left": 0, "width": 800, "height": 640})) # getting 144 fps

    # d3dshot
    img.screenshot(region=(0,40, 800, 640))

    # pyautogui (pillow)
    # img = pyautogui.screenshot(region=(0,40, 800, 640)) # 31 fps

    fps = 1 / (time.perf_counter() - last_time)
    # print(f"fps: {fps}")

    # calc avg
    number_list.append(fps)
    avg = sum(number_list)/len(number_list)
    print(f"averages {round(avg, 2)} fps")

python 3.10.2 | windows 10 64 bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions