styler00dollar / VapourSynth-RIFE-ncnn-Vulkan

RIFE filter for VapourSynth
MIT License
97 stars 22 forks source link

vsedit closing with Release r9_mod_v4 #7

Closed Selur closed 1 year ago

Selur commented 1 year ago

Using

# Imports
import vapoursynth as vs
# getting Vapoursynth core
core = vs.core
# Loading Plugins
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/FrameFilter/RIFE/librife.dll")
core.std.LoadPlugin(path="i:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/vslsmashsource.dll")
# source: 'G:\TestClips&Co\files\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# 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)
# Setting detected color matrix (470bg).
clip = core.std.SetFrameProps(clip, _Matrix=5)
# Setting color transfer info, when it is not set
clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=5)
# Setting color primaries info, when it is not set
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)
clip = core.misc.SCDetect(clip=clip,threshold=0.300)
# adjusting color space from YUV420P8 to RGBS for vsRIFE
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
# adjusting frame count&rate with RIFE, target fps: 60fps
#clip = core.rife.RIFE(clip, model=22, fps_num=60, fps_den=1, sc=True) # new fps: 60
# adjusting output color from: RGBS to YUV420P8 for x264Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="470bg", range_s="limited", dither_type="error_diffusion")
# set output frame rate to 60fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=60, fpsden=1)
# Output
clip.set_output()

with the new Release r9_mod_v4 causes all editors I tried: https://github.com/YomikoR/VapourSynth-Editor https://github.com/Selur/vsViewer https://github.com/AmusementClub/VapourSynth-Editor to simply crash. (they simply close, no error message)

Using; VSPipe.exe c:\Users\Selur\Desktop\test_2.vpy -c y4m - | i:\Hybrid\64bit\x264.exe --demuxer y4m -o g:\Output\script.mkv works fine. With Release r9_mod_v3 the viewers work fine.

=> Any idea what might cause all the viewers I tried to crash?

I'm on Windows 11, with a Geforce RTX 4080 with v528.49 Studio drivers.

styler00dollar commented 1 year ago

yay -S vulkan-devel ffms2 vapoursynth vapoursynth-editor

import vapoursynth as vs
core = vs.core
core.std.LoadPlugin(path="/home/user/Schreibtisch/librife.so")
clip = core.ffms2.Source(source="/home/user/Schreibtisch/a.mp4", cache=False)

clip = vs.core.resize.Bicubic(clip, format=vs.RGBS, matrix_in_s="709")
clip = core.rife.RIFE(
    clip,
    model=21,
    factor_num=2,
    gpu_id=0,
    gpu_thread=4,
    tta=False,
    uhd=False,
    skip=False,
    sc=False,
)
clip = vs.core.resize.Bicubic(clip, format=vs.YUV420P8, matrix_s="709")
clip.set_output()

Speicherzugriffsfehler (Speicherabzug geschrieben)

I thought I can just update ncnn submodules and I thought it is fine since it compiled. :/ I didn't even have time to test it to be honest. After some recompiling, my conclusion is that ncnn is broken with this commit https://github.com/Tencent/ncnn/commit/1f1981052c6650408d947a4d9ba29407605cb457. https://github.com/Tencent/ncnn/commit/9cc6eb1942149be8b19bc5b703a6886c09acbb0a works fine.

Recompiling with opt_var.add_cmake_defines({'WITH_LAYER_gemm': true}) seems to work. I did not expect them to straight up break ncnn. Works on Manjaro with VapourSynth Editor from aur now. New release soon.

styler00dollar commented 1 year ago

Try again, updated release.

Selur commented 1 year ago

Updated Release r9_mod_v4 works fine. Thanks for looking into it. :)