Advertisement
Guest User

Untitled

a guest
Dec 11th, 2016
16,730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.55 KB | None | 0 0
  1. #Full Script - RemasteringATLA Release1
  2.  
  3. #All episodes were encoded using a minimum of two passes due to the availability of certain plugins. We used TFM to deinterlace all episodes. Some episodes were originally 29.970 FPS and some were 23.977 FPS and were telecined to 29.970 FPS. Most episodes are hybrids.
  4.  
  5. #Keep in mind that every single encode and every single filter is going to destroy some detail. If you encode using very high settings, the detail loss is mostly negligible and other than the dehalo filters, this detail lost to filters is also pretty negligible. Waifu2x can generate some missing detail and more than makes up for any lost detail long the way and warpsharp does change the detail a bit to thin out the black outlines.
  6.  
  7. #First Pass using 32 bit StaxRip/Avisynth on all episodes: Deinterlacing (and dehaloing of "medium" quality episodes, 9-25) and encoded using a lossless* h264 setting (at least crf-6 though feel free to play with it)
  8. QTGMC = QTGMC(preset="very slow", noiseprocess=0, FPSDivisor=2)
  9. TFM(order=1, cthresh=8, mode=0, pp=3, slow=2, mmsco=false, micmatching=2, clip2=QTGMC)
  10. DeHalo_alpha(rx=1.5, ry=1.5, darkstr=0, brightstr=2.0, lowsens=50, highsens=50, ss=3.0) #only on episodes 9-25
  11.  
  12. #Second Pass using 64 bit StaxRip/Vapoursynth on all episodes: Upscale, Denoise, dehalo, warpsharp. Here's the script straight out of the staxrip editor:
  13. clip = core.lsmas.LWLibavSource(r"%source_file%")
  14.  
  15. core.max_cache_size = 27000
  16.  
  17. #core.avs.LoadPlugin(path=r'C:\ReMasteringATLA\plugins\TIVTC.dll')
  18. core.std.LoadPlugin (path=r'D:\caffe\Waifu2x-caffe.dll')
  19. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\flash3kyuu_deband.dll')
  20. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\TCanny.dll')
  21. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\KNLMeansCL.dll')
  22. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\libnnedi3.dll')
  23. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\TDeintMod.dll')
  24. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\scenechange.dll')
  25. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\temporalsoften.dll')
  26. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\libmvtools.dll')
  27. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\Retinex.dll')
  28. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\libawarpsharp2.dll')
  29. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\fmtconv.dll')
  30. Vine = importlib.machinery.SourceFileLoader('Vine', r"C:\ReMasteringATLA\plugins\Vine.py").load_module()
  31. mvsfunc = importlib.machinery.SourceFileLoader('mvsfunc', r"C:\ReMasteringATLA\plugins\mvsfunc.py").load_module()
  32. havsfunc = importlib.machinery.SourceFileLoader('havsfunc', r"C:\ReMasteringATLA\plugins\havsfunc.py").load_module()
  33.  
  34. clip = core.fmtc.bitdepth(clip,bits=32)
  35. #clip = Vine.Dehalo(clip, radius=[4, 2], a=32, h=15, sharp=1.1, sigma=0.7, alpha=0.38, beta=32, cutoff=1, show=False) #B1D1 only, eps 1-4
  36. #clip = havsfunc.DeHalo_alpha(clip, rx=1.5, ry=1.5, darkstr=0, brightstr=2.0, lowsens=50, highsens=50, ss=3.0) #eps 9-25 and 53 if not already dehaloed during TFM pass
  37. clip = core.caffe.Waifu2x(clip, noise=1, scale=2, block_w=512, block_h=512, model=3, cudnn=True, processor=0, tta=False)
  38. clip = core.fmtc.resample(clip, w=1440, h=1080, kernel = "spline36")
  39. clip = core.fmtc.bitdepth(clip,bits=16)
  40. clip = core.warp.AWarpSharp2(clip,thresh=128, blur=2, type=0, depth=16, chroma=0)
  41. clip = core.f3kdb.Deband(clip, sample_mode=2, dither_algo=3, output_depth=8)
  42. return clip
  43.  
  44. #We did run a third pass on some episodes where TFM missed some frames. This third pass can be eliminated by tweaking TFM parameters further. It can also be run before the second pass. This pass will selectively re-do some scenes using a different interlacing method and requires both the videos from the second pass and the original rips.
  45.  
  46. #Third Pass using 64 but StaxRip/Vapoursynth (select episodes, the following is an example for episode 27. Using the default parameters (the ones listed above), the full scene list can be found at: http://pastebin.com/W2bF4TXU )
  47. clip = core.lsmas.LWLibavSource(r"%source_file%")
  48.  
  49. core.max_cache_size = 27000
  50.  
  51. #core.avs.LoadPlugin(path=r'C:\ReMasteringATLA\plugins\TIVTC.dll')
  52. core.std.LoadPlugin (path=r'D:\caffe\Waifu2x-caffe.dll')
  53. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\flash3kyuu_deband.dll')
  54. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\TCanny.dll')
  55. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\KNLMeansCL.dll')
  56. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\libnnedi3.dll')
  57. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\TDeintMod.dll')
  58. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\scenechange.dll')
  59. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\temporalsoften.dll')
  60. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\libmvtools.dll')
  61. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\Retinex.dll')
  62. core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\libawarpsharp2.dll')
  63. #core.std.LoadPlugin (path=r'C:\ReMasteringATLA\plugins\fmtconv.dll')
  64. Vine = importlib.machinery.SourceFileLoader('Vine', r"C:\ReMasteringATLA\plugins\Vine.py").load_module()
  65. mvsfunc = importlib.machinery.SourceFileLoader('mvsfunc', r"C:\ReMasteringATLA\plugins\mvsfunc.py").load_module()
  66. havsfunc = importlib.machinery.SourceFileLoader('havsfunc', r"C:\ReMasteringATLA\plugins\havsfunc.py").load_module()
  67.  
  68. def p(x, y):
  69.     clip = core.lsmas.LWLibavSource(r"C:\Users\penkki\Desktop\ATLA\ATLA DVD RIP\B2\ep27.mkv")  ##edit this
  70.     clip = clip[x:y]
  71.     clip = havsfunc.QTGMC(clip, TFF = True, Preset="Very Slow", NoiseProcess=0)
  72.     clip = clip[::2]
  73.     clip = core.fmtc.bitdepth(clip,bits=32)
  74.     #clip = Vine.Dehalo(clip, radius=[4, 2], a=32, h=15, sharp=1.1, sigma=0.7, alpha=0.38, beta=32, cutoff=1, show=False) #B1D1 only, eps 1-4 only
  75.     #clip = havsfunc.DeHalo_alpha(clip, rx=1.5, ry=1.5, darkstr=0, brightstr=2.0, lowsens=50, highsens=50, ss=3.0) #eps 9-25 and 53 if not already dehaloed during TFM pass
  76.     clip = core.caffe.Waifu2x(clip, noise=1, scale=2, block_w=512, block_h=512, model=3, cudnn=True, processor=0, tta=False)
  77.     clip = core.fmtc.resample(clip, w=1440, h=1080, kernel = "spline36")
  78.     clip = core.fmtc.bitdepth(clip,bits=16)
  79.     clip = core.warp.AWarpSharp2(clip,thresh=128, blur=2, type=0, depth=16, chroma=0)
  80.     clip = core.f3kdb.Deband(clip, sample_mode=2, dither_algo=3, output_depth=8)
  81.     return clip
  82.  
  83. clip = clip[0:6123] + p(6124,6180) + clip[6181:] #edit the frame numbers to match up with scenes that need to be re-deinterlaced. This is quick and dirty but takes less time than restarting from scratch.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement