HolyWu / vs-rife

RIFE function for VapourSynth
MIT License
94 stars 7 forks source link

Requesting example vapoursynth script #7

Closed styler00dollar closed 2 years ago

styler00dollar commented 2 years ago

I tried to create a valid script for a while, but I can't make it run.

from vsrife import RIFE
import vapoursynth as vs
core = vs.core
core.std.LoadPlugin(path='/usr/lib/x86_64-linux-gnu/libffms2.so')
clip = core.ffms2.Source(source='test.webm')
print(clip) # YUV420P8
clip = vs.core.resize.Bicubic(clip, format=vs.RGBS)
print(clip) # RGBS
clip = RIFE(clip)
clip.set_output()
vspipe --y4m inference.py - | x264 - --demuxer y4m -o example.mkv

Error: Failed to retrieve frame 0 with error: Resize error: Resize error 3074: no path between colorspaces (2/2/2 => 0/2/2). May need to specify additional colorspace parameters.

Can I get an example that should actually work?

HolyWu commented 2 years ago

Either matrix_in or matrix_in_s needs to be set if no matrix is specified in the frame's properties when converting to RGB. Refer to http://www.vapoursynth.com/doc/functions/video/resize.html for more details.

clip = vs.core.resize.Bicubic(clip, format=vs.RGBS, matrix_in_s='709')
styler00dollar commented 2 years ago

Thank you. I somehow overlooked this. Now it works.

from vsrife import RIFE
import vapoursynth as vs
core = vs.core
core.std.LoadPlugin(path='/usr/lib/x86_64-linux-gnu/libffms2.so')
clip = core.ffms2.Source(source='test.webm')
clip = vs.core.resize.Bicubic(clip, format=vs.RGBS, matrix_in_s='709')
clip = RIFE(clip)
clip = vs.core.resize.Bicubic(clip, format=vs.YUV420P8, matrix_s="709")
clip.set_output()