Skip to content

Commit

Permalink
Update output file name to work with Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin David committed Nov 28, 2014
1 parent ed98ee5 commit 81663c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions MotionDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self,threshold=8, doRecord=True, showWindows=True):

def initRecorder(self): #Create the recorder
codec = cv.CV_FOURCC('M', 'J', 'P', 'G') #('W', 'M', 'V', '2')
self.writer=cv.CreateVideoWriter(datetime.now().strftime("%b-%d_%H:%M:%S")+".wmv", codec, 5, cv.GetSize(self.frame), 1)
self.writer=cv.CreateVideoWriter(datetime.now().strftime("%b-%d_%H_%M_%S")+".wmv", codec, 5, cv.GetSize(self.frame), 1)
#FPS set to 5 because it seems to be the fps of my cam but should be ajusted to your needs
self.font = cv.InitFont(cv.CV_FONT_HERSHEY_SIMPLEX, 1, 1, 0, 2, 8) #Creates a font

Expand Down Expand Up @@ -105,4 +105,4 @@ def somethingHasMoved(self):

if __name__=="__main__":
detect = MotionDetectorInstantaneous(doRecord=True)
detect.run()
detect.run()
4 changes: 2 additions & 2 deletions MotionDetectorContours.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self,threshold=25, doRecord=True, showWindows=True):

def initRecorder(self): #Create the recorder
codec = cv.CV_FOURCC('M', 'J', 'P', 'G')
self.writer=cv.CreateVideoWriter(datetime.now().strftime("%b-%d_%H:%M:%S")+".wmv", codec, 5, cv.GetSize(self.frame), 1)
self.writer=cv.CreateVideoWriter(datetime.now().strftime("%b-%d_%H_%M_%S")+".wmv", codec, 5, cv.GetSize(self.frame), 1)
#FPS set to 5 because it seems to be the fps of my cam but should be ajusted to your needs
self.font = cv.InitFont(cv.CV_FONT_HERSHEY_SIMPLEX, 1, 1, 0, 2, 8) #Creates a font

Expand Down Expand Up @@ -117,4 +117,4 @@ def somethingHasMoved(self):

if __name__=="__main__":
detect = MotionDetectorAdaptative(doRecord=True)
detect.run()
detect.run()

0 comments on commit 81663c1

Please sign in to comment.