View Full Version : Use VDub filters in other programs
kovi
8th January 2005, 16:09
Hi.
Is there a way to use virtualdub filters with my own programs? I need fast and HQ resample and rotation filters... The wellknown "resample.pas" is quite slow compared to vdub.
I use Delphi. Please help.
KoVi
emilytzgyr
28th July 2005, 12:48
Hi,
I'm also interested in using the resizing algorithms of vdub in my program. How can I do this (besides copying and changing the vdub sources to my needs)?
fccHandler
29th July 2005, 18:56
It's not as easy as it sounds. The filters' exported functions use the C calling convention (cdecl) and they are allowed to call back into VirtualDub. Parameters and function pointers are passed in two large structures, and both of them appear to be parts of a larger linked list (i.e., they point to chains of identical structures) which VirtualDub maintains internally. I suspect you would have to emulate a lot of VirtualDub's internal filter management to be able to load any .vdf file into your own program and make it work.
If you really want to tackle it, start by studying the FilterSDK (http://www.virtualdub.org/filtersdk) and VirtualDub's source code (http://virtualdub.sourceforge.net/). Basically your task is to "fool" the filter into thinking that your program is VirtualDub.
Note that the actual "resize" filter is internal to VirtualDub, so first you will have to externalize it into a .vdf to be able to use it outside of VirtualDub. That shouldn't be too difficult, but I've never tried it so I'm not sure.
At the end of the day, it may actually be easier just to cut and paste the code into your program and change it to your needs, if "resize" is the only filter you're interested in using.
Guest
29th July 2005, 19:01
You can look at Avisynth's code for LoadVirtualDubPlugin(), because it is able to load and run VirtualDub filters.
I have an external version of the resize filter called Smart Resize at my web site.
emilytzgyr
29th July 2005, 21:17
I studied virtualdub's resampling code today and it is quite easy to use. It took me about 2 hours to resize a .bmp image and save it with its new size. Now I know how to use it in my complex program.
BTW: I just needed to copy about 10 or 15 files, only one small change was necessary to make it compile without vdub.
Joe Fenton
30th July 2005, 00:35
You might want to post the process so others can gain from your knowledge. :)
emilytzgyr
13th August 2005, 16:07
Sorry, I was on vacation during the last 2 weeks. I'll post my knowledge as soon as I have access to my program code (which will probably be on monday).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.