aboutsummaryrefslogtreecommitdiff
path: root/components/video.py
diff options
context:
space:
mode:
authortassaron2017-06-22 18:40:34 -0400
committertassaron2017-06-22 18:40:34 -0400
commit5c74d496a960042ed4a4279328dc81e23dfdc1d9 (patch)
treef11c4f6fe69ab202688b55100ec841bb24f8804f /components/video.py
parent82011de966f95afa88ec9e11e0ce86cbd04d5fc0 (diff)
preset-loading and basic args from commandline
also made some docstrings more informative
Diffstat (limited to 'components/video.py')
-rw-r--r--components/video.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/components/video.py b/components/video.py
index 3d43a18..dd385b4 100644
--- a/components/video.py
+++ b/components/video.py
@@ -221,6 +221,22 @@ class Component(__base__.Component):
width, height = scale(self.scale, width, height, int)
self.chunkSize = 4*width*height
+ def command(self, arg):
+ if not arg.startswith('preset='):
+ if os.path.exists(arg):
+ if os.path.splitext(arg)[1] in self.core.videoFormats:
+ self.videoPath = arg
+ self.scale = 100
+ return True
+ else:
+ print("Not a supported video format")
+ quit(1)
+ super().command(arg)
+
+ def commandHelp(self):
+ print('Give a complete filepath to a video to load that '
+ 'video with default settings.')
+
def scale(scale, width, height, returntype=None):
width = (float(width) / 100.0) * float(scale)
height = (float(height) / 100.0) * float(scale)