aboutsummaryrefslogtreecommitdiff
path: root/components/video.py
diff options
context:
space:
mode:
Diffstat (limited to 'components/video.py')
-rw-r--r--components/video.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/components/video.py b/components/video.py
index 1d250bd..4fced4e 100644
--- a/components/video.py
+++ b/components/video.py
@@ -41,8 +41,8 @@ class Video:
'-i', self.videoPath,
'-f', 'image2pipe',
'-pix_fmt', 'rgba',
- '-filter:v', 'scale=%s:%s' %
- scale(self.scale, self.width, self.height, str),
+ '-filter:v', 'scale=%s:%s' % scale(
+ self.scale, self.width, self.height, str),
'-vcodec', 'rawvideo', '-',
]
@@ -199,8 +199,8 @@ class Component(__base__.Component):
'-i', self.videoPath,
'-f', 'image2pipe',
'-pix_fmt', 'rgba',
- '-filter:v', 'scale=%s:%s' %
- scale(self.scale, width, height, str),
+ '-filter:v', 'scale=%s:%s' % scale(
+ self.scale, width, height, str),
'-vcodec', 'rawvideo', '-',
'-ss', '90',
'-vframes', '1',
@@ -238,6 +238,7 @@ class Component(__base__.Component):
def commandHelp(self):
print('Load a video:\n path=/filepath/to/video.mp4')
+
def scale(scale, width, height, returntype=None):
width = (float(width) / 100.0) * float(scale)
height = (float(height) / 100.0) * float(scale)
@@ -248,6 +249,7 @@ def scale(scale, width, height, returntype=None):
else:
return (width, height)
+
def finalizeFrame(self, imageData, width, height):
if self.distort:
try:
@@ -265,7 +267,7 @@ def finalizeFrame(self, imageData, width, height):
imageData)
if self.scale != 100 \
- or self.xPosition != 0 or self.yPosition != 0:
+ or self.xPosition != 0 or self.yPosition != 0:
frame = self.blankFrame(width, height)
frame.paste(image, box=(self.xPosition, self.yPosition))
else: