Log in

View Full Version : How to run Avisynth scripts within VapourSynth


Pages : 1 [2]

gmail123
3rd February 2023, 10:43
I'm using avs 3.72, and my avs script works fine. What is the problem?

gmail123
3rd February 2023, 14:59
modify:
c = core.avsw.Eval('AddAutoloadDir("C:\Program Files (x86)\AviSynth+\plugins+") AiUpscale (Luma = "hq")', clips=[ret], clip_names=["last"],slave_log=r"D:\x.txt")
but:
AddAutoloadDir("C:\Program Files (x86)\AviSynth+\plugins+") AiUpscale (Luma = "hq") [observe @ :503] end eval script
[send_async @ :465] async send command type 1: 4294967295
[run_loop @ :135] class avs::AvisynthError_: Script error: There is no function named 'ConvertToShader'.
(C:/Program Files (x86)/AviSynth+/plugins+/AiUpscale.avsi, line 292)
(C:/Program Files (x86)/AviSynth+/plugins+/AiUpscale.avsi, line 294)
(C:/Program Files (x86)/AviSynth+/plugins+/AiUpscale.avsi, line 146)
(C:/Program Files (x86)/AviSynth+/plugins+/AiUpscale.avsi, line 147)

ConvertToShader is a command for the AviSynthShader plugin, but I've put it in the plugin directory and avs works fine. How do I call AviSynthShader?
AiUpscale
This is a script to test some Super-resolution convolutional neural networks implemented as hlsl pixel shaders, through Avisynth Shader

poisondeathray
3rd February 2023, 15:35
I'm using avs 3.72, and my avs script works fine. What is the problem?

The other option is to use AVISource to load the working .avs directly

gmail123
3rd February 2023, 15:49
The other option is to use AVISource to load the working .avs directly
my working .vpy:

ret=core.lsmas.LWLibavSource(r'C:\Users\Administrator\Desktop\1.mp4')
core = vs.core
ret =scunet(ret,model=3)
aiupscale() #avs script
ret = core.resize.Bicubic(ret, format=vs.YUV420P8, matrix_s="470bg", range_s="full")
ret.set_output()

how to use AVISource to load the working .avs directly?thx:scared:

poisondeathray
3rd February 2023, 15:58
my working .vpy:


ret=core.lsmas.LWLibavSource(r'C:\Users\Administrator\Desktop\1.mp4')
core = vs.core
ret =scunet(ret,model=3)
aiupscale() #avs script
ret = core.resize.Bicubic(ret, format=vs.YUV420P8, matrix_s="470bg", range_s="full")
ret.set_output()


how to use AVISource to load the working .avs directly?thx:scared:


AVISource won't work for the order that you have that script.

AVISource can only load .avs scripts in a .vpy script as the output node of the avs script, so it must be first filter in the vpy script. You cannot apply in the middle of a vpy script

If you use scunet, then avs aiupscale, you would need to import the vpy into the avs script eg. using vapoursoursce, then apply aiupscale, then import that back into the vpy. The problem is RGBS cannot be sent through vapoursource - not a supported pixel format. (vs-scunet requires RGBS or RGBH). So you'd have to downconvert after scunet in the vpy script output node, (before vapoursource in the avs script) to a supported pixel format in the AIUpscale avs script . I would use the output node of avisynth instead of sending back to vapoursynth in that case. All the piping has overhead (slow)

gmail123
3rd February 2023, 16:03
AVISource won't work for the order that you have that script.

AVISource can only load .avs scripts in a .vpy script as the output node of the avs script, so it must be first filter in the vpy script. You cannot apply in the middle of a vpy script

If you use scunet, then avs aiupscale, you would need to import the vpy into the avs script eg. using vapoursoursce, then apply aiupscale, then import that back into the vpy. The problem is RGBS cannot be sent through vapoursource - not a supported pixel format. (vs-scunet requires RGBS or RGBH). So you'd have to downconvert in the vpy script before vapoursource in the AIUpscale avs script if sending back to vapoursynth, or use the output of avisynth instead of sending back to vapoursynth
how to import the vpy into the avs script? I can import the avsscript into the vs script

poisondeathray
3rd February 2023, 16:07
how to import the vpy into the avs script? I can import the avsscript into the vs script

Vapoursource - VSImport() or VSEval()

gmail123
3rd February 2023, 16:09
Vapoursource - VSImport() or VSEval()

yes ,i will try it:D