the_provider
18th April 2008, 01:05
My comments were based on the amount of 'blocking' in the sample you provided. If you can get the tape again and grab it at the highest bit rate you can, you should reduce the amount of blocking which gives you less to clean up afterwards.
I understand.
But, as I said, I have no experience in identifying the flaws of the movie as in I don't now what do you call "blocking", for instance. Therefore I am not able at this point to analyze the video and then choose a combination of filters that will improve it. Deringing, demasking and so forth are just words for me, I can't spot/recognize them in a video. I can just say that it looks ugly...:confused:
That is why I am kindly asking Malcolm and anyone else to paste the script :script::script: he used for my sample here, in this thread.
And maybe some links too where all these concepts used in video editing are explained with pictures...
Best regards.
fibbingbear
18th April 2008, 01:32
I understand.
But, as I said, I have no experience in identifying the flaws of the movie as in I don't now what do you call "blocking", for instance. Therefore I am not able at this point to analyze the video and then choose a combination of filters that will improve it. Deringing, demasking and so forth are just words for me, I can't spot/recognize them in a video. I can just say that it looks ugly...:confused:
You might try looking at these guides from Anime Music Video. Even though it's not anime, as Malcolm points out, it'll work well for cartoons. If nothing else, it'll help show what some of the words mean:
One guide (older):
http://www.animemusicvideos.org/guides/avtech/avspostqual.html
Another guide (newer):
http://www.animemusicvideos.org/guides/avtechbeta/avspostqual.html
Although I use FFT3DFilter instead of the 3D Filter they use in the guide, and I think VMToom has superceded MFToon.
And as everyone else has already said on this forum, Malcolm :script:
Malcolm
18th April 2008, 22:56
O.k. here is the script.
It's a simplified version of my VHS processing script. It's intended for very old and dirty VHS recordings. But as you can see it works nicely with this source too.
Although it's simplified it still uses loads of RAM when it's executed. As you can imagine it's sloooooowwww! :)
All used functions are included in the script with the exception of mc_spuds. But you can find it in the forum.
It's fun to watch the output frame by frame and compare it to the original! ;)
setmemorymax(1024)
#import needed scripts
Import("C:\Programme\Videotools\AviSynth 2.5\plugins\" + "mc_spuds.avs")
# Load the video
mpeg2source("Flying_Dragons_split1.d2v",cpu2="ooooox",info=3)
# Crop for faster preview, remove before encoding
crop(0,0,432,-0)
# Save for later comparison
orig = last
# Heavy deblocking
deblock(quant=51)
# Add borders. Remove later to hide some green artifacts
addborders(4,0,4,0)
# Remember vinverse for later use
saved = vinverse()
# Remove VHS colorshift
Vshift=2 # 2 pixels per tape generation
Hshift=0
#mergechroma(last.crop(Hshift,Vshift,0,0, align=true).addborders(0,0,Hshift,Vshift))
# Remove large horizontal stripes
#turnleft()
#descratch(mindif=12, maxgap=170, minlen=25, blurlen=5, keep=100, border=0, maxangle=1, modey=2)
#turnright()
# Remove Colorbleeding
RemoveColorBleeding()
# Derainbow
DeRainbow()
# Motion compensated denoise & Sharpen
MC_Spuds(strength=6, frames=3, flow=false, focus=false, preprocess=true, postprocess=true, temporal=true)
soothe_local(saved.mergechroma(last), last, 10)
# Fizzkiller
fizzkiller3(blksize = 16, sharp = 2, overlap=4)
# Vinverse
vinverse()
# Sharpen
a=degrainmedian(mode=2).VagueDenoiser(threshold=0.8, method=1, nsteps=6, chromaT=0.8)
SeeSaw(last, a, NRlimit=6, NRlimit2=7, Sstr=1.5, Slimit=5, Spower=5, Sdamplo=6, Szp=16)
limitedsharpenfaster(strength=300,overshoot=0, Smode=4, soft=-1)
# Add grain
AddGrain(8,0,0)
# Remove added borders from above
crop(4,0,-4,-0)
# Show original clip & difference
clipA = last
diffRate = 16
d_clipA = subtract(orig, clipA).levels(127-diffRate,1,128+diffRate,0,255)
stackhorizontal(clipA, d_clipA)
stackhorizontal(orig, last)
converttoyuy2()
return last
### Functions ###
# RemoveColorBleeding (by Didée)
function RemoveColorBleeding(clip input) {
o=input
warp1=o.mergechroma(o .blur(1.0).unsharpmask(255,1,1).aWarpSharp(depth=20.0, thresh=0.75, blurlevel=3, cm=1))
warp2=o.mergechroma(warp1.blur(1.0).unsharpmask(255,1,1).aWarpSharp(depth=12.0, thresh=0.75, blurlevel=2, cm=1))
# interleave(o,warp1,warp2) # visualization
return warp2
}
# DeRainbow (by sh0dan)
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)
}
# Fizzkiller3 (by Jawed)
function FizzKiller3(clip source, int "blksize", int "overlap", int "sharp", int "thSAD") {
# Motion compensated denoiser for progressive source clip with prefiltering optimised to reduce high-contrast noise
# Uses MVTools and RemoveGrain
blksize = default(blksize,8) # blksize value (4, 8 or 16)
overlap = default(overlap,blksize/2) # overlap value (0 to half blksize)
sharp = default(sharp,1) # 0=bilinear softest, 1=bicubic, 2=Wiener sharpest
thSAD = default(thSAD,400) # higher risks motion ghosting and swimming, lower risks blotchy denoising
#idx = 20 # "safe" idx for use within this function only
# Prefilter the clip
calm = source.invert("Y").levels(0, 0.5, 255, 0, 255, coring = false)
calm = calm.removegrain(mode = 17)
calm = calm.removegrain(mode = 17)
calm = calm.removegrain(mode = 17)
backward_vec3 = calm.MVAnalyse(isb = true, delta = 3, pel = 2, blksize=blksize, overlap=overlap, sharp=sharp, idx = idx)
backward_vec2 = calm.MVAnalyse(isb = true, delta = 2, pel = 2, blksize=blksize, overlap=overlap, sharp=sharp, idx = idx)
backward_vec1 = calm.MVAnalyse(isb = true, delta = 1, pel = 2, blksize=blksize, overlap=overlap, sharp=sharp, idx = idx)
forward_vec1 = calm.MVAnalyse(isb = false, delta = 1, pel = 2, blksize=blksize, overlap=overlap, sharp=sharp, idx = idx)
forward_vec2 = calm.MVAnalyse(isb = false, delta = 2, pel = 2, blksize=blksize, overlap=overlap, sharp=sharp, idx = idx)
forward_vec3 = calm.MVAnalyse(isb = false, delta = 3, pel = 2, blksize=blksize, overlap=overlap, sharp=sharp, idx = idx)
source.MVDegrain3(backward_vec1, forward_vec1, backward_vec2, forward_vec2, backward_vec3, forward_vec3, thSAD = thSAD, idx = idx + 1)
}
# Soothe (by Didée)
function Soothe_local(clip sharp, clip orig, int "keep") {
Assert(sharp.width == orig.width && sharp.height == orig.height,
\ "Soothe: clip dimentions must match!")
keep = default(keep, 24)
keep = (keep>100) ? 100 : (keep<0) ? 0 : keep
KP = string(keep)
diff = mt_makediff(orig,sharp)
diff2 = diff.temporalsoften(1,255,0,32,2)
diff3 = mt_lutxy(diff,diff2, "x 128 - y 128 - * 0 < x 128 - 100 / " + KP
\ + " * 128 + x 128 - abs y 128 - abs > x " + KP
\ + " * y 100 " + KP + " - * + 100 / x ? ?")
return( mt_makediff(orig,diff3,chroma="copy first") )
}
Malcolm
19th April 2008, 12:30
Wow! I am really, really stunned! Thanks a lot!
You're welcome.
Actually i just have compiled the functions & plugins some genious guys (mentioned in my script) have created to a meaningful combination. Still - this was a task that took months of tweaking. For example, the order in which the functions are called is very important and influences the output quality a lot! And i don't mean obvious thinks like sharpening at the end and so on..
Also obviously the parameters used are key!
There are some lines commented out, like descratch and compensation of tape-generation color shift. I don't find them necessary atm. but you can decide yourself. Actually, the source is _that_ bad, i can't figure out which parameters i should choose to compensate color shift! ;)
If you can make another capture with less blocking, you can comment-out the deblocking call (or use "xxxxox" for cpu2 in mpeg2source). Interestingly it's not that important anyway since the following stuff like denoising and so on also 'removes' the blocks quite good.
Also, if your new capture is of higher quality (i guess with a higher bitrate you will preserve a lot more details), the denoising doesn't have to be that strong (it kills some details (blurs edges) atm.). lower the 'strength' value in mc_spuds. You could also comment-out Fizzkiller3 as it blurs the picture somewhat (but on the other hand 'straightens' the picture where it's distorted).
My VHS script has things like motion compensated bobbing, which is slow per-se but also doubles the number of frames (= twice the time needed), also stabilizing of camera shake (very slow), deringing, Halo removal (slow) and some other thinks like dotcrawl removal and colour corrections.
I processed 17 VHS captures recently with around 45 minutes each and it took 18 hours per capture (~1fps). This was done on a Core2Duo @2.6GHz with 2GB RAM. My PC at home is a Core2Duo @3.15GHz with 2GB RAM.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.