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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th November 2016, 18:30   #1  |  Link
snarfies
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
snarfies is offline   Reply With Quote
Old 27th November 2016, 03:16   #2  |  Link
kuchikirukia
Registered User
 
Join Date: Oct 2014
Posts: 476
Tcomb?
kuchikirukia is offline   Reply With Quote
Old 28th November 2016, 15:31   #3  |  Link
LemMotlow
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)
snarfies_nine_rainbows_rework.mp4 -> https://www.mediafire.com/?m0ndi0ty0mrpfkg
Other ideas?

Last edited by LemMotlow; 28th November 2016 at 15:54.
LemMotlow is offline   Reply With Quote
Old 29th November 2016, 21:28   #4  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
@Lem
Nice job with this messy source.
Your script is slow as hell...
Taurus is offline   Reply With Quote
Old 29th November 2016, 22:00   #5  |  Link
LemMotlow
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.
LemMotlow is offline   Reply With Quote
Old 30th November 2016, 00:28   #6  |  Link
poisondeathray
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
poisondeathray is offline   Reply With Quote
Old 30th November 2016, 02:02   #7  |  Link
LemMotlow
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.
LemMotlow is offline   Reply With Quote
Old 30th November 2016, 02:16   #8  |  Link
real.finder
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.
real.finder is offline   Reply With Quote
Old 30th November 2016, 04:26   #9  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
Quote:
Originally Posted by real.finder View Post
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
That script would probably work if I had a version of SMDegrain that worked. I got a little weary from collecting all the versions, mods, re-mods, revisions, updates, update mods, and whatnot, and I don't ever want to see daa3mod again, among others. I downloaded the new 11/2016 mod anyway. Maybe next week I'll have time for all the required support mods, support re-mods, support updates, etc., if their download links don't disappear by then. Seriously. Avisynth has some great stuff, and some nice docs for developers, but I've never been able to make SMDegrain run, anywhere, any time, so I can't trust it. Maybe snarfies can give it a go. What happened to him/her, anyway?

[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.
LemMotlow is offline   Reply With Quote
Old 30th November 2016, 11:51   #10  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
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
Taurus is offline   Reply With Quote
Old 30th November 2016, 12:11   #11  |  Link
kuchikirukia
Registered User
 
Join Date: Oct 2014
Posts: 476
Smdegerain. I think this is everything.

http://s000.tinyupload.com/?file_id=...84607212255611
kuchikirukia is offline   Reply With Quote
Old 30th November 2016, 12:38   #12  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
Quote:
Originally Posted by Taurus View Post
@Lem.
Would you mind sharing your version of ReplaceFramesMC2?
Mine is attached, from an old Videohelp post.
[EDIT]Attachment removed. Scroll down a couple of posts to find the script.

Quote:
Originally Posted by kuchikirukia View Post
Smdegerain. I think this is everything.

http://s000.tinyupload.com/?file_id=...84607212255611
Yes, that's last year's which I have, thanks. The version mentioned in the earlier post is SMDegrainMod from 2016.
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.
LemMotlow is offline   Reply With Quote
Old 30th November 2016, 13:30   #13  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
@Lem:
Waiting for the attachments pending approval.
Thanks anyway
Taurus is offline   Reply With Quote
Old 30th November 2016, 13:39   #14  |  Link
LemMotlow
Registered User
 
Join Date: Jul 2011
Location: Tennessee, USA
Posts: 266
Quote:
Originally Posted by Taurus View Post
@Lem:
Waiting for the attachments pending approval.
Thanks anyway
Shucks. Well here it is (should have done this way in the fist place, I just happened tyo have it zip'd):
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)
}
LemMotlow is offline   Reply With Quote
Old 30th November 2016, 14:02   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by kolak View Post
There maybe solution, which is adaptive block
The things is that Groucho2004 is not using 1 command with a block size, but recalculate option, which I assume may help with quality.
Quote:
Originally Posted by feisty2 View Post
It definitely helps with denoising and stuff like that, not with frame interpolation
http://forum.doom9.org/showthread.ph...09#post1783609

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.
StainlessS is offline   Reply With Quote
Old 30th November 2016, 14:12   #16  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
Quote:
Shucks. Well here it is (should have done this way in the fist place, I just happened tyo have it zip'd)
@Lem:
Thanks for sharing!
Taurus is offline   Reply With Quote
Old 30th November 2016, 15:13   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
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.
StainlessS is offline   Reply With Quote
Old 30th November 2016, 15:34   #18  |  Link
LemMotlow
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.
LemMotlow is offline   Reply With Quote
Old 4th December 2016, 16:39   #19  |  Link
snarfies
Registered User
 
Join Date: Apr 2015
Posts: 10
Okay, thanks guys! Looks like this SMDegrain is the way to go, will try experimenting with it soon.
snarfies is offline   Reply With Quote
Old 4th December 2016, 16:48   #20  |  Link
snarfies
Registered User
 
Join Date: Apr 2015
Posts: 10
Quote:
Originally Posted by poisondeathray View Post
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
Well, I like the results, and I don't know that I'm looking to do this on over three hours of footage, but sure, I'm interested in knowing a little more.
snarfies is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.