From b60a685c856a0fea30f5e64757e9db90eb2b95dd Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 25 Sep 2014 23:01:40 +0200 Subject: [PATCH] detect ffmpeg or avconv, use version from ~/.ox/bin if available --- oxtimelines/ffmpeg.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/oxtimelines/ffmpeg.py b/oxtimelines/ffmpeg.py index 018fe4b..7f8f01c 100644 --- a/oxtimelines/ffmpeg.py +++ b/oxtimelines/ffmpeg.py @@ -11,7 +11,14 @@ import Image import numpy as np import ox -FFMPEG = ox.file.cmd('ffmpeg') +FFMPEG = None +for cmd in ('ffmpeg', 'avconv'): + cmd = ox.file.cmd(cmd) + if subprocess.call(['which', cmd], stdout=subprocess.PIPE) == 0: + FFMPEG = cmd + break +if not FFMPEG: + print "could not find ffmpeg, make sure its installed and available in PATH" FPS = 25 class Video(object):