switch dshow to msmf

This commit is contained in:
Thies Mueller
2026-04-23 19:01:01 +02:00
parent 07ecb4ffb1
commit 0d19b00fcc
+1 -6
View File
@@ -25,18 +25,13 @@ CONFIG = load_config()
def create_capture(index):
if os.name == "nt":
cap = cv2.VideoCapture(index, cv2.CAP_DSHOW)
else:
cap = cv2.VideoCapture(index)
cap = cv2.VideoCapture(index, cv2.CAP_MSMF)
if not cap.isOpened():
return None
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG'))
for _ in range(20):
ret, frame = cap.read()