User Tools

Site Tools


Custom Avisynth Filter


In most cases when a built in filter is not able to do what you like, you can use a custom avisynth filter to come around this problem. Look up AVISynth in the internet if you do not know what it is.

Example usage

Example Custom Avisynth script for watermark (or burn in image) with inpoint:

m_clip = ConvertTo8Bit(m_clip)
m_clip = ConvertToRGB32(m_clip)
watermark = ImageSource("\\storage\path_with_pictures\picture.jpg", start=20, end=m_clip.FrameCount, pixel_type = "rgb32")
watermark_clip = Layer(m_clip, watermark, "add", 257, x=Round(0), y=Round(0))
m_clip = ConditionalFilter(m_clip, watermark_clip, m_clip, "current_frame", ">", "20")
m_clip = ConvertToYUV444(m_clip)
Return m_clip 

For AVISynth script developers

Your script must always “return m_clip” at the end. The source file is already “loaded” and contained in m_clip. FFAStrans will automatically add the following lines BEFORE your “custom script” (that you input to the AVISynth processor in the FFAStrans workflow manager)

_ffas_video = "___SOURCEFILE___.mpg"
_ffas_audio = "___SOURCEFILE___.mpg"
_ffas_width = 1280
_ffas_height = 720
_ffas_work_fdr = "___WORKDIR___"
video = FFVideoSource(_ffas_video, 0, cachefile = "___WORKDIR___\1~191226092340598~20356~20191226-0050-4328-3535-e426c93090bc~dec_avmedia~ffindex.dat", seekmode = -1)
audio_null = BlankClip(length=299, width=1280, height=720, color=$000000, channels=1, audio_rate=48000, fps=30)
audio_1 = audio_null
audio_2 = audio_null
audio_32 = audio_null
audio = MergeChannels(audio_1, audio_2, audio_3, audio_4, audio_5, audio_6, audio_7, audio_8, audio_9, audio_10, audio_11, audio_12, audio_13, audio_14, audio_15, audio_16, audio_17, audio_18, audio_19, audio_20, audio_21, audio_22, audio_23, audio_24, audio_25, audio_26, audio_27, audio_28, audio_29, audio_30, audio_31, audio_32)
Global m_clip = AudioDub(video, audio)
m_clip = ConvertToYUV422(m_clip)
m_clip = ConvertBits(m_clip, 8)
m_clip = AssumeFieldBased(m_clip)

Original Manual

With this editor you can create your own custom AviSynth scripts. When using the "Stills" or "A/VMedia" decoders, FFAStrans will return 'm_clip', which has video size and frame rate of the original source, and one audio stream holding all channels. Other properties might have changed depending on the decoder setting.

Set as 64 bit AviSynth

Tells the the workflow to use 64 bit processing on subsequent nodes. Note that this option has no effect if you already have used a "A/V Media"-decoder prior to this node.

Check this option ONLY if you know your workflow and plugins will support 64 bit processing. If you're using the QTSource AviSynth plugin, which is only 32 bit, then leave this option off.

Skip script verification

This option will skip the script verification which normally occurs in some filters that must know some of the input file media properties in order to adapt to the input file. However, no such logic exist in this filter so verifying can safely be skipped. Errors will still be picket up by a subsequent encoder.

Adapt color space to video size

Enabling this will enable FFAStrans to attempt to set correct color space based on frame size of the output from the script.

Use this option only if you convert colors pace yourself in the script to match the output frame size. Consider as experimental.

Clear media properties

This will clear all media properties. This is to be compatible with old AviSynth behavior that did not support any media properties.

2019/12/09 16:19
processors/filters_custom_avs.txt · Last modified: 2022/02/13 10:51 by benjamin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki