ra1nty / DXcam

A Python high-performance screen capture library for Windows using Desktop Duplication API
MIT License
457 stars 67 forks source link

All frames taken from camera.get_latest_frame() are glitchy in a weird way! #84

Open elmoiv opened 4 months ago

elmoiv commented 4 months ago

Here is a screenshot of the output: image

The code used:

target_fps = 18
camera = dxcam.create(output_idx=0, output_color="BGR")
camera.start(target_fps=target_fps, video_mode=True)
writer = cv2.VideoWriter(
    "video.mp4", cv2.VideoWriter_fourcc(*"mp4v"), target_fps, (1920, 1080)
)
for _ in range(target_fps * 6):
    writer.write(camera.get_latest_frame())
camera.stop()
writer.release()

The video file:

https://github.com/ra1nty/DXcam/assets/31712173/c50f6b19-31a3-41a8-84ae-ba5577d746ca