Free Motion Capture for Everyone πβ¨
TypeScript
add switch to use CAP_DSHOW on windwos and CAP_ANY otherwise
jon matthis9b6a00de6cea
diff --git a/freemocap/user_preferences.yaml b/freemocap/user_preferences.yamlindex 2b865cde..f38cfbf9 100644--- a/freemocap/user_preferences.yaml+++ b/freemocap/user_preferences.yaml@@ -9,10 +9,10 @@ default:framerate: 30codec: DIVXsaved:- path_to_save: C:/+ path_to_save: C:/Users/jonma/Dropbox/FreeMoCapProjectrotations:0: 0- 1: 0+ 2: 0parameters:exposure: -7resWidth: 640diff --git a/freemocap/webcam/startcamrecording.py b/freemocap/webcam/startcamrecording.pyindex a60a6fd5..6d4060db 100644--- a/freemocap/webcam/startcamrecording.py+++ b/freemocap/webcam/startcamrecording.py@@ -2,7 +2,7 @@ import threadingimport cv2import timeimport pickle-+import osclass CamRecordingThread(threading.Thread):def __init__(@@ -50,7 +50,13 @@ def CamRecording(flag = Falsecv2.namedWindow(camID) # name the preview window for the camera its showing- cam = cv2.VideoCapture(camInput, cv2.CAP_DSHOW) # create the video capture object++ if os.name == 'nt': #use CAP_DSHOW for windows, CAP_ANY otherwise (*might* make things ubuntu/mac compatible, but not sure. See https://github.com/jonmatthis/freemocap/issues/52)+ cap = cv2.VideoCapture(self.camID, cv2.CAP_DSHOW)+ else:+ cap = cv2.VideoCapture(self.camID, cv2.CAP_ANY)++# if not cam.isOpened():# raise RuntimeError('No camera found at input '+ str(camID))# pulling out all the dictionary paramters