diff options
| author | tassaron | 2017-06-06 08:55:22 -0400 |
|---|---|---|
| committer | tassaron | 2017-06-06 08:55:22 -0400 |
| commit | 6c78c96d80618598692c121672f6d56e2feade5a (patch) | |
| tree | d2a636ba731603c6252add7d7ccf4b9d7956d885 | |
| parent | 6a1deb9b781890f9a62a6f6ce608856c1fc9e720 (diff) | |
fixed empty preview frame bug
| -rw-r--r-- | components/video.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/video.py b/components/video.py index 3162279..de91264 100644 --- a/components/video.py +++ b/components/video.py @@ -90,7 +90,11 @@ class Component(__base__.Component): width = int(previewWorker.core.settings.value('outputWidth')) height = int(previewWorker.core.settings.value('outputHeight')) self.chunkSize = 4*width*height - return self.getPreviewFrame(width, height) + frame = self.getPreviewFrame(width, height) + if not frame: + return Image.new("RGBA", (width, height),(0,0,0,0)) + else: + return frame def preFrameRender(self, **kwargs): super().preFrameRender(**kwargs) @@ -122,6 +126,8 @@ class Component(__base__.Component): self.update() def getPreviewFrame(self, width, height): + if not self.videoPath or not os.path.exists(self.videoPath): + return command = [ self.parent.core.FFMPEG_BIN, '-thread_queue_size', '512', |
