x264streamsize=str(tsize[0])+u"x720"
x264_bitrate="2500"
if deinterlace==0:
+ tsize=getMovieBaseSize(pin)
ofps="-ofps 30000/1001"
fps="-fps 30000/1001"
x264fps="--fps 30000/1001"
- x264tune="--tune animation --tff --nal-hrd vbr"
+ x264tune=x264tune+" --tff --nal-hrd vbr"
encvf="-vf hqdn3d=2:1:2"
harddup=",harddup"
encvf=encvf+harddup
+ x264streamsize=str(tsize[0])+u"x"+str(tsize[1])
if quality==1:
x264preset=u"--preset ultrafast"
elif quality==2:
except:
""
recdblist.addCommandLog(pin, u"FFmpeg動画エンコード", exe, txt)
-def getMovieSize(pin):
- ffmpeg=configreader.getpath("ffmpeg")
- os.environ['LANG']="ja_JP.UTF-8"
- 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
- sizeMaxY=0
- txtls=txts.split("\n")
- for t in txtls:
- rM=rT.match(t)
- if rM:
- sizetxt=rM.group(1)
- partxt=rM.group(2)
- tX=int(sizetxt.split("x")[0])
- tY=int(sizetxt.split("x")[1])
- tEX=int(partxt.split(":")[0])
- tEY=int(partxt.split(":")[1])
- if tX==1920 and tY==1080:
- tEX=1
- tEY=1
- tX2=tX*tEX*10/tEY
- if tX2>10*int(tX2/10):
- tX2=tX2/10+1
- else:
- tX2=tX2/10
- if sizeMaxX<tX2:
- sizeMaxX=tX2
- sizeMaxY=tY
- return [sizeMaxX,sizeMaxY]
+
def getMovieBaseSize(pin):
ffmpeg=configreader.getpath("ffmpeg")
os.environ['LANG']="ja_JP.UTF-8"
darx=tEX
dary=tEY
return [darx,dary]
-def get16_9ffmpeg_s(pin,x,y):
- try:
- tDAR=getMovieDAR(pin)
- if (tDAR[0]==16 and tDAR[1]==9):
- return 0
- elif tDAR==[0,0]:
- return 0
- else:
- tSize=getMovieSize(pin)
- tn=x-tSize[1]*x/tSize[0]
- tn=tn/4
- tn=tn*2#偶数にするための処理
- return tn
- except:
- return 0
def get_par_size(pin,y):
tSize=getMovieBaseSize(pin)
tX=tSize[0]*10*y/tSize[1]