@@ -469,22 +469,25 @@ internal void Grain_detect(NumericUpDown gsupdown, Label status, int maxgs, Labe
469469 Process ffmpeg = new Process ( ) ;
470470 Func . Setinicial ( ffmpeg , 3 ) ;
471471 int ss = ( int ) ( Duration * i / ( loop + 2 ) ) ;
472- string cmd = " -loglevel panic -init_hw_device opencl:" + Encoder . OCL_Device + " -ss " + ss + " -i \" " + File + "\" -an -sn -frames:v 1 -vf \" " + crop + "thumbnail=n=" + frames + ",scale=w=1920:h=1080:force_original_aspect_ratio=decrease:force_divisible_by=2" ;
472+ string cmd = " -loglevel panic -init_hw_device opencl:" + Encoder . OCL_Device + " -ss " + ss + " -i \" " + File + "\" -an -sn -frames:v 1 -vf \" " + crop + "crop='min(386,iw):min(386,ih)':exact=1, thumbnail=n=" + frames ;
473473 if ( Hdr == 1 )
474474 cmd += ",format=p010,hwupload,tonemap_opencl=tonemap=hable:r=tv:p=bt709:t=bt709:m=bt709:format=nv12,hwdownload,format=nv12" ;
475475 else if ( Hdr == 2 && Encoder . Libplacebo )
476476 {
477477 cmd = cmd . Replace ( "opencl:" + Encoder . OCL_Device , "vulkan:" + Encoder . Vkn_Device ) ;
478478 cmd += ",format=yuv420p10le,hwupload,libplacebo=tonemapping=reinhard:range=tv:color_primaries=bt709:color_trc=bt709:colorspace=bt709:format=yuv420p,hwdownload,format=yuv420p" ;
479479 }
480- cmd += "\" -lossless 1 -compression_level 1 - y \" " + name + "_th.webp \" " ;
480+ cmd += "\" -y \" " + name + "_ss.png \" " ;
481481 ffmpeg . StartInfo . Arguments = cmd ;
482482 ffmpeg . Start ( ) ;
483483 ffmpeg . WaitForExit ( - 1 ) ;
484- ffmpeg . StartInfo . Arguments = " -loglevel panic -init_hw_device opencl:" + Encoder . OCL_Device + " - i \" " + name + "_th.webp \" -frames:v 1 - vf pad=(iw+16):(ih+16):8:8,format=pix_fmts=yuv420p,hwupload,nlmeans_opencl=s=1.8:p=7:r=9,hwdownload,format=pix_fmts=yuv420p, crop=(iw-16):(ih-16):8:8 -lossless 1 -compression_level 1 -y \" " + name + "_th_dns .webp\" " ;
484+ ffmpeg . StartInfo . Arguments = " -loglevel panic -i \" " + name + "_ss.png \" -vf crop='min(270,iw):min(270,ih)' -lossless 1 -compression_level 1 -y \" " + name + "_th .webp\" " ;
485485 ffmpeg . Start ( ) ;
486486 ffmpeg . WaitForExit ( - 1 ) ;
487- ffmpeg . StartInfo . Arguments = " -loglevel panic -init_hw_device opencl:" + Encoder . OCL_Device + " -i \" " + name + "_th.webp\" -frames:v 1 -vf pad=(iw+12):(ih+12):6:6,format=pix_fmts=yuv420p,hwupload,nlmeans_opencl=s=4:p=5:r=15,hwdownload,format=pix_fmts=yuv420p,crop=(iw-10):(ih-12):6:6 -lossless 1 -compression_level 1 -y \" " + name + "_th_dnb.webp\" " ;
487+ ffmpeg . StartInfo . Arguments = " -loglevel panic -init_hw_device opencl:" + Encoder . OCL_Device + " -i \" " + name + "_ss.png\" -frames:v 1 -vf format=pix_fmts=yuv420p,hwupload,nlmeans_opencl=s=1.8:p=7:r=9,hwdownload,format=pix_fmts=yuv420p,crop='min(270,iw):min(270,ih)':exact=1 -lossless 1 -compression_level 1 -y \" " + name + "_th_dns.webp\" " ;
488+ ffmpeg . Start ( ) ;
489+ ffmpeg . WaitForExit ( - 1 ) ;
490+ ffmpeg . StartInfo . Arguments = " -loglevel panic -init_hw_device opencl:" + Encoder . OCL_Device + " -i \" " + name + "_ss.png\" -frames:v 1 -vf format=pix_fmts=yuv420p,hwupload,nlmeans_opencl=s=4:p=5:r=15,hwdownload,format=pix_fmts=yuv420p,crop='min(270,iw):min(270,ih)':exact=1 -lossless 1 -compression_level 1 -y \" " + name + "_th_dnb.webp\" " ;
488491 ffmpeg . Start ( ) ;
489492 ffmpeg . WaitForExit ( - 1 ) ;
490493 double s1 = new FileInfo ( name + "_th.webp" ) . Length ;
@@ -537,6 +540,8 @@ public void Clear_tmp()
537540 string name = Path . GetFileNameWithoutExtension ( File ) ;
538541 try
539542 {
543+ if ( System . IO . File . Exists ( name + "_ss.png" ) )
544+ System . IO . File . Delete ( name + "_ss.png" ) ;
540545 if ( System . IO . File . Exists ( name + "_th.webp" ) )
541546 System . IO . File . Delete ( name + "_th.webp" ) ;
542547 if ( System . IO . File . Exists ( name + "_th_dns.webp" ) )
0 commit comments