diff options
author | pommicket <leonardomtenenbaum@gmail.com> | 2016-06-12 15:28:00 -0400 |
---|---|---|
committer | pommicket <leonardomtenenbaum@gmail.com> | 2016-06-12 15:28:00 -0400 |
commit | 8477a6c219c92de65d23b4516fe7c8cfe8ac1b5f (patch) | |
tree | 63ca168defe725775a8652be213457f300e3fc81 | |
parent | ba8d00301c8cd903268ab02e5b523e46ccc73d18 (diff) |
Fixed codec problems
-rw-r--r-- | AutoImagesGPU2.py | 16 | ||||
-rw-r--r-- | AutoVideosGPU.py | 10 | ||||
-rw-r--r-- | AutoVideosGPU2.py | 16 | ||||
-rw-r--r-- | ImportAutoImages.py | 1 | ||||
-rw-r--r-- | ImportAutoVideos.py | 1 | ||||
-rw-r--r-- | README.md | 4 |
6 files changed, 10 insertions, 38 deletions
diff --git a/AutoImagesGPU2.py b/AutoImagesGPU2.py deleted file mode 100644 index d23f06f..0000000 --- a/AutoImagesGPU2.py +++ /dev/null @@ -1,16 +0,0 @@ -import os - -def removeIfExists(filename): - if os.path.exists(filename): - os.remove(filename) - - -exitStatus = os.system('python AutoImagesGPU.py') - -SEGFAULT = 35584 - -while exitStatus == SEGFAULT: - exitStatus = os.system('python ImportAutoImages.py') - -removeIfExists('AutoImagesSettings.txt') -removeIfExists('imageNumber.txt') diff --git a/AutoVideosGPU.py b/AutoVideosGPU.py index a088e65..e65f82d 100644 --- a/AutoVideosGPU.py +++ b/AutoVideosGPU.py @@ -98,8 +98,13 @@ def createVideo(width, height, videoLength, frameRate, functionLength, 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)) - + out = cv2.VideoWriter(directory+'/'+name, fourcc, frameRate, (width,height)) + if not out.isOpened(): + try: + fourcc = cv2.cv.CV_FOURCC(*'MJPG') + except: + fourcc = cv2.VideoWriter_fourcc(*'MJPG') + out = cv2.VideoWriter(directory+'/'+name, fourcc, frameRate, (width,height)) for t in range(int(videoLength*frameRate)): clProgram = replace(clProgramTemplate2, '<FRAMENUMBER>', str(t)) @@ -120,6 +125,7 @@ def createVideo(width, height, videoLength, frameRate, functionLength, out.write(output[:, :, ::-1]) out.release() + def createVideos(): diff --git a/AutoVideosGPU2.py b/AutoVideosGPU2.py deleted file mode 100644 index b724c2d..0000000 --- a/AutoVideosGPU2.py +++ /dev/null @@ -1,16 +0,0 @@ -import os - -def removeIfExists(filename): - if os.path.exists(filename): - os.remove(filename) - - -exitStatus = os.system('python AutoVideosGPU.py') - -SEGFAULT = 35584 - -while exitStatus == SEGFAULT: - exitStatus = os.system('python ImportAutoVideos.py') - -removeIfExists('AutoVideosSettings.txt') -removeIfExists('videoNumber.txt') diff --git a/ImportAutoImages.py b/ImportAutoImages.py deleted file mode 100644 index 1643a4a..0000000 --- a/ImportAutoImages.py +++ /dev/null @@ -1 +0,0 @@ -import AutoImagesGPU diff --git a/ImportAutoVideos.py b/ImportAutoVideos.py deleted file mode 100644 index a371f51..0000000 --- a/ImportAutoVideos.py +++ /dev/null @@ -1 +0,0 @@ -import AutoVideosGPU @@ -40,11 +40,11 @@ cd /directory/where/AutoArt/is/ To run AutoImages: ``` -python AutoImagesGPU2.py +python AutoImagesGPU.py ``` To run AutoVideos: ``` -python AutoVideosGPU2.py +python AutoVideosGPU.py ``` To run AutoAudio: ``` |