From e4c51f05989db32edd791aec00bd8784b345e5bc Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 3 Jan 2015 10:58:21 +0100 Subject: [PATCH] use ffprobe in avinfo if installed --- ox/file.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ox/file.py b/ox/file.py index 9ef0fcd..26d16a9 100644 --- a/ox/file.py +++ b/ox/file.py @@ -9,6 +9,7 @@ import shutil import struct import subprocess import sqlite3 +from distutils.spawn import find_executable from .utils import json @@ -154,6 +155,8 @@ def avinfo(filename, cached=True): if cached: return cache(filename, 'info') if os.path.getsize(filename): + if find_executable('ffprobe'): + return ffprobe(filename) ffmpeg2theora = cmd('ffmpeg2theora') p = subprocess.Popen([ffmpeg2theora], stdout=subprocess.PIPE, stderr=subprocess.PIPE) info, error = p.communicate()