use ffprobe in avinfo if installed

This commit is contained in:
j 2015-01-03 10:58:21 +01:00
parent f02d42712d
commit e4c51f0598

View file

@ -9,6 +9,7 @@ import shutil
import struct import struct
import subprocess import subprocess
import sqlite3 import sqlite3
from distutils.spawn import find_executable
from .utils import json from .utils import json
@ -154,6 +155,8 @@ def avinfo(filename, cached=True):
if cached: if cached:
return cache(filename, 'info') return cache(filename, 'info')
if os.path.getsize(filename): if os.path.getsize(filename):
if find_executable('ffprobe'):
return ffprobe(filename)
ffmpeg2theora = cmd('ffmpeg2theora') ffmpeg2theora = cmd('ffmpeg2theora')
p = subprocess.Popen([ffmpeg2theora], stdout=subprocess.PIPE, stderr=subprocess.PIPE) p = subprocess.Popen([ffmpeg2theora], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
info, error = p.communicate() info, error = p.communicate()