AI Upscaler

Questions and answers on how to get the most out of FFAStrans
Post Reply
PoznanskaPyra
Posts: 7
Joined: Mon Jan 04, 2021 3:02 pm

AI Upscaler

Post by PoznanskaPyra »

How do use this avisynth plugin: https://github.com/Alexkral/AviSynthAiUpscale with ffastrans?

At this moment my script looks that

Code: Select all

Import("%s_ffastrans_dir%\Processors\AVS_plugins\ai_upscaler\AiUpscale.avsi
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\AviSynth.dll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\system\DevIL.dll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\plugins\ConvertStacked.dll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\plugins\DirectShowSource.dlll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\plugins\ImageSeq.dlll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\plugins\Shibatch.dll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\plugins\TimeStretch.dll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\plugins\VDubFilter.dll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthShader-1.6.6\Shader-x64.dll")

AiUpscale(m_clip, int "Factor", string "Luma", string "Chroma", string "CResample", int "Width" , int "Height" , int "Double", string "Mode", string "CPlace", int "OutDepth")

Return m_clip
Workflow window is in attachment.

Regards
Hubert
Attachments
workflow
workflow
ups.PNG (46.71 KiB) Viewed 7119 times
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: AI Upscaler

Post by admin »

Hi PoznanskaPyra, thank you for using FFAStrans and welcome to the forum.

Try and put "m_clip = " before the function:

Code: Select all

....
m_clip = AiUpscale(m_clip, params....)
Return m_clip
Hope this helps.
-steinar
PoznanskaPyra
Posts: 7
Joined: Mon Jan 04, 2021 3:02 pm

Re: AI Upscaler

Post by PoznanskaPyra »

Thanks, but i tested this command to, and this doesn't work. In status monitor i see result "success" but file is does not encoded.

This plugin need avisynth+, ffstrans have it? If not, how add this to ffastrans?
Theoretically i added missing dll's with command "LoadPlugin".

Thanks for reply, Hubert
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: AI Upscaler

Post by admin »

Hi, yes FFAStrans includes avisynth+ as standard. Are you manually able to create a script that works? Because this is the first step in order to implement you script in FFAStrans. viewtopic.php?f=5&t=235

Also, it's good practice to export your workflow and post it here so It's much easier to see what you have done and what might be going on in your workflow.

-steinar
User avatar
FranceBB
Posts: 264
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: AI Upscaler

Post by FranceBB »

Ok, so... first of all, I don't actually understand this:

Code: Select all

LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\AviSynth.dll")
LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\system\DevIL.dll")
Avisynth.dll is the core of the frameserver, why are you trying to import Avisynth inside Avisynth? xD
Same goes for DevIL, it's the library used to handle images, you don't really have to load it as a plugin.
I'm also concerned about the other things like:

Code: Select all

LoadPlugin ("%s_ffastrans_dir%\Processors\avs_plugins\AviSynthPlus_3.6.1\x64\plugins\DirectShowSource.dlll")
leaving aside the triple "lll", what do you need DirectShowSource for? It's an indexer, its role is to make an uncompressed A/V Stream from a file, which is already been taken care of by the FFASTrans A/V Decoder (which of course has an indexer - a better one - built-in).

Code: Select all

AiUpscale(m_clip, int "Factor", string "Luma", string "Chroma", string "CResample", int "Width" , int "Height" , int "Double", string "Mode", string "CPlace", int "OutDepth")
This is wrong. "AiUpscale" is a function, which means that it expects parameters, while you're really just passing types.
This is the correct syntax:

Code: Select all

AiUpscale(m_clip, Luma="Medium", Chroma="Lanczos", Width=1920, Height=1080, Mode="Photo")
where "Width" and "Height" are your target Width and Height.
Please know that it will NOT keep AR for you, it will stretch or shrink if the AR of your target resize doesn't match the one of your input.
Last but not least, this plugin only works on GPUs through Avisynth Shader, so you should make sure that the shader is working properly before trying to use AiUpscale which uses the Shader.
I would also gently ask you to download AVSPmod and try to compile the script and let us know the error message if it doesn't work.
AVSPmod is an IDE to code in Avisynth that it's used by encoders all over the world.
Last but not least, please note that the "Custom Avisynth Script" is for expert and very advanced users who are generally encoder on their own (an encoder is an audio/video related programmer) and are used to code in Avisynth anyway, so it should be used once people are very familiar with Avisynth anyway. May I ask you what makes you wanna use AiUpscale when you have NNEDI3 (a neural network) built-in FFASTrans in the resize node?
PoznanskaPyra
Posts: 7
Joined: Mon Jan 04, 2021 3:02 pm

Re: AI Upscaler

Post by PoznanskaPyra »

This my stupid fail. I search lot's of options(thats why i have this dlls in command line and other strange things), why script dosent work. And i found... It's in workflow one processor over other processor and they hasn't connected...
Post Reply