3 # Rec10 TS Recording Tools
\r
4 # Copyright (C) 2009-2011 Yukikaze
\r
16 def ts2x264(pin, pout, opts):#sizeは"HD"か"SD"
\r
18 pinで指定されたファイルをpoutにx264でエンコードして書き出す
\r
25 quality=int(configreader.getConfEnv("x264_preset"))
\r
26 crf=int(configreader.getConfEnv("crf"))
\r
30 if re.search("H", opts):
\r
32 if re.search("S", opts):
\r
34 if re.search("F", opts):
\r
36 if re.search("W",opts):
\r
38 if re.search("MW1",opts):
\r
41 if re.search("MW2", opts):
\r
44 if re.search("v", opts):
\r
46 crf=int(configreader.getConfEnv("animation_crf"))
\r
47 if re.search("a", opts):
\r
49 crf=int(configreader.getConfEnv("animation_crf"))
\r
50 if re.search("I", opts):
\r
52 if re.search("B", opts):
\r
55 if re.search("q",opts):
\r
57 if re.search("w",opts):
\r
59 if re.search("e",opts):
\r
61 if re.search("r",opts):
\r
63 if re.search("u",opts):
\r
65 if re.search("i",opts):
\r
67 if re.search("o",opts):
\r
69 if re.search("p",opts):
\r
71 if re.search("d",opts):#二カ国語放送の場合
\r
72 tm2v=pin.replace(".ts",".m2v")
\r
73 encodeFfmpegSar(tm2v,pout,size,is24fps,quality,crf,deinterlace=deinterlace,usebluray=bluray,usesar=sar)
\r
74 elif re.search("5",opts):#5.1chの場合
\r
75 encodeFfmpegSar(pin,pout,size,is24fps,quality,crf,deinterlace=deinterlace,usebluray=bluray,usesar=sar)
\r
76 elif re.search("b",opts):#BonTsDemuxを使いたい場合
\r
77 tm2v=pin.replace(".ts",".m2v")
\r
78 encodeFfmpegSar(tm2v,pout,size,is24fps,quality,crf,deinterlace=deinterlace,usebluray=bluray,usesar=sar)
\r
81 encodeMencoderSar(pin, pout,size,is24fps,quality,crf,deinterlace=deinterlace,uselavf=1,usebluray=bluray,usesar=sar)
\r
82 if os.path.exists(pout):
\r
83 if not os.path.getsize(pout)>1*1000:
\r
84 recdblist.addCommonlogEX("Warning", "Old mencoder option used.","","",log_level=200)
\r
86 encodeMencoderSar(pin, pout,size,is24fps,quality,crf,deinterlace=deinterlace,uselavf=0,usebluray=bluray,usesar=sar)
\r
87 except Exception, inst:
\r
88 recdblist.addCommonlogEX("Error", "ts2x264_mencoder_old(ts2x264.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
\r
90 recdblist.addCommonlogEX("Warning", "Old mencoder option used.","","",log_level=200)
\r
92 encodeMencoderSar(pin, pout,size,is24fps,quality,crf,deinterlace=deinterlace,uselavf=0,usebluray=bluray,usesar=sar)
\r
93 except Exception, inst:
\r
94 recdblist.addCommonlogEX("Error", "ts2x264_mencoder_old(ts2x264.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
\r
95 except Exception, inst:
\r
96 recdblist.addCommonlogEX("Error", "ts2x264(ts2x264.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
\r
97 def encodeMencoderSar(pin,pout,size,is24fps,quality,crf,deinterlace=1,uselavf=0,usebluray=0,usesar=1):
\r
98 mencoder=configreader.getConfPath("mencoder")
\r
99 tee=configreader.getConfPath("tee")
\r
102 encvf="-sws 9 -vf yadif=0,pp=l5"
\r
103 harddup=",hqdn3d=2:1:2,unsharp=l3x3:0.75:c3x3:0.75,harddup"
\r
104 ofps="-ofps 30000/1001"
\r
105 fps="-fps 30000/1001"
\r
106 x264fps="30000/1001 --keyint 30"
\r
110 x264_bitrate="5000"
\r
113 tsar=getMoviePAR2(pin)
\r
115 x264sar=str(tsar[0])+u":"+str(tsar[1])
\r
118 ofps="-ofps 24000/1001"
\r
119 fps="-fps 30000/1001"
\r
120 x264fps="24000/1001 --keyint 24"
\r
121 x264tune="--tune animation"
\r
122 encvf="-sws 9 -vf pullup,softskip"
\r
123 harddup=",pp=l5,unsharp=l3x3:0.75:c3x3:0.75,hqdn3d=2:1:2,harddup"
\r
125 tsize=getParSize(pin,720)
\r
127 encvf = encvf + ",scale=-3:720::0:3"+harddup
\r
128 x264streamsize=str(tsize[0])+u"x720"
\r
130 encvf = encvf + ",scale=-2:720::0:3,expand=1280:720"+harddup
\r
131 x264streamsize=u"1280x720"
\r
132 x264_bitrate="2500"
\r
133 elif size == "WVGA":
\r
134 tsize=getParSize(pin,480)
\r
136 encvf = encvf + ",scale=-3:480::0:3"+harddup
\r
137 x264streamsize=str(tsize[0])+u"x480"
\r
139 encvf = encvf + ",scale=-2:480::0:3,expand=854:480"+harddup
\r
140 x264streamsize=u"854x480"
\r
141 x264_bitrate="1500"
\r
142 elif size == "FullHD":
\r
143 tsize=getParSize(pin,1080)
\r
145 encvf = encvf + ",scale=-3:1080::0:3"+harddup
\r
146 x264streamsize=str(tsize[0])+u"x1080"
\r
148 encvf = encvf + ",scale=-2:1080::0:3,expand=1920:1080"+harddup
\r
149 x264streamsize=u"1920x1080"
\r
150 x264_bitrate="5000"
\r
151 elif size == "QVGA_BASE":
\r
152 tsize=getParSize(pin,240)
\r
154 encvf = encvf + ",scale=-3:240::0:3"+harddup
\r
155 x264streamsize=str(tsize[0])+u"x240"
\r
157 encvf = encvf + ",scale=320:-2::0:3,expand=320:240"+harddup
\r
158 x264streamsize=u"320x240"
\r
160 elif size == "WVGA_BASE":
\r
161 tsize=getParSize(pin,480)
\r
163 encvf = encvf + ",scale=-3:480::0:3"+harddup
\r
164 x264streamsize=str(tsize[0])+u"x480"
\r
166 encvf = encvf + ",scale=-2:480::0:3,expand=854:480"+harddup
\r
167 x264streamsize=u"854x480"
\r
168 x264_bitrate="1500"
\r
170 tsize=getParSize(pin,720)
\r
172 encvf = encvf + ",scale=-3:720::0:3"+harddup
\r
173 x264streamsize=str(tsize[0])+u"x720"
\r
175 encvf = encvf + ",scale=-2:720::0:3,expand=1280:720"+harddup
\r
176 x264streamsize=u"1280x720"
\r
177 x264_bitrate="2500"
\r
179 tsize=getMovieBaseSize2(pin)
\r
180 ofps="-ofps 30000/1001"
\r
181 #fps="-fps 30000/1001"
\r
183 x264fps="30000/1001 --keyint 30"
\r
185 encvf="-vf hqdn3d=2:1:2"
\r
187 encvf=encvf+harddup
\r
188 x264streamsize=str(tsize[0])+u"x"+str(tsize[1])
\r
190 encvf = encvf + ",scale=-2:1080::0:3,expand=1920:1080"+harddup
\r
191 x264streamsize=u"1920x1080"
\r
192 if tsize[0] <= 0 or tsize[1] <= 0:
\r
193 encvf="-sws 9 -vf yadif=0,pp=l5"
\r
194 harddup=",hqdn3d=2:1:2,unsharp=l3x3:0.75:c3x3:0.75,harddup"
\r
195 ofps="-ofps 30000/1001"
\r
196 fps="-fps 30000/1001"
\r
197 x264fps="30000/1001 --keyint 30"
\r
199 encvf = encvf + ",scale=-2:720::0:3,expand=1280:720"+harddup
\r
200 x264streamsize=u"1280x720"
\r
201 x264_bitrate="2500"
\r
203 x264preset=u"ultrafast"
\r
205 x264preset=u"veryfast"
\r
209 x264preset=u"medium"
\r
213 x264preset=u"slower"
\r
215 x264preset=u"medium"
\r
216 if size == "WVGA_BASE" or size == "QVGA_BASE":
\r
217 x264profile=" --level 32 --profile baseline "
\r
219 x264profile=" --level 41 --profile high "
\r
221 lavft="-demuxer lavf "
\r
223 os.environ['LANG']="ja_JP.UTF-8"
\r
225 random.jumpahead(10)
\r
226 temptime=int(time.time())
\r
227 temptime=temptime % 9697
\r
228 random.jumpahead(temptime)
\r
229 streampath=os.path.join(os.path.dirname(pin),str(random.randint(10000, 99999999)))
\r
230 unicode(commands.getoutput(u"mkfifo "+streampath),'utf-8','ignore')
\r
231 logmencoder=recdblist.getLogTitle(pin)+".mencoder.log"
\r
232 logx264=recdblist.getLogTitle(pin)+".x264.log"
\r
233 encexe=mencoder+u" \""+pin+u"\" -quiet -vfm ffmpeg "+lavft+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" 2>&1 | "+tee+" \""+logmencoder+"\" & "
\r
234 encexe=encexe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout, streampath, x264streamsize, crf=x264crf,interlaced=x264interlaced,bluray=usebluray)
\r
235 #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
236 encexe=u"nice -n 19 " +encexe+" 2>&1 | "+tee+" \""+logx264+"\""
\r
238 recdblist.addCommandSelfLog(pin, encexe)
\r
239 except Exception, inst:
\r
242 print traceback.print_exc(file=sys.stdout)
\r
243 recdblist.printutf8(encexe)
\r
246 txt=unicode(commands.getoutput(encexe.encode('utf-8')),'utf-8','ignore')
\r
249 os.remove(streampath)
\r
250 zip.addFile2FileZip(logmencoder, recdblist.getLogTitle(pin)+".log.zip")
\r
251 zip.addFile2FileZip(logx264, recdblist.getLogTitle(pin)+".log.zip")
\r
252 os.remove(logmencoder)
\r
254 recdblist.addCommandLog(pin, u"Mencoder", encexe, txt)
\r
255 # recdblist.addCommandLogTar(pin,u"Mencoder","mencoder", encexe,txt)
\r
256 def encodeFfmpegSar(pin,pout,size,is24fps,quality,crf,deinterlace=1,usebluray=0,usesar=1):
\r
260 ffmpeg=configreader.getConfPath("ffmpeg")
\r
261 tee=configreader.getConfPath("tee")
\r
262 fps=u"-r 29.970030 "
\r
263 x264fps="30000/1001 --keyint 30"
\r
267 x264_bitrate="2500"
\r
270 tsar=getMoviePAR2(pin)
\r
271 filter="-deinterlace"
\r
272 x264sar=str(tsar[0])+":"+str(tsar[1])
\r
274 fps=u"-r 23.976023 "
\r
275 x264fps="24000/1001 --keyint 24"
\r
276 x264tune="--tune animation"
\r
278 tsize=getParSize(pin,720)
\r
279 s = "-s "+str(tsize[0])+"x720 "
\r
280 x264streamsize=str(tsize[0])+u"x720"
\r
281 x264_bitrate="2500"
\r
282 elif size == "WVGA":
\r
283 tsize=getParSize(pin,480)
\r
284 s = "-s "+str(tsize[0])+"x480 "
\r
285 x264streamsize=str(tsize[0])+u"x480"
\r
286 x264_bitrate="1500"
\r
287 elif size == "FullHD":
\r
288 tsize=getParSize(pin,1080)
\r
289 s = "-s "+str(tsize[0])+"x1080 "
\r
290 x264streamsize=str(tsize[0])+u"x1080"
\r
291 x264_bitrate="5000"
\r
293 tsize=getParSize(pin,480)
\r
294 s = "-s "+str(tsize[0])+"x480 "
\r
295 x264streamsize=str(tsize[0])+u"x480"
\r
296 x264_bitrate="1250"
\r
297 elif size == "QVGA_BASE":
\r
298 tsize=getParSize(pin,240)
\r
299 s = "-s "+str(tsize[0])+"x240 "
\r
300 x264streamsize=str(tsize[0])+u"x240"
\r
302 elif size == "WVGA_BASE":
\r
303 tsize=getParSize(pin,480)
\r
304 s = "-s "+str(tsize[0])+"x480 "
\r
305 x264streamsize=str(tsize[0])+u"x480"
\r
306 x264_bitrate="1500"
\r
308 tsize=getParSize(pin,720)
\r
309 s = "-s "+str(tsize[0])+"x720 "
\r
310 x264streamsize=str(tsize[0])+u"x720"
\r
311 x264_bitrate="2500"
\r
313 tsize=getMovieBaseSize2(pin)
\r
315 s = "-s "+str(tsize[0])+"x"+str(tsize[1])+" "
\r
316 x264fps="30000/1001 --keyint 30"
\r
319 x264streamsize=str(tsize[0])+u"x"+str(tsize[1])
\r
321 x264preset=u"ultrafast"
\r
323 x264preset=u"veryfast"
\r
327 x264preset=u"medium"
\r
331 x264preset=u"slower"
\r
333 x264preset=u"medium"
\r
334 if size == "WVGA_BASE" or size == "QVGA_BASE":
\r
335 x264profile=" --level 32 --profile baseline "
\r
337 x264profile=" --level 41 --profile high "
\r
340 os.environ['LANG']="ja_JP.UTF-8"
\r
341 log_ffmpeg=recdblist.getLogTitle(pin)+".ffmpeg.log"
\r
342 log_x264=recdblist.getLogTitle(pin)+".x264.log"
\r
343 exe=ffmpeg+u" -y -i \""+pin+"\" -vsync 400 -vcodec rawvideo -pix_fmt yuv420p "+s+fps+" "+filter+" -an -f rawvideo - 2> \""+log_ffmpeg+"\" | "
\r
344 exe=exe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout,"-", x264streamsize, crf=x264crf,interlaced=x264interlaced,bluray=usebluray)
\r
345 exe = "nice -n 19 " + exe+" 2>&1 | "+tee+" \""+log_x264+"\""
\r
347 #recdblist.addCommandSelfLog(log_ffmpeg,recdblist.getLogTitle(pin)+".log.zip")
\r
348 #recdblist.addCommandSelfLog(log_x264,recdblist.getLogTitle(pin)+".log.zip")
\r
349 recdblist.printutf8(exe)
\r
350 recdblist.addCommandSelfLog(pin,exe)
\r
352 txt=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
\r
355 recdblist.addCommandLog(pin, u"FFmpeg動画エンコード", exe, txt)
\r
356 zip.addFile2FileZip(log_ffmpeg, recdblist.getLogTitle(pin+".log.zip"))
\r
357 zip.addFile2FileZip(log_x264, recdblist.getLogTitle(pin+".log.zip"))
\r
358 os.remove(log_ffmpeg)
\r
359 os.remove(log_x264)
\r
360 def getMovieBaseSize(pin):
\r
361 ffmpeg=configreader.getConfPath("ffmpeg")
\r
362 os.environ['LANG']="ja_JP.UTF-8"
\r
363 exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
\r
364 txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
\r
365 rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")
\r
368 txtls=txts.split("\n")
\r
372 sizetxt=rM.group(1)
\r
374 tX=int(sizetxt.split("x")[0])
\r
375 tY=int(sizetxt.split("x")[1])
\r
376 tEX=int(partxt.split(":")[0])
\r
377 tEY=int(partxt.split(":")[1])
\r
381 return [sizeMaxX,sizeMaxY]
\r
382 def getMovieBaseSize2(pin):##動画開始後すぐに解像度が変更されたときに対処
\r
383 ffmpeg=configreader.getConfPath("ffmpeg")
\r
384 os.environ['LANG']="ja_JP.UTF-8"
\r
385 exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"
\r
386 txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
\r
387 rT=re.compile(u"Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")
\r
390 txtls=txts.split("\n")
\r
394 sizetxt=rM.group(1)
\r
396 tX=int(sizetxt.split("x")[0])
\r
397 tY=int(sizetxt.split("x")[1])
\r
398 tEX=int(partxt.split(":")[0])
\r
399 tEY=int(partxt.split(":")[1])
\r
403 os.remove(pin+".size.ts")
\r
404 return [sizeMaxX,sizeMaxY]
\r
405 def getMoviePAR(pin):
\r
406 ffmpeg=configreader.getConfPath("ffmpeg")
\r
407 os.environ['LANG']="ja_JP.UTF-8"
\r
408 exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
\r
409 txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
\r
410 rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")
\r
414 txtls=txts.split("\n")
\r
418 sizetxt=rM.group(1)
\r
420 tX=int(sizetxt.split("x")[0])
\r
421 tY=int(sizetxt.split("x")[1])
\r
422 tEX=int(dartxt.split(":")[0])
\r
423 tEY=int(dartxt.split(":")[1])
\r
426 if tX==1920 and tY==1080:
\r
433 def getMoviePAR2(pin):
\r
434 ffmpeg=configreader.getConfPath("ffmpeg")
\r
435 os.environ['LANG']="ja_JP.UTF-8"
\r
436 exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"
\r
437 txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
\r
438 rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+PAR\D+(\d+:\d+)\D+.*\Z")
\r
442 txtls=txts.split("\n")
\r
446 sizetxt=rM.group(1)
\r
448 tX=int(sizetxt.split("x")[0])
\r
449 tY=int(sizetxt.split("x")[1])
\r
450 tEX=int(dartxt.split(":")[0])
\r
451 tEY=int(dartxt.split(":")[1])
\r
454 if tX==1920 and tY==1080:
\r
460 os.remove(pin+".size.ts")
\r
462 def getMovieDAR(pin):
\r
463 ffmpeg=configreader.getConfPath("ffmpeg")
\r
464 os.environ['LANG']="ja_JP.UTF-8"
\r
465 exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
\r
466 txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
\r
467 rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")
\r
471 txtls=txts.split("\n")
\r
475 sizetxt=rM.group(1)
\r
477 tX=int(sizetxt.split("x")[0])
\r
478 tY=int(sizetxt.split("x")[1])
\r
479 tEX=int(dartxt.split(":")[0])
\r
480 tEY=int(dartxt.split(":")[1])
\r
483 if tX==1920 and tY==1080:
\r
490 def getMovieDAR2(pin):
\r
491 ffmpeg=configreader.getConfPath("ffmpeg")
\r
492 os.environ['LANG']="ja_JP.UTF-8"
\r
493 exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"
\r
494 txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
\r
495 rT=re.compile(u".*Stream.*#.*:.*\D+([\d]+x[\d]+)\D+.*DAR\D+(\d+:\d+)\D+.*\Z")
\r
499 txtls=txts.split("\n")
\r
503 sizetxt=rM.group(1)
\r
505 tX=int(sizetxt.split("x")[0])
\r
506 tY=int(sizetxt.split("x")[1])
\r
507 tEX=int(dartxt.split(":")[0])
\r
508 tEY=int(dartxt.split(":")[1])
\r
511 if tX==1920 and tY==1080:
\r
517 os.remove(pin+".size.ts")
\r
519 def getParSize(pin,y):
\r
520 tSize=getMovieBaseSize2(pin)
\r
522 tX=tSize[0]*10*y/tSize[1]
\r
524 if tX>int(tX/10)*10:
\r
532 def getX264CoreVersion():
\r
533 x264=configreader.getConfPath("x264")
\r
534 t1=commands.getoutput(x264+" --help|grep core")
\r
535 rT=re.compile(u"x264 core:(\d*)[\d]*.*\Z")
\r
541 def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsize,crf=-1,bitrate=0,interlaced=0,bluray=0):
\r
542 x264=configreader.getConfPath("x264")
\r
543 os.environ['LANG']="ja_JP.UTF-8"
\r
544 x264_sar="--sar "+sar
\r
545 x264preset=u"--preset "+preset
\r
546 x264fps="--fps "+fps
\r
549 x264_addline=configreader.getConfEnv("x264_addline")
\r
551 x264bitrate=u"--bitrate "+str(bitrate)
\r
553 x264crf=u"--crf "+str(crf)
\r
555 x264interlaced="--tff --nal-hrd vbr"
\r
557 x264bluray="--weightp 1 --nal-hrd vbr --bframes 3 --b-pyramid none --open-gop bluray --slices 4 --aud --colorprim bt709 --transfer bt709 "
\r
559 if fps=="24000/1001 --keyint 24" or fps =="24000/1001":
\r
560 if x264streamsize=="1280x720":
\r
561 x264bluray=u"--ref 6 "+x264bluray
\r
562 if x264streamsize=="1920x1080":
\r
563 x264bluray=u"--ref 3 "+x264bluray
\r
564 elif fps=="30000/1001 --keyint 30" or fps =="30000/1001":
\r
565 if x264streamsize=="1280x720":
\r
566 x264bluray=u"--ref 6 --pulldown double "+x264bluray
\r
567 if x264streamsize=="1920x1080":
\r
569 x264bluray=u"--ref 3 --fake-interlaced --pic-struct "+x264bluray
\r
571 x264bluray=u"--ref 3 "+x264bluray
\r
574 xtt=configreader.getConfEnv("x264_thread")
\r
577 x264_thread=str(xtt)
\r
580 x264_addline=configreader.getConfEnv("x264_addline")
\r
581 if getX264CoreVersion()>103:
\r
582 x264res=u"--input-res "+x264streamsize
\r
583 exe=u"nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264bluray+u" "+x264interlaced+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" "+x264res+" -o \""+pout+"\" "+pin
\r
585 exe=u"nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264bluray+u" "+x264interlaced+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+pin+" "+x264streamsize
\r