diff options
author | Melody Horn <melody@boringcactus.com> | 2019-04-23 01:03:57 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2019-04-23 01:03:57 -0600 |
commit | 23132238f9baa9a061a445e2d786a32790aa60a7 (patch) | |
tree | 344a6cc44e2f2dcadee5297a1d3c9b7a446a5b88 /options.py | |
parent | b81ee0c830398f9fcf26b32f0eca3da161f5c09c (diff) | |
download | vidslice-23132238f9baa9a061a445e2d786a32790aa60a7.tar.gz vidslice-23132238f9baa9a061a445e2d786a32790aa60a7.zip |
use -ss as an input option for *far* better efficiency
Diffstat (limited to 'options.py')
-rw-r--r-- | options.py | 23 |
1 files changed, 15 insertions, 8 deletions
@@ -13,6 +13,12 @@ EDIT_BOX_COL = 2 NEW_COL = 3 +class FFmpegOptions: + def __init__(self, input, output): + self.input = input + self.output = output + + class Property: def __init__(self, parent, name, *, label=None, orig=None, edit=None, new_class=None, new=None): self.handlers = [] @@ -238,19 +244,20 @@ class OptionsPanel(wx.Panel): self.enforce_constraints() def ffmpeg_opts(self): - opts = [] + input_opts = [] + output_opts = [] if self.start_time.is_edit(): - opts += ['-ss', str(self.start_time.get_final())] + input_opts += ['-ss', str(self.start_time.get_final())] elif self.end_time.is_edit() and self.duration.is_edit(): new_end = float(self.end_time.get_final()) new_duration = float(self.duration.get_final()) new_start = new_end - new_duration - opts += ['-ss', str(new_start)] + input_opts += ['-ss', str(new_start)] if self.end_time.is_edit(): - opts += ['-to', str(self.end_time.get_final())] + output_opts += ['-to', str(self.end_time.get_final())] if self.duration.is_edit(): - opts += ['-t', str(self.duration.get_final())] + output_opts += ['-t', str(self.duration.get_final())] if self.width.is_edit() or self.height.is_edit(): width = str(self.width.get_final()) @@ -259,9 +266,9 @@ class OptionsPanel(wx.Panel): width = "-1" if not self.height.is_edit(): height = "-1" - opts += ['-vf', 'scale=' + width + ':' + height] + output_opts += ['-vf', 'scale=' + width + ':' + height] if self.framerate.is_edit(): - opts += ['-r', str(self.framerate.get_final())] + output_opts += ['-r', str(self.framerate.get_final())] - return opts + return FFmpegOptions(input_opts, output_opts) |