Free Motion Capture for Everyone πβ¨
TypeScript
solved the mystery of the 'cam[x]' file
Aaron Cherian51905ff7437c
diff --git a/freemocap/runcams.py b/freemocap/runcams.pyindex 343f6f0d..b3c21131 100644--- a/freemocap/runcams.py+++ b/freemocap/runcams.py@@ -30,6 +30,7 @@ def RecordCams(session,camInputs,parameterDictionary,rotationInputs):threads = []for n in numCamRange: # starts recording video, opens threads for each cameracamRecordings = startcamrecording.CamRecordingThread(+ session,camIDs[n],camInputs[n],vidNames[n],@@ -53,7 +54,7 @@ def RecordCams(session,camInputs,parameterDictionary,rotationInputs):) in (numCamRange): # open the saved pickle file for each camera, and add the timestamps to the dataList list- with open(camIDs[e], "rb") as f:+ with open(session.sessionPath/camIDs[e], "rb") as f:camTimeList = pickle.load(f)timeStampList.append(camTimeList)diff --git a/freemocap/webcam/startcamrecording.py b/freemocap/webcam/startcamrecording.pyindex bfd194d3..3e6edb48 100644--- a/freemocap/webcam/startcamrecording.py+++ b/freemocap/webcam/startcamrecording.py@@ -6,7 +6,7 @@ import pickleclass CamRecordingThread(threading.Thread):def __init__(- self, camID, camInput, videoName, rawVidPath, beginTime, parameterDictionary+ self, session, camID, camInput, videoName, rawVidPath, beginTime, parameterDictionary):threading.Thread.__init__(self)self.camID = camID@@ -15,10 +15,12 @@ class CamRecordingThread(threading.Thread):self.rawVidPath = rawVidPathself.beginTime = beginTimeself.parameterDictionary = parameterDictionary+ self.session = sessiondef run(self):print("Starting " + self.camID)self.timeStamps = CamRecording(+ self.session,self.camID,self.camInput,self.videoName,@@ -33,7 +35,7 @@ class CamRecordingThread(threading.Thread):# the recording function that each threaded camera object runsdef CamRecording(- camID, camInput, videoName, rawVidPath, beginTime, parameterDictionary+ session, camID, camInput, videoName, rawVidPath, beginTime, parameterDictionary):# the flag is triggered when the user shuts down one webcam to shut down the rest.# normally I'd try to avoid global variables, but in this case it's@@ -76,7 +78,7 @@ def CamRecording(success): # while the camera is opened, record the data until the escape button is hitif flag: # when the flag is triggered, stop recording and dump the data- with open(camID, "wb") as f:+ with open(session.sessionPath/camID, "wb") as f:pickle.dump(timeStamps, f)breaksuccess, frame = cam.read()@@ -90,7 +92,7 @@ def CamRecording(key = cv2.waitKey(20)if key == 27: # exit on ESCflag = True # set flag to true to shut down all other webcams- with open(camID, "wb") as f:+ with open(session.sessionPath/camID, "wb") as f:pickle.dump(timeStamps, f) # dump the databreakcv2.destroyWindow(camID)