Avisynth support in Purebasic

Developed or developing a new product in PureBasic? Tell the world about it.
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Avisynth support in Purebasic

Post 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.
Check out OOP support for PB here!
dige
Addict
Addict
Posts: 1256
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Post by dige »

Very interesting! thanks inc.
Coolman
Enthusiast
Enthusiast
Posts: 103
Joined: Sat Sep 03, 2005 4:07 pm

Post by Coolman »

Good jobs, thanks :)
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Avisynth support in Purebasic

Post 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.
Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Avisynth support in Purebasic

Post 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
Check out OOP support for PB here!
Post Reply