From 44cc99fe0ebe7bd823f17275b1b0c47e15661491 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 7 Aug 2009 13:35:28 +0200 Subject: [PATCH] avinfo, get info about file --- oxlib/file.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) +