avinfo, get info about file
This commit is contained in:
parent
99a05fb55c
commit
44cc99fe0e
1 changed files with 8 additions and 0 deletions
|
@ -6,6 +6,9 @@ import os
|
||||||
import hashlib
|
import hashlib
|
||||||
import sys
|
import sys
|
||||||
import struct
|
import struct
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from simplejson
|
||||||
|
|
||||||
|
|
||||||
def sha1sum(filename):
|
def sha1sum(filename):
|
||||||
|
@ -55,3 +58,8 @@ def oshash(filename):
|
||||||
except(IOError):
|
except(IOError):
|
||||||
return "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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue