aboutsummaryrefslogtreecommitdiff
path: root/src/components/video.py
diff options
context:
space:
mode:
authortassaron2017-08-03 00:44:46 -0400
committertassaron2017-08-03 00:44:46 -0400
commit6611492b30a7daf7bdbe77f6e12f9d322bdd90c1 (patch)
tree57826b56646ccf81a7954af7daa4eb10632f2b32 /src/components/video.py
parent62431a3cfebdc8490b7010d71b8e646dd6bd0d35 (diff)
relative gradients & last good frame used for preview errors
Diffstat (limited to 'src/components/video.py')
-rw-r--r--src/components/video.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/components/video.py b/src/components/video.py
index 3569d17..2cd67c6 100644
--- a/src/components/video.py
+++ b/src/components/video.py
@@ -16,12 +16,12 @@ class Component(Component):
def widget(self, *args):
self.videoPath = ''
- self.badVideo = False
self.badAudio = False
self.x = 0
self.y = 0
self.loopVideo = False
super().widget(*args)
+ self._image = BlankFrame(self.width, self.height)
self.page.pushButton_video.clicked.connect(self.pickVideo)
self.trackWidgets(
{
@@ -70,8 +70,6 @@ class Component(Component):
if not self.videoPath:
self.lockError("There is no video selected.")
- elif self.badVideo:
- self.lockError("Could not identify an audio stream in this video.")
elif not os.path.exists(self.videoPath):
self.lockError("The video selected does not exist!")
elif os.path.realpath(self.videoPath) == os.path.realpath(outputFile):
@@ -199,14 +197,10 @@ class Component(Component):
'RGBA',
scale(self.scale, self.width, self.height, int),
imageData)
-
+ self._image = image
except ValueError:
- print(
- '### BAD VIDEO SELECTED ###\n'
- 'Video will not export with these settings'
- )
- self.badVideo = True
- return BlankFrame(self.width, self.height)
+ # use last good frame
+ image = self._image
if self.scale != 100 \
or self.xPosition != 0 or self.yPosition != 0:
@@ -214,5 +208,4 @@ class Component(Component):
frame.paste(image, box=(self.xPosition, self.yPosition))
else:
frame = image
- self.badVideo = False
return frame