View Single Post
Old 27th July 2016, 18:06   #16  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Code:
import vapoursynth as vs
import mvmulti
import Vine
import Oyster
core = vs.get_core()

clp = core.lsmas.LWLibavSource("DJI Inspire Drone Video Long GOP Jerkiness .MOV")
clp = core.fmtc.bitdepth(clp,bits=32,fulls=False,fulld=True) #convert to floating point precision and full range
clp = core.std.ShufflePlanes(clp,0,vs.GRAY) #extract Y
clp = core.fmtc.resample(clp,1920,1080,kernel="cubic",a1=-1,a2=0) #scale to 2k
clp = core.fmtc.transfer(clp,"709","470bg",fulls=True,fulld=True) #brighten it up, dont want dark details all fucked up

pre = Vine.helpers.padding(clp,17,17,17,17) #pad, in spatial dimensions
pre = core.std.Reverse(pre)+pre+core.std.Reverse(pre) #pad, in temporal dimension
pre = core.knlm.KNLMeansCL(pre, 16, 8, 1, 6.4) #very large time radius NLMeans, motion flow and denoising 2 in 1, more of motion flow here
pre = core.std.Trim(pre,269,537) #remove padding in temporal dimension
pre = core.std.CropRel(pre,17,17,17,17) #remove padding in spatial dimensions

#"pre" looks super smooth in motion because of the motion flow alike NLMeans, and super washed out...

supv = core.mvsf.Super(pre) #blah 
supd = core.mvsf.Super(core.std.MakeDiff(clp,pre)) #blah
vec = mvmulti.Analyze(supv,tr=16,blksize=32,overlap=16,search=3,badrange=-24) #blah
vec = mvmulti.Recalculate(supv,vec,tr=16,blksize=16,overlap=8,search=3) #blah
vec = mvmulti.Recalculate(supv,vec,tr=16,blksize=8,overlap=4,search=3) #blah
vec = mvmulti.Recalculate(supv,vec,tr=16,blksize=4,overlap=2,search=3) #blah
dif = mvmulti.DegrainN(core.std.Expr(clp,"0.5"), supd, vec, tr=16,thsad=10000,thscd1=10000,thscd2=255) #stabilize the difference between clp and pre
clp = core.std.MergeDiff(pre,dif) #merge the difference back

#no more washed out now

supr = core.mvsf.Super(clp) #blah
bv = core.mvsf.Analyze(supv,delta=3,blksize=32,overlap=16,search=3,badrange=-24,isb=True) #delta=3 is good, delta=1,2 ain't effective enough
fv = core.mvsf.Analyze(supv,delta=3,blksize=32,overlap=16,search=3,badrange=-24,isb=False) #blah
blr = core.mvsf.FlowBlur(clp, supr, bv, fv, 100,thscd1=10000,thscd2=255) #do a full time motion blur here and make the fog look smoother than ever
blr = Oyster.helpers.thr_merge(blr,clp,thr=8/256,elast=2/256) #don't want motion blur on the entire frame
                                                              #only want that on the fog, and fog is kind of the delicate and flat feature here
                                                              #this filters out motion blur on strong and significant features like the auto and moutains
clp = Vine.helpers.cutoff(blr,clp,8) #this filters out motion blur on high frequency features

clp = core.grain.Add(clp, 2) #some extra grain here to make it look less... whatever
clp = core.fmtc.transfer(clp,"470bg","709",fulls=True,fulld=True) #reverse the brightening

clp.set_output()

Last edited by feisty2; 27th July 2016 at 18:12.
feisty2 is offline   Reply With Quote