aboutsummaryrefslogtreecommitdiff
path: root/core.py
diff options
context:
space:
mode:
authorMartin Kaistra2015-03-05 15:58:45 +0100
committerMartin Kaistra2015-03-05 15:58:45 +0100
commit38cfae0b4e30fdc19612f5873aec09ea69e74486 (patch)
treea2e88d52a8e68d012183cd8028a8b314fbe53f54 /core.py
parent88105403e9d0b1afc9992c6a871ac7c0fed0cdaa (diff)
add setup.py, automatic discovery for avconv/ffmpeg, add installation help to readme
Diffstat (limited to 'core.py')
-rw-r--r--core.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/core.py b/core.py
index ac957e7..996bd52 100644
--- a/core.py
+++ b/core.py
@@ -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):