def getMovieSize(pin):
ffmpeg=configreader.getpath("ffmpeg")
os.environ['LANG']="ja_JP.UTF-8"
- exe=ffmpeg+u" \""+pin+"\" 2>&1"
+ exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8')
rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")
sizeMaxX=0
tX2=tX*tEX*10/tEY
if tX2>10*int(tX2/10):
tX2=tX2/10+1
+ else:
+ tX2=tX2/10
if sizeMaxX<tX:
sizeMaxX=tX2
sizeMaxY=tY
def getMovieDAR(pin):
ffmpeg=configreader.getpath("ffmpeg")
os.environ['LANG']="ja_JP.UTF-8"
- exe=ffmpeg+u" \""+pin+"\" 2>&1"
+ exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8')
- rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+DAR\D+(\d+:\d+)\D+.*\Z")
+ rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")
sizeMaxX=0
darx=0
dary=0
tDAR=getMovieDAR(pin)
if (tDAR[0]==16 and tDAR[1]==9):
return 0
+ elif tDAR==[0,0]:
+ return 0
else:
tSize=getMovieSize(pin)
- tn=y-tSize[1]*x/tSize[0]
+ tn=x-tSize[1]*x/tSize[0]
tn=tn/4
tn=tn*2#偶数にするための処理
return tn