View Full Version : Bob then reinterlace, or separatefields?
joshbm
20th July 2005, 03:00
I have a VHS source and I hooked up a VCR (which has S-Video out) to my 3-CCD camera (VX2000 NTSC) then firewire from the camera to my computer. I don't know if that is a bad thing to do, because I bobbed it and reinterlaced it and I get artifacts:
Unfiltered VHS (http://www.videocdpro.com/josh/vhs1.png)
SeparateFields (http://www.videocdpro.com/josh/vhs2.png)
LeakKernelBob >> Reinterlace (http://www.videocdpro.com/josh/vhs3.png)
What's happening here? The Bobbed video seems to have mice teeth (look on his face)... If there were no mice teeth, it would appear that the bobbed method looks superior.
Regards,
joshbm
scharfis_brain
20th July 2005, 05:03
Post your Script!
joshbm
20th July 2005, 15:13
SeparateFields:
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\LoadPluginEx2.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\warpsharp.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\awarpsharp.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\asharp.dll")
AVISource("uvs050719-001.AVI",fourCC="CDVC")
#Trim(6800,7099)
FixBrokenChromaUpsampling() # Fix bug with DV Codec
ReInterpolate411() # Fix NTSC DV
ColorYuv(levels="TV->PC")
mergechroma(blur(0,1))
#chromashift(c=2, l=-3)
AssumeBFF()
SeparateFields()
#GuavaComb(mode="NTSC",activation=30,recall=85,MaxVariation=40)
ConvertToYv12()
LRemoveDust_YV12(17,limit=4)
FFT3DFilter(sigma=3.0,bh=64, bw=64, sharpen=.75)
SSIQ(diameter=11,strength=50,interlaced=false)
Cnr2("xxx",4,5,255)
LimitedSharpen2( ss_x=1.0, ss_y=1.0,
\ Smode=4, strength=100, radius=2,aSharpS=1,
\ Lmode=1, wide=false, overshoot=7,
\ soft=false, edgemode=0, special=false,
\ exborder=8 )
weave()
Letterbox(8,8,8,8)
ConvertToYUY2()
Limiter(16,235,16,240)
Deinterlaced:
(fixed mice teeth by switching selectevery(4,0,3) to selectevery(4,1,4) ) -- I'm starting out with DV and then my end product is DVD, shouldn't it be selectevery(4,0,3)?
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\LoadPluginEx2.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\warpsharp.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\awarpsharp.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\asharp.dll")
AVISource("uvs050719-002.AVI",fourCC="CDVC")
#Trim(6800,7099)
FixBrokenChromaUpsampling() # Fix bug with DV Codec
ReInterpolate411() # Fix NTSC DV
ColorYuv(levels="TV->PC")
ConvertToYv12()
mergechroma(blur(0,1))
LeakKernelBob(order=0)
LRemoveDust_YV12(17,4)
FFT3DFilter(sigma=5.0,bh=64, bw=64, sharpen=0)
Cnr2("xxx",4,5,255)
SSIQ(diameter=11,strength=50,interlaced=false)
LimitedSharpen(overshoot=15,strength=300)
FFT3DFilter(sigma=2.5,bh=64, bw=64, sharpen=0)
ConvertToYUY2()
SeparateFields()
selectevery(4,1,2) #4,1,2 = DV, 4,0,3 = DVD
Weave()
AssumeFPS(29.97)
Letterbox(8,8,8,8)
Limiter(16,235,16,240)
With selectevery(4,1,4) (http://www.videocdpro.com/josh/vhs4.png)
PS- Any other filter suggestions or changes to filters? (like LimitedSharpen... or even the fft3dfilter sharpen... unsure whether it needs to sharpen more)
Regards,
joshbm
scharfis_brain
20th July 2005, 15:38
there are SEVERAL mistakes in your script.
commented script:
AVISource("uvs050719-002.AVI",fourCC="CDVC")
#Trim(6800,7099)
# really necessary ?
FixBrokenChromaUpsampling() # Fix bug with DV Codec
ReInterpolate411() # Fix NTSC DV
# needed?
ColorYuv(levels="TV->PC")
# don't use it before deinterlacing. it destroys chroma!
ConvertToYv12()
# this destroys interlaced chroma too
mergechroma(blur(0,1))
# set a lower threshold. (because default is 10)
LeakKernelBob(order=0)
# you are suffering a total 'filteritis'
# use ONE temporal denoiser (Lremovedust OR CNR2),
# and ONE spatiol denoiser (FFT3D OR SSIQ)
LRemoveDust_YV12(17,4)
FFT3DFilter(sigma=5.0,bh=64, bw=64, sharpen=0)
Cnr2("xxx",4,5,255)
SSIQ(diameter=11,strength=50,interlaced=false)
LimitedSharpen(overshoot=15,strength=300)
FFT3DFilter(sigma=2.5,bh=64, bw=64, sharpen=0)
# that's okay
ConvertToYUY2()
# this way is not clean. because leakkernelbob and other Filters are resetting the Fieldorder Flag
SeparateFields()
selectevery(4,1,2) # do NOT alter these numbers
Weave()
# why?
AssumeFPS(29.97)
Letterbox(8,8,8,8)
# again, why?
Limiter(16,235,16,240)
corrected script:
AVISource("uvs050719-002.AVI",fourCC="CDVC")
#Trim(6800,7099)
# really necessary ?
FixBrokenChromaUpsampling() # Fix bug with DV Codec
ReInterpolate411() # Fix NTSC DV
LeakKernelBob(order=0, threshold=7)
ConvertToYv12() # mergechroma(blur(0,1)) shouldn't be needed, because cnvtoyv12 blurs just enough...
### knocked out filtering. please re-think about it, please.
ConvertToYUY2()
# set the fieldorder of the input-video:
# do not try to alter the fieldorder here. it will result in a horrible reduced quality!
assumebff()
SeparateFields().selectevery(4,0,3).Weave()
Letterbox(8,8,8,8)
but without having seen the source video, I cannot judge about your filter chain...
joshbm
20th July 2005, 16:07
As always, I am grateful that I can learn from you... I appreciate it!
Here is the updated script with the output:
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\LoadPluginEx2.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\warpsharp.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\awarpsharp.dll")
LoadPlugin("J:\Program Files\AviSynth 2.5\oldplugins\asharp.dll")
AVISource("uvs050719-002.AVI",fourCC="CDVC")
#Trim(6800,7099)
FixBrokenChromaUpsampling() # why is this not important with the codec I am using (CDVC)?
ReInterpolate411()
ColorYuv(levels="TV->PC")
LeakKernelBob(order=0)
ConvertToYv12()
LRemoveDust_YV12(17,4)
FFT3DFilter(sigma=4.0,bh=64, bw=64, sharpen=0)
Cnr2("xxx",4,5,255)
SSIQ(diameter=11,strength=50,interlaced=false)
LimitedSharpen(overshoot=7,strength=150)
ConvertToYUY2()
assumebff()
SeparateFields()
selectevery(4,0,3)
Weave()
Letterbox(8,8,8,8)
Output (http://www.videocdpro.com/josh/vhs5.png)
Any other suggestions? Although I think it may need a bit more sharpening?
Regards,
joshbm
scharfis_brain
20th July 2005, 16:21
before sharpening you must remove the halos with BDH3.
joshbm
20th July 2005, 17:14
Called BDH3 directly before limitedsharpen with:
BlindDeHalo3(2.0,2.0,160)
and tweaked limitedsharpen to:
LimitedSharpen(ss_x=2.0,ss_y=2.0,overshoot=7,strength=300)
and the result. (http://www.videocdpro.com/josh/vhs6.png)
Tweaking?
Regards,
joshbm
Chainmax
20th July 2005, 17:16
If you care about details, I'd steer clear of the BDH functions. I tried a few settings on a cartoon VHS capture, they always destroyed little things (like stars on space or white eyes behind a mask) and blurred the picture too much. I'd suggest to use HQDering() or BlindPP(quant=0,cpu=0,cpu2="ooooxx") instead.
joshbm
20th July 2005, 17:40
I tried BlindPP(quant=0,cpu=0,cpu2="ooooxx") and I really don't see any results... Also HQDering(), I tried it, but it closes VirtualDub.
Regards,
joshbm
Chainmax
20th July 2005, 18:26
That's because the original HQDering script isn't compatible with the newest MaskTools. You have to change the YV12Layer line with Overlay(amplifiedmask.Invert(), thickmask, mode="multiply").greyscale (suggested by Didée). Also, bear in mind that HQDering needs Deen.
joshbm
20th July 2005, 18:53
Any more suggestions? If that's all, I believe my script is complete!
Thanks!
Joshbm
Boulder
21st July 2005, 15:11
I think that Converttoxxx() clamps to TV scale (unless told to do otherwise) so the ColorYUV line is not of much use. You probably can't prevent the clamping from happening because you do a YV12->YUY2 conversion.
You should also set the LeakKernelBob threshold to 7 as Scharfi pointed out.
mg262
21st July 2005, 15:32
I think that Converttoxxx() clamps to TV scale (unless told to do otherwise)If that's true, it should definitely be put into the docs... I know Levels behaves in the way you describe, but I didn't realise the Convert functions did. Hang on... I can doublecheck with a script...
edit:
blankclip(pixel_type= "yuy2", color = $ffffff)
levels(64,1,196,0,255,false)
#info
converttoyv12
converttoyuy2
showpixelvalues
that shows up values of 255. ( The levels was necessary because without it the blankclip only produced 235. ) But converting to RGB32 and back does apply coring -- or rather the RGB->YUV bit does. (I can't tell which colourspace the source is in.)
Have I got that right?
Boulder
21st July 2005, 15:46
In that case, I got it wrong. On a second look, it looks like the clamping occurs only with RGB-YUV conversions unless you select something else than the default.
mg262
21st July 2005, 15:52
Sorry, missed your post while I was editing. YUY2->RGB seems okay but the reverse applies coring. Similarly YV12->RGB seems okay but the reverse applies coring.
Edit: I think I see what's happening ... YUV->RGB maps (235,128,128) to (255, 255, 255)... so it's not so much a case of explicit clamping as that the RGB colour space has a lower(less white) 'maximum white level' than YUV.
Wilbert
21st July 2005, 16:44
I hope it's clear now :) To recap:
YV12 <-> YUY2 does not do any coring or scaling.
YUV <-> RGB does scaling unless you use matrix = PC.xxx.
joshbm
21st July 2005, 18:09
I would like to know one thing though... why is FixBrokenChromaUpsampling() unecessary? I was reading the FAQ and I so I am using it with CDVC codec.
Regards,
joshbm
stickboy
21st July 2005, 19:02
You should be using Reinterpolate411 instead of FixBrokenChromaUpsampling for CDVC, I think.
Here are some samples from a CDVC source:
Sample 1 (http://www.avisynth.org/stickboy/advc100-comparison/test.1.advc100.png)
Sample 1 with FixBrokenChromaUpsampling (http://www.avisynth.org/stickboy/advc100-comparison/test.1.advc100.fixupsampling(not).png)
Sample 1 with Reinterpolate411 (http://www.avisynth.org/stickboy/advc100-comparison/test.1.advc100.reinterpolated.png)
Sample 2 (http://www.avisynth.org/stickboy/advc100-comparison/test.3.advc100.png)
Sample 2 with FixBrokenChromaUpsampling (http://www.avisynth.org/stickboy/advc100-comparison/test.3.advc100.fixupsampling(not).png)
Sample 2 with Reinterpolate411 (http://www.avisynth.org/stickboy/advc100-comparison/test.3.advc100.reinterpolated.png)
If anything, FixBrokenChromaUpsampling made things worse.
joshbm
29th July 2005, 16:58
@ scharfis_brain
I was rereading this and since I am using a DV codec which works with YUY2 video, and you said that it destroys chroma to convert to YV12 then deinterlace, so how am I suppose to use MVBob() with my DV without first converting to YV12?
Regards,
joshbm
Wilbert
31st July 2005, 13:12
I would like to know one thing though... why is FixBrokenChromaUpsampling() unecessary? I was reading the FAQ and I so I am using it with CDVC codec.
Could you point me to this faq entry? Because as stickboy says this is wrong (and should be corrected):
http://www.avisynth.org/FixBrokenChromaUpsampling
I guess i should include some screenshots with this MS DV codec.
scharfis_brain
31st July 2005, 13:24
@joshbm: for PAL-DV I suggest to use my function ReYV12() which returns YUY2-decoded PAL-DV to its origin: YV12.
Lossless of course.
however, mvbob() also works quite acceptable with yuy2 input.
North2Polaris
31st July 2005, 14:08
Could you point me to this faq entry?
http://forum.doom9.org/showthread.php?p=180052#post180052
Wilbert
31st July 2005, 14:31
Thx. I added a comment to that thread. I hope bb corrects it.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.