Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
8th June 2009, 23:33 | #1 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Attempt to stabilize fluctuation(flickering?) in old anime
This question arose occasionally here and I didn't really see any proper solution to it. Stabilizing filters like depan or mvdepan was not enough, in which the inner part of the frame still fluctuate like crazy on playback. Here's my attempt to clean it up
Code:
LRemoveDust(2,10) #stabilize inner frame fluctuation stab() #global stablize fastdegrain() #reduce flickering along lines I've uploaded 2 samples to test with, the first one is a stilled scene, where and script works well, and the second sample is the one I have problem with panning. Is there any way to modify LRemoveDust to the leave panning areas along? UPDATE: Link to updated script Last edited by lansing; 12th April 2012 at 16:25. Reason: updated link |
9th June 2009, 02:41 | #2 | Link |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
Something I liked to do with old anime was stab with a high dy/xmax + msmooth for "edge noise" or ringing + (for hard cases) temporaldegrain with a fft3d prefiltered clip + dithering (overkill, maybe, but for crappy sources.....)
For line flickering, by LaTo : Code:
strength = 3 mt_merge(last,last.MVDegrainMulti(last.FFT3Dgpu(sigma=strength*2,plane=4,bw=32,bh=32,ow=8,oh=8,bt=3).MVanalyseMulti(refframes=strength,blksize=16,overlap=4,idx=1),refframes=strength,thSAD=strength*200,idx=1),last.mt_edge("min/max").removegrain(19),U=3,V=3)
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
9th June 2009, 04:46 | #3 | Link | |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
Quote:
Code:
stab(1,10,10) temporaldegrain(gpu=true) ################################ strength = 3 mt_merge(last, \ last.MVDegrainMulti(last.FFT3Dgpu(sigma=strength*2,plane=4,bw=32,bh=32,ow=8,oh=8,bt=3).MVanalyseMulti(refframes=strength,blksize=16,overlap=4,idx=1),refframes=strength,thSAD=strength*200,idx=1), \ last.mt_edge("min/max").removegrain(19), \ U=3,V=3) ################################# #some cropping and resizing |
|
9th June 2009, 05:16 | #4 | Link |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
a user-defined prefiltered clip for temporaldegrain will help avoiding too agressive denoising. I personally like tweaking sigmas with fft3dfilter.
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
9th June 2009, 11:46 | #6 | Link |
Registered User
Join Date: Jul 2007
Posts: 137
|
After using stab() on sample1 it looks like the frames are stretching and squishing vertically. And in some frames only parts of the frame appear to stretch from one frame to the next. That might be why stab() can't really stabilize the picture. I tried using zoom estimation to compensate for this but no luck.
I wonder if an incorrect deinterlace or IVTC could be at fault here? Like somehow the wrong fields in different parts of the frame were weaved. Last edited by onesloth; 9th June 2009 at 14:45. |
9th June 2009, 13:03 | #7 | Link | |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
Quote:
Code:
a=td b=a.deflicker mt_lutxy(a,b,string(mt_polish("y>235 ? .5*y + .5*x : y")),chroma="copy second") Other options are out there... one being ajusting the strength of the deflickering script.
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
|
9th June 2009, 22:08 | #8 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
@onesloth
Yes, stab() or any other stabilizing filter alone will not work on this, nor does any temporal smoother. And I think this flickering problem doesn't have anything to do with IVTC, since most old anime in the 90s were like that. @toof I change the strength to 1 in that deflickering script, and it works fine in all three samples now, yay. One minor problem is the small flickering on the top and bottom of the frame sometime, but I can live with that. I'll put the script here just for future references: Code:
stab(1,10,10) temporaldegrain(gpu=true) ######################################################## strength = 1 mt_merge(last, \ last.MVDegrainMulti(last.FFT3Dgpu(sigma=strength*2,plane=4,bw=32,bh=32,ow=8,oh=8,bt=3).MVanalyseMulti(refframes=strength,blksize=16,overlap=4,idx=1),refframes=strength,thSAD=strength*200,idx=1), \ last.mt_edge("min/max").removegrain(19), \ U=3,V=3) ######################################################### #some cropping and resizing |
12th April 2012, 16:20 | #10 | Link |
Registered User
Join Date: Sep 2006
Posts: 1,657
|
to dig this thread back up, as I learn more about how the mt_merge and mt_edge work, i can concluded, in my many tests the last two days, the key of the whole thing is the sigma value of the fft3dgpu/fft3dfilter, setting it to 4 or 5 will basically get the job done. And the temporaldegrain script is not necessary. So the updated script will be:
Code:
o=AVISource("D:\video samples\sample1.avi").stab() #global stabilize the video ############################### _fft = 5 _thSAD = 100 _bs = 16 _ov = 4 FFT3Dgpu(o,sigma=_fft) super = last.MSuper() b3v = MAnalyse(super, isb=true, delta=3, blksize=_bs, overlap=_ov) b2v = MAnalyse(super, isb=true, delta=2, blksize=_bs, overlap=_ov) b1v = MAnalyse(super, isb=true, delta=1, blksize=_bs, overlap=_ov) f1v = MAnalyse(super, delta=1, blksize=_bs, overlap=_ov) f2v = MAnalyse(super, delta=2, blksize=_bs, overlap=_ov) f3v = MAnalyse(super, delta=3, blksize=_bs, overlap=_ov) process = MDeGrain1(super, b1v, f1v, thSAD=_thSAD) #process = MDeGrain2(osuper, b1v, f1v, b2v, f2v, thSAD=_thSAD) #process = MDeGrain3(super, b1v, f1v, b2v, f2v, b3v, f3v, thSAD=_thSAD) mt_merge(o, process, o.mt_edge("min/max").RemoveGrain(19), U=3, V=3) ############################### #some cropping and resizing The detail processes of script are, first global stabilize the video clip1; then create clip2 of dead calm pixels using fft3dgpu+mdegrain (fft3dgpu alone could be enough, but in my sample1, the lines are still not calm enough yet); and then create an edge mask of clip1; and finally merge only the edge of clip1 with the dead calm edge(lines) of clip2. The Removegrain(19) after mt_edge was there to remove any dirt in the mask that were mistaken as edge. note: Msuper only seems to work with "last", I got error "Mdegrain1: wrong source size" if I wrote like this: "prefilter.MSuper()". ________________________________________________ Here are the other alternatives I've tried but didn't satisfy my taste: Code:
QTGMC(Preset="Slower", InputType=1, TR2=3) Code:
o=AVISource("D:\video samples\sample3.avi").stab() tblur = o.TemporalCleaner (ythresh=25, cthresh=10).fft3dgpu(sigma=3) mt_merge(o, tblur, o.mt_edge("min/max").removegrain(19), U=3,V=3) ythresh above 30 will causes ghosting, fft3dgpu was throw in to smooth out jaggy lines that may be introduced by temporalcleaner. This one also eliminate the line flickers, but it manipulated the image too much for my taste, such as lines started to thin out in motion scene. Last edited by lansing; 12th April 2012 at 19:24. Reason: typo |
Tags |
anime, flicker, stabilize |
Thread Tools | Search this Thread |
Display Modes | |
|
|