From 0e2421477582f98849525d3b5159ad7af6fc9f41 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 28 Feb 2016 11:43:36 -0500 Subject: Fixed fourcc for newer versions of OpenCV --- AutoVideosGPU.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AutoVideosGPU.py b/AutoVideosGPU.py index 25ccabd..a088e65 100644 --- a/AutoVideosGPU.py +++ b/AutoVideosGPU.py @@ -92,8 +92,11 @@ def createVideo(width, height, videoLength, frameRate, functionLength, clProgramTemplate2 = replace(clProgramTemplate2, '', rfunction) clProgramTemplate2 = replace(clProgramTemplate2, '', gfunction) clProgramTemplate2 = replace(clProgramTemplate2, '', bfunction) - - fourcc = cv2.cv.CV_FOURCC(*'XVID') + + try: + fourcc = cv2.cv.CV_FOURCC(*'XVID') + except: + fourcc = cv2.VideoWriter_fourcc(*'XVID') name = ' '.join([namemaker3.generate() for i in range(3)]) + '.avi' out = cv2.VideoWriter(directory+'/'+name,fourcc, frameRate, (width,height)) -- cgit v1.2.3