Log in

View Full Version : VHS capture filtering and deinterlacing for hi bit encoding


yup
28th April 2017, 12:58
Hi all!
I am new in hi bit video (higher than 8 bit per chanel). My source VHS capture, not very good quality, indoor shooting with low level lighting. Now I try to hi bit depth. I am using two stage filtering.
First denoising and autoscaling:
AVISource("resurection.avi")#.Trim(10000,11000)
ConvertToYV16(interlaced=true)
AssumeTFF()
GetChannel(1)
nnedi3(field=-2, nsize=3, nns=3,threads=2)
ConvertBits(16).Converttostacked()
e=SelectEven()
o=SelectOdd()
Y=e.KNLMeansCL(device_type="GPU",d=2,h=6, lsb_inout=true)
U=e.UToY8().KNLMeansCL(d=2, device_type="GPU",h=9, lsb_inout=true)
V=e.VToY8().KNLMeansCL(d=2,device_type="GPU",h=9, lsb_inout=true)
ef=YToUV (U, V, Y)
Y=o.KNLMeansCL(device_type="GPU",d=2,h=6, lsb_inout=true)
U=o.UToY8().KNLMeansCL(d=2, device_type="GPU",h=9, lsb_inout=true)
V=o.VToY8().KNLMeansCL(d=2,device_type="GPU",h=9, lsb_inout=true)
of=YToUV (U, V, Y)
Interleave(ef,of)
ConvertFromStacked()
src = last
crp=src.Crop(16,12,-16,-12)
src=src.ConvertToStacked()
crp=crp.ConvertToStacked()
AutoAdjust(src, external_clip = crp, auto_gain=true, auto_balance=true,high_bitdepth=true)
DelayAudio(-0.04)
ConvertToYUY2(interlaced=false)
Prefetch(2)
Using Virtualdab save avi file.
Please check code above I am not made error? Trick with stacked video. Source realy noisy, You can see big value for h in non local means filter, but details practically untouched.
Autoadjust also make work fine, I have professional photo the same that video and colours very close. Using high bit depth especially increase contrast in dark area and colours more saturated. Any advice for this part welcome.
Second deinterlacing and downsampling:
AVISource("testn.avi")
convertToYV16(interlaced=false)
Edibob=ConvertFromStacked()#.ConvertBits(10)
Edibob=Edibob.AssumeTFF()
Edibob.SeparateFields().SelectEvery(4,0,3).Weave().AssumeTFF()
QTGMC(Ediext=Edibob, Edithreads=1,chromamotion=false, dct=5,search=5)
SelectEven()
Crop(16,12,-16,-12)
Spline36Resize(640,480)
ConvertBits(10)
Prefetch(8)
For this part simpler question, if I want encoding at 10 bit I could make all process at 16 bit and at end convert to 10 bit or processing at 10 bit? I try comparing and do not see visual difference, fps little higher.
yup.