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. |
24th November 2016, 18:30 | #1 | Link |
Registered User
Join Date: Apr 2015
Posts: 10
|
Moving rainbows in anime title
A little derainbowing help, please?
Normally I use DFMDerainbow, and that works well for me, and occasionally I pull out Bifrost2 if I really need to. But I'm working on a title with a LOT of chain-link fences in it, and in a lot of scenes there's scrolling along the fences: DFMDerainbow and Bifrost are useless in non-static scenes like that. I've tried experimenting with every other derainbowing filter I've been able to get my hands on: Chubbyrain2, ASTDR, SmartSSIQ, none of which touch these rainbows. Can anyone provide a bit of advice, please? Sample video clip: https://drive.google.com/open?id=0Bz...jZQbG45bnpIRmc |
28th November 2016, 15:31 | #3 | Link |
Registered User
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
|
Tracking issues? Color issues? Looks like analog to DV to me, not a good choice if you expect to do lossless repair work. In any event, I gave it a try based on other posts with similar glitches and moire patterns. Probably a dozen ways to do it, none perfect.
CamcorderColorDenoise (aka "CCD") also helped a little. The original sample is telecined (3:2 pulldown) -- and has twittery borders and dot crawl. You can use SmoothUV() instead of BiFrost(), same result. You need a cleaner capture setup, not DV or composite. I used this (slow as hell): Code:
LoadVirtualDubPlugin("path\to\VirtualDub\plugins\ccd.vdf", "ccd",0) #<- adjust path statement for your setup ConverttoYUY2(interlaced=true) Crop(0,2,0,0).AddBorders(0,2,0,0) TFM(pp=0).TDecimate() ConvertToYV12(interlaced=false) QTGMC(InputType=2,preset="faster",border=true) MergeChroma(MCTemporalDenoise(settings="very high")) BiFrost() ReplaceFramesMC2(49,4) ReplaceFramesMC2(114,1) ConvertToRGB32(interlaced=false) Crop(10,0,-6,-2).AddBorders(8,0,8,2) ccd(40,1) ConvertToYV12(interlaced=false) Other ideas? Last edited by LemMotlow; 28th November 2016 at 15:54. |
29th November 2016, 22:00 | #5 | Link |
Registered User
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
|
Yes, it is. It's the way it runs MCTemporalDenoise (aka MCTD). I've used it this way many times, but the big secret if you don't have a mega-PC is to run the script in two steps. First step is running everything up to and including QTGMC, save that as a lossless intermediate, then open it again with a second script that has MCTD and the remaining lines.
|
30th November 2016, 00:28 | #6 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Very nasty pattern looking at U,V channels. It looks tough to fix properly without causing too much damage or blurring the chroma too much. Maybe some method of using Y to guide the U,V fix ?
If they are mostly static background with some panning, you can use motion tracking / stabilization / clean plates to "fix" it . Avisynth can be used for some of it, such as part of the clean plate generation (e.g. median or merge on some of the stabilized sequence). Since it is a "static BG" , you can actually replace everything, even the dark smudge that occurs briefly on the lower border . You can expand and fill in the frame edges and pillarbox (edge fill) if you wanted to. Or you can choose to fix only some problems. Or you can merge the fixed U,V back with the original Y if you wanted to retain the original Y noise pattern minus the rainbows (maybe not on stuff like this, but for things like original film grain). It takes some manual work and needs to be done per scene - it takes a few minutes per scene if they are this simple (or can be much longer depending on complexity), and can be done with fairly common tools like Adobe AE. Let me know if you want more info. https://www.mediafire.com/?xicfn3e0ddetb2a |
30th November 2016, 02:02 | #7 | Link |
Registered User
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
|
I get the general idea, and would appreciate seeing a link to further material since I have AE installed but never used it for the procedure mentioned. OTH, I have a feeling the entire video has similar rainbow and other problems, the submitted problem sample is only a small piece of the pie. I wonder, too, if snarfies or other readers have AE.
|
30th November 2016, 02:16 | #8 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
http://rgho.st/private/89QQzxHkZ/e28...bf2a6e0d93b0cf
A quick test Code:
SMDegrain(prefilter=2,tr=10,thSADc=1000,interlaced=true,chroma=false,truemotion=false,plane=3) tfm(pp=0) TDecimate(1) daa3mod
__________________
See My Avisynth Stuff Last edited by real.finder; 30th November 2016 at 02:34. |
30th November 2016, 04:26 | #9 | Link | |
Registered User
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
|
Quote:
[EDIT] But I tried it anyway. Oh, well, back to the drawing board. Probably something very simple. Last edited by LemMotlow; 30th November 2016 at 11:50. |
|
30th November 2016, 11:51 | #10 | Link |
Registered User
Join Date: Mar 2002
Location: Krautland
Posts: 903
|
@Lem.
Would you mind sharing your version of ReplaceFramesMC2? I found an ancient function that works. But I also found versions that use svflow and more. I don't want to clutter my avisynth directory with unused stuff Thanks in advance |
30th November 2016, 12:38 | #12 | Link | |
Registered User
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
|
Mine is attached, from an old Videohelp post.
[EDIT]Attachment removed. Scroll down a couple of posts to find the script. Quote:
As I said, probably something very simple. Meanwhile I just use the plain MDegrain's from MVTools. Last edited by LemMotlow; 30th November 2016 at 13:41. |
|
30th November 2016, 13:39 | #14 | Link | |
Registered User
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
|
Quote:
Code:
# ###################################################################################################### # # http://forum.videohelp.com/threads/353818-luma-error-on-VHS-restoration?p=2224484&viewfull=1#post2224484 # # Note: This function was originally called "RX". # ######################################################################################################## function ReplaceFramesMC2(clip Source, int N, int X) { # N is number of the 1st frame in Source that needs replacing. # X is total number of frames to replace # e.g. "RX(101, 5)" would replace 101,102,103,104,105, by using # 100 and 106 as reference points for mflowfps interpolation. start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point start+end AssumeFPS(1) #temporarily FPS=1 to use mflowfps super = MSuper(pel=2, hpad=0, vpad=0, rfilter=4) backward_1 = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24)) forward_1 = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24)) backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3) forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3) backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3) forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3) MBlockFps(super, backward_3, forward_3, num=X+1, den=1, mode=0) AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining Trim(1, framecount-1) #trim ends, leaving replacement frames Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0) } |
|
30th November 2016, 14:02 | #15 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Quote:
MRecalculate may be just a time waster. See here for how Overlap can change results, but some versions (all except pinterf, I think) are broken for Overlap>0 without at least 1 MRecalculate(Overlap=0). http://forum.doom9.org/showthread.ph...42#post1786042 EDIT: I guess we really need image with OLap=0 and MRecalculate and Flow=True/False. EDIT: Also, hpad/vpad is beneficial in frame interpolation.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 16th July 2017 at 03:03. |
||
30th November 2016, 15:13 | #17 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Here without Overlap, MRecalculate do make a difference
Code:
Function ReplaceFramesMC_Test(clip Source, int N, int X,Bool "Flow",Bool "Recalc",Bool "Pad") { Flow = Default(Flow,False) Recalc = Default(Recalc,False) Pad = Default(Pad,False) # N is number of the 1st frame in Source that needs replacing. # X is total number of frames to replace # e.g. "RX(101, 5)" would replace 101,102,103,104,105, by using # 100 and 106 as reference points for mflowfps interpolation. start=Source.trim(N-1,-1) #one good frame before, used for interpolation reference point end=Source.trim(N+X,-1) #one good frame after, used for interpolation reference point start+end AssumeFPS(1) #temporarily FPS=1 to use mflowfps super = MSuper(pel=2, hpad=(PAD)?16:0, vpad=(PAD)?16:0, rfilter=4) bv = MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24)) fv = MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24)) bv = (ReCalc)?MRecalculate(super, chroma=false, bv, blksize=8, searchparam=1, search=3):bv fv = (ReCalc)?MRecalculate(super, chroma=false, fv, blksize=8, searchparam=1, search=3):fv bv = (ReCalc)?MRecalculate(super, chroma=false, bv, blksize=4, searchparam=0, search=3):bv fv = (ReCalc)?MRecalculate(super, chroma=false, fv, blksize=4, searchparam=0, search=3):fv (Flow) \ ? MFlowFps( super, bv, fv, num=X+1, den=1) \ : MBlockFps(super, bv, fv, num=X+1, den=1, mode=0) AssumeFPS(FrameRate(Source)) #return back to normal source framerate for joining Trim(1, framecount-1) #trim ends, leaving replacement frames Source.trim(0,-N) ++ last ++ Source.trim(N+X+1,0) } Function Sub(clip c,string tit) { S = "SubTitle("+Chr(34)+tit+Chr(34)+")" StackVertical(c.BlankClip(height=20).ScriptClip(S),c) } Function Test(Clip c,Int n,Int x,Bool "Flow",Bool "Recalc",Bool "Pad") { Flow = Default(Flow,False) Recalc = Default(Recalc,False) Pad = Default(Pad,False) c.ReplaceFramesMC_Test(n,x,Flow,Recalc,Pad).Sub("Flow="+String(Flow)+" Recalc="+String(Recalc)+" Pad="+String(Pad)) Return Trim(n,-1) } FN="F:\v\StarWars.avi" Avisource(FN) PAD=true STARTFRAME=24057 A=Test(STARTFRAME,1,Flow=False,Recalc=False, Pad=PAD) B=Test(STARTFRAME,1,Flow=False,Recalc=True , Pad=PAD) C=Test(STARTFRAME,1,Flow=True ,Recalc=False, Pad=PAD) D=Test(STARTFRAME,1,Flow=True ,Recalc=True , Pad=PAD) H = A.Blankclip(Height=4,color=$FFFFFF) LFT = StackVertical(A,H,B) RGT = StackVertical(C,H,D) V = LFT.Blankclip(Width=4,color=$FFFFFF) Return StackHorizontal(LFT,V,RGT) EDIT: Above is not exactly same as prev images, prev images synthesized new frame between n and n+1, whereas this script deletes frame n and replaces with frame synthesized with n-1 and n+1. EDIT: Mod of previous script (end lines only), duplicates each frame, then produces similar result to compare with images from other thread. Code:
FN="F:\v\StarWars.avi" Avisource(FN) SelectEvery(1,0,0) PAD=true #STARTFRAME=24058 STARTFRAME=48115 A=Test(STARTFRAME,1,Flow=False,Recalc=False, Pad=PAD) B=Test(STARTFRAME,1,Flow=False,Recalc=True , Pad=PAD) C=Test(STARTFRAME,1,Flow=True ,Recalc=False, Pad=PAD) D=Test(STARTFRAME,1,Flow=True ,Recalc=True , Pad=PAD) H = A.Blankclip(Height=4,color=$FFFFFF) LFT = StackVertical(A,H,B) RGT = StackVertical(C,H,D) V = LFT.Blankclip(Width=4,color=$FFFFFF) Return StackHorizontal(LFT,V,RGT) EDIT: HPAD, seems to make a difference when there are verticals near left and right edges (sometimes produces oscillating edges [disappear, reappear] without HPAD, some clips only, maybe with horizontal jitter), presumably VPAD does same for top/bottom, but cant say I've ever noticed problems there. EDIT: I've only just noticed, but the MC function with MRecalculate uses different SearchParam at each stage, perhaps need to play with that also.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 16th July 2017 at 03:05. |
30th November 2016, 15:34 | #18 | Link |
Registered User
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
|
Thank you, Stainless. I have Have another project where ReplaceFramesMC2 solved one glitch but caused another, lesser one. Will try yours.
Last edited by LemMotlow; 30th November 2016 at 15:39. |
4th December 2016, 16:48 | #20 | Link | |
Registered User
Join Date: Apr 2015
Posts: 10
|
Quote:
|
|
|
|