OSDN Git Service

add tar log.(alpha)
[rec10/rec10-git.git] / rec10 / trunk / src / ts2x264.py
1 #!/usr/bin/python\r
2 # coding: UTF-8\r
3 # Rec10 TS Recording Tools\r
4 # Copyright (C) 2009-2011 Yukikaze\r
5 import commands\r
6 import configreader\r
7 import os\r
8 import os.path\r
9 import re\r
10 import random\r
11 import time\r
12 import traceback\r
13 \r
14 import recdblist\r
15 def ts2x264(pin, pout, opts):#sizeは"HD"か"SD"\r
16     """\r
17     pinで指定されたファイルをpoutにx264でエンコードして書き出す\r
18     """\r
19     dualpass = 0\r
20     is24fps=0\r
21     size="HD"\r
22     crf=18\r
23     quality=4\r
24     quality=int(configreader.getConfEnv("x264_preset"))\r
25     crf=int(configreader.getConfEnv("crf"))\r
26     deinterlace=1\r
27     if re.search("H", opts):\r
28         size = "HD"\r
29     if re.search("S", opts):\r
30         size = "WVGA"\r
31     if re.search("F", opts):\r
32         size = "FullHD"\r
33     if re.search("W",opts):\r
34         size = "WVGA"\r
35     if re.search("MW1",opts):\r
36         size = "QVGA_BASE"\r
37         crf=crf+4\r
38     if re.search("MW2", opts):\r
39         size = "WVGA_BASE"\r
40         crf=crf+2\r
41     if re.search("v", opts):\r
42         is24fps=1\r
43         crf=int(configreader.getConfEnv("animation_crf"))\r
44     if re.search("a", opts):\r
45         is24fps=1\r
46         crf=int(configreader.getConfEnv("animation_crf"))\r
47     if re.search("I", opts):\r
48         deinterlace=0\r
49     if re.search("q",opts):\r
50         quality=quality-2\r
51     if re.search("w",opts):\r
52         quality=quality-1\r
53     if re.search("e",opts):\r
54         quality=quality+1\r
55     if re.search("r",opts):\r
56         quality=quality+2\r
57     if re.search("u",opts):\r
58         crf=crf+2\r
59     if re.search("i",opts):\r
60         crf=crf+1\r
61     if re.search("o",opts):\r
62         crf=crf-1\r
63     if re.search("p",opts):\r
64         crf=crf-2\r
65     if re.search("d",opts):#二カ国語放送の場合\r
66         tm2v=pin.replace(".ts",".m2v")\r
67         encodeFfmpegSar(tm2v,pout,size,is24fps,quality,crf,deinterlace)\r
68     elif re.search("5",opts):#5.1chの場合\r
69         encodeFfmpegSar(pin,pout,size,is24fps,quality,crf,deinterlace)\r
70     else:\r
71         try:\r
72             encodeMencoderSar(pin, pout,size,is24fps,quality,crf,deinterlace)\r
73         except Exception, inst:\r
74             recdblist.addCommonlogEX("Error", "ts2x264(ts2x264.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)\r
75 def encodeMencoderSar(pin,pout,size,is24fps,quality,crf,deinterlace=1):\r
76     mencoder=configreader.getConfPath("mencoder")\r
77     encvf=""\r
78     txt=""\r
79     encvf="-sws 9 -vf yadif=0,pp=l5"\r
80     harddup=",hqdn3d=2:1:2,unsharp=l3x3:0.75:c3x3:0.75,harddup"\r
81     ofps="-ofps 30000/1001"\r
82     fps="-fps 30000/1001"\r
83     x264fps="30000/1001"\r
84     x264streamsize=""\r
85     x264preset=""\r
86     x264tune=""\r
87     x264_bitrate="5000"\r
88     tsar=getMoviePAR2(pin)\r
89     x264sar=str(tsar[0])+":"+str(tsar[1])\r
90     if is24fps==1:\r
91         ofps="-ofps 24000/1001"\r
92         fps="-fps 30000/1001"\r
93         x264fps="24000/1001"\r
94         x264tune="--tune animation"\r
95         encvf="-sws 9 -vf pullup,softskip"\r
96         harddup=",pp=l5,unsharp=l3x3:0.75:c3x3:0.75,hqdn3d=2:1:2,harddup"\r
97     if size == "HD":\r
98         tsize=getParSize(pin,720)\r
99         encvf = encvf + ",scale=-3:720::0:3"+harddup\r
100         x264streamsize=str(tsize[0])+u"x720"\r
101         x264_bitrate="2500"\r
102     elif size == "WVGA":\r
103         tsize=getParSize(pin,480)\r
104         encvf = encvf + ",scale=-3:480::0:3"+harddup\r
105         x264streamsize=str(tsize[0])+u"x480"\r
106         x264_bitrate="1500"\r
107     elif size == "FullHD":\r
108         tsize=getParSize(pin,1080)\r
109         encvf = encvf + ",scale=-3:1080::0:3"+harddup\r
110         x264streamsize=str(tsize[0])+u"x1080"\r
111         x264_bitrate="5000"\r
112     elif size == "QVGA_BASE":\r
113         tsize=getParSize(pin,240)\r
114         encvf = encvf + ",scale=-3:240::0:3"+harddup\r
115         x264streamsize=str(tsize[0])+u"x240"\r
116         x264_bitrate="300"\r
117     elif size == "WVGA_BASE":\r
118         tsize=getParSize(pin,480)\r
119         encvf = encvf + ",scale=-3:480::0:3"+harddup\r
120         x264streamsize=str(tsize[0])+u"x480"\r
121         x264_bitrate="1500"\r
122     else:\r
123         tsize=getParSize(pin,720)\r
124         encvf = encvf + ",scale=-3:720::0:3"+harddup\r
125         x264streamsize=str(tsize[0])+u"x720"\r
126         x264_bitrate="2500"\r
127     if deinterlace==0:\r
128         tsize=getMovieBaseSize2(pin)\r
129         ofps="-ofps 30000/1001"\r
130         #fps="-fps 30000/1001"\r
131         fps=""\r
132         x264fps="30000/1001"\r
133         x264tune=x264tune+" --tff --nal-hrd vbr"\r
134         encvf="-vf hqdn3d=2:1:2"\r
135         harddup=",harddup"\r
136         encvf=encvf+harddup\r
137         x264streamsize=str(tsize[0])+u"x"+str(tsize[1])\r
138     if tsize[0] <= 0 or tsize[1] <= 0:\r
139         encvf="-sws 9 -vf yadif=0,pp=l5"\r
140         harddup=",hqdn3d=2:1:2,unsharp=l3x3:0.75:c3x3:0.75,harddup"\r
141         ofps="-ofps 30000/1001"\r
142         fps="-fps 30000/1001"\r
143         x264fps="30000/1001"\r
144         tsize=[1280,720]\r
145         encvf = encvf + ",scale=-2:720::0:3,expand=1280:720"+harddup\r
146         x264streamsize=u"1280x720"\r
147         x264_bitrate="2500"\r
148     if quality==1:\r
149         x264preset=u"ultrafast"\r
150     elif quality==2:\r
151         x264preset=u"veryfast"\r
152     elif quality==3:\r
153         x264preset=u"fast"\r
154     elif quality==4:\r
155         x264preset=u"medium"\r
156     elif quality==5:\r
157         x264preset=u"slow"\r
158     elif quality==6:\r
159         x264preset=u"slower"\r
160     else:\r
161         x264preset=u"medium"\r
162     if size == "WVGA_BASE" or size == "QVGA_BASE":\r
163         x264profile=" --level 32 --profile baseline "\r
164     else:\r
165         x264profile=" --level 41 --profile high "\r
166     x264crf=str(crf)\r
167     os.environ['LANG']="ja_JP.UTF-8"\r
168     random.seed(pin)\r
169     random.jumpahead(10)\r
170     temptime=int(time.time())\r
171     temptime=temptime % 9697\r
172     random.jumpahead(temptime)\r
173     streampath=os.path.join(os.path.dirname(pin),str(random.randint(10000, 99999999)))\r
174     unicode(commands.getoutput(u"mkfifo "+streampath),'utf-8','ignore')\r
175     logmencoder=recdblist.getLogTitle(pin)+".mencoder.log"\r
176     logx264=recdblist.getLogTitle(pin)+".x264.log"\r
177     encexe=mencoder+u" \""+pin+u"\" -vfm ffmpeg -quiet "+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" | tee "+logmencoder+"& "\r
178     encexe=encexe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout, streampath, x264streamsize, crf=x264crf)\r
179     #encexe=encexe+u" nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264_addline+u"  --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize\r
180     encexe=u"nice -n 19 " +encexe+" | tee "+logx264\r
181     recdblist.addCommandSelfLog(pin, encexe)\r
182     recdblist.printutf8(encexe)\r
183     txt=""\r
184     try:\r
185         txt=unicode(commands.getoutput(encexe.encode('utf-8')),'utf-8','ignore')\r
186     except:\r
187         ""\r
188     os.remove(streampath)\r
189     recdblist.addCommandLog(pin, u"Mencoder", encexe, txt)\r
190     recdblist.addCommandLogTar(pin,u"Mencoder","mencoder", encext,txt)\r
191 def encodeFfmpegSar(pin,pout,size,is24fps,quality,crf,deinterlace=1):\r
192     """\r
193 \r
194     """\r
195     ffmpeg=configreader.getConfPath("ffmpeg")\r
196     fps=u"-r 29.970030 "\r
197     x264fps="30000/1001"\r
198     x264streamsize=""\r
199     x264preset=""\r
200     x264tune=""\r
201     x264_bitrate="2500"\r
202     x264_thread="auto"\r
203     tsar=getMoviePAR2(pin)\r
204     filter="-deinterlace"\r
205     x264sar=str(tsar[0])+":"+str(tsar[1])\r
206     if size == "HD":\r
207         tsize=getParSize(pin,720)\r
208         s = "-s "+str(tsize[0])+"x720 "\r
209         x264streamsize=str(tsize[0])+u"x720"\r
210         x264_bitrate="2500"\r
211     elif size == "WVGA":\r
212         tsize=getParSize(pin,480)\r
213         s = "-s "+str(tsize[0])+"x480 "\r
214         x264streamsize=str(tsize[0])+u"x480"\r
215         x264_bitrate="1500"\r
216     elif size == "FullHD":\r
217         tsize=getParSize(pin,1080)\r
218         s = "-s "+str(tsize[0])+"x1080 "\r
219         x264streamsize=str(tsize[0])+u"x1080"\r
220         x264_bitrate="5000"\r
221     elif size == "SD":\r
222         tsize=getParSize(pin,480)\r
223         s = "-s "+str(tsize[0])+"x480 "\r
224         x264streamsize=str(tsize[0])+u"x480"\r
225         x264_bitrate="1250"\r
226     elif size == "QVGA_BASE":\r
227         tsize=getParSize(pin,240)\r
228         s = "-s "+str(tsize[0])+"x240 "\r
229         x264streamsize=str(tsize[0])+u"x240"\r
230         x264_bitrate="300"\r
231     elif size == "WVGA_BASE":\r
232         tsize=getParSize(pin,480)\r
233         s = "-s "+str(tsize[0])+"x480 "\r
234         x264streamsize=str(tsize[0])+u"x480"\r
235         x264_bitrate="1500"\r
236     else:\r
237         tsize=getParSize(pin,720)\r
238         s = "-s "+str(tsize[0])+"x720 "\r
239         x264streamsize=str(tsize[0])+u"x720"\r
240         x264_bitrate="2500"\r
241     if deinterlace==0:\r
242         tsize=getMovieBaseSize2(pin)\r
243         fps=""\r
244         s = "-s "+str(tsize[0])+"x"+str(tsize[1])+" "\r
245         x264fps="30000/1001"\r
246         x264tune=x264tune+" --tff --nal-hrd vbr"\r
247         filter=""\r
248         x264streamsize=str(tsize[0])+u"x"+str(tsize[1])\r
249     if quality==1:\r
250         x264preset=u"ultrafast"\r
251     elif quality==2:\r
252         x264preset=u"veryfast"\r
253     elif quality==3:\r
254         x264preset=u"fast"\r
255     elif quality==4:\r
256         x264preset=u"medium"\r
257     elif quality==5:\r
258         x264preset=u"slow"\r
259     elif quality==6:\r
260         x264preset=u"slower"\r
261     else:\r
262         x264preset=u"medium"\r
263     if size == "WVGA_BASE" or size == "QVGA_BASE":\r
264         x264profile=" --level 32 --profile baseline "\r
265     else:\r
266         x264profile=" --level 41 --profile high "\r
267     x264crf=str(crf)\r
268     txt=""\r
269     os.environ['LANG']="ja_JP.UTF-8"\r
270     log_ffmpeg=recdblist.getLogTitle(pin)+".ffmpeg.log"\r
271     log_x264=recdblist.getLogTitle(pin)+".x264.log"\r
272     exe=ffmpeg+u" -y -i \""+pin+"\" -vsync 400 -vcodec rawvideo -pix_fmt yuv420p "+s+fps+" "+filter+" -an -f rawvideo - 2> "+log_ffmpeg+"| "\r
273     exe=exe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout,"-", x264streamsize, crf=x264crf)\r
274     exe = "nice -n 19 " + exe+" 2>&1 | tee "+log_x264\r
275     txt=""\r
276     recdblist.addCommandSelfLog(pin,exe)\r
277     recdblist.printutf8(exe)\r
278     try:\r
279         txt=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
280     except:\r
281         ""\r
282     recdblist.addCommandLog(pin, u"FFmpeg動画エンコード", exe, txt)\r
283     recdblist.addCommandLogTar(pin,u"ffmpeg","ffmpeg", exe,txt)\r
284 def getMovieBaseSize(pin):\r
285     ffmpeg=configreader.getConfPath("ffmpeg")\r
286     os.environ['LANG']="ja_JP.UTF-8"\r
287     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"\r
288     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
289     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")\r
290     sizeMaxX=0\r
291     sizeMaxY=0\r
292     txtls=txts.split("\n")\r
293     for t in txtls:\r
294         rM=rT.match(t)\r
295         if rM:\r
296             sizetxt=rM.group(1)\r
297             partxt=rM.group(2)\r
298             tX=int(sizetxt.split("x")[0])\r
299             tY=int(sizetxt.split("x")[1])\r
300             tEX=int(partxt.split(":")[0])\r
301             tEY=int(partxt.split(":")[1])\r
302             if sizeMaxX<tX:\r
303                 sizeMaxX=tX\r
304                 sizeMaxY=tY\r
305     return [sizeMaxX,sizeMaxY]\r
306 def getMovieBaseSize2(pin):##動画開始後すぐに解像度が変更されたときに対処\r
307     ffmpeg=configreader.getConfPath("ffmpeg")\r
308     os.environ['LANG']="ja_JP.UTF-8"\r
309     exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
310     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
311     rT=re.compile(u"Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")\r
312     sizeMaxX=0\r
313     sizeMaxY=0\r
314     txtls=txts.split("\n")\r
315     for t in txtls:\r
316         rM=rT.search(t)\r
317         if rM:\r
318             sizetxt=rM.group(1)\r
319             partxt=rM.group(2)\r
320             tX=int(sizetxt.split("x")[0])\r
321             tY=int(sizetxt.split("x")[1])\r
322             tEX=int(partxt.split(":")[0])\r
323             tEY=int(partxt.split(":")[1])\r
324             if sizeMaxX<tX:\r
325                 sizeMaxX=tX\r
326                 sizeMaxY=tY\r
327     os.remove(pin+".size.ts")\r
328     return [sizeMaxX,sizeMaxY]\r
329 def getMoviePAR(pin):\r
330     ffmpeg=configreader.getConfPath("ffmpeg")\r
331     os.environ['LANG']="ja_JP.UTF-8"\r
332     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"\r
333     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
334     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")\r
335     sizeMaxX=0\r
336     parx=0\r
337     pary=0\r
338     txtls=txts.split("\n")\r
339     for t in txtls:\r
340         rM=rT.match(t)\r
341         if rM:\r
342             sizetxt=rM.group(1)\r
343             dartxt=rM.group(2)\r
344             tX=int(sizetxt.split("x")[0])\r
345             tY=int(sizetxt.split("x")[1])\r
346             tEX=int(dartxt.split(":")[0])\r
347             tEY=int(dartxt.split(":")[1])\r
348             if sizeMaxX<tX:\r
349                 sizeMaxX=tX\r
350                 if tX==1920 and tY==1080:\r
351                     parx=1\r
352                     pary=1\r
353                 else:\r
354                     parx=tEX\r
355                     pary=tEY\r
356     return [parx,pary]\r
357 def getMoviePAR2(pin):\r
358     ffmpeg=configreader.getConfPath("ffmpeg")\r
359     os.environ['LANG']="ja_JP.UTF-8"\r
360     exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
361     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
362     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")\r
363     sizeMaxX=0\r
364     parx=0\r
365     pary=0\r
366     txtls=txts.split("\n")\r
367     for t in txtls:\r
368         rM=rT.match(t)\r
369         if rM:\r
370             sizetxt=rM.group(1)\r
371             dartxt=rM.group(2)\r
372             tX=int(sizetxt.split("x")[0])\r
373             tY=int(sizetxt.split("x")[1])\r
374             tEX=int(dartxt.split(":")[0])\r
375             tEY=int(dartxt.split(":")[1])\r
376             if sizeMaxX<tX:\r
377                 sizeMaxX=tX\r
378                 if tX==1920 and tY==1080:\r
379                     parx=1\r
380                     pary=1\r
381                 else:\r
382                     parx=tEX\r
383                     pary=tEY\r
384     os.remove(pin+".size.ts")\r
385     return [parx,pary]\r
386 def getMovieDAR(pin):\r
387     ffmpeg=configreader.getConfPath("ffmpeg")\r
388     os.environ['LANG']="ja_JP.UTF-8"\r
389     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"\r
390     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
391     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")\r
392     sizeMaxX=0\r
393     darx=0\r
394     dary=0\r
395     txtls=txts.split("\n")\r
396     for t in txtls:\r
397         rM=rT.match(t)\r
398         if rM:\r
399             sizetxt=rM.group(1)\r
400             dartxt=rM.group(2)\r
401             tX=int(sizetxt.split("x")[0])\r
402             tY=int(sizetxt.split("x")[1])\r
403             tEX=int(dartxt.split(":")[0])\r
404             tEY=int(dartxt.split(":")[1])\r
405             if sizeMaxX<tX:\r
406                 sizeMaxX=tX\r
407                 if tX==1920 and tY==1080:\r
408                     darx=16\r
409                     dary=9\r
410                 else:\r
411                     darx=tEX\r
412                     dary=tEY\r
413     return [darx,dary]\r
414 def getMovieDAR2(pin):\r
415     ffmpeg=configreader.getConfPath("ffmpeg")\r
416     os.environ['LANG']="ja_JP.UTF-8"\r
417     exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"\r
418     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')\r
419     rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")\r
420     sizeMaxX=0\r
421     darx=0\r
422     dary=0\r
423     txtls=txts.split("\n")\r
424     for t in txtls:\r
425         rM=rT.match(t)\r
426         if rM:\r
427             sizetxt=rM.group(1)\r
428             dartxt=rM.group(2)\r
429             tX=int(sizetxt.split("x")[0])\r
430             tY=int(sizetxt.split("x")[1])\r
431             tEX=int(dartxt.split(":")[0])\r
432             tEY=int(dartxt.split(":")[1])\r
433             if sizeMaxX<tX:\r
434                 sizeMaxX=tX\r
435                 if tX==1920 and tY==1080:\r
436                     darx=16\r
437                     dary=9\r
438                 else:\r
439                     darx=tEX\r
440                     dary=tEY\r
441     os.remove(pin+".size.ts")\r
442     return [darx,dary]\r
443 def getParSize(pin,y):\r
444     tSize=getMovieBaseSize2(pin)\r
445     if tSize[1] != 0 :\r
446         tX=tSize[0]*10*y/tSize[1]\r
447         tY=y\r
448         if tX>int(tX/10)*10:\r
449             tX=tX/10+1\r
450         else:\r
451             tX=tX/10\r
452     else:\r
453         tX=-1\r
454         tY=-1\r
455     return [tX,tY]\r
456 def getX264CoreVersion():\r
457     x264=configreader.getConfPath("x264")\r
458     t1=commands.getoutput(x264+" --help|grep core")\r
459     rT=re.compile(u"x264 core:(\d*)[\d]*.*\Z")\r
460     rM=rT.match(t1)\r
461     v=-1\r
462     if rM:\r
463         v=int(rM.group(1))\r
464     return v\r
465 def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsize,crf=-1,bitrate=0):\r
466     x264=configreader.getConfPath("x264")\r
467     os.environ['LANG']="ja_JP.UTF-8"\r
468     x264_sar="--sar "+sar\r
469     x264preset=u"--preset "+preset\r
470     x264fps="--fps "+fps\r
471     if crf==-1:\r
472         x264bitrate=u"--bitrate "+str(bitrate)\r
473     else:\r
474         x264crf=u"--crf "+str(crf)\r
475     x264_addline=configreader.getConfEnv("x264_addline")\r
476     x264_thread="auto"\r
477     try:\r
478         xtt=configreader.getConfEnv("x264_thread")\r
479         xtt=int(xtt)\r
480         if xtt>0:\r
481             x264_thread=str(xtt)\r
482     except:\r
483         x264_thread="auto"\r
484     x264_addline=configreader.getConfEnv("x264_addline")\r
485     if getX264CoreVersion()>103:\r
486         x264res=u"--input-res "+x264streamsize\r
487         exe=u"nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" "+x264res+" -o \""+pout+"\" "+pin\r
488     else:\r
489         exe=u"nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+pin+" "+x264streamsize\r
490     return exe\r