This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[HELP] 25i to 29.97i with interpolation
#11
Hybrid is currently running, I will let you know later.

Sending you a sample clip via PM.
Reply
#12
busy today (helping out a friend) will look at it tomorrow after work
Reply
#13
Script:
# Imports
import vapoursynth as vs
import os
import sys
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow2_vs64.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/FrameFilter/Interframe/svpflow1_vs64.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/CTMF/CTMF.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/HQDN3D/libhqdn3d.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DebandFilter/Flash3kDeband/flash3kyuu_deband.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import edi_rpow2
import G41Fun
import mvsfunc
import havsfunc
# source: 'S:\Ghostwatch\Ghostwatch-In\Ghostwatch_LDPS505T_TX31-10-1992-Apple ProRes 422 HQ.mov'
# current color space: YUV422P10, bit depth: 10, resolution: 720x576, fps: 25, color matrix: 170m, yuv luminance scale: limited, scanorder: top field first
# Loading S:\Ghostwatch\Ghostwatch-In\Ghostwatch_LDPS505T_TX31-10-1992-Apple ProRes 422 HQ.mov using LWLibavSource
clip = core.lsmas.LWLibavSource(source="S:/Ghostwatch/Ghostwatch-In/Ghostwatch_LDPS505T_TX31-10-1992-Apple ProRes 422 HQ.mov", format="YUV422P10", cache=0, fpsnum=25, prefer_hw=0)
# Setting color matrix to 170m.
clip = core.std.SetFrameProps(clip, _Matrix=6)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=6)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Color Adjustment using SmoothLevels
clip = havsfunc.SmoothLevels(input=clip, input_low=0, input_high=1020, output_low=0, output_high=1020, Ecurve=0)
# cropping the video to 720x570
clip = core.std.CropRel(clip=clip, left=0, right=0, top=2, bottom=4)
# converting interlaced to half-height progressive for filtering (vsMLDegrain) (separate fields)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P10, range_s="limited")
clip = core.std.SeparateFields(clip, tff=True)
clipEven = clip[::2] # resolution 720x285
clipEven = core.std.SetFrameProp(clip=clipEven, prop="_FieldBased", intval=0)
clipOdd = clip[1::2] # resolution 720x285
clipOdd = core.std.SetFrameProp(clip=clipOdd, prop="_FieldBased", intval=0)
# adjusting color space from YUV444P10 to YUV444P8 for vsMLDegrain
clipEven = core.resize.Bicubic(clip=clipEven, format=vs.YUV444P8, range_s="limited")
# removing grain using MLDegrain
clipEven = G41Fun.MLDegrain(clip=clipEven, tr=2, rec=True, soft=[0,0,0])
# adjusting color space from YUV444P10 to YUV444P8 for vsMLDegrain
clipOdd = core.resize.Bicubic(clip=clipOdd, format=vs.YUV444P8, range_s="limited")
# removing grain using MLDegrain
clipOdd = G41Fun.MLDegrain(clip=clipOdd, tr=2, rec=True, soft=[0,0,0])
# adjusting color space from YUV444P10 to YUV444P8 for vsHQDN3D
clipEven = core.resize.Bicubic(clip=clipEven, format=vs.YUV444P8, range_s="limited")
# denoising using HQDN3D
clipEven = core.hqdn3d.Hqdn3d(clip=clipEven, lum_spac=0.00, chrom_spac=7.00, chrom_tmp=10.50)
# denoising using HQDN3D
clipOdd = core.hqdn3d.Hqdn3d(clip=clipOdd, lum_spac=0.00, chrom_spac=7.00, chrom_tmp=10.50)
# contrast sharpening using CAS
clipEven = core.cas.CAS(clip=clipEven, sharpness=0.700)
# contrast sharpening using CAS
clipOdd = core.cas.CAS(clip=clipOdd, sharpness=0.700)
# deringing using HQDeringmod
clipEven = havsfunc.HQDeringmod(clipEven, mrad=2, msmooth=2, nrmode=2, minp=2, sharp=2, darkthr=3.0)
# deringing using HQDeringmod
clipOdd = havsfunc.HQDeringmod(clipOdd, mrad=2, msmooth=2, nrmode=2, minp=2, sharp=2, darkthr=3.0)
clipEven = core.std.AddBorders(clip=clipEven, left=0, right=0, top=0, bottom=1) # add borders to archive mod 2 (Interframe) - 720x286
# adjusting color space from YUV444P10 to YUV420P8 for Interframe
clipEven = core.resize.Bicubic(clip=clipEven, format=vs.YUV420P8, range_s="limited")
# adjusting frame count with Interframe/SVP
clipEven = havsfunc.InterFrame(clipEven, NewNum=30000, NewDen=1001) # new fps: 29.97
clipEven = core.std.CropRel(clip=clipEven, left=0, right=0, top=0, bottom=1) # removing borders (Interframe) -  720x285
clipOdd = core.std.AddBorders(clip=clipOdd, left=0, right=0, top=0, bottom=1) # add borders to archive mod 2 (Interframe) - 720x286
# adjusting color space from YUV444P8 to YUV420P8 for Interframe
clipOdd = core.resize.Bicubic(clip=clipOdd, format=vs.YUV420P8, range_s="limited")
# adjusting frame count with Interframe/SVP
clipOdd = havsfunc.InterFrame(clipOdd, NewNum=30000, NewDen=1001) # new fps: 29.97
clipOdd = core.std.CropRel(clip=clipOdd, left=0, right=0, top=0, bottom=1) # removing borders (Interframe) -  720x285
clipEven = core.std.AddBorders(clip=clipEven, left=0, right=0, top=0, bottom=3) # add borders to archive mod 4 (NNEDI3(CL)) - 720x288
# resizing using ZNEDI3
# current: 720x288 target: 1492x540 -> pow: 4
clipEven = edi_rpow2.nnedi3_rpow2(clip=clipEven, rfactor=4) # 2880x1152
clipEven = core.std.CropRel(clip=clipEven, left=0, right=0, top=0, bottom=12) # removing borders (NNEDI3(CL)) -  2880x1140
# adjusting resizing
clipEven = core.fmtc.resample(clip=clipEven, w=1492, h=540, kernel="lanczos", interlaced=False, interlacedd=False)
clipOdd = core.std.AddBorders(clip=clipOdd, left=0, right=0, top=0, bottom=3) # add borders to archive mod 4 (NNEDI3(CL)) - 720x288
# resizing using ZNEDI3
# current: 720x288 target: 1492x540 -> pow: 4
clipOdd = edi_rpow2.nnedi3_rpow2(clip=clipOdd, rfactor=4) # 2880x1152
clipOdd = core.std.CropRel(clip=clipOdd, left=0, right=0, top=0, bottom=12) # removing borders (NNEDI3(CL)) -  2880x1140
# adjusting resizing
clipOdd = core.fmtc.resample(clip=clipOdd, w=1492, h=540, kernel="lanczos", interlaced=False, interlacedd=False)
# adding Grain using AddGrain
clipEven = core.grain.Add(clip=clipEven, var=0.50)
# adding Grain using AddGrain
clipOdd = core.grain.Add(clip=clipOdd, var=0.50)
# converting progressive to interlaced for 'progressive to interlaced'
clip = core.std.Interleave([clipOdd, clipEven])
clip = core.std.DoubleWeave(clip=clip, tff=True)  # resolution 1492x1080
clip = core.std.SelectEvery(clip, 2, 0)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
# adjusting output color from: YUV420P16 to YUV422P10 for ProResModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
# set output frame rate to 29.970fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# Output
clip.set_output()
Reply
#14
Okay, do that again, but before it set 'Filtering->Misc->Script->Filter interlace handling' to 'QTGMC(prest="Fast)'.
Reply
#15
In Filtering -> Misc -> Script, I do not see this option.

