How to load Avisynth scripts into TVEAI

TVEAi 3,x doesn’t accept Avisynth scripts (AVS) anymore because of some legal issues, but with AVFS (Avisynth.Virtual.File.System) and Pismo File Mount you can load your Avs scripts into TVEAi again.
So, let’s do it…
1º Download AVFS… https://turtlewar.org/avfs/
2º Download Pismo File Mount Audit Package build 192… Pismo Technic Inc. - Download
3º Unzip avfs_1.0.0.6.zip and copy avsf.exe to C:\Windows
4º Install Pismo File Mount Audit Package build 192
5º Open a CMD prompt in the folder where you have the AVS scrip and write; start avfs somescript.avs
Press enter and wait some time.
Once you have mounted an AVS, you can access the output of the script through the mount point in the c:\volumes folder. So for the above example, you would go to c:\volumes\somescript.avs . The script output will be there as somescript.avi.
You could also associate avfs.exe with the avs file extension
in explorer, to allow you to more conveniently mount avfs files.
Any problems you may face read the Readme file included in the AVSF.zip

Vapoursynth users… Output — VapourSynth R63 documentation

5 Likes

Akin to my topic on the matter:

You can also compile a version of ffmpeg with –enable-vapoursynth, btw. Then you can do stuff like

ffmpeg.exe -f vapoursynth -i "input.vpy"

Topaz’ ffmpeg doesn’t have it (what a surprise); but I prefer the AVFS system myself anyway, as it allows you to seek (transparently) with TVAI, for your preview needs.

2 Likes

If command line operations can be done directly, it is also possible to read avs by pipe.
I use avs2pipemod, but avs2yuv, etc. would work as well.

avs2pipemod64 -y4mp input.mkv | "C:\Program Files\Topaz Labs LLC\Topaz Video AI\ffmpeg" -y -color_primaries 1 -color_trc 1 -colorspace 1 -color_range tv -i pipe: -sws_flags spline+accurate_rnd+full_chroma_int -filter_complex tvai_up=device=-2:model=prob-3:scale=2:compression=0.24:details=0.24:blur=0:noise=0.12:halo=0:preblur=0,scale=w=3840:h=2160:out_color_matrix=bt709 -color_primaries 1 -color_trc 1 -colorspace 1 -color_range tv -an -c:v prores_ks -profile:v 3 -vendor apl0 -pix_fmt yuv422p10le output.mov

The GUI is still unreliable due to the long history of color space processing problems (BT601, BT709), so I stick to the CLI :upside_down_face:

3 Likes

Thanks for the great addition to this topic Tico :+1: Always learning…
The processing speed of the CLI is faster or the same of the GUI ?

1 Like

I don’t know the difference in speed between GUI and CLI, as I have never actually measured it.
However, TVAI 3.x consists of FFMPEG with a built-in TVAI filter and a GUI wrapper, and it relies on FFMPEG for input, conversion, and output.
Therefore, there should be no difference in speed between GUI and CLI.

The advantage of the CLI is that you can freely combine FFMPEG’s built-in filters, specify the color space, and configure other settings that cannot be controlled in detail by the GUI.

Note that there was almost no speed difference between reading avs(QTGMC&ColorSpaceConvert) with pipe and reading video files directly with FFMPEG.
This may change in the case of heavy avs.

3 Likes

Yeah… Just getting errors like :
Script error: There is no function named ‘QTGMC’.
(D:\Video TEMP\saga.avs, line 3)

Any ideas ?

In your Avs script try to add the full path to all the plugins and Avsi scripts needed to run QTGMC… Example: Import(“C:\Program Files (x86)\AviSynth+\plugins64+\QTGMC.avsi”)

Tried that now, but getting this error :
Script error: syntax error
(D:\Video TEMP\saga.avs, line 3, column 2)

Try this way…; Import(“C:\Program Files (x86)\AviSynth+\plugins64+\QTGMC.avsi”)

That worked !
But how do I set the QTGMC parameters ?
Do you have a parameter sample ? :slight_smile:

A simple one that i use… QTGMC(Preset=“Slow”, ediThreads=2)
There are more advanced parameters with filtering and such but for that i advice you to use Hybrid by Selur and learn how to work with it.

1 Like

Google it. No, seriously, QTGMC and its parameters are easy to find; see QTGMC

A small VapourSynth example:

import vapoursynth as vs
import havsfunc as haf

core = vs.core
core.max_cache_size = 65536

vid = core.dgdecodenv.DGSource (r'c:\jobs\min.dgi')
vid = core.std.CropRel (clip=vid, left=0, right=0, top=130, bottom=146)
vid = haf.QTGMC (vid, InputType=1, Preset="Very Slow", TR2=3, EdiQual=2, EZDenoise=0.2, NoisePreset="Slower", TFF=True, Denoiser="KNLMeansCL")
vid = core.std.AddBorders (clip=vid, left=0, right=0, top=130, bottom=146)

vid.set_output ()

Wasn’t the parameters I was wondering about, it was how to input them after doing the import

Well, with AVFS system, as outlined in this topic. :slight_smile: You can simply mount your Avi- or VapourSynth script into the file system, after which you can load it into TVAI.

in the avs file i’ve tried :
Import(“C:\Program Files (x86)\AviSynth+\plugins64+\QTGMC.avsi”)
QTGMC(Preset=“Slower”, InputType=0, FPSDivisor=1)

That gives me the error :
I don’t know what ‘AvsPlusVersionNumber’ means.
(C:\Program Files (x86)\AviSynth+\plugins64+\QTGMC.avsi, line 208)
(D:\Video TEMP\saga.avs, line 4)

:confused:

Thanks, was looking for this. unfortunately it does not seem to work with any of my avs files.

The error log under c:\volumes tells me it cannot find any of the avisynth plugins i’ve installed. In my case it tells me that FFmpegSource2 is missing.

Script error: There is no function named 'FFmpegSource2'.

how can i fix this? is this limited to 32 bit Avisynth plugins?

The Avfs posted is outdated and with a lot of problems to load 64bit plugins. Please download Avfs for Vapoursynth… Download VapourSynth64-Portable-R45.7z - VideoHelp
Inside of the 7z you can find a working Avfs. Just copy it and replace the old Avfs. It works perfectly with 64bit Avisynth scripts.
Later I will try to update my topic with this new info.
You’re welcome

1 Like

Thanks for the help :slight_smile: I was able to replace the avfs.exe and the error message is gone but I do not get an avi file in the c:\volumes directory. am I missing something?

Not in the c:\volumes directory but inside the directory with the name of Avisynth script… Ex. c:\volumes\AvisynthScriptName.avs
Screenshot 2023-02-27 210329

there is just an empty error.log file and a copy of the .avs file but no avi file :frowning:
image