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 |
|
16th January 2008, 13:43 | #1 | Link |
Registered User
Join Date: Jan 2008
Posts: 3
|
exist any filter specially done for (deinterlace) flicker
after deinterlace (even with mv/mcbob) some parts are flickering.
when small (mostly horizontal shape) areas appears in clip, the flickering is much visible. these areas (after deinterlace) needs some deflicker. look at http://www.pate15.de/entrelacement/entrelacement_7.htm http://www.pate15.de/entrelacement/p...m-mvbobmod.avi |
19th January 2008, 05:36 | #2 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
maybe try Repair, in Kassandro's removegrain package.
that might calm down the bobby bits. i'd love to see a perfect bob, but it's one of those intractable "holy grail" problems - pulling detail out that simply isn't there, and doing it in a way that a human wont notice (computers as yet can't "watch" video in the same way we do, and most of the problems we have processing video stem from this fact).
__________________
sucking the life out of your videos since 2004 |
19th January 2008, 08:12 | #3 | Link |
Registered User
Join Date: Feb 2007
Posts: 25
|
I find Yadifmod: Perfect!!
I use this script: interpe = clip.separatefields().selecteven().nnedi(field=1,dh=true) interpo = clip.separatefields().selectodd()turn180().nnedi(field=1,dh=true).turn180() interp = interleave(interpe,interpo) yadifmod(clip,mode=1,edeint=interp) Perfect! (I had to deinterlace real interlaced clip) |
16th May 2008, 02:08 | #4 | Link | |
Registered User
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
|
Quote:
__________________
Nostalgia's not what it used to be |
|
16th May 2008, 04:22 | #5 | Link |
Registered User
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
|
Here’s an example of the type of deinterlace situation I’m grappling with – resolving striped patterns with minimal shimmering.
DV Source (50i, 16.9 anamorphic) http://rapidshare.com/files/11522330...rphic.avi.html Deinterlaced 50p outputs: (Decoder: Cedocida YV12, MPEG2 interlaced. Encoder: FFDShow HuffYuv-YV12) yadifmod(order=0, mode=1, edeint=nnedi(field=-2)) http://rapidshare.com/files/11522397...-YV12.avi.html interpe = separatefields().selecteven().nnedi(field=1, dh=true) interpo = separatefields().selectodd().turn180().nnedi(field=1, dh=true).turn180() interp = interleave(interpe,interpo) yadifmod(order=0,mode=1,edeint=interp) http://rapidshare.com/files/11522448...-YV12.avi.html MCBob 0.3u http://rapidshare.com/files/11522499...-YV12.avi.html Actually, yadifmod-NNEDI does a pretty decent job, but rotating the odd (top) fields before NNEDI, if anything, generates more misalignment and flicker/shimmering. Any suggestions for improvement?
__________________
Nostalgia's not what it used to be |
16th May 2008, 10:51 | #7 | Link |
Registered User
Join Date: Dec 2002
Location: UK
Posts: 1,673
|
The first thing to say is that, in interlaced video, there is complete confusion between high vertical spatial frequencies (fine detail) and vertical motion of approx 1 video line per field. The two cannot be resolved, theoretically. Even if you watch such footage on an interlaced CRT, what you see can sometimes look a little strange.
What to do? Well, this probably won't help, but IMO when there are problems like this, then the best visual result is a dumb bob to 50fps, and correct playback of that 50fps result. The eye does a much better job of selectively averaging the two fields than any of these tools, at the expensive of perceived vertical resolution of course. Try it (if your 50fps playback works well on your system) - you might be surprised how good it can look. Alternatively, for a similar perceived effect but written into the video itself, you can add an aggressive temporal soften. the problem is this will mess up other parts of the image. If you could do this selectively to the problem areas, it would be a great solution. Look at the strips after a simple bob(0.0,1.0).temporalsoften(1,255,255,mode=2) - I'm guessing that's what you want to happen? Shame about the other parts of the frame! If you only want 25fps, then a dumb approach won't give bobbing, but aliasing. You could try blending to 25fps, if that's what you want. None of these suggestions give you anything as sharp as what you've tried, but they dramatically reduce the artefacts. FWIW I'm using mcbob 0.3c, and it make a real mess of those stripes! Cheers, David. Last edited by 2Bdecided; 16th May 2008 at 11:00. |
16th May 2008, 17:08 | #8 | Link |
Registered User
Join Date: Jan 2007
Posts: 6
|
Having similar prolems with some of my videos so I just tried combining the suggestions from 2Bdecided's post; dumb bob to 50fps, removing the vertical motion, and correct playback of that 50fps result (by reinterlacing and then deinterlacing the result with yadifmod or mcbob). Vertical resolution appears to be preserved, the majority of artifacts are removed and the use of mcbob may be acceptable. A long temporal filter is required to minimise the residual flicker.
#Resize to 1:1 aspect ratio Spline36Resize(1024,height) # Dumb bob then motion stabilise bob(0.0, 1.0) i=last mdata = DePanEstimate(i) DePanStabilize(i, data=mdata) #Reinterlace AssumeFrameBased().SeparateFields().SelectEvery(4,0,3).assumefieldbased().weave() #Deinterlace yadifmod(order=0, mode=1, edeint=nnedi(field=-2)) #Long temporal fileter to minimise residual flicker Scripted_MVDegrain5Filter() |
16th May 2008, 23:21 | #9 | Link | |
Registered User
Join Date: Apr 2008
Posts: 1,181
|
Quote:
|
|
16th May 2008, 18:37 | #10 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Yay, the old prob of not knowing what's in those missing lines ... we've been there before, haven't we?
EDI interpolators too are struggling (and failing) often times with those high-contrast patterns. And when you start right out with EDI interpolation, then you can throw MVStuff at it afterwards as much as you like ... it will mostly just follow & compensate the flicker, and there your effort goes down the drain. Unless the effort is big enough to blurrr the crap out of it and to hammer everything flaaat ... @ WorBry: What're your expectations? Perhaps like so ?
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
16th May 2008, 21:53 | #11 | Link |
Registered User
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
|
My expectations? Well I wasnt expecting miracles, bearing in mind also the limitations of line resolution coming from a consumer-level SD DV camcorder, in this case a Panasonic NV-GS400, which is about as good as it gets for interlaced DV. Granted the clip was shot under artificial light so there's some discrimination of noise and detail to deal with there also.
So my best hope was to reduce the shimmering to a level that is not so visually distracting with as little loss of definition as possible...pretty much along the lines of what your TGB treatment achieves. I was thinking that Vinverse or one of the SangNom anti-aliasing routines (e.g. SAA) might help but wasnt sure how to apply these in this context.....on the fields, before or after NNEDI interp? Sooooo...are you going to reveal how the TGB trick is done or do I first need to join the Magic Circle and make a solemn oath?
__________________
Nostalgia's not what it used to be Last edited by WorBry; 16th May 2008 at 22:11. |
16th May 2008, 22:31 | #12 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Well, joining the Magic Circle surely is an option. Waiting for me making a clean script is anther one (you won't believe how knotty and non-understandable my scripts can get after an hour of toying around!). Though I can't foresee if it'll work correctly under all possible circumstances; most probably it won't. Whatever approach one takes, there will always be compromises to be made at some point.
Thing is, you can't really fight this flickering with spatial filters, Vinverse, AntiAliasing & Co. are out of the game. Using temporal filtering works wonders in static areas, and catastrophic in motion areas. Keeping both apart is difficult when not using motion compensation. And with motion compensation - as already said - the flicker tends to get "motion" compensated too, so that the temporal sword loses its sharpness. It's like Mug Funky concluded in post#2, a machine doesn't see the real problem. It tends to choose the "closest" solution, where man's brain wishes to have the solution that's only after the third corner, or even farther. Or: to find a solution that satisfies a neural network (->brain), you need a neural network to find that solution. Simple pixel compairing mechanics will always fall short, sooner or later. It's the *interpretation* of the actual content that is needed, and that is beyond cheap scripting ...
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
16th May 2008, 23:38 | #13 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
When resizing only horizontally and NOT vertically, then it's safe, yes.
The script I had used, cleaned up, a bit generalized & put into a function for convenience: Edit 2008-05-20 : corrected gaussian weightings ! Edit 2008-05-23 : new version - improved speed and results Edit 2008-05-24 : new version - more parameters allow more speedy processing Edit 2008-05-27 : fixed bugs for "tr0=1" and "tr2=3" Code:
# needed: MVTools, RemoveGrain/Repair, MaskTools v2, NNEDI, plus EEDI2 & Yadif for the fast modes function TempGaussMC_alpha3(clip clp, int "tr0", int "tr1", int "tr2", float "sharpness", bool "rep0", bool "rep1", int "border", int "blocksize", int "overlap", string "EdiMode", int "draft") { tr0 = default( tr0, 2 ) # temporal radius for temporal Gauss before motion compensation (1 or 2) tr1 = default( tr1, 2 ) # temporal radius for temporal Gauss with motion compensation (1 or 2) tr2 = default( tr2, 1 ) # temporal radius for final MVDegrain (1, 2 or 3) rep0 = default( rep0, true ) # repair temporalsoften-defects for searchclip rep1 = default( rep1, true ) # repair MVDegrain-defects for output border = default( border, 1 ) # 1 = padd borders internally to catch "half scanlines" at top + bottom (broadcast material) bs = default( blocksize,8) # Blocksize for motion search ovlp = default( overlap,bs/2) # Overlap size for ME blocks sharpness = default( sharpness, 0.25+(tr1+tr2)/8.) # "inloop" sharpening to counteract softening, 0.0 to 1.0, or more if you like EdiMode = default( EdiMode, "NNEDI") # interpolator to use: "NNEDI", "EEDI2" or "Yadif" draft = default( draft, 0 ) # '1' outputs a quick draft, and '2' is even more draft'ier :p trmax = (tr1 > tr2) ? tr1 : tr2 nullclip = blankclip(clp,width=16,height=16) clp = (border==0) ? clp \ : clp.pointresize(clp.width(),clp.height()+8, 0,-4,-0,clp.height()+8.001 ) edi = (EdiMode=="NNEDI") ? clp.nnedi(field=-2) \ : (EdiMode=="EEDI2") ? clp.SeparateFields().EEDI2(field=-2, maxd=8) \ : clp.Yadif(mode=1) dbob = clp.bob() t1 = dbob.temporalsoften(1,255,255,32,2) t2 = dbob.temporalsoften(2,255,255,32,2) t = (tr0==0) ? dbob \ : (tr0==1) ? t1.merge(dbob,0.25) \ : t1.merge(t2,0.357).merge(dbob,0.125) tD = mt_makediff(dbob,t,U=3,V=3) tD1 = tD.mt_inpand(mode="vertical",U=3,V=3).mt_deflate(U=3,V=3) .mt_expand(U=3,V=3) tD2 = tD.mt_expand(mode="vertical",U=3,V=3).mt_inflate(U=3,V=3) .mt_inpand(U=3,V=3) tDD = tD.mt_lutxy(tD1,"x 129 < x y 128 < 128 y ? ?",U=3,V=3).mt_lutxy(tD2,"x 127 > x y 128 > 128 y ? ?",U=3,V=3) t2 = (rep0==true) ? t.mt_adddiff(tDD,U=3,V=3) \ : t searchclip = t2.removegrain(11).removegrain(11) searchclip = (rep0==true) ? searchclip \ : searchclip.mt_lutxy(edi,"x 2 + y < x 2 + x 2 - y > x 2 - y ? ?",U=3,V=3) #bs = 16 #ovlp = 4 tm = false pel = 2 shrp = 2 bvec3 = (trmax>=3) ? searchclip.MVAnalyse(isb=true, delta=3,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=6) : nullclip bvec2 = (trmax>=2) ? searchclip.MVAnalyse(isb=true, delta=2,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=6) : nullclip bvec1 = searchclip.MVAnalyse(isb=true, delta=1,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=6) fvec1 = searchclip.MVAnalyse(isb=false,delta=1,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=6) fvec2 = (trmax>=2) ? searchclip.MVAnalyse(isb=false,delta=2,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=6) : nullclip fvec3 = (trmax>=3) ? searchclip.MVAnalyse(isb=false,delta=3,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=6) : nullclip mvdg1 = edi.MVDegrain1(bvec1,fvec1, thSAD=800,idx=7) mvdg2 = (tr1>1) ? edi.MVDegrain1( bvec2,fvec2,thSAD=800,idx=7) : nullclip stage1 = (tr1==0) ? edi \ : (tr1==1) ? mvdg1.merge(edi,0.25) \ : mvdg1.merge(mvdg2,0.2).merge(edi,0.0625) stage1a = stage1.mt_lutxy(stage1.removegrain(11),"x x y - "+string(sharpness)+" * +",U=3,V=3) stage1b = (sharpness==0.0) ? stage1 : stage1a.repair(stage1a.repair(edi,12),1) stage2 = (tr2==0) ? stage1b \ : (tr2==1) ? stage1b.MVDegrain1(bvec1,fvec1, thSAD=400,idx=8) \ : (tr2==2) ? stage1b.MVDegrain2(bvec1,fvec1,bvec2,fvec2, thSAD=400,idx=8) \ : stage1b.MVDegrain3(bvec1,fvec1,bvec2,fvec2,bvec3,fvec3,thSAD=400,idx=8) tD_2 = mt_makediff(dbob,stage2,U=3,V=3) tD1_2 = tD_2.mt_inpand(mode="vertical",U=3,V=3).mt_deflate(U=3,V=3) .mt_expand(U=3,V=3) tD2_2 = tD_2.mt_expand(mode="vertical",U=3,V=3).mt_inflate(U=3,V=3) .mt_inpand(U=3,V=3) tDD_2 = tD_2.mt_lutxy(tD1_2,"x 129 < x y 128 < 128 y ? ?",U=3,V=3).mt_lutxy(tD2_2,"x 127 > x y 128 > 128 y ? ?",U=3,V=3) stage3 = (draft==2) ? t .subtitle("Draft 2") \ : (draft==1) ? t2 .subtitle("Draft 1") \ : (rep1==true) ? stage2.mt_adddiff(tDD_2,U=3,V=3) \ : stage2 (border==0) ? stage3 \ : stage3.crop(0,4,-0,-4) return( last ) }
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) Last edited by Didée; 27th May 2008 at 12:08. |
17th May 2008, 01:25 | #14 | Link |
Registered User
Join Date: Jan 2004
Location: Here, there and everywhere
Posts: 1,197
|
Wow, thats quite amazing...."slow as a migrating glacier" (to quote Leak ) of course, but very impressive and true-to-life (i.e. non-video-looking). Even my wife (our resident subjective video critic) will notice the difference...she's the one with a penchant for dressing the kids in striped tee-shirts.
So there's life in the 'old bob' yet ! Does a pretty good denoising job in the process also. Thanks alot.
__________________
Nostalgia's not what it used to be Last edited by WorBry; 17th May 2008 at 01:39. |
17th May 2008, 01:40 | #15 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
You're welcome. A little more "speed" (*cough*) is possible by using lower temporal radii. Sure this will also reduce the flicker reduction a bit, you've to try & see. With tr0=2 / tr1=1 / tr2=2 it's still quite stable, and you'll probably save a few hours on a complete project.
And a *denoiser* is all that this script is, indeed. A denoiser that also "denoises" bob flickering.
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
17th May 2008, 10:51 | #16 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,654
|
@roozhou:
your scirpt is somehow weird: 1) resize the video to 16x9 and bob the video 2) stabilize motion 3) re-interlace it 4) bob-deinterlace it this is a very lossy process since 1) already avoids temporal and spatial data being catched. it is better to use this kind of script: Code:
# Dumb bob then motion stabilise yadifmod(order=0, mode=1, edeint=nnedi(field=-2)) i=last mdata = DePanEstimate(i, pixaspect=1.454) DePanStabilize(i, data=mdata, pixaspect=1.454) #Long temporal fileter to minimise residual flicker Scripted_MVDegrain5Filter()
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
17th May 2008, 14:47 | #19 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Exactly. The result could look similar to this:
Edit 2008-05-20 : corrected vectors for distances 4 & 5 ... Code:
function Scripted_MVDegrain5(clip clp, bool "truemotion", int "pel", int "blksize", int "overlap", int "sharp", int "thSAD", int "idx") { tm = default( truemotion, true ) pel = default( pel, 2 ) bs = default( blksize, 8 ) ovlp = default( overlap, 0 ) shrp = default( sharp, 1 ) thSAD = default( thSAD, 400 ) idx = default( idx, 11 ) bvec5 = clp.MVAnalyse(isb=true, delta=5,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) bvec4 = clp.MVAnalyse(isb=true, delta=4,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) bvec3 = clp.MVAnalyse(isb=true, delta=3,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) bvec2 = clp.MVAnalyse(isb=true, delta=2,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) bvec1 = clp.MVAnalyse(isb=true, delta=1,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) fvec1 = clp.MVAnalyse(isb=false,delta=1,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) fvec2 = clp.MVAnalyse(isb=false,delta=2,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) fvec3 = clp.MVAnalyse(isb=false,delta=3,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) fvec4 = clp.MVAnalyse(isb=false,delta=4,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) fvec5 = clp.MVAnalyse(isb=false,delta=5,truemotion=tm,pel=pel,sharp=shrp,blksize=bs,overlap=ovlp,idx=idx) mvdg3 = clp.MVDegrain3(bvec1,fvec1,bvec2,fvec2,bvec3,fvec3,thSAD=thSAD,idx=idx) mvdg5 = mvdg3.MVDegrain2(bvec4,fvec4,bvec5,fvec5,thSAD=thSAD,idx=idx) \ .Merge(mvdg3, 0.436) # correct weightings (hopefully) return( mvdg5 ) }
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) Last edited by Didée; 20th May 2008 at 16:01. |
17th May 2008, 18:06 | #20 | Link |
Registered User
Join Date: Jan 2007
Posts: 6
|
Scharfis_brain,
For this example “smart“ deinterlacers are unable to handle the vertical motion between fields without producing artefacts. Mcbob in this case fails spectacularly with patches of double frequency strips appearing. These artefacts are not being filtered with MVtools, either they have a high contrast and thus a high SAD or the block based MVtools is following the artefacts and reinforcing them. Didee described this beautifully in post #9 above. Just using a dumb bob and then temporal filtering to reduce the flicker losses the advantages of “smart“ deinterlacers such EDI interpolation and increased vertical resolution on static areas. Hence this experiment with global motion-compensate before using a smart deinterlacer. The global estimation to follow the content and not the flicker. A dumb bob followed by re-interlacing should be lossless if there is no movement and if there is movement then the vertical low-passed filtered dumb bob output is exactly what we need to avoid aliasing. A common problem with content from hand held video camera content. I see it with my own footage and it is compounded by sharpening halos on horizontal edges. I now remove these halos on each field before smart deinterlacing and will try adding global motion compensation as well. |
Tags |
deinterlace, flickering |
Thread Tools | Search this Thread |
Display Modes | |
|
|