diff --git a/oxlib/file.py b/oxlib/file.py index 38edfef..3db93c8 100644 --- a/oxlib/file.py +++ b/oxlib/file.py @@ -6,6 +6,9 @@ import os import hashlib import sys import struct +import subprocess + +from simplejson def sha1sum(filename): @@ -55,3 +58,8 @@ def oshash(filename): except(IOError): return "IOError" +def avinfo(filename): + p = subprocess.Popen(['ffmpeg2theora', '--info', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + info, error = p.communicate() + return simplejson.loads(info) +