You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what is happening but like when I set my device_idx = 1 ( as my gpu is 1 ) it gives the error:
Traceback (most recent call last):
File "C:\Users\phuoc\OneDrive\Desktop\All-in-One\Coding\Aimbot\test\capture.py", line 5, in
camera = dxcam.create(device_idx= 1, output_color="BGR")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\phuoc\AppData\Local\Programs\Python\Python311\Lib\site-packages\dxcam_init_.py", line 112, in create
return _factory.create(
^^^^^^^^^^^^^^^^^
File "C:\Users\phuoc\AppData\Local\Programs\Python\Python311\Lib\site-packages\dxcam_init.py", line 45, in create
device = self.devices[device_idx]
~~~~~~~~~~~~^^^^^^^^^^^^
IndexError: list index out of range
but when I set it to 0 ( is my cpu ) it work fine
below is my code:
import dxcam
import cv2
import time
camera = dxcam.create(device_idx= 1, output_color="BGR")
print(dxcam.device_info())
Initialize loop_time before the loop
loop_time = time.time()
print("running")
while True:
capture = camera.grab()
if capture is None:
continue
I think your computer may be laptop,not desktop computer. Beacuse I also had this problem when I wanted to use my Nvida. But, I found it's normal if I chose Interl, which is a more slow device.
I'm not sure what is happening but like when I set my device_idx = 1 ( as my gpu is 1 ) it gives the error:
Traceback (most recent call last):
File "C:\Users\phuoc\OneDrive\Desktop\All-in-One\Coding\Aimbot\test\capture.py", line 5, in
camera = dxcam.create(device_idx= 1, output_color="BGR")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\phuoc\AppData\Local\Programs\Python\Python311\Lib\site-packages\dxcam_init_.py", line 112, in create
return _factory.create(
^^^^^^^^^^^^^^^^^
File "C:\Users\phuoc\AppData\Local\Programs\Python\Python311\Lib\site-packages\dxcam_init.py", line 45, in create
device = self.devices[device_idx]
~~~~~~~~~~~~^^^^^^^^^^^^
IndexError: list index out of range
but when I set it to 0 ( is my cpu ) it work fine
below is my code:
import dxcam
import cv2
import time
camera = dxcam.create(device_idx= 1, output_color="BGR")
print(dxcam.device_info())
Initialize loop_time before the loop
loop_time = time.time()
print("running")
while True:
capture = camera.grab()
if capture is None:
continue
print("done")
time.sleep(3)
cv2.destroyAllWindows()
The text was updated successfully, but these errors were encountered: