I attached the full porting to VapourSynth of FRED film restore
I included the call to DepanEstimate and DepanStabilise
I added also the script for the function UnsharpMask (unsharpmask.py) -> It is safe to add it in Hybrid
This script should be copied in ".\Hybrid\64bit\vsscripts"
It is quite annoying the fact that Vapoursynth display the message:
Avisynth Compat: requested frame ... not prefetched, using slow method
I think that the addins ColorYUV2.dll and AutoLevels_x64.dll could be added to the whitelist in avisynth_compat.cpp
Dan
@Selur: I think that script FRED_Restoring_Blending_Cleaning.vpy with the necessary changes to include only the FRED restoring part could be added in ".\Hybrid\64bit\vsscripts"
Quote:@Selur: I think that script FRED_Restoring_Blending_Cleaning.vpy with the necessary changes to include only the FRED restoring part could be added in ".\Hybrid\64bit\vsscripts"
The whole FRED part should be put in a function, with proper parameters and documentation.
Also, not adding a script that requires Avisynths dlls (here: ColorYUV2 and AutoLevels) Hybrids Vapoursynth scripts.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page. Offline between (including) 29th of June and 5th of July => RochHarz Festival
I’ve just completed a new test today, trying to faithfully reproduce Fred’s 2017 script — the one he described in detail on Doom9 but never published fully.
I used the same filter chain as he mentioned:
RemoveDirtSMC()
GamMac()
DePanStabilize()
Several passes of Tweak() (with starthue and endhue) to isolate specific color bands
McDegrainSharp()
And his sharpening technique: UnsharpMask, blur, UnsharpMask again, then Sharpen()
The goal was to stay as close as possible to Fred's 2017 workflow.
Let me know what you think of the results — I’ll be happy to refine it further based on your suggestions.
@djilayeden: you should add 'code'-tags around your script.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page. Offline between (including) 29th of June and 5th of July => RochHarz Festival
Here's a Vapoursynth port or RemoveDirtSMC, but normal RemoveDirtMC seems superior.
The S seems to stand for 'simple'.
def RemoveTempGrain(clip: vs.VideoNode, mode: int=17) -> vs.VideoNode:
if hasattr(core, 'zsmooth'):
rg = core.zsmooth.RemoveGrain(clip, mode=mode)
else:
rg = core.rgvs.RemoveGrain(clip, mode=mode)
return TemporalRepair(rg, clip)
def RemoveDirtS(clip: vs.VideoNode, limit: int= 6, grey: bool=False) -> vs.VideoNode:
clensed = core.rgvs.Clense(clip)
if hasattr(core, 'zsmooth'):
alt = core.zsmooth.RemoveGrain(clip, mode=10)
else:
alt = core.rgvs.RemoveGrain(clip, mode=10)
return core.removedirt.RestoreMotionBlocks(clensed, clip, alternative=alt, pthreshold=4, cthreshold=6, gmthreshold=40, dist=1, dmode=2, debug=False, noise=limit, noisy=16, grey=False)
def RemoveDirtSMC(clip: vs.VideoNode, limit: int=6, repmode: int=16, remgrainmode: int=17, block_size: int=8, block_over: int=4, gpu: bool=False) -> vs.VideoNode:
if gpu:
import ChangeFPS
block_over = 0 if block_over == 0 else 1 if block_over == 2 else 2 if block_over == 4 else 3
Super = core.svp1.Super(clip, "{gpu:1,pel:4}")
bvec = core.svp1.Analyse(Super['clip'], Super['data'], clip, "{ gpu:1, block:{w:"+str(block_size)+", h:"+str(block_size)+",overlap:"+str(block_over)+"} }")
fvec = core.svp1.Analyse(Super['clip'], Super['data'], clip, "{ gpu:1, block:{w:"+str(block_size)+", h:"+str(block_size)+",overlap:"+str(block_over)+",special:{delta: 1}} }")
backw = core.svp2.SmoothFps(clip,Super['clip'], Super['data'],bvec['clip'],bvec['data'],"{}") # here the frame rate is doubled
forw = core.svp2.SmoothFps(clip,Super['clip'], Super['data'],fvec['clip'],fvec['data'],"{}") # here the frame rate is doubled
# since backw and forw now have twice the frame count I drop half the frames
backw = ChangeFPS.ChangeFPS(backw,clip.fps_num,clip.fps_den)
forw = ChangeFPS.ChangeFPS(forw,clip.fps_num,clip.fps_den)
else:
#block size of MAnalyze, blksize 8 is much better for 720x576 noisy source than blksize=16
#block overlapping of MAnalyze 0! 2 or 4 is not good for my noisy b&w 8mm film source
i = core.mv.Super(clip, pel=2, sharp=2) # avs: i=MSuper(clip,pel=2, isse=false)
bvec = core.mv.Analyse(super=i,isb=True, blksize=block_size,overlap=block_over, delta=1, truemotion=True, chroma=True)
fvec = core.mv.Analyse(super=i,isb=False, blksize=block_size,overlap=block_over, delta=1, truemotion=True, chroma=True)
backw = core.mv.Flow(clip=clip,super=i,vectors=[bvec])
forw = core.mv.Flow(clip=clip,super=i,vectors=[fvec])
clip = core.std.Interleave([backw, clip, forw])
clip = RemoveDirtS(clip, limit)
if hasattr(core, 'zsmooth'):
clip = core.zsmooth.RemoveGrain(clip, mode=10)
else:
clip = core.rgvs.RemoveGrain(clip, mode=10)
clip = core.std.SelectEvery(clip, 3, 1)
return clip
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page. Offline between (including) 29th of June and 5th of July => RochHarz Festival
Quote:@Selur: I think that script FRED_Restoring_Blending_Cleaning.vpy with the necessary changes to include only the FRED restoring part could be added in ".\Hybrid\64bit\vsscripts"
The whole FRED part should be put in a function, with proper parameters and documentation.
Also, not adding a script that requires Avisynths dlls (here: ColorYUV2 and AutoLevels) Hybrids Vapoursynth scripts.
Cu Selur
Unfortunately I was unable to find any Vapoursynth substitute for ColorYUV and AutoLevels do you have any idea if they are available ?
Afaik. they do not exist.
They are listed them in my 'Things missing in Vapoursynth'-thread over in Doom9s forum.
Since these are missing for years, my hope to get a proper port for these is slim.
For ColorYUV, the old Vapoursynth doc stated that one should 'Do the adjustment yourself' with 'std.Lut/std.Expr'.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page. Offline between (including) 29th of June and 5th of July => RochHarz Festival