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] Distortion of fast movement
#11
[yuv4mpegpipe @ 000002b3aada8c00] Header too large.
points to some problem with Vapoursynth.

The Vapoursynth script:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import site
from fractions import Fraction
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'C:/Program Files/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
os.environ["CUDA_MODULE_LOADING"] = "LAZY"
# loading plugins
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vs-mlrt/vsov.dll")
core.std.LoadPlugin(path="C:/Program Files/Hybrid/64bit/vsfilters/Support/akarin.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/LSMASHSource.dll")
# Import scripts
from importlib.machinery import SourceFileLoader
vsmlrt = SourceFileLoader('vsmlrt', 'C:/Program Files/Hybrid/64bit/vs-mlrt/vsmlrt.py').load_module()
import validate
# Source: 'S:\Twemlow IN for 5994 Sep 2024\Eye of Satan-NTSC-VHS-Omode3-25.mov'
# Current color space: YUV422P10, bit depth: 10, resolution: 616x462, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg, transfer: bt.709, primaries: bt.470 system m, format: prores
# Loading S:\Twemlow IN for 5994 Sep 2024\Eye of Satan-NTSC-VHS-Omode3-25.mov using LWLibavSource
clip = core.lsmas.LWLibavSource(source="S:/Twemlow IN for 5994 Sep 2024/Eye of Satan-NTSC-VHS-Omode3-25.mov", format="YUV422P10", stream_index=0, cache=0, fpsnum=25, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
# setting color transfer (vs.TRANSFER_BT709), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
# setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
if validate.primariesIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 25fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
from vsmlrt import Backend
clip = core.misc.SCDetect(clip=clip,threshold=0.150)
clip = core.std.AddBorders(clip=clip, left=12, right=12, top=8, bottom=10) # add borders to archive mod 32 (vsRIFEmlrt) - 640x480
# adjusting color space from YUV422P10 to RGBS for vsRIFEmlrt
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
# adjusting frame count&rate with RIFE (mlrt)
clip = vsmlrt.RIFE(clip, multi=Fraction(2.5), model=424, backend=Backend.OV_CPU(fp16=False), ensemble=True) # new fps: 62.5
clip = core.std.Crop(clip=clip, left=12, right=12, top=8, bottom=10) # removing borders (vsRIFEmlrt) -  616x462
# adjusting output color from: RGBS to YUV422P10 for ProResModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV422P10, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
# set output frame rate to 62.5fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=60000, fpsden=960)
# output
clip.set_output()
seems fine.

Don't see anything strange happening with the resolution. (RIFE requires mod32, which is why Hybrid pads the source and removes the padded borders)

Using latest dev with:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import site
from fractions import Fraction
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
os.environ["CUDA_MODULE_LOADING"] = "LAZY"
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vs-mlrt/vsort.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/akarin.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
from importlib.machinery import SourceFileLoader
vsmlrt = SourceFileLoader('vsmlrt', 'F:/Hybrid/64bit/vs-mlrt/vsmlrt.py').load_module()
import validate
# Source: 'G:\TestClips&Co\files\test.avi'
# Current color space: YUV420P8, bit depth: 8, resolution: 640x352, frame rate: 25fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg, format: MPEG-4 Visual
# Loading G:\TestClips&Co\files\test.avi using LWLibavSource
clip = core.lsmas.LWLibavSource(source="G:/TestClips&Co/files/test.avi", format="YUV420P8", stream_index=0, cache=0, fpsnum=25, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
# setting color transfer (vs.TRANSFER_BT601), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT601)
# setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
if validate.primariesIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 25fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
from vsmlrt import Backend
clip = core.misc.SCDetect(clip=clip,threshold=0.100)
# adjusting color space from YUV420P8 to RGBS for vsRIFEmlrt
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
# adjusting frame count&rate with RIFE (mlrt)
clip = vsmlrt.RIFE(clip, multi=Fraction(2.4), model=424, backend=Backend.ORT_CPU(fp16=False), ensemble=True) # new fps: 60
# adjusting output color from: RGBS to YUV420P10 for NVEncModel
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
# set output frame rate to 60fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=60, fpsden=1)
# output
clip.set_output()
causes no problem and uses (aside from the Fraction) the same RIFE call:
clip = vsmlrt.RIFE(clip, multi=Fraction(2.4), model=424, backend=Backend.ORT_CPU(fp16=False), ensemble=True) # new fps: 60

=> What does the Vapoursynth Preview say?
Reply
#12
Audio - OK
Video finished with exit code -22
Crashed with exit staus 0

Perhaps it's because the PC can't handle RIFE?
Reply
#13
Quote:What does the Vapoursynth Preview say?
Huh Huh

Quote:Perhaps it's because the PC can't handle RIFE?
To know that, I asked you what the Vapoursynth Preview says. Does it properly show the preview or does it show an error message?
Also using another backend might work. Not all backends work on all machines.

Cu Selur
Reply
#14
It properly shows a preview.

I just tried again, but same error messages and crash.

This is using an old HP Z420 Workstation, I guess the spec is not good enough?
Reply
#15
If the Vapoursynth Preview works fine with your settings, then my guess would be that you are running out of RAM or VRAM or something is interfering with the encoding.

"HP Z420 Workstation" that doesn't really say much.
This you try different backends, like I suggested?
Reply
#16
OK, looks like I need a better PC, after a re-boot I now see this:

Failed to evaluate the script:
Python exception: RIFE: invalid GPU device

Traceback (most recent call last):
File "src\\cython\\vapoursynth.pyx", line 3365, in vapoursynth._vpy_evaluate
File "src\\cython\\vapoursynth.pyx", line 3366, in vapoursynth._vpy_evaluate
File "M:\TwemlowTEMP\tempPreviewVapoursynthFile18_05_49_069.vpy", line 41, in
clip = core.rife.RIFE(clip, model=66, fps_num=60, fps_den=1, gpu_id=1, gpu_thread=4, sc=True) # new fps: 60
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src\\cython\\vapoursynth.pyx", line 3101, in vapoursynth.Function.__call__
vapoursynth.Error: RIFE: invalid GPU device
Reply
#17
"gpu_id=1"<- this will select the second gpu in your system, by default gpu_id=0,...
Reply
#18
Is this "force gpu" = 1? I think that was the setting I tried.
Reply
#19
Yes, with force gpu you force a specific gpu,...
Reply
#20
The only one that works is SVP - MVTools looks poor, FrameRateConverter also not so good, and RIFE crashes. I will need to look for a better PC, but I have no idea what sort of specs I would need to properly run RIFE?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)