View Full Version : VHS rainbow problems
Sighting
13th August 2004, 11:28
Hi, I'm in process of making a clean xvid encode out of an old VHS tape... Here is my script so far:
LoadPlugin("c:\Program Files\Avisynth 2.5\plugins\LoadPluginEx2.dll")
LoadPlugin("c:\Program Files\Avisynth 2.5\plugins\DustV5.dll")
vid=AviSource("c:\capture.avi").Telecide(order=1,guide=2).Trim(1316,38910).CNR2().Crop(0,10,0,-14).PixieDust(5).BicubicResize(480,360).FadeOut(20)
blk=Blackness(vid,20)
UnalignedSplice(blk,vid)
The main problem that I have now is some rainbowing on some subtitles. I tried the Antiblink filter on it with both the recommended parameters that were described in the readme. This DOES make the rainbowing disappear, but it gives me a bigger problem: in the last frame before a scene change, the colors get messed up.
Could anyone help me with finding a better solution for the rainbowing? It only happens for a short time, but I would still like to get rid of it. I also tried Guavacomb, but that one didn't seem to help at all.
Also, if you have any suggestions for my current script, you're welcome ;)
Mug Funky
14th August 2004, 19:44
hmm... is there a sample of 20 or so frames available?
there's rainbows and then there's rainbows :) some can be quite successfully dealt with, others can only be "fixed" by completely destroying the chroma channels.
unfortunately, once alias frequencies appear, they are nigh-on-impossible to distinguish from regular signal, at least in any reasonable amount of time. i find interlaced rainbows that invert every field are the easiest to get rid of (just comb-mask-and-deinterlace the chroma channels), but if there's too long-term a pattern to the rainbows, then there's not much hope of getting rid of them. (guavacomb attempts this, but requires a sequence where nothing moves but the rainbows)
Sighting
14th August 2004, 21:44
Here's a compressed huff avi that shows the 'scene' that has the rainbow errors in the subtitle. This avi has telecide and CNR2 applied to it and no dust of rainbow filter yet.
LINK (http://home.tiscali.nl/vigilante/1.rar)
hartford
15th August 2004, 04:54
You might try this (although, your "rainbows" are nothing compared to
what I've had):
AviSynth script:
Loadplugin("c:\program files\avisynth 2.5.5\plugins\MaskTools.dll")
Loadplugin("c:\program files\avisynth 2.5.5\plugins\MipSmooth.dll")
Loadplugin("c:\program files\avisynth 2.5.5\plugins\MSharpen.dll")
Loadplugin("c:\program files\avisynth 2.5.5\plugins\old\LoadpluginEX.dll")
Loadplugin("c:\program files\avisynth 2.5.5\plugins\old\Dustv5.dll")
Import("c:\program files\avisynth 2.5.5\plugins\jdl-util.avs")
Import("c:\program files\avisynth 2.5.5\plugins\DeRainbowYUY2.avsi")
Avisource("c:\1.avi")
jdl_UnfoldFieldsVertical(flip=true)
Pixiedust(limit=2)
DeRainbowYUY2(last,30)
jdl_FoldFieldsVertical(flip=true)
For jdl-util.avs Search Stickboy.
Be sure to get the correct "LoadpluginEX.dll" as there are several.
Virtual dub filters: copy this to 1.vcf and load it as
"Load processing settings"
VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
VirtualDub.audio.EnableFilterGraph(0);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("smart smoother HiQuality (2.11)");
VirtualDub.video.filters.instance[0].Config(5, 50, 0, 254, 1, 0, 1, 0);
VirtualDub.video.filters.Add("dynamic noise reduction (MMX)");
VirtualDub.video.filters.instance[1].Config (4);
VirtualDub.video.filters.Add("static noise reduction (1.3)");
VirtualDub.video.filters.instance[2].Config (4,0);
VirtualDub.audio.filters.Clear();
Your "rainbows" are rather insignificant, in my opinion.
Best.
madness
15th August 2004, 09:18
you could try sh0dan's derainbow script I found the forum quite a while ago and someone created a function for it I can't quite remember who was it but anyway, it works quite effective for some dvd source has heavy rainbow on static areas.
Heres a reprint of the script:
function DeRainbow(clip org, int "thresh")
{
assert(org.isYV12(),"DeRainbow() requires YV12 input!")
thresh = default(thresh, 10)
org_u = utoy(org)
org_v = vtoy(org)
msharpen(org, threshold = thresh, mask=true)
reduceby2()
greyscale()
uv = blur(1.5).levels(0,2.0,255,0,255, coring=false).blur(1.5).blur(1.5).levels(50,2.0,255,0,255, coring=false)
filtered_u = org_u.mipsmooth(spatial=255, temporal=255, scenechange=3, show=false, method="strong", scalefactor=0.5)
filtered_v = org_v.mipsmooth(spatial=255, temporal=255, scenechange=3, show=false, method="strong", scalefactor=0.5)
u_final = MaskedMerge(org_u, filtered_u, uv)
v_final = MaskedMerge(org_v, filtered_v, uv)
return ytouv(u_final, v_final, org)
}
just copy and paste that into notepad and save it derainbow.avs or something you can remember in the future and in your avs script just put Derainbow() make sure the input is YV12 colorspace if not then do ConvertToYV12().DeRainbow()
the default threshold for the derainbow is 10 u can chnage the value to shuite ur needs.
oh also make sure you got these filters loaded into your script
MSharpen.dll, MaskTools.dll, MipSmooth.dll
its needed inorder for the derainbow to work.
Sighting
15th August 2004, 10:54
Thanks for the replies!
I will use this then:
LoadPlugin("c:\Program Files\Avisynth 2.5\plugins\MSharpen.dll")
LoadPlugin("c:\Program Files\Avisynth 2.5\plugins\MaskTools.dll")
LoadPlugin("c:\Program Files\Avisynth 2.5\plugins\MipSmooth.dll")
LoadPlugin("c:\Program Files\Avisynth 2.5\plugins\old\LoadPluginEx.dll")
LoadPlugin("c:\Program Files\Avisynth 2.5\plugins\old\DustV5.dll")
Import("c:\Program Files\Avisynth 2.5\plugins\derainbow.avs")
vid=AviSource("c:\capture.avi").Telecide(order=1,guide=2).Trim(1316,38910).CNR2().Crop(0,10,0,-14).PixieDust(5).ConvertToYV12().DeRainbow().BicubicResize(480,360).FadeOut(20)
blk=Blackness(vid,20)
UnalignedSplice(blk,vid)
Greetings
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.