[BUG 🪲] Exception: InnerNativeWindowsCapture::start threw an exception: Failed to convert item to `GraphicsCaptureItem`
Describe the bug 🐛
PS D:> & d:/.venv/Scripts/python.exe d:/tools/win_captu
re_test.py
Traceback (most recent call last):
File "d:\tools\win_capture_test.py", line 158, in GraphicsCaptureItem
Expected behavior 📝 A clear and concise description of what you expected to happen.
OS 🤖
- Version: [e.g. 11] 10
- Build[e.g. 22H2] 1809 (17763.2029)
Additional context ➕ Add any other context about the problem here.
Send the code please
import numpy as np
from windows_capture import WindowsCapture, Frame, InternalCaptureControl
# Every Error From on_closed and on_frame_arrived Will End Up Here
capture = WindowsCapture(
cursor_capture=None,
draw_border=None,
monitor_index=None,
# window_name='MKSWindow#0',
)
# Called Every Time A New Frame Is Available
@capture.event
def on_frame_arrived(frame: Frame, capture_control: InternalCaptureControl):
# Gracefully Stop The Capture Thread
capture_control.stop()
# Called When The Capture Item Closes Usually When The Window Closes, Capture
# Session Will End After This Function Ends
@capture.event
def on_closed():
print("Capture Session Closed")
capture.start()
My System is: Microsoft Windows 版本 1809 (操作系统内部版本 17763.2029)© 2018 Microsof Corporation。保置所有权利.
Set the monitor index ,see if that would work
For monitor indexes 0 and 2, the following error is displayed:
Traceback (most recent call last):
File "d:\tools\win_capture_test.py", line 158, in <module>
capture.start()
File "D:\.venv\Lib\site-packages\windows_capture_init_.py", line 224, in start
self.capture.start()
Exception: Failed to get monitor from index: Failed to find the specified monitor.
For monitor index 1, the following error is displayed:
Traceback (most recent call last):
File "d:\tools\win_capture_test.py", line 158, in <module>
capture.start()
File "D:\.venv\Lib\site-packages\windows_capture_init_.py", line 224, in start
self.capture.start()
Exception: InnerNativeWindowsCapture::start threw an exception: Failed to convert item to GraphicsCaptureItem