View Full Version : Stabilizes background jitter
real.finder
24th August 2016, 23:32
in old anime sources sometimes the jitter can be fixed nicely by Stab()
and sometimes Stab() make the non background things (like Characters) stable but leave the background with jitter
this not Stab() fault, it's source fault, there are CelStabilize() that made for this case but CelStabilize is unusable because CelBackground not fully developed (has a lot of Issues like very slow working and artifacts), so is there another solution?
Mug Funky
25th August 2016, 04:16
Depan could be set to only analyze the frame edge but stabilize the entire frame.
But depending on the film transfer that probably won't be enough - both major telecine methods (flying spot and single line ccd) can jitter over the frame height, making all global stabilization of little use.
real.finder
26th August 2016, 01:37
ok, I made this workaround function
function Stabilisemod(clip o, bool "padding", float "repthr")
{
padding = default (padding, true)
cell_s_repthr = default (repthr, 30)
bo = padding ? o.pointresize(width(o)+16,height(o)+16,-8,-8,width(o)+16.0001,height(o)+16.0001) : o.AddBorders(8, 8, 8, 8)
s=bo.Stabilise(bo.capabsolutemetric(15)).crop(8,8,-8,-8,align=true)
oas=Interleave(o,s)
ScriptClip(oas,"""
sc=last.cFrameDiff(prevf=true, chroma=false, denoise=true, nt=1)
sc > cell_s_repthr ? Interleave(o,o) : last
""", args="o, cell_s_repthr").Selectodd()
}
real.finder
26th August 2016, 08:04
it will not work after scenes changed or moving... I think it need auto trim base on scenes to make it work on group of frames instead of all frames (especially Previous frames) automatically (in 1 pass like AutoAdjust do)
real.finder
27th August 2016, 17:39
new workaround function, this time it use trims sections base on scenes changed
function Stabilisemod2_all(clip o, bool "padding", float "repthr", float "difthr")
{
difthr = default (difthr, 30)
global cell_s_padding = padding
global cell_s_repthr = repthr
global cell_s_difthr = difthr
ScriptClip(o, """
sc=last.cFrameDiff(prevf=false, chroma=false, denoise=true, nt=1)
sc < cell_s_difthr ? trim(0,current_frame-2) ++ trim(current_frame-1, FrameCount()-1).Stabilisemod(cell_s_padding, cell_s_repthr) : last
""")
}
function Stabilisemod2(clip o, bool "padding", float "repthr")
{
global c_min_scene_size = 5
global c_scene_num = 1
global c_scene_begin = 0
global c_scene_end = -1
global cell_s_padding = padding
global cell_s_repthr = repthr
ScriptClip(o, """
source=last
vectors = source.MSuper(pel=2, hpad=12, vpad=12, rfilter=2, isse=true).MAnalyse(isb=false, search=3, searchparam=3, isse=true, lambda=440, dct=4)
source.MSCDetection(vectors, thscd1=248, thscd2=50)
# detect new scene
global newscene = (current_frame < c_scene_end + c_min_scene_size) ? false \
: (AverageLuma>250)
# remember where scene started for subsequent filtering.
# this probably doesn't work well if not accesing the clip linearly.
c_scene_begin = newscene ? c_scene_end+1 : c_scene_begin
c_scene_end = newscene ? current_frame-1 : c_scene_end
global c_scene_num = (newscene && (current_frame > 0)) ? c_scene_num+1 : c_scene_num
c_scene_num > 1 ? source.trim(0,c_scene_begin-1) ++ source.trim(c_scene_begin,c_scene_end) ++ source.trim(c_scene_end+1,source.FrameCount()-1).Stabilisemod(cell_s_padding, cell_s_repthr) : source
""")
RequestLinear(8,10, 5, false, false)
}
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.