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.

Problems in using RealESRGAN in Hybrid 2022.11.28.1
#13
Quote: If is not set the cache is created under ..
Argh, I'll adjust Hybrid so it always sets the cache path to the current temp dir.

----

The used script:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
import site
import os
# Adding torch dependencies to PATH
path = site.getsitepackages()[0]+'/torch_dependencies/'
path = path.replace('\\', '/')
os.environ["PATH"] = path + os.pathsep + os.environ["PATH"]
# Loading Plugins
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# source: 'E:\VideoTest\2022-12-17\Anime_DVD_test.mkv'
# current color space: YUV420P8, bit depth: 8, resolution: 720x536, fps: 25, color matrix: 709, yuv luminance scale: limited, scanorder: progressive
# Loading E:\VideoTest\2022-12-17\Anime_DVD_test.mkv using LWLibavSource
clip = core.lsmas.LWLibavSource(source="E:/VideoTest/2022-12-17/Anime_DVD_test.mkv", format="YUV420P8", stream_index=0, cache=0, fpsnum=25, prefer_hw=0)
# Setting color matrix to 709.
clip = core.std.SetFrameProps(clip, _Matrix=1)
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=1)
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)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0)
from vsrealesrgan import RealESRGAN
# adjusting color space from YUV420P8 to RGBH for VsRealESRGAN
clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="709", range_s="limited")
# resizing using RealESRGAN
clip = RealESRGAN(clip=clip, model=3, device_index=0, trt=True, trt_cache_path=r"E:\VideoTest\2022-12-17", num_streams=2) # 2880x2144
# resizing 2880x2144 to 1280x952
# adjusting resizing
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, range_s="limited")
clip = core.fmtc.resample(clip=clip, w=1280, h=952, kernel="lanczos", interlaced=False, interlacedd=False)
# adjusting output color from: RGBS to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_s="limited", dither_type="error_diffusion")
# set output frame rate to 25fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
seems fine to me.
Encoding call:
"D:\Programs\Hybrid\64bit\Vapoursynth\vspipe.exe" "E:\VideoTest\2022-12-17\encodingTempSynthSkript_2022-12-17@19_51_26_2510.vpy" - -c y4m | "D:\Programs\Hybrid\64bit\x265.exe" --preset fast --input - --output-depth 10 --y4m --profile main10 --b-adapt 2 --crf 20.00 --sbrc --deblock=-1:-1 --psnr --ssim --range limited --colormatrix bt709 --output "E:\VideoTest\2022-12-17\2022-12-17@19_51_26_2510_03.265"
crashes with:
x265 [error]: unable to open input file <->
No clue why it would crash since you wrote that the script works fine. (assuming you are not running out if vram)

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
RE: Problems in using RealESRGAN in Hybrid 2022.11.28.1 - by Selur - 17.12.2022, 21:21

Forum Jump:


Users browsing this thread: 1 Guest(s)