use ffprobe in avinfo if installed
This commit is contained in:
parent
f02d42712d
commit
e4c51f0598
1 changed files with 3 additions and 0 deletions
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue