Can't get avisynt workflow working

Questions and answers on how to get the most out of FFAStrans
Post Reply
Zeego86
Posts: 2
Joined: Wed Oct 30, 2024 7:46 am

Can't get avisynt workflow working

Post by Zeego86 »

Hi there,

New to the forum and already a quick question.

I am trying to build my first workflow with an avisynt processor but I can't get it to work. The workflow just gives me the error "Validate: Script error: syntax error" on the encode processor.

Anyone an idea what I am missing?

I attached the workflow in .json.
Attachments
TEST PR.json
(6.03 KiB) Downloaded 20 times
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Can't get avisynt workflow working

Post by emcodem »

Hi Zeego86,
welcome to the Forum and thanks so much for trying to use FFAStrans :D

So before any avisynth filter (e.g. Custom Avs script as in your case), in the current version you always have to insert the A/V decoding processor.
If you are familiar with avisynth you know that you must first "load" the file, in your case nothing does that at the moment. You could also do it in your processor but the A/V decoder is a much more convenient way to do it.
If you insert A/V processor before yours, what happens in the background is that A/V will generate the .avs script lines for loading the file using ffmpegsource, handling audio etc... Then when the workflow encounters your custom avs processor, it will just "stack" the 2 scripts, ending up in one longer avs script :D

One hint for debugging avs operations in ffastrans is that you can always use the "deliver" processor directly after some Avisynth processor. It will deliver the current .avs file which you can then investigate.

Also, in your Custom script you do:

Code: Select all

Import("C:\FFASTRANS\Processors\avs_plugins\maa2.avsi")
This should of course work but in order to keep ffastrans "portable", you better write it like

Code: Select all

Import("%s_ffastrans_dir%\Processors\avs_plugins\maa2.avsi")
emcodem, wrapping since 2009 you got the rhyme?
Zeego86
Posts: 2
Joined: Wed Oct 30, 2024 7:46 am

Re: Can't get avisynt workflow working

Post by Zeego86 »

Thank you very much for the information.

Unfortunately I am still getting the same error when the workflow tries to encode the media file.

I don't see anything strange in the .avs files that FFAStrans deliverd.

Code: Select all

_ffas_video = "C:\_Watchfolders\FFASTRANS\DJI_20240710175119_0003_D.MP4"
_ffas_audio = "C:\_Watchfolders\FFASTRANS\DJI_20240710175119_0003_D.MP4"
_ffas_width = 3840
_ffas_height = 2160
_ffas_work_fdr = "c:\.ffastrans_work_root\20241030-0837-3436-367f-3a681b751ccf\20241030-1333-2905-2956-7ff33b1ceebc"
Import("C:\FFASTRANS\processors\AVS_plugins\avsi\mtmodes.avsi")
LoadPlugin("C:\FFASTRANS\processors\AVS_plugins\ffms2\x64\ffms2.dll")
LoadPlugin("C:\FFASTRANS\processors\AVS_plugins\JPSDR\x64\Release_W7\plugins_JPSDR.dll")
video = FFVideoSource(_ffas_video, 0, cachefile = "c:\.ffastrans_work_root\20241030-0837-3436-367f-3a681b751ccf\20241030-1333-2905-2956-7ff33b1ceebc\1-0-0~241030133334791~33736~20241030-1328-0060-5166-8cdbbdcf3e0f~dec_avmedia~ffindex.dat", seekmode = 1)
audio = BlankClip(video, audio_rate=48000, channels=32)
Global m_clip = AudioDub(video, audio)
m_clip = ConvertToYUV422(m_clip)
m_clip = ConvertBits(m_clip, 8, dither=1)
m_clip = AssumeFieldBased(m_clip)
m_clip = propClearAll(m_clip)

#node_name:Antialiasing, id:20241030-0838-1868-1fe3-7aed6e8870e4
# Variables:
#
# m_clip		= The last returned AviSynth media
#
# Do NOT change any of the following variables!!!
# _ffas_video 	= <original video>
# _ffas_audio	= <original audio>
# _ffas_height	= <source height>
# _ffas_width	= <source width>
# _m_clip_a_channels = <total channels>
# _ffas_work_fdr	= Working folder for the workflow
#
Import("C:\FFASTRANS\Processors\avs_plugins\maa2.avsi")

c=ConverttoYUY2(m_clip)
antialiased=(c).Blur(1.25)
m_clip=Limiter(antialiased)

# The following MUST be the last line of your script
Return m_clip
emcodem
Posts: 1749
Joined: Wed Sep 19, 2018 8:11 am

Re: Can't get avisynt workflow working

Post by emcodem »

OK thanks for that, so i see 2 points of interest on first look:

1) can you check if this file exists? C:\FFASTRANS\processors\AVS_plugins\JPSDR\x64\Release_W7\plugins_JPSDR.dll
For me this does not exist and i remember @FranceBB messing around with this. If it does not exist, please create the folder "Release_W7" and copy the JPSDR.dll there.

2) do you know that your avsi works, e.g. did you get it working outside of ffastrans in your own avs script?
For me, after downloading the file (from wayback machine actually), it was polluted with some javascript at the start and an superfluous } character at the end

Best would be if you just get the script that you posted working without ffastrans e.g. in avspmod so you can identify the error.
emcodem, wrapping since 2009 you got the rhyme?
User avatar
FranceBB
Posts: 258
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: Can't get avisynt workflow working

Post by FranceBB »

Hi Zeego,
I'm happy to see that you're using the best frameserver in the world. :D
Now, the first part of the script is what FFAStrans is creating automatically with the indexing stuff, so I'm gonna ignore that and I'm gonna focus on the box you named "Antialiasing".
I can see that you're trying to convert to YUY2 (that's actually 4:2:2 interleaved which shouldn't be used any longer as pretty much everything runs on yv16 which is 4:2:2 planar), then blur the whole thing and then clipping.
I'd advise against that.

What are you trying to achieve?
If it's just to avoid introducing aliasing while downscaling and interlacing progressive UHD clips to FULL HD interlaced clips, then you could just blur vertically and it will be just fine.

To do that, in the Custom Avisynth Script box just write:

Code: Select all

ConverttoYU422(m_clip)
Blur(0, 1.58)
m_clip=last

return m_clip
also make sure to untick all the tickboxes other than the "Set as 64bit Avisynth" one, like this:
Screenshot from 2024-10-30 17-08-30.png
Screenshot from 2024-10-30 17-08-30.png (26.22 KiB) Viewed 237 times
As for clipping, you can use the Safe Color Limiter node instead and potentially you could stack it after a conditional so that it only clips when the clip is BT709 and is limited tv range, like so:
Screenshot from 2024-10-30 17-09-53.png
Screenshot from 2024-10-30 17-09-53.png (25.43 KiB) Viewed 237 times
Screenshot from 2024-10-30 17-10-21.png
Screenshot from 2024-10-30 17-10-21.png (5.1 KiB) Viewed 237 times
if the conditional is true, then it will go through the node, otherwise if the conditional is false you can just make it go through the encoding node directly and let the filter_builder take care of the conversion for you.
Post Reply