diff options
| author | tassaron | 2017-08-10 16:04:41 -0400 |
|---|---|---|
| committer | tassaron | 2017-08-10 16:04:41 -0400 |
| commit | 1c4afc96d69789f16284c067ffd7098dc7b2ca70 (patch) | |
| tree | f04e4117c133a539a87ffcae00d0cd66fa1517f4 /src/components/waveform.py | |
| parent | 8baa24e87847a0c7c530cbb55196103ce9cc511c (diff) | |
using the builtin logging module
Diffstat (limited to 'src/components/waveform.py')
| -rw-r--r-- | src/components/waveform.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/components/waveform.py b/src/components/waveform.py index 71cbcac..1517be2 100644 --- a/src/components/waveform.py +++ b/src/components/waveform.py @@ -4,6 +4,7 @@ from PyQt5.QtGui import QColor import os import math import subprocess +import logging from component import Component from toolkit.frame import BlankFrame, scale @@ -13,6 +14,9 @@ from toolkit.ffmpeg import ( ) +log = logging.getLogger('AVP.Components.Waveform') + + class Component(Component): name = 'Waveform' version = '1.0.0' @@ -106,10 +110,16 @@ class Component(Component): '-codec:v', 'rawvideo', '-', '-frames:v', '1', ]) - pipe = openPipe( - command, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL, bufsize=10**8 - ) + logFilename = os.path.join( + self.core.logDir, 'preview_%s.log' % str(self.compPos)) + log.debug('Creating ffmpeg process (log at %s)' % logFilename) + with open(logFilename, 'w') as logf: + logf.write(" ".join(command) + '\n\n') + with open(logFilename, 'a') as logf: + pipe = openPipe( + command, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, + stderr=logf, bufsize=10**8 + ) byteFrame = pipe.stdout.read(self.chunkSize) closePipe(pipe) |
