diff options
Diffstat (limited to 'src/components/video.py')
| -rw-r--r-- | src/components/video.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/components/video.py b/src/components/video.py index b6bdd52..a189f60 100644 --- a/src/components/video.py +++ b/src/components/video.py @@ -3,6 +3,7 @@ from PyQt5 import QtGui, QtCore, QtWidgets import os import math import subprocess +import logging from component import Component from toolkit.frame import BlankFrame, scale @@ -10,6 +11,9 @@ from toolkit.ffmpeg import openPipe, closePipe, testAudioStream, FfmpegVideo from toolkit import checkOutput +log = logging.getLogger('AVP.Components.Video') + + class Component(Component): name = 'Video' version = '1.0.0' @@ -134,10 +138,17 @@ class Component(Component): '-ss', '90', '-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) |
