Page 1 of 1

Avisynth support in Purebasic

Posted: Sat Jun 02, 2007 3:33 pm
by inc.
Avisynth is a powerful videoframeserver which does base on a hughe amount of available plugins for videoediting.

Such plugins till now have only been developed in C++ and C.
I wanted to make PB coders also be able to do some nice image processing development on Avisynth and so I did port the C interface of Avisynth to Purebasic, including an example dll code and of course an example mini appl. where VideoInfos can be received. Means where its shown how to invoke avisynth commands directly without the VFW Avifile Interface.

The Downloads:

Avisynth.pbi <-- The header which always has to be 'included'

invert_inplace.pb <-- a simple sample plugin where the videostream gets inverted

avisynth_get_video_info.pb <-- a mini sample appl. where you can receive the videoinfos


Avisynths main page: http://avisynth.org
The filter SDK: http://avisynth.org/mediawiki/Filter_SDK
The dev. forum: http://forum.doom9.org/forumdisplay.php?f=69

Kevin Atkinsons API explanation of the Avisynth C Interface (and therefore also the PureBasic port): http://kevin.atkinson.dhs.org/avisynth_c/

If you do encounter bugs, please feel free to check the PB port by comparing to the original avisynth_c.h headerfile


Well by getting into videoimage processing maybe some people can proofe their skills on programming "fast-code" for image processing routines :)

Enjoy,
Inc.

Posted: Sun Jun 03, 2007 11:05 am
by dige
Very interesting! thanks inc.

Posted: Sun Jun 03, 2007 12:23 pm
by Coolman
Good jobs, thanks :)

Re: Avisynth support in Purebasic

Posted: Fri Jan 28, 2011 10:23 pm
by Zach
Hi, Inc.

I finally started digging into your example and looking at it. However when I went to compile the example program, the wrapper (Avisynth.pbi) throws an error on compilation. I am using PureBasic x32 versions 4.51
PureBasic Compiler wrote: [COMPILER]Line 116: Object mix (numeric, string, array, list and map) is not allowed in StructureUnion
Here is the Structure/Union block generating the error.

Code: Select all

108: Structure sAVS_Value 
109:   type.w;  // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
110:   array_size.w
111:   StructureUnion
112:   *clip ; // do not use directly, use avs_take_clip
113:   boolean.b
114:   integer.l
115:   floating_pt.f
116:   string.s
117:   *array.sAVS_Value 
118:   EndStructureUnion
119: EndStructure


Sorry to bug you about this, I know you probably haven't touched in years.

Re: Avisynth support in Purebasic

Posted: Mon Jan 31, 2011 6:06 pm
by inc.
Seems that in structures strings aren't supported beside numerical elements anymore.
But as its a simple common pointer to a char array you can change the purebasic string element it to a pointer element of the structure.
108: Structure sAVS_Value
109: type.w; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong
110: array_size.w
111: StructureUnion
112: *clip ; // do not use directly, use avs_take_clip
113: boolean.b
114: integer.l
115: floating_pt.f
116: *string
117: *array.sAVS_Value
118: EndStructureUnion
119: EndStructure
So by using PeekS or PokeS on that pointer you can change the string contend