I see the following:

Frame Count to:
Frame Rate to:
Width to:
Height to:
Output Lumance:

OK, now I see it, in another tab Smile
Reply
#16
Wink 
Reading Miranda's requests for Selur are very strange, since the whole point of Hybrid and it's filters is to enhance old interlaced videos and make them compatible with the progressive displays. Miranda on the other hand wants to take progressive videos and interlace them? In that case I would recommend enhancing & up-scaling your videos to your desired resolution of 1080p, then stream that video to a hardware or software encoder set to 1080i. I've done that in the past to make it compatible with certain old hardware, but stopped doing it when I realized that Youtube is offering same services for free. Kind of like my old aunt wanted me to convert new digital songs to her old cassettes so she could listen to them. It was easier for me to get her a digital player then to waste time with analog tape decks Wink
Reply
#17
The video is a 1990s interlaced tv show. We want to keep the interlaced shot on video TV feel as much as possible, without making it look too "filmic".
An example:

https://conversation.which.co.uk/technol...framerate/
Reply
#18
Well my method should help you achieve that. And just FYI, you will never achieve old look and feel to the video unless you add 50Hz PAL or 60Hz NTSC flicker to the video which ruins your vision.
Reply
#19
@Miranda: I'm waiting on a script where you have 'Filtering->Misc->Script->Filter interlace handling' to 'QTGMC(prest="Fast)' enabled. Wink
Reply
#20
Script:

# Imports
import vapoursynth as vs
import os
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import sys
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SharpenFilter/CAS/CAS.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/Cnr2/libcnr2.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/HQDN3D/libhqdn3d.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/EEDI3m.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/RemoveGrain/RemoveGrainVS.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/GrainFilter/AddGrain/AddGrain.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/NEO_FFT3DFilter/neo-fft3d.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/DenoiseFilter/DFTTest/DFTTest.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/vsznedi3.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/libmvtools.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/temporalsoften.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/scenechange.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import edi_rpow2
import G41Fun
import mvsfunc
import havsfunc
# source: 'S:\Ghostwatch\Ghostwatch-In\Ghostwatch_LDPS505T_TX31-10-1992-Apple ProRes 422 HQ.mov'
# current color space: YUV422P10, bit depth: 10, resolution: 720x576, fps: 25, color matrix: 170m, yuv luminance scale: limited, scanorder: top field first
# Loading S:\Ghostwatch\Ghostwatch-In\Ghostwatch_LDPS505T_TX31-10-1992-Apple ProRes 422 HQ.mov using LWLibavSource
clip = core.lsmas.LWLibavSource(source="S:/Ghostwatch/Ghostwatch-In/Ghostwatch_LDPS505T_TX31-10-1992-Apple ProRes 422 HQ.mov", format="YUV422P10", cache=0, fpsnum=25, prefer_hw=0)
# Setting color matrix to 170m.
clip = core.std.SetFrameProps(clip, _Matrix=6)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=6)
clip = clip if not core.text.FrameProps(clip,'_Primaries') else core.std.SetFrameProps(clip, _Primaries=5)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# ColorMatrix: adjusting color matrix from 170m to 709
# adjusting luma range to 'limited' due to post clipping
clip = core.resize.Bicubic(clip=clip, matrix_in_s="170m", matrix_s="709", range_in=0, range=0)
# cropping the video to 720x572
clip = core.std.CropRel(clip=clip, left=0, right=0, top=2, bottom=2)
# converting interlaced to half-height progressive for filtering (vsMLDegrain) (QTGMC(preset="Fast"))
clip = havsfunc.QTGMC(Input=clip, Preset="Fast", Lossless=2, TFF=True) # new fps: 50
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0)
# adjusting color space from YUV422P10 to YUV444P8 for vsMLDegrain
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444P8, range_s="limited")
# removing grain using MLDegrain
clip = G41Fun.MLDegrain(clip=clip, tr=1, soft=[0,0,0])
# denoising using HQDN3D
clip = core.hqdn3d.Hqdn3d(clip=clip, lum_spac=0.00, chrom_spac=7.00, chrom_tmp=10.50)
# adjusting color space from YUV444P8 to YUV422P8 for vsCnr2
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P8, range_s="limited")
# chroma denoising using VsCnr2
clip = core.cnr2.Cnr2(clip=clip, mode="oxx")
# contrast sharpening using CAS
clip = core.cas.CAS(clip=clip)
# adjusting color space from YUV422P8 to YUV420P8 for Interframe
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# Not using InterFrame since input (50) is less or equal target (29.97) fps!
# resizing using ZNEDI3
# current: 720x572 target: 1486x1080 -> pow: 4
clip = edi_rpow2.nnedi3_rpow2(clip=clip, rfactor=4) # 2880x2288
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=1486, h=1080, kernel="lanczos", interlaced=False, interlacedd=False)
# converting progressive to interlaced for 'progressive to interlaced'
clip = core.std.SeparateFields(clip=clip, tff=True)
clip = core.std.SelectEvery(clip=clip, cycle=4, offsets=[0, 3])
clip = core.std.DoubleWeave(clip=clip, tff=True) # resolution 1486x1080
clip = core.std.SelectEvery(clip=clip, cycle=2, offsets=0) # new fps: 25
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=2)
# adjusting output color from: YUV420P16 to YUV422P10 for ProResModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, range_s="limited")
# set output frame rate to 29.970fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# Output
clip.set_output()

Error Notice:


2022-06-29 21:58:35.140
Script was successfully evaluated. Output video info:
Frames: 285144 | Time: 1:35:02.880 | Size: 1452x528 | FPS: 50/1 = 50 | Format: YUV422P10
2022-06-29 21:58:47.278
[VSE Server]: incoming connection
[VSE Server]: ConnectedState
[VSE Server]: socket is ready to be read
[VSE Server]: connection open: true
[VSE Server]: connection readable: true
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_56_52_212.vpy ### off#0#0#2#2
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_56_59_797.vpy ### off#0#0#2#2
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_57_53_341.vpy ### off#0#0#2#2
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_57_55_329.vpy ### off#0#0#2#2
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_58_29_952.vpy ### off#0#0#2#2
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_58_30_936.vpy ### off#0#0#2#2
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_58_33_085.vpy ### off#0#0#2#2
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_58_36_764.vpy ### off#0#0#2#2
2022-06-29 21:58:58.813
Failed to evaluate the script:
Python exception: There is no attribute or namespace named misc

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2886, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2887, in vapoursynth._vpy_evaluate
File "S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_58_36_764.vpy", line 54, in
clip = havsfunc.QTGMC(Input=clip, Preset="Fast", Lossless=2, TFF=True) # new fps: 50
File "C:\Program Files\Hybrid\64bit\vsscripts\havsfunc.py", line 1182, in QTGMC
if TR0 > 0: ts1 = AverageFrames(bobbed, weights=[1] * 3, scenechange=28 / 255, planes=CMplanes) # 0.00 0.33 0.33 0.33 0.00
File "C:\Program Files\Hybrid\64bit\vsscripts\havsfunc.py", line 5336, in AverageFrames
clip = SCDetect(clip, threshold=scenechange)
File "C:\Program Files\Hybrid\64bit\vsscripts\havsfunc.py", line 5651, in SCDetect
sc = sc.misc.SCDetect(threshold=threshold)
File "src\cython\vapoursynth.pyx", line 1820, in vapoursynth.VideoNode.__getattr__
AttributeError: There is no attribute or namespace named misc

2022-06-29 21:59:12.464
[VSE Server]: socket is ready to be read
[VSE Server]: connection open: true
[VSE Server]: connection readable: true
[VSE Server] - Message received: changeTo ### S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_59_12_435.vpy ### off#0#0#2#2
2022-06-29 21:59:24.797
Failed to evaluate the script:
Python exception: There is no attribute or namespace named misc

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2886, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2887, in vapoursynth._vpy_evaluate
File "S:\Ghostwatch\Ghostwatch-Temp\tempPreviewVapoursynthFile21_59_12_435.vpy", line 54, in
clip = havsfunc.QTGMC(Input=clip, Preset="Fast", Lossless=2, TFF=True) # new fps: 50
File "C:\Program Files\Hybrid\64bit\vsscripts\havsfunc.py", line 1182, in QTGMC
if TR0 > 0: ts1 = AverageFrames(bobbed, weights=[1] * 3, scenechange=28 / 255, planes=CMplanes) # 0.00 0.33 0.33 0.33 0.00
File "C:\Program Files\Hybrid\64bit\vsscripts\havsfunc.py", line 5336, in AverageFrames
clip = SCDetect(clip, threshold=scenechange)
File "C:\Program Files\Hybrid\64bit\vsscripts\havsfunc.py", line 5651, in SCDetect
sc = sc.misc.SCDetect(threshold=threshold)
File "src\cython\vapoursynth.pyx", line 1820, in vapoursynth.VideoNode.__getattr__
AttributeError: There is no attribute or namespace named misc
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)