txlyre 7 сар өмнө
parent
commit
ee24db44da
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      main.py

+ 1 - 1
main.py

@@ -250,7 +250,7 @@ def sample(source, source_type, multiplier=1):
 
 
 def video2_sampler(q, source):
-    with Device.from_id(source) as device:
+    with Device.from_id(abs(int(source))) as device:
         capture = VideoCapture(device)
         capture.set_format(
             device.info.frame_sizes[0].width, device.info.frame_sizes[0].height, "YUYV"