aboutsummaryrefslogtreecommitdiff
path: root/options.py
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2019-02-22 03:48:18 -0700
committerMelody Horn <melody@boringcactus.com>2019-02-22 03:48:18 -0700
commitd8a76e71de7dfa6692ffcb9d7a1a293d8f319157 (patch)
treed18de0ae7f3922e91319e62c34c1e9628fe4af7a /options.py
parentff5f3f50d42193f6dcdedcd48403f8718a6fa757 (diff)
downloadvidslice-d8a76e71de7dfa6692ffcb9d7a1a293d8f319157.tar.gz
vidslice-d8a76e71de7dfa6692ffcb9d7a1a293d8f319157.zip
edit options
Diffstat (limited to 'options.py')
-rw-r--r--options.py33
1 files changed, 31 insertions, 2 deletions
diff --git a/options.py b/options.py
index e93826f..763eba6 100644
--- a/options.py
+++ b/options.py
@@ -197,10 +197,10 @@ class OptionsPanel(wx.Panel):
self.height.set_calc_new(round(orig_height / orig_width * new_width))
orig_framerate = float(self.framerate.get_orig())
- self.framerate.set_range(0, 10 * orig_framerate)
+ self.framerate.set_range(0, orig_framerate)
self.framerate.set_calc_new(orig_framerate)
- def update(self, path, info):
+ def update(self, info):
import fractions
if info is None:
@@ -224,3 +224,32 @@ class OptionsPanel(wx.Panel):
self.Enable()
self.Layout()
self.enforce_constraints()
+
+ def ffmpeg_opts(self):
+ opts = []
+
+ if self.start_time.is_edit():
+ 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)]
+ if self.end_time.is_edit():
+ opts += ['-to', str(self.end_time.get_final())]
+ if self.duration.is_edit():
+ opts += ['-t', str(self.duration.get_final())]
+
+ if self.width.is_edit() or self.height.is_edit():
+ width = str(self.width.get_final())
+ height = str(self.height.get_final())
+ if not self.width.is_edit():
+ width = "-1"
+ if not self.height.is_edit():
+ height = "-1"
+ opts += ['-vf', 'scale=' + width + ':' + height]
+
+ if self.framerate.is_edit():
+ opts += ['-r', str(self.framerate.get_final())]
+
+ return opts