Example of Custom Avisynth script

Questions and answers on how to get the most out of FFAStrans
Rubikean
Posts: 9
Joined: Sun Nov 08, 2015 1:33 am

Example of Custom Avisynth script

Post by Rubikean »

Could anyone share an example of an avisynth script?
This is more for learning than anything in particular. Below is the script i have been playing with (unsuccessfully).
SCRIPT:

Code: Select all

# 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
#

AssumeFPS(59.94, 1)
hd2sd("m_clip", Interlaced=true, OutputFieldRate=29.97, OutputColorSpace=”YV12″)

# The following MUST be the last line of your script
Return m_clip
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Example of Custom Avisynth script

Post by admin »

First, you must add the "A/V Media"-decoder prior to your "Custom AviSynth scrip" preset. Then make these changes marked with an underscore:

m_clip = AssumeFPS(m_clip, 59.94, 1)
m_clip = hd2sd(m_clip, Interlaced=true, OutputFieldRate=29.97, OutputColorSpace=”YV12″)

# The following MUST be the last line of your script
Return m_clip


Remember that "m_clip" is always your source variable in AviSynth so if you want to do something with the incomming media, it is represented in the "m_clip" variable. The reason is that the "A/V Media"-decoder return the incomming media in the "m_clip" variable. The "Custom AviSynth script" just continues where "A/V Media" ended. Was that clear ? :-)

-steipal
Rubikean
Posts: 9
Joined: Sun Nov 08, 2015 1:33 am

Re: Example of Custom Avisynth script

Post by Rubikean »

Perfectly! Now let see if I can do something useful!
Thanks, Steipal.
Rubikean
Posts: 9
Joined: Sun Nov 08, 2015 1:33 am

Re: Example of Custom Avisynth script

Post by Rubikean »

Aparently, I am still missing something. I keep getting this error-

[avisynth @ 031bf560] unexpected character "�"
(C:\\20151116101339\20151118-170449-162-9ABB675A\~iodpqfd.avs, line 16, column 80)
C:\\20151116101339\20151118-170449-162-9ABB675A\~iodpqfd.avs: Unknown error occurred
,Frames,0)

Workflow is Watchfolder->Av Media (Full Decode)->Custom AviSynth Script->Custom FFMPEG->Output Folder.

This occurs even with the default Custom AviSynth script unmodified. What am I missing?
-Chris
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Example of Custom Avisynth script

Post by admin »

I'm sorry Rubikean, I did'nt see this reply until now :-(

When this error occurs, can you please send me the zipped contents of the work folder (like "C:\20151116101339\20151118-170449-162-9ABB675A") to post@ffastrans.com. If you have very large decoded files in there then just leave them out. Does your files have any strange characters in them?

-steipal
gor
Posts: 8
Joined: Mon Dec 28, 2015 12:23 pm

Re: Example of Custom Avisynth script

Post by gor »

I also tried to use hd2sd script but without success, using this file HD2SD plugin for AVS and this Custom AviSynth Script:

Code: Select all

LoadPlugin("%s_ffastrans_dir%\Processors\AVS_plugins\hd2sd_sd2hd\ColorMatrix.dll")
LoadPlugin("%s_ffastrans_dir%\Processors\AVS_plugins\hd2sd_sd2hd\FFT3DFilter.dll")
LoadPlugin("%s_ffastrans_dir%\Processors\AVS_plugins\hd2sd_sd2hd\GrapeSmoother.dll")
LoadPlugin("%s_ffastrans_dir%\Processors\AVS_plugins\hd2sd_sd2hd\TDeint.dll")
LoadPlugin("%s_ffastrans_dir%\Processors\AVS_plugins\hd2sd_sd2hd\VScope.dll")
m_clip = hd2sd(m_clip)

# The following MUST be the last line of your script
Return m_clip
The hd2sd.avsi file is in "%s_ffastrans_dir%\Processors\AVS_plugins\"
What's wrong?
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Example of Custom Avisynth script

Post by admin »

To use the hd2sd.avsi file you need to add the following line to your custom script:

Import("%s_ffastrans_dir%\Processors\AVS_plugins\hd2sd.avsi")

-steipal
gor
Posts: 8
Joined: Mon Dec 28, 2015 12:23 pm

Re: Example of Custom Avisynth script

Post by gor »

Thank you!
Unfortunately the function didn't succeed - it contain too many plugins (maybe some of them incompatible with actual Avisynth version) or wrong color profile input.
I give up!
I'm trying to find a better interlace scaler... The actual one (include in FFASTrans - Resize) create a poor image, same quality like this code too:

Code: Select all

m_clip = AssumeTFF(m_clip)
m_clip = SeparateFields(m_clip)
m_clip = BiCubicResize(m_clip, 720,288)
m_clip = Weave(m_clip)

Return m_clip
Gabi
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: Example of Custom Avisynth script

Post by admin »

Yes, I am aware of the poor quality of the inbuilt resize node and I have plans to revise it. What encoders are you using for this workflow?

-steipal
gor
Posts: 8
Joined: Mon Dec 28, 2015 12:23 pm

Re: Example of Custom Avisynth script

Post by gor »

I'm just testing - Stills PNG.
Post Reply