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 > VapourSynth
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st December 2020, 18:42   #1  |  Link
vascostmr
Registered User
 
Join Date: Dec 2020
Posts: 1
Processing HI8 (deinterlace, color correction, ghost removal, upscaling)

Hi everyone, long time lurker and first time poster here. Please be kind with the newbie

I have this collection of Hi8 digitized clips that i captured back in 2006. I'm not 100% sure, but i probably encoded the files with Huffyuv:
Code:
Format                                   : AVI
Overall bit rate                         : 19.9 Mb/s
Writing library                          : VirtualDub build 23604/release

Video
Format                                   : JPEG
Codec ID                                 : MJPG
Bit rate                                 : 19.2 Mb/s
Width                                    : 768 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 4:3
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First

Audio
ID                                       : 1
Format                                   : PCM
Bit rate                                 : 705.6 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 44.1 kHz
Bit depth                                : 16 bits
Screenshot from one example source:



After some fiddling with vapoursynth i got to this stage, with which i'm farly happy with:



I'm posting here in the hope to gather some feedback. I'm not sure if the order and plugins i'm using are the best ones for my needs.

The process script is basicly:
- deinterlace with QTGMC
- shift the UV fields to center the scopes
- slightly increase saturation
- remove ghosting with LGhost
- resize with lanczos

Is there a better plugin to remove ghosting? I left some of my experiments commented in the script but the best results i got were with LGhost.
There's other kinds of "artifacts" from the tapes as well but i'm not sure what to call them. Like some "chroma drag", can i do anything about it?
I also tried some denoising plugins, but was not happy with the loss of detail.


i'll be happy with any criticism or suggestion.
Thanks for your time!

The script i used to generate the result above:
Code:
from vapoursynth import core

import havsfunc as haf
import adjust

core.std.LoadPlugin(path='/usr/local/lib/libffms2.so') 
core.std.LoadPlugin(path='/usr/local/lib/libfmtconv.so') 
core.std.LoadPlugin(path='/usr/local/lib/libmvtools.so') 
core.std.LoadPlugin(path='/usr/local/lib/libnnedi3.so') 
core.std.LoadPlugin(path='/usr/local/lib/libhistogram.so')
core.std.LoadPlugin(path='/usr/local/lib/libcnr2.so')
core.std.LoadPlugin(path='/usr/local/lib/libvideoscope.so')
core.std.LoadPlugin(path='/usr/local/lib/libdecross.so')
core.std.LoadPlugin(path='/usr/local/lib/libfluxsmooth.so')
core.std.LoadPlugin(path='/usr/local/lib/libawarpsharp2.so')
core.std.LoadPlugin(path='/usr/local/lib/libhqdn3d.so')
core.std.LoadPlugin(path='/usr/local/lib/libtemporalsoften2.so')
core.std.LoadPlugin(path='/usr/local/lib/libmotionmask.so')

video = core.ffms2.Source(source='source.avi')


####### DEINTERLACE  #######
clip = haf.QTGMC(video, Preset='Very Slow', SourceMatch=3, Sharpness=1.2, SLMode=4, TR2=2, Lossless=2, NoiseProcess=2, Denoiser="dfttest", DenoiseMC=True, NoiseTR=2, Sigma=2.0, ShowNoise=False, NoiseDeint="Generate", StabilizeNoise=True, NoiseRestore=0.1, GrainRestore=0.5, TFF=True)


####### COLOR CORRECTION #######
src_u = core.std.ShufflePlanes(clip,planes=1, colorfamily=GRAY)
src_v = core.std.ShufflePlanes(clip,planes=2, colorfamily=GRAY)
dst_u = core.std.Expr(clips=[src_u, src_v], expr=["x {} +".format(-5)])
dst_v = core.std.Expr(clips=[src_u, src_v], expr=["y {} +".format(-5)])
clip = core.std.ShufflePlanes(clips=[clip, dst_u, dst_v], planes=[0, 0, 0], colorfamily=clip.format.color_family)
clip = adjust.Tweak(clip, hue=0, sat=1, bright=1, cont=1.0, coring=False)
#clip = haf.SmoothLevels(clip, input_low=0, gamma=1.05, input_high=255, output_low=0, output_high=None, chroma=50, limiter=3, Lmode=0, DarkSTR=100, BrightSTR=100, Ecenter=None, protect=-1, Ecurve=1, Smode=2, Mfactor=2, RGmode=12, useDB=False)

####### HALO AND GHOST REMOVAL #######
clip = core.lghost.LGhost(clip, mode=[4,3], shift=[-3,4], intensity=[120,60])
#b = haf.FineDehalo(clip, rx=2.0, ry=2.0, thmi=0, brightstr=1.5)
#c = haf.FineDehalo2(clip, hconv = [-1, -1, 5, 5, 40, 5, 5, -1, -1], vconv = [-1, -1, 1, 1, 40, 1, 1, -1, -1])
#d = haf.HQDeringmod(clip, p=None, ringmask=None, mrad=1, msmooth=1, incedge=False, mthr=60, minp=1, nrmode=None, sharp=1, drrep=24, thr=12.0, elast=2.0, darkthr=None, planes=[0], show=False)
#clip = haf.FixChromaBleedingMod(clip, cx=-4, cy=-4, thr=4.0, strength=0.8, blur=False)


####### NOISE REDUCTION  #######
#a = core.cnr2.Cnr2(clip, mode="oxx", scdthr=10.0, ln=150, lm=192, un=150, um=255, vn=150, vm=255, scenechroma=False)
#b = core.dfttest.DFTTest(clip, tbsize=5, ftype=1, sbsize=16, sosize=12, sigma=100)
#c = haf.MCTemporalDenoise(clip, radius=None, pfMode=3, sigma=None, twopass=None, useTTmpSm=False, limit=None, limit2=None, post=0, chroma=None, refine=False, deblock=False, useQED=None, quant1=None, quant2=None, edgeclean=False, ECrad=None, ECthr=None, stabilize=None, maxr=None, TTstr=None, bwbh=None, owoh=None, blksize=None, overlap=None, bt=None, ncpu=1, thSAD=None, thSADC=None, thSAD2=None, thSADC2=None, thSCD1=None, thSCD2=None, truemotion=False, MVglobal=True, pel=None, pelsearch=None, search=4, searchparam=2, MVsharp=None, DCT=0, p=None, settings='low')
#d = haf.SMDegrain(clip, tr=2, thSAD=300, thSADC=None, RefineMotion=False, contrasharp=None, CClip=None, interlaced=False, tff=None, plane=4, Globals=0, pel=None, subpixel=2, prefilter=-1, mfilter=None, blksize=None, overlap=None, search=4, truemotion=None, MVglobal=None, dct=0, limit=255, limitc=None, thSCD1=400, thSCD2=130, chroma=True, hpad=None, vpad=None, Str=1.0, Amp=0.0625)


####### RESIZE / UPSCALE  #######
clip = core.resize.Lanczos(clip=clip, width=1440, height=1080)

########### CLIP LEVELS ###########
#clip = core.hist.Levels(clip)

########### CLIP SCOPES ###########
#clip=core.vscope.Scope(clip, mode="both", tickmarks=0, side="UV", bottom="Y", corner="UV")

####### OUT  #######
####### Stack Compare 2x2 (a,b,c,d) #######
#cima = core.std.StackHorizontal([a,b])
#baixo = core.std.StackHorizontal([c,d])
#out = core.std.StackVertical([cima,baixo])

####### Stack Compare a,b #######
#cima = core.resize.Bicubic(cima, width=1440, height=1080)
#out = core.std.StackHorizontal([cima, clip])

#out = core.std.StackHorizontal([cima, clip])
#out=clip
out.set_output()
vascostmr is offline   Reply With Quote
Old 27th December 2020, 06:35   #2  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Sorry, just saw this thread. Hopefully one of the film experts can help!
foxyshadis 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 00:30.


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