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.

Cannot upscale MPEG to MP4
#3
(15.04.2022, 07:34)Selur Wrote: The script:
# Imports
import os
import sys
import ctypes
# Loading Support Files
Dllref = ctypes.windll.LoadLibrary("C:/Program Files/Hybrid/64bit/vsfilters/Support/libfftw3f-3.dll")
import vapoursynth as vs
# 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/AWarpSharp2/libawarpsharp2.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/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/Support/EEDI3m.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/ResizeFilter/nnedi3/NNEDI3CL.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/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# Import scripts
import edi_rpow2
import havsfunc
# source: 'G:\6002688.mp4'
# current color space: YUV420P8, bit depth: 8, resolution: 720x480, fps: 29.97, color matrix: 470bg, yuv luminance scale: limited, scanorder: bottom field first
# Loading G:\6002688.mp4 using LibavSMASHSource
clip = core.lsmas.LibavSMASHSource(source="G:/6002688.mp4")
# Setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=5)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
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 29.970
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# setting field order to what QTGMC should assume (bottom field first)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=1)
# Deinterlacing using QTGMC
clip = havsfunc.QTGMC(Input=clip, Preset="Slow", TFF=False, opencl=True) # new fps: 29.97
# make sure content is preceived as frame based
clip = core.std.SetFieldBased(clip, 0)
clip = clip[::2]
# denoising using DFTTest
clip = core.dfttest.DFTTest(clip=clip)
# contrast sharpening using CAS
clip = core.cas.CAS(clip=clip, sharpness=0.850)
clip = havsfunc.EdgeCleaner(c=clip)
# resizing using NNEDI3CL
clip = edi_rpow2.nnedi3cl_rpow2(clip=clip, rfactor=4, nns=4) # 2880x1920
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=1964, h=1080, kernel="lanczos", interlaced=False, interlacedd=False)
# letterboxing 1964x1080 to 1920x1080
clip = core.std.AddBorders(clip=clip, left=-22, right=-22, top=0, bottom=0)
# adjusting output color from: YUV420P16 to YUV420P8 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# set output frame rate to 29.970fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# Output
clip.set_output()
-> The letterboxing is wrong. AddBorders can't be used with negative values and the gui should not allow this.

Selur, thanks for the quick response!
I was able to upscale the h264 converted file on AME when I untick the Letterbox option.

I have a saved XML preset to resize SD files.
https://drive.google.com/file/d/1U6jHHRa...sp=sharing

I open Hybrid, apply the XML profile, open the original mpeg SD file 6002688.mpeg
https://drive.google.com/file/d/1hvZKmJx...R7gbV/view

and Hybrid gets stuck at about 98%, as seen on the log I shared earlier:
https://drive.google.com/file/d/1SkdPMxv...IGCxr/view

Best regards from Rio,
Reply


Messages In This Thread
Cannot upscale MPEG to MP4 - by dogmydog - 15.04.2022, 00:23
RE: Cannot upscale MPEG to MP4 - by Selur - 15.04.2022, 07:34
RE: Cannot upscale MPEG to MP4 - by dogmydog - 17.04.2022, 03:56
RE: Cannot upscale MPEG to MP4 - by Selur - 17.04.2022, 08:45
RE: Cannot upscale MPEG to MP4 - by dogmydog - 27.04.2022, 12:17
RE: Cannot upscale MPEG to MP4 - by Selur - 27.04.2022, 15:49
RE: Cannot upscale MPEG to MP4 - by Selur - 27.04.2022, 16:05
RE: Cannot upscale MPEG to MP4 - by Selur - 27.04.2022, 16:20
RE: Cannot upscale MPEG to MP4 - by dogmydog - 27.04.2022, 19:51
RE: Cannot upscale MPEG to MP4 - by Selur - 27.04.2022, 19:54

Forum Jump:


Users browsing this thread: 1 Guest(s)