diff options
| author | Martin Kaistra | 2015-03-05 15:58:45 +0100 |
|---|---|---|
| committer | Martin Kaistra | 2015-03-05 15:58:45 +0100 |
| commit | 38cfae0b4e30fdc19612f5873aec09ea69e74486 (patch) | |
| tree | a2e88d52a8e68d012183cd8028a8b314fbe53f54 /core.py | |
| parent | 88105403e9d0b1afc9992c6a871ac7c0fed0cdaa (diff) | |
add setup.py, automatic discovery for avconv/ffmpeg, add installation help to readme
Diffstat (limited to 'core.py')
| -rw-r--r-- | core.py | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,4 +1,4 @@ -import sys, io +import sys, io, os from PyQt4 import QtCore, QtGui, uic from PyQt4.QtGui import QPainter, QColor from os.path import expanduser @@ -13,10 +13,18 @@ class Core(): self.lastBackgroundImage = "" self._image = None + self.FFMPEG_BIN = self.findFfmpeg() + + def findFfmpeg(self): if sys.platform == "win32": - self.FFMPEG_BIN = "ffmpeg.exe" + return "ffmpeg.exe" else: - self.FFMPEG_BIN = "ffmpeg" # on Linux and Mac OS + try: + with open(os.devnull, "w") as f: + sp.check_call(['ffmpeg', '-version'], stdout=f, stderr=f) + return "ffmpeg" + except: + return "avconv" def drawBaseImage(self, backgroundImage, titleText, titleFont): |
