Filter SDK

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
(Processing video)
(Processing video)
Line 21: Line 21:
 
* [[Filter_SDK/SimpleSample|SimpleSample]] has some very simple examples covering development of a filter that draws a variable sized square, in the middle of the screen. It does so for all color formats.
 
* [[Filter_SDK/SimpleSample|SimpleSample]] has some very simple examples covering development of a filter that draws a variable sized square, in the middle of the screen. It does so for all color formats.
  
One thing not covered in [[Filter_SDK/Simple_sample|Simple sample]], is how to [[Filter_SDK/Change_frame_size|change frame size]] in a filter.
+
One thing not covered in the examples, is how to [[Filter_SDK/Change_frame_size|change frame size]] in a filter.
  
 
=== Processing audio ===
 
=== Processing audio ===

Revision as of 21:52, 15 September 2013

AviSynth external Filter SDK is a package for developers to create your own filters (plugins) for AviSynth.

The package consists of:

  • this documentation text files (in HTML or Wiki format);
  • the header file 'avisynth.h' (recent version) with all declarations to include in plugin source code;
  • SimpleSample plugin source codes;
  • may be some extra files in 'Extra' folder.

Contents

Necessary software

You must have some necessary software.

Writing a plugin

We will start by writing some simple plugins to show you the basics.

Processing video

  • InvertNeg produces a photo-negative of the input clip.
  • SimpleSample has some very simple examples covering development of a filter that draws a variable sized square, in the middle of the screen. It does so for all color formats.

One thing not covered in the examples, is how to change frame size in a filter.

Processing audio

  • xxx

Also have a look at Getting started with Audio.

Runtime functions

See Non-clip sample how to create runtime AviSynth functions.

Source filters

xxx

Speeding up your plugin using assembler

You can also browse various topic on Assembler Optimizing.

Making dual plugins

There are several ways to make 2.6 plugins (that is plugins compiled with plugin api v5 or higher) work with AviSynth 2.5, provided that you use the 2.5 feature set. They are described here.

Writing utilities that access AviSynth

xxx avs2yuv, avs2avi, etc ...

What's new in the 2.6 api

...

AviSynth and its plugin api's

AviSynth exists as an instance of the ScriptEnvironment class, that implements the IScriptEnvironment interface. The IScriptEnvironment interface is defined in avisynth.h (and avisynth_c.h) and it is the only way for plugins and external applications to communicate with AviSynth. A pointer to ScriptEnvironment object is passed along to all plugins, so that they can use AviSynth facilities. Plugins are forbidden from storing this pointer. AviSynth creates one ScriptEnvironment object when Windows attempts to use AviSynth to open a script via AVIFile API.

When ScriptEnvironment is created, it checks for CPU extensions (to provide this information to filters that are able to use CPU extensions), sets up memory limits for itself and performs pre-scanning of all plugins.

AviSynth has the capability to load third-party libraries that include their own video and audio filters. It comes with two language interfaces (or plugin api's):

  • C++ API (through avisynth.h)
  • C API (through avisynth_c.h)

Although not included in AviSynth itself, several people wrote other language interfaces in Delphi, Purebasic, NET and Java. They can be found here.

The built-in filters use the C++ API. This Filter SDK (or Source Development Kit) describes how to create plugins using both interfaces.

...

There are several different Colorspaces in AviSynth. See more information about Color spaces and Working with Images.

Read more about the Internal Functions in AviSynth.

...

C++ API

The header, avisynth.h, declares all the classes, structures and miscellaneous constants that you might need when writing a plugin. All external plugins should #include it:

#include "avisynth.h"

The classes and miscellaneous constants are described in here.

C API

The header, avisynth_c.h, declares all the classes, structures and miscellaneous constants that you might need when writing a plugin. All external plugins should #include it:

#include "avisynth_c.h"

The classes and miscellaneous constants are described in here.

Some history

Ben's AviSynth Docs is the documentation written for AviSynth 1.0 by Ben Rudiak-Gould, in its original form.

See more about the modifications for AviSynth 2.5 in the AviSynth Two-Five SDK.

Please read AviSynth SDK History. ---

Other sources ???

Once you've got the basics down on AVS development (Ben's text is quite good), the SDK for VirtualDub is also a good read. Good news is you won't have to worry about writing function pointers and raw Win32; meanwhile, Avery knows his stuff when it comes to video & CPU optimization techniques, so you better pay attention.

Some video related ebooks (PDF) can be downloaded freely from Snell & Wilcox. edit - http://www.snellgroup.com/support/documentation/engineering-guides this???


License terms

Note: Avisynth Filter SDK parts are under specific SDK license terms.

Personal tools