function step7slow(clip base, bool "preview", int "in", int "out", \ int "initspd", int "transpda", int "transpdb", int "slowspd", \ int "buffa", int "buffb", int "thresh", bool "debug") { prv = default(preview, false) dbg = default(debug, false) in = default(in, 0) out = default(out, 0) initspd = default(initspd, 1) transpda = default(transpda, 2) transpdb = default(transpdb, 3) slowspd = default(slowspd, 4) inc1 = round(default(buffa, 6)) inc2 = inc1+round(default(buffb, 6)) thresh = default(thresh, 0) clipa = changespeed(base, 0, in, initspd, thresh, prv, dbg) clipb = nofirst(changespeed(base, in, in+inc1, transpda, thresh, prv, dbg)) clipc = nofirst(changespeed(base, in+inc1, in+inc2, transpdb, thresh, prv, dbg)) clipd = nofirst(changespeed(base, in+inc2, out-inc2, slowspd, thresh, prv, dbg)) clipe = nofirst(changespeed(base, out-inc2, out-inc1, transpdb, thresh, prv, dbg)) clipf = nofirst(changespeed(base, out-inc1, out, transpda, thresh, prv, dbg)) clipg = nofirst(changespeed(base, out, 0, initspd, thresh, prv, dbg)) return clipa+clipb+clipc+clipd+clipe+clipf+clipg } function nofirst(clip base) { return trim(base, 1, 0) } function changespeed(clip base, int in, int out, int factor, int thresh, bool prv, bool debug) { in = in*factor out = out*factor frate = round(base.framerate) base = prv?Bob(base) : LeakKernelBob(base, 0, threshold=thresh) base = assumefps(base, frate) # compensate for bob doubling factoradj = factor/2.0 # speed label currently tied to previewing base = debug ? base.subtitle(string(factor)+"x SlowMo") : base backward_vec = prv?nop(): base.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1) forward_vec = prv?nop(): base.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1) cropped = prv?nop(): base.crop(4,4,-4,-4) backward_vec2 = prv?nop(): cropped.MVAnalyse(isb = true, truemotion=true, pel=2, idx=2) forward_vec2 = prv?nop(): cropped.MVAnalyse(isb = false, truemotion=true, pel=2, idx=2) newfps = round(frate*factoradj) base = prv? changefps(base, newfps) : MVFlowFps2(base, backward_vec,forward_vec,backward_vec2,forward_vec2,num=newfps,idx=1,idx2=2) base = assumefps(base, frate) base = trim(base, in, out) return base }