diff options
| author | tassaron | 2017-07-29 23:45:37 -0400 |
|---|---|---|
| committer | tassaron | 2017-07-29 23:45:37 -0400 |
| commit | db1ea1fc4edf19589e82171d48c417742c61c74b (patch) | |
| tree | 61058487ca96905f6f722498e0f6f2fc69dbb7c4 /src/toolkit/ffmpeg.py | |
| parent | 1297af61c9ce00b6dd76f8ec690baedf5bf887c7 (diff) | |
generic preview sound for waveform component
with secret preference to use the audio file again
Diffstat (limited to 'src/toolkit/ffmpeg.py')
| -rw-r--r-- | src/toolkit/ffmpeg.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/toolkit/ffmpeg.py b/src/toolkit/ffmpeg.py index e37282f..4ea2863 100644 --- a/src/toolkit/ffmpeg.py +++ b/src/toolkit/ffmpeg.py @@ -37,6 +37,7 @@ class FfmpegVideo: self.frameNo = -1 self.currentFrame = 'None' self.map_ = None + self.debug = False if 'loopVideo' in kwargs and kwargs['loopVideo']: self.loopValue = '-1' @@ -47,6 +48,8 @@ class FfmpegVideo: kwargs['filter_'].insert(0, '-filter_complex') else: kwargs['filter_'] = None + if 'debug' in kwargs: + self.debug = True self.command = [ core.Core.FFMPEG_BIN, @@ -62,7 +65,6 @@ class FfmpegVideo: kwargs['filter_'] ) self.command.extend([ - '-s:v', '%sx%s' % (self.width, self.height), '-codec:v', 'rawvideo', '-', ]) @@ -88,11 +90,15 @@ class FfmpegVideo: self.frameBuffer.task_done() def fillBuffer(self): - import sys - print(self.command) + if self.debug: + print(" ".join([word for word in self.command])) + err = sys.__stdout__ + else: + err = subprocess.DEVNULL + self.pipe = openPipe( self.command, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, - stderr=sys.__stdout__, bufsize=10**8 + stderr=err, bufsize=10**8 ) while True: if self.parent.canceled: |
