summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <leonardomtenenbaum@gmail.com>2016-02-28 11:43:36 -0500
committerpommicket <leonardomtenenbaum@gmail.com>2016-02-28 11:43:36 -0500
commit0e2421477582f98849525d3b5159ad7af6fc9f41 (patch)
tree2295f94edace633c2a835783d18265f199d002c6
parent4db9fc0f0fb7ad70f5fe539d794c24c3147a9869 (diff)
Fixed fourcc for newer versions of OpenCV
-rw-r--r--AutoVideosGPU.py7
1 files 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>', rfunction)
clProgramTemplate2 = replace(clProgramTemplate2, '<GFUNCTION>', gfunction)
clProgramTemplate2 = replace(clProgramTemplate2, '<BFUNCTION>', 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))