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 17th July 2012, 17:59   #1  |  Link
baunduley
Registered User
 
Join Date: Jun 2012
Posts: 5
how to fix random change of color

the color changes in the video randomly.
once it the color scheme is reddish and a little greenish in the very next frame.

eg. screen
frame #16984

frame #16985

this change hasn't maintained any numerical series...its completely random. is there any way to fix this any how?

i've cut the video and giving a sample clip here...

http://www.mediafire.com/?x6nxz6u6fkf65gy

now please answer these stupid questions, if u can (i nothing but a newbie...:-P
1. this video is highly deinterlaced, i've tried QTGMC(Preset="Very Slow", SourceMatch=2, Lossless=2, EZKeepGrain=0.5, Sharpness=0.1, Sbb=0)
, and has got decent result but it is taking very long time to rip.....is there any better way to deinterlace it?

and what are the other problems of this video i should worry about? and the suitable options to tweak it......
thanx in advance
baunduley is offline   Reply With Quote
Old 17th July 2012, 19:16   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
There seems to be a problem in your capture. How did you capture the video?
Guest is offline   Reply With Quote
Old 17th July 2012, 20:03   #3  |  Link
baunduley
Registered User
 
Join Date: Jun 2012
Posts: 5
Quote:
Originally Posted by neuron2 View Post
There seems to be a problem in your capture. How did you capture the video?
dvdshrink......should i use a different one?
baunduley is offline   Reply With Quote
Old 17th July 2012, 22:17   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Oh sorry, the logo fooled me into thinking it was an off-air capture.

Now that I see that it is just a typical crappy Bollywood DVD I will withdraw.
Guest is offline   Reply With Quote
Old 24th July 2012, 12:40   #5  |  Link
cobo
Registered User
 
Join Date: Mar 2004
Posts: 118
You can use MDegrainN from cretindesalpes modified MVTools2 version that's included in his Dither package to average the chroma
over a long sequence of frames.
http://forum.doom9.org/showthread.ph...59#post1386559

For removing spots and scratches I would use Didées single frame spot remover (adapted with SelectEvery second frame so that
it catches spots that are static over up to four frames) to produce a search clip for MDegrain noise removal on the luma.
I recommend using the older 0.5 version of medianblur for the spot remover because the newer versions cause some encoders to
crash. Medianblur 0.5 is only available here:
http://www.avisynth.org/warpenterpri...l_20041029.zip

For the significant spots, scratches and anomalies that remain, you could scroll through the clip in virtualdub and note the bad
frame numbers and replace them with interpolated replacement frames using MugFunkys Morph function.

The flicker can be greatly reduced with the Flux7framesT function used on the search clip for the MDegrain luma noise removal pass.

I had to process your clip in three passes because I have only an old single core processor with no hyper-threading. You may be
able to use fewer if you use multi-threading.

Here's the script I used on your sample clip. The line of hash-marks indicate the separate passes.
Scripts for the functions used follow.

Code:
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\All\mvtools2.6.0.5.dll")
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\All\medianblur0.5.dll")
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\RemoveGrain1.0\RemoveGrainSSE2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\RemoveGrain1.0\RepairSSE2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\MaskTools v2.0a48\mt_masktools-25.dll") 
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\All\FFT3Dfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\All\NNedi3.dll")
LoadPlugin("C:\Program Files\AviSynth 2.56a\plugins\All\VerticalCleanerSSE2.dll")

import("C:\Program Files\AviSynth 2.56a\plugins\All\QTGMC-3.32.avsi")
import("C:\Program Files\AviSynth 2.56a\plugins\All\Morph.avsi")
import("C:\Program Files\AviSynth 2.56a\plugins\All\Flux7framesT.avsi")
import("C:\Program Files\AviSynth 2.56a\plugins\All\ContraSharpening.avsi")
import("C:\Program Files\AviSynth 2.56a\plugins\All\LimitedSharpenFaster.avsi")

mpeg2source("VTS_01_1.d2v",idct=7, info=3)

QTGMC(Preset="Very Slow", SourceMatch=2, Lossless=2, EZKeepGrain=0.5, Sharpness =0.1, Sbb=0)

SelectEven()

########################################################################
Morph(50,54)
Morph(239,241)
Morph(265,267)
Morph(272,275)
Morph(330,334)
Morph(338,341)
Morph(370,373)
Morph(794,798)

x=last

SelectEvery(2,0)+SelectEvery(2,1)

# remove single-frame spots
o=last ox=o.width() oy=o.height()
osup = o.MSuper(pel=2,sharp=2)
bv1  = osup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1  = osup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4) 
bc1  = o.MCompensate(osup,bv1)
fc1  = o.MCompensate(osup,fv1)
Interleave(fc1,o,bc1)
MedianblurT(0,0,0,1)   #  you can also use "Clense(reduceflicker=false)" instead
SelectEvery(3,1)

a=last.Trim(0,428)
b=last.Trim(429,857)
Interleave(a,b)

# remove single-frame spots
o2=last ox=o2.width() oy=o2.height()
o2sup = o2.MSuper(pel=2,sharp=2)
bv1a  = o2sup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1a  = o2sup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4) 
bc1a  = o2.MCompensate(o2sup,bv1a)
fc1a  = o2.MCompensate(o2sup,fv1a)
Interleave(fc1a,o2,bc1a)
MedianblurT(0,0,0,1)   #  you can also use "Clense(reduceflicker=false)" instead
SelectEvery(3,1)

Flux7framesT()

y=last


Sup1=y.MSuper(mt=false) 
Vec1=MAnalyse(Sup1, delta=3, chroma=true, blksize=8, blksizeV=8, overlap=4, overlapV=4, multi=true, mt=false)
x.MDeGrainN( Sup1, Vec1, 3, plane=4, thSAD=400, thSAD2=400, thSADC=400, mt=false)

z=last

########################################################################
Sup2=MSuper(mt=false) 
Vec2=MAnalyse(Sup2, delta=128, chroma=true, blksize=32, blksizeV=32, overlap=16, overlapV=16, multi=true, mt=false)
MDeGrainN( Sup2, Vec2, 128, plane=3, mt=false)

ContraSharpening(z,x)

LimitedSharpenFaster( Smode=3, Lmode=3, ss_x=1.0, ss_y=1.0, strength=60, overshoot=0,soft=40, wide=true, edgemode=0 )
Copy and save as Morph.avsi
Quote:
# http://forum.doom9.org/showthread.php?t=161154
# 9th May 2011
# Using MVTools2 for repair of broken frames.
# morph by Mug Funky
# usage: if you have, say, frames 21 and 22 bad, then use "morph(20,23)"
#
# (changes made from original for more accurate interpolation:
# increased default blksize from 16 to 32,
# increased thscd1 from 255 to 800,
# changed search type from 4 to 3 and searchparam from 2 to 16)
# http://forum.doom9.org/showthread.php?t=165338

function morph (clip c, int in, int "out", int "blksize")
{

Function fill_loop(string s, int stop, int count)
{
return (stop == 0) ? s : string("tofill.mflowinter(morph_spr,fill_vb,fill_vf,time=" + string(100*(count - stop)/float(count))) + ",thscd1=800,thscd2=255).selectevery(tofill.framecount(),0)," + fill_loop(s,stop-1,count)
}

out=default(out, 0)
blksize=default(blksize,32)

d=c.trim(in,out)# in-1?

numframes=d.framecount-2
tofill=d.selectevery(c.framecount(),0,c.framecount()-1)
global morph_spr=tofill.msuper()
fill_vf=morph_spr.manalyse(truemotion=true,blksize=blksize,isb=false,search=3,searchparam=16,overlap=blksize/2)
fill_vb=morph_spr.manalyse(truemotion=true,blksize=blksize,isb=true,search=3,searchparam=16,overlap=blksize/2)
filled=eval("interleave(" + fill_loop("" ,d.framecount()-1,d.framecount()-1) + "tofill.selectevery(tofill.framecount(),tofill.framecount())).assumefps(c.framerate())")
c.trim(0,-(in+1))++filled.trim(1,numframes)++c.trim(out,0)
}
Copy and save as Flux7framesT.avsi
Quote:
# http://forum.doom9.org/showthread.php?t=132310
# Need Suggestions for VERY GRAINY source
# Originally Posted by Didée
# @ Zep: Some more thoughts on "dancing" grain.
# This sort of "dancing" usually isn't a property of the original grain, at least for the most part. Grain in itself usually is
# a high-frequency distortion only. The "dancing" effect is introduced by lossy DCT-based compressors, where in the
# lossy compression process some error is introduced into the low-frequency parts, caused mainly by the hi-frequency
# parts.
# In result, there will be almost no smoothing, and the grain basically is fully preserved. It's just the flicker, or "dancing"
# effect, that will be removed.
# As a side-effect, there might occur some slight toning-down of shadings when there is motion. One can definetly see it
# in single-frame comparisons by flipping between original and processed. But one will hardly note that during watching
# the movie.
#
# One step further, something in this direction often is very useful for subsequent motioncompensated denoising.
# If the flicker is left in, it eventually will also disturb the ME engine (making the vectors follow the flicker, causing spatial
# shifts where in fact there should be none), which will lower the benefit one can get from MC-NR. When the flicker is
# taken out before the motion search, chances are better to get more clean vectors.
# ...
# the whole purpose of this script is to not touch grain at all, and to calm down only the low spatial frequencies.
# If FluxSmooth is set up more aggressively (i.e. bigger threshold), then it'll do more good where Flux is doing right,
# and will do more bad where Flux is doing wrong.
# Remember FluxSmooth is a simple temporal smoother with median-like decision where to filter and where not.
# Examples:
# a) a pixel sequence: ... 80 81 85 79 80 ...
# Flux will filter the "85" and the "79", because these two pixels are overshooting both of their neighbors.
# b) pixel sequence: ... 80 81 85 85 81 80
# Flux will filter *nothing*, because no pixel satisfies the "overshooting both neighbors" criteria.
# For case b), this means:
# - IF those two "85" are due to motion, then Flux has done correct.
# - But IF those two "85" in fact are related to "flicker" in a "flat" a/o "static" area, then Flux has not filtered something that
# you would like to have filtered.
# Truth is, this kind of "flickering of low spatial frequencies" is one of the ultimate foes, because right here it is where the
# nebula-of-uncertainty becomes thick:
# a) without mocomp, you can't know if it's flicker or motion
# b) with mocomp, you can't know if the mocomp has been misleaded by the flicker
# c) With prefiltering before mosearch, you can't know if the prefilter has mangled moving areas (because of a)) and
# conseqquentially has misleaded the mosearch
# Chicken-and-egg problem, without any definite solution.
# ...
# For this one, 'th' and 'thC' are the only knobs to tweak.

function Flux7framesT(clip c, int "th", int "thC") {
th = default(th,7)
thC = default(thC,th)
med = c.MedianBlurT(2,0,0,3)#, mc=true,blksize=8,pel=2,thSCD1=400,thSCD2=130)
avg = c.temporalsoften(3,th,thC,24,2)
medD = mt_makediff(c,med,U=3,V=3)
avgD = mt_makediff(c,avg,U=3,V=3)
DD = mt_lutxy(medD,avgD,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?",U=3,V=3)
c.mt_makediff(DD,U=3,V=3)
}
Copy and save as ContraSharpening.avsi
Code:
# http://forum.doom9.org/showthread.php?t=150299&highlight=contrasharpening

FUNCTION ContraSharpening(clip denoised, clip original)
{
# contra-sharpening: sharpen the denoised clip, but don't add more to any pixel than what was removed previously.
# script function from Didee from the VERY GRAINY thread
s = denoised.minblur(1,1) # Damp down remaining spots of the denoised clip.
allD = mt_makediff(original,denoised) # The difference achieved by the denoising.
ssD = mt_makediff(s,s.removegrain(11,-1)) # The difference of a simple kernel blur.
ssDD = ssD.repair(allD,1) # Limit the difference to the max of what the denoising removed locally.
ssDD = SSDD.mt_lutxy(ssD,"x 128 - abs y 128 - abs < x y ?") # abs(diff) after limiting may not be bigger than before.

denoised.mt_adddiff(ssDD,U=2,V=2) # Apply the limited difference. (Sharpening is just inverse blurring.)

RETURN (last)
}

# From Didee's MCBob script
function MinBlur(clip clp, int r, int "uv")
{
uv   = default(uv,3)
uv2  = (uv==2) ? 1 : uv
rg4  = (uv==3) ? 4 : -1
rg11 = (uv==3) ? 11 : -1
rg20 = (uv==3) ? 20 : -1
medf = (uv==3) ? 1 : -200

RG11D = (r==1) ? mt_makediff(clp,clp.removegrain(11,rg11),U=uv2,V=uv2)
 \    : (r==2) ? mt_makediff(clp,clp.removegrain(11,rg11).removegrain(20,rg20),U=uv2,V=uv2)
 \    :          mt_makediff(clp,clp.removegrain(11,rg11).removegrain(20,rg20).removegrain(20,rg20),U=uv2,V=uv2)
RG4D  = (r==1) ? mt_makediff(clp,clp.removegrain(4,rg4),U=uv2,V=uv2)
 \    : (r==2) ? mt_makediff(clp,clp.medianblur(2,2*medf,2*medf),U=uv2,V=uv2)
 \    :          mt_makediff(clp,clp.medianblur(3,3*medf,3*medf),U=uv2,V=uv2)
DD    = mt_lutxy(RG11D,RG4D,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?",U=uv2,V=uv2)
clp.mt_makediff(DD,U=uv,V=uv)
return(last)
}

Last edited by cobo; 26th July 2012 at 17:38.
cobo is offline   Reply With Quote
Old 25th July 2012, 06:39   #6  |  Link
cobo
Registered User
 
Join Date: Mar 2004
Posts: 118
You could eliminate the need to make a list of frames to replace with the Morph function by denoising the clip directly with the spot removal routine and Flux7T function, instead of using them indirectly to create a search clip for MDegraining the luma. The only objectionable difference I notice is that swiftly moving objects, such as the pointing hand, are not as well reconstructed and may have some color smudging which can be seen stepping through the clip frame by frame, but likely wouldn't be noticeable when playing it.

So then the script would be:
Quote:
mpeg2source("VTS_01_1.d2v",idct=7, info=3)

QTGMC(Preset="Very Slow", SourceMatch=2, Lossless=2, EZKeepGrain=0.5, Sharpness =0.1, Sbb=0)

SelectEven()

########################################################################

Sup=MSuper(mt=false)
Vec=MAnalyse(Sup, delta=128, chroma=true, blksize=32, blksizeV=32, overlap=16, overlapV=16, multi=true, mt=false)
MDeGrainN( Sup, Vec, 128, plane=3, mt=false)

########################################################################

x=last

SelectEvery(2,0)+SelectEvery(2,1)

# remove single-frame spots
o=last ox=o.width() oy=o.height()
osup = o.MSuper(pel=2,sharp=2)
bv1 = osup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1 = osup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4)
bc1 = o.MCompensate(osup,bv1)
fc1 = o.MCompensate(osup,fv1)
Interleave(fc1,o,bc1)
MedianblurT(0,0,0,1) # you can also use "Clense(reduceflicker=false)" instead
SelectEvery(3,1)

a=last.Trim(0,428)
b=last.Trim(429,857)
Interleave(a,b)

# remove single-frame spots
o2=last ox=o2.width() oy=o2.height()
o2sup = o2.MSuper(pel=2,sharp=2)
bv1a = o2sup.MAnalyse(isb=true, delta=1,blksize=8,overlap=4,search=4)
fv1a = o2sup.MAnalyse(isb=false,delta=1,blksize=8,overlap=4,search=4)
bc1a = o2.MCompensate(o2sup,bv1a)
fc1a = o2.MCompensate(o2sup,fv1a)
Interleave(fc1a,o2,bc1a)
MedianblurT(0,0,0,1) # you can also use "Clense(reduceflicker=false)" instead
SelectEvery(3,1)

Flux7framesT()

z=last

ContraSharpening(z,x)

LimitedSharpenFaster( Smode=3, Lmode=3, ss_x=1.0, ss_y=1.0, strength=60, overshoot=0,soft=40, wide=true, edgemode=0 )
cobo 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 05:25.


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