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. |
16th June 2009, 07:29 | #1 | Link |
Registered User
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
|
Sharpening VHS capture
Hi folk. Now I try improve quality from VHS capture. VHS tape from camcorder original (no generation copy). Quality very good only grain and white noise. Main idea from videofred thread, difference only that my source interlaced.
script: Code:
SetMemoryMax(1152) Loadplugin("MT.dll") LoadPlugin("warpsharp.dll") LoadPlugin("mt_masktools-25.dll") LoadPlugin("SSE3Tools.dll") LoadPlugin("RemoveGrainTSSE3.dll") LoadPlugin("RemoveGrainSSE3.dll") LoadPlugin("RepairSSE3.dll") Import("LimitedSharpenFaster.avsi") SetMTMode(5) LSF_sharp_ness=250 LSF_radi_us=3 LSF_sub=1.5 #first sharpening parameters (LimitedSharpenFaster) sub=subsampling W=720 H=576 DirectShowSource("my.avi") SetMTMode(2) source=AssumeTFF() noise=source.nnedi2(field=-2) supernoise = MSuper(noise) backward_vec1=supernoise.MAnalyse(isb = true, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec1=supernoise.MAnalyse(isb = false, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec2=supernoise.MAnalyse(isb = true, delta = 4,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec2=supernoise.MAnalyse(isb = false, delta = 4,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec3=supernoise.MAnalyse(isb = true, delta = 6,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec3=supernoise.MAnalyse(isb = false, delta = 6,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) noise.MDegrain3(supernoise,backward_vec3,backward_vec2,backward_vec1,forward_vec1,forward_vec2,forward_vec3,thSAD=400,thSADc=400,plane=4) #HDRAGC() limitedSharpenFaster(last,smode=3,strength=LSF_sharp_ness,overshoot=50,radius=LSF_radi_us, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H) AssumeTFF().SeparateFields().SelectEvery(4,0,3) StackVertical(SeparateFields(source),last) #Weave() HDRAGC now give flickering, I will be try AutoLevels. Any suggestion and advice welcome! With kind regards yup. |
16th June 2009, 08:00 | #2 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Without sample it's a bit difficult...
LSF doesn't need radius for Smode=3 You can try this to: (instead of MDegrain3) Code:
noise.MCTemporalDenoise(settings="low",Tovershoot=2,strength=200,chroma=true) ### adjust "settings" to your video, and try with GPU=true (speedup) |
16th June 2009, 10:02 | #5 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Replace MDegrain3 & LSF by this:
Code:
MCTemporaldenoise(settings="high",chroma=true,strength=300,Tovershoot=7,flat=true,AGstr=4,bias=128) Some strong halos are present in the source, you should remove these before MCTemporalDenoise because they are over-enhanced by sharpening. Try Dehalo_alpha before or others scripts in the forum. |
17th June 2009, 07:59 | #7 | Link |
Registered User
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
|
for all!
@ LaTo my target PAL DVD 720x576 25Hz interlaced. @ scharfis_brain if i right understandt You suggest: Code:
tempgauss_mc() limitedSharpenFaster(last,smode=3,strength=LSF_sharp_ness,overshoot=50, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H) AssumeTFF().SeparateFields().SelectEvery(4,0,3) Weave() @ 2Bdecided You do not see chroma shift? yup. |
17th June 2009, 09:38 | #8 | Link |
Silver Über Alles
Join Date: Aug 2006
Location: Australia
Posts: 269
|
EDIT: Best to ignore this post, error in script.
Heres another angle, remove some noise, sharpen then re-add some noise to give it a non custard/oil painting look; http://www.users.on.net/~inet_s51/doom9/test.jpg Mdegrain2 seems to get rid of most noise and the chroma problem. The detail based grain function just adds some grain based on the detail levels. Just a suggestion, we all like different things ! Last edited by R3Z; 18th June 2009 at 08:21. |
17th June 2009, 10:26 | #9 | Link | |
Registered User
Join Date: Jan 2005
Location: cz
Posts: 704
|
you can try remove the yellow areas using
Camcorder color denoise, see http://acobw.narod.ru/ so the script can be like: Quote:
|
|
17th June 2009, 11:59 | #10 | Link | |
Registered User
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
|
Quote:
Fred.
__________________
About 8mm film: http://www.super-8.be Film Transfer Tutorial and example clips: https://www.youtube.com/watch?v=W4QBsWXKuV8 More Example clips: http://www.vimeo.com/user678523/videos/sort:newest |
|
17th June 2009, 13:24 | #11 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,389
|
The result shown by R3Z looks quite good. However, the DetailBasedGrain function looks really fishy! See:
Code:
function DetailBasedGrain(clip source, int "BM", int "dmin", int "dmax", int "grain_str", float "blur_str1",float "blur_str2", float "sharp_str") { bm=default(bm,"noise") # BlockBuster Method dmin=default(dmin,1) # Blockbuster Detail Min dmax=default(dmax,15) # Blockbuster Detail Max grain_str=default(grain_str,2) # Grain strength blur_str1=default(blur_str1,1.5) # Blur Strength blur_str2=default(blur_str2,0.75) # Blur Strength sharp_str=default(sharp_str,1) # Sharpen Strength grain_dist = source.BlockBuster(method=bm,detail_min=dmin,detail_max=dmax,variance=grain_str) difference = mt_makediff(source, grain_dist, U=1, V=1) grain_pro = difference.Blur(blur_str1).Blur(blur_str2).Sharpen(sharp_str) mt_makediff(source,grain_pro,U=2,V=2) grain_dist.addgrain(12,0,0).Blur(1) return last } source Blockbuster() addgrain() blur(1) i.e. take source, let Blockbuster add noise to flat areas, let addgrain add noise everywhere, and finally blur *everything* (including the original underlying content!) Is that really the intended operation? Oh, and ... the "BM" parameter is declared as integer variable, but it's supposed to be a string variable - see default(bm).
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
18th June 2009, 03:23 | #12 | Link | |
Silver Über Alles
Join Date: Aug 2006
Location: Australia
Posts: 269
|
Quote:
Its supposed to blur the grain added by blockbuster and then add some extra grain ontop after this to help blend in the added grain. I asked around a bit for help on how to do that and after making the function I had no comments until now ! Edit: I see whats wrong, i am making a few changes and we will see if i have learnt anything. Last edited by R3Z; 18th June 2009 at 03:55. |
|
18th June 2009, 06:37 | #13 | Link |
Registered User
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
|
I try three scripts:
first,fields ordering on bobed frames Code:
SetMemoryMax(1152) Loadplugin("MT.dll") LoadPlugin("warpsharp.dll") LoadPlugin("mt_masktools-25.dll") LoadPlugin("SSE3Tools.dll") LoadPlugin("RemoveGrainTSSE3.dll") LoadPlugin("RemoveGrainSSE3.dll") LoadPlugin("RepairSSE3.dll") Import("LimitedSharpenFaster.avsi") SetMTMode(5) LSF_sharp_ness=250 LSF_radi_us=3 LSF_sub=1.5 #first sharpening parameters (LimitedSharpenFaster) sub=subsampling W=720 H=576 DirectShowSource("tape1.avi") SetMTMode(2) source=AssumeTFF() noise=source.nnedi2(field=-2) supernoise = MSuper(noise) backward_vec1=supernoise.MAnalyse(isb = true, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec1=supernoise.MAnalyse(isb = false, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec2=supernoise.MAnalyse(isb = true, delta = 4,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec2=supernoise.MAnalyse(isb = false, delta = 4,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec3=supernoise.MAnalyse(isb = true, delta = 6,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec3=supernoise.MAnalyse(isb = false, delta = 6,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) noise.MDegrain3(supernoise,backward_vec3,backward_vec2,backward_vec1,forward_vec1,forward_vec2,forward_vec3,thSAD=400,thSADc=400,plane=4) limitedSharpenFaster(last,smode=3,strength=LSF_sharp_ness,overshoot=50, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H) AssumeTFF().SeparateFields().SelectEvery(4,0,3) Weave() Code:
SetMemoryMax(1152) Loadplugin("MT.dll") LoadPlugin("warpsharp.dll") LoadPlugin("mt_masktools-25.dll") LoadPlugin("SSE3Tools.dll") LoadPlugin("RemoveGrainTSSE3.dll") LoadPlugin("RemoveGrainSSE3.dll") LoadPlugin("RepairSSE3.dll") Import("LimitedSharpenFaster.avsi") SetMTMode(5) LSF_sharp_ness=250 LSF_radi_us=3 LSF_sub=1.5 #first sharpening parameters (LimitedSharpenFaster) sub=subsampling W=720 H=576 DirectShowSource("tape1.avi") SetMTMode(2) source=AssumeTFF() noise=source.SeparateFields() supernoise = MSuper(noise) backward_vec1=supernoise.MAnalyse(isb = true, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec1=supernoise.MAnalyse(isb = false, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec2=supernoise.MAnalyse(isb = true, delta = 4,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec2=supernoise.MAnalyse(isb = false, delta = 4,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec3=supernoise.MAnalyse(isb = true, delta = 6,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec3=supernoise.MAnalyse(isb = false, delta = 6,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) noise.MDegrain3(supernoise,backward_vec3,backward_vec2,backward_vec1,forward_vec1,forward_vec2,forward_vec3,thSAD=400,thSADc=400,plane=4) weave.nnedi2(field=-2) limitedSharpenFaster(last,smode=3,strength=LSF_sharp_ness,overshoot=50, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H) AssumeTFF().SeparateFields().SelectEvery(4,0,3) Weave() Code:
SetMemoryMax(1152) Loadplugin("MT.dll") LoadPlugin("warpsharp.dll") LoadPlugin("mt_masktools-25.dll") LoadPlugin("SSE3Tools.dll") LoadPlugin("RemoveGrainTSSE3.dll") LoadPlugin("RemoveGrainSSE3.dll") LoadPlugin("RepairSSE3.dll") Import("LimitedSharpenFaster.avsi") SetMTMode(5) LSF_sharp_ness=250 LSF_radi_us=3 LSF_sub=1.5 #first sharpening parameters (LimitedSharpenFaster) sub=subsampling W=720 H=576 DirectShowSource("tape1.avi") SetMTMode(2) source=AssumeTFF() noise=source.nnedi2(field=-2) supernoise = MSuper(noise) backward_vec1=supernoise.MAnalyse(isb = true, delta = 1,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec1=supernoise.MAnalyse(isb = false, delta = 1,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec2=supernoise.MAnalyse(isb = true, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec2=supernoise.MAnalyse(isb = false, delta = 2,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) backward_vec3=supernoise.MAnalyse(isb = true, delta = 3,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) forward_vec3=supernoise.MAnalyse(isb = false, delta = 3,blksize=8, overlap=4,dct=0, chroma=true, badSAD=1000) noise.MDegrain3(supernoise,backward_vec3,backward_vec2,backward_vec1,forward_vec1,forward_vec2,forward_vec3,thSAD=400,thSADc=400,plane=4) limitedSharpenFaster(last,smode=3,strength=LSF_sharp_ness,overshoot=50, ss_X=LSF_sub, SS_Y=LSF_sub, dest_x=W,dest_y=H) AssumeTFF().SeparateFields().SelectEvery(4,0,3) Weave() I think tat first script work better than other espicialy on static background. Also speak me that I need make before reinterlacing (or nothing)? Please explain. yup. |
18th June 2009, 08:10 | #14 | Link |
Silver Über Alles
Join Date: Aug 2006
Location: Australia
Posts: 269
|
Hopefully this is right, at least it looks that way when comparing frames between each stage of filtering (using subtract);
Code:
AVISOURCE(.... Bob(0,0.75) bobbed= last src = last super = src.MSuper() bvec2 = super.MAnalyse(isb=true, delta=2, overlap=8,blksize=16) bvec1 = super.MAnalyse(isb=true, delta=1, overlap=8,blksize=16) fvec1 = super.MAnalyse(isb=false, delta=1, overlap=8,blksize=16) fvec2 = super.MAnalyse(isb=false, delta=2, overlap=8,blksize=16) src.MDegrain2(super, bvec1, fvec1, bvec2, fvec2) LimitedSharpenFaster(last,smode=4,strength=180,overshoot=50,soft=30) comp=last function DetailBasedGrain(clip src, string "BM", int "dmin", int "dmax", int "grain_str", float "blur_str1",float "blur_str2", float "sharp_str") { bm=default(bm,"noise") # BlockBuster Method dmin=default(dmin,1) # Blockbuster Detail Min dmax=default(dmax,15) # Blockbuster Detail Max grain_str=default(grain_str,2) # Grain strength blur_str1=default(blur_str1,1.5) # Blur Strength blur_str2=default(blur_str2,0.75) # Blur Strength sharp_str=default(sharp_str,1) # Sharpen Strength grain_dist = src.BlockBuster(method=bm,detail_min=dmin,detail_max=dmax,variance=grain_str) difference = mt_makediff(src, grain_dist, U=1, V=1) grain_blur = difference.Blur(blur_str1).Blur(blur_str2).Sharpen(sharp_str) difference2=mt_makediff(src,grain_blur,U=2,V=2) Blank=BlankClip(width=src.width(), height=src.height(),pixel_type="YV12").ColorYUV(off_y=-128) PP_Grain=Blank.Addgrain(3,0.2,0.4).Blur(.8) PP=Overlay(Difference2,PP_Grain,mode="subtract") return PP } DetailBasedGrain(dmax=23,grain_str=12,blur_str2=1.5,blur_str1=1, sharp_str=0.9) substrong = Subtract(comp,last).Levels(127, 1, 129, 0, 255) StackHorizontal(src.subtitle("original"),last.subtitle("processed"),substrong.subtitle("amp dif")) |
Thread Tools | Search this Thread |
Display Modes | |
|
|