Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

Swapping `CAP_DSHOW` with `CAP_ANY` for Ubuntu (and mac?) support

jon matthisd990c78c05f0
diff --git a/freemocap/webcam/camsetup.py b/freemocap/webcam/camsetup.py
index 591a00da..03004f61 100644
--- a/freemocap/webcam/camsetup.py
+++ b/freemocap/webcam/camsetup.py
@@ -24,7 +24,7 @@ class VideoSetup(threading.Thread):
camName = "Camera" + str(self.camID)
cv2.namedWindow(camName)
- cap = cv2.VideoCapture(self.camID, cv2.CAP_DSHOW)
+ cap = cv2.VideoCapture(self.camID, cv2.CAP_ANY)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, resWidth)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, resHeight)
cap.set(cv2.CAP_PROP_EXPOSURE, exposure)
diff --git a/freemocap/webcam/checkcams.py b/freemocap/webcam/checkcams.py
index 6491a2fa..51bacd13 100644
--- a/freemocap/webcam/checkcams.py
+++ b/freemocap/webcam/checkcams.py
@@ -6,7 +6,7 @@ def TestDevice(source):
"""
Checks to see if there is a camera available at the input
"""
- cap = cv2.VideoCapture(source, cv2.CAP_DSHOW)
+ cap = cv2.VideoCapture(source, cv2.CAP_ANY)
# if cap is None or not cap.isOpened():
# print('Warning: unable to open video source: ', source)
diff --git a/freemocap/webcam/startcamrecording.py b/freemocap/webcam/startcamrecording.py
index a60a6fd5..98fa4420 100644
--- a/freemocap/webcam/startcamrecording.py
+++ b/freemocap/webcam/startcamrecording.py
@@ -50,7 +50,7 @@ def CamRecording(
flag = False
cv2.namedWindow(camID) # name the preview window for the camera its showing
- cam = cv2.VideoCapture(camInput, cv2.CAP_DSHOW) # create the video capture object
+ cam = cv2.VideoCapture(camInput, cv2.CAP_ANY) # create the video capture object
# if not cam.isOpened():
# raise RuntimeError('No camera found at input '+ str(camID))
# pulling out all the dictionary paramters