CrendKing / avisynth_filter

DirectShow filters that put AviSynth and VapourSynth into video playing
MIT License
107 stars 8 forks source link

Vapoursynth filter doesn't load property page #52

Closed Usulyre closed 3 years ago

Usulyre commented 3 years ago

Environment

Describe the bug

Vapoursynth filter won't load property page in mpc-be 1.5.7 64 bit. It doesn't load in any other player like mpc-hc either. It can be added fine but when I doubleclick on the filter in mpc-be to load the property page, player crashes and exits.

Also I wouldl like to use the filter mentioned in the github link, do you think it will work? Please test this filter thanks in advance.

To Reproduce

  1. Just add filter to mpc-be 1.5.7 portable and try to open the filter property page (double click), player exits immediately after that.
CrendKing commented 3 years ago

It looks like a registration issue. Try regsvr32 vapoursynth_filter_64.ax. It should give you an error. One possible cause is that you didn't have VapourSynth directory in your PATH, more specificallyVSScript.dll.

Usulyre commented 3 years ago

I tried regsvr32 vapoursynth_filter_64.ax and it succeeded with no error. How do I add VapourSynth directory in your PATH, more specifically VSScript.dll?

CrendKing commented 3 years ago

How do I add VapourSynth directory in your PATH, more specifically VSScript.dll?

If you used VapourSynth installer, that option should already be checked by default. How did you install VapourSynth? Portable?

Usulyre commented 3 years ago

Installed the x64 installer version, i believe the options was checked but i can try to install again

Usulyre commented 3 years ago

what options should i choose for python and vapoursynth when installing?

CrendKing commented 3 years ago

Python: First page, "Add Python 3.9 to PATH" VapourSynth: "Add VSPipe and AVFS to PATH"

Usulyre commented 3 years ago

I got it to work now. I didn't see "Add Python 3.9 to PATH" but I did see something like "add python to environmental path" or something like that. I believe I already checked that before. I did check a few options more for python - pip and py launcher and associate files with python. For vapoursynth i checked also vsrepo package manager and add new vapousynth python script to shell context men and update vsrepo package list and add vsrepo to path as well.

Going to try that filter i mentioned above. Have you tried it yet, does it work with vapoursynth filter?

Usulyre commented 3 years ago

shell context menu

Usulyre commented 3 years ago

Not sure but how does one set a target framerate with this filter?

Here is my script,

Imports

import vapoursynth as vs core = vs.get_core()

clip = VpsFilterSource clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="full")

clip = core.rife.RIFE(clip, model=0, gpu_thread=4, tta=False, uhd=False, sc=True, fp32=False, list_gpu=False)

CrendKing commented 3 years ago

First, according to the project, "Only planar RGB format with float sample type of 32 bit depth is supported." DirectShow does not support outputting planar RGB format, so we need to convert it back to YUV.

Second, your script is using sc=True, but according to the project, "You must invoke misc.SCDetect on YUV or Gray format of the input beforehand so as to set frame properties."

Third, according to the parent project, this thing "Input two frame images, output one interpolated frame image." So it can only double the fps.


Here is my script to get correct frames. However, the output rate is extremely low, making the video choppy. For example, with a 30fps video, normally AVSF deliver each frame per 33ms. Adding the RIFE() call increases that to 92ms. The renderer is forced to drop lots of frames. But my CPU and GPU are all pretty much idle. Maybe this filter is not designed for realtime use?

My script:

    sc_clip = vapoursynth.core.misc.SCDetect(VpsFilterSource)
    rgb_clip = vapoursynth.core.resize.Bicubic(sc_clip, format=vapoursynth.RGBS, matrix_in_s="470bg", range_s="full")
    rife_clip = vapoursynth.core.rife.RIFE(rgb_clip, sc=True, fp32=True)
    output_clip = vapoursynth.core.resize.Bicubic(rife_clip, format=vapoursynth.YUV420P8, matrix_s="709")
    output_clip.set_output()
Usulyre commented 3 years ago

Right I see that it is only doubling the original framerate.

Although I cannot see any difference visibly in the video, just noticed the framerate going up.

I couldn't get your script to work for some reason.

I will ask if there is a way to increase the framerate more.

My updated script

import vapoursynth as vs core = vs.get_core()

clip = VpsFilterSource clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="full") clip = core.rife.RIFE(clip, model=1, gpu_id=0, list_gpu=True, gpu_thread=4, tta=True, uhd=False, sc=False, fp32=True) output_clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709") output_clip.set_output()

Usulyre commented 3 years ago

I also noticed this:

https://github.com/HomeOfVapourSynthEvolution/VapourSynth-RIFE-ncnn-Vulkan/issues/2

I don't know myself but is that script setting a custom framerate?

CrendKing commented 3 years ago

I'm pretty sure if you use list_gpu=True, it won't do any interpolation. You can verify the theoretical output FPS in AVSF's Status page.

Usulyre commented 3 years ago

In the status page with my script unchanged the output fps is the same as input, but in mpc-be statistics page, it is doubled. When I took out list_gpu=True, video playback was choppy and slow and the framerate was like 3 fps?

CrendKing commented 3 years ago

You can see the source code that if list_gpu=True, it just invoke Text and return. It doesn't load model and do anything real processing below.

CrendKing commented 3 years ago

So if it turns out there is no issue in AVSF, I'm closing this.