Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #1  
02-09-2024, 06:24 PM
iseevisions iseevisions is offline
Premium Member
 
Join Date: Nov 2023
Posts: 32
Thanked 0 Times in 0 Posts
As a follow-up on my capturing thread ( https://www.digitalfaq.com/forum/vid...sharper-2.html ), I'm now in the post-processing/restoring phase, using vapoursynth

Below my current script. It does the following:

1. crop noise&black borders existing in capture
2. correct the broken u,v channels at the right edge coming from the D8 camcorder during PAL Hi8 playback, different pixel width for each in my case
3. deinterlace with QTGMC
4. resizing with spline64
5. upscaling with nnedi3cl

I think I'm doing something wrong in the upscaling steps.
Disabling/enabling the nnedi3cl does give the result.
I'm resizing with spline64 because the nnedi3cl has no w/h parameters.
Should I try using nnedi3_rpow2 instead ?

Code:
# vapoursynth script originally from https://forum.videohelp.com/threads/354425-Hi8-capture-using-Digital8-camcorder-Edge-color-issues/page2?highlight=discolored+edge#post2677115
# modified & added stuff for my needs

import vapoursynth as vs
import havsfunc as haf
import adjust

core = vs.core
core.std.LoadPlugin(path="/usr/local/lib/libmvtools.so")
core.std.LoadPlugin(path="/usr/lib/x86_64-linux-gnu/libffms2.so.5")
core.std.LoadPlugin(path="/usr/local/lib/libfmtconv.so")
core.std.LoadPlugin(path="/home/render/vapoursynth/vapoursynth-temporalsoften2/build/libtemporalsoften2.so")
core.std.LoadPlugin(path="/home/render/vapoursynth/vs-miscfilters-obsolete/build/libmiscfilters.so")
core.std.LoadPlugin(path="/home/render/vapoursynth/znedi3/vsznedi3.so")
core.std.LoadPlugin(path="/home/render/vapoursynth/VapourSynth-EEDI3/build/libeedi3m.so")
core.std.LoadPlugin(path="/usr/local/lib/libnnedi3.so")
core.std.LoadPlugin(path="/home/render/vapoursynth/VapourSynth-NNEDI3CL/build/libnnedi3cl.so")

clip = core.ffms2.Source(source=file)

## a) Crop extra pixels, noise, headswitching noise included in captured format
# https://web.archive.org/web/20191026141308/https://bjohas.de/wiki/Tutorials/Video/Pixel_Aspect_Ratio
# https://web.archive.org/web/20050404092907/http://www.bbc.co.uk/commissioning/branding/picturesize.shtml
# https://bavc.github.io/avaa/artifacts/head_switching_noise.html
clip = core.std.Crop(clip, 12, 10, 6, 10)

## b) correct the broken u,v channels at the right edge coming from the D8 camcorder during PAL Hi8 playback
# https://forum.videohelp.com/threads/354425-Hi8-capture-using-Digital8-camcorder-Edge-color-issues
badPixelsv = 15
badPixelsu = 5

y = core.std.ShufflePlanes(clips=clip, planes=0, colorfamily=vs.GRAY)
u = core.std.ShufflePlanes(clips=clip, planes=1, colorfamily=vs.GRAY)
v = core.std.ShufflePlanes(clips=clip, planes=2, colorfamily=vs.GRAY)
v = core.std.Crop(v, 0, badPixelsv, 0, 0)
u = core.std.Crop(u, 0, badPixelsu, 0, 0)

# Stretch V channel to the right
extrav= core.std.CropAbs(v, 2, v.height, v.width-2).resize.Point(badPixelsv, v.height)
v = core.std.StackHorizontal([v, extrav])
# Stretch U channel to the right
extrau = core.std.CropAbs(u, 2, u.height, u.width-2).resize.Point(badPixelsu, u.height)
u = core.std.StackHorizontal([u, extrau])

# merge Y,U,V planes again
clip = core.std.ShufflePlanes(clips=[y, u, v], planes=[0, 0, 0], colorfamily=vs.YUV)

## c) Deinterlace
clip = haf.QTGMC(clip, Preset='Slower', TFF=True)

## d) Resizing/Upscaling to square pixels for 4:3
#clip = core.resize.Bicubic(clip, 768, 576)
#clip = core.resize.Bicubic(clip, 1440, 1080).std.AddBorders(240, 240, 0, 0, color=[0, 128, 128])
#clip = core.resize.Bicubic(clip, 1440, 1080)
clip = core.resize.Spline64(clip,1440,1080,matrix_s="709")
clip = core.nnedi3cl.NNEDI3CL(clip, 0, dh=False, dw=False, planes=[0, 1, 2], nsize=0, nns=4, qual=2, etype=0, pscrn=2, device=-1, list_device=True, info=True)

clip.set_output()

Last edited by iseevisions; 02-09-2024 at 06:50 PM.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Super8 noise: best Hybrid Vapoursynth filter? ThumperStrauss Restore, Filter, Improve Quality 3 01-23-2024 08:57 AM
Hybrid/Vapoursynth is crushing shadow detail? bradgranath Restore, Filter, Improve Quality 14 02-10-2022 02:19 AM
Upscaling VHS before or after capture, which is best? BIGMEDIADINO Capture, Record, Transfer 3 10-23-2020 12:51 PM
VapourSynth + QTGMC Deinterlace + Hybrid FAQ for macOS ELinder Restore, Filter, Improve Quality 0 03-16-2020 09:01 AM
VHS upscaling to HD? waloshin Capture, Record, Transfer 5 06-10-2019 03:16 PM




 
All times are GMT -5. The time now is 11:04 AM