View Full Version : Adding new VDub filters to avisynth
TelemachusMH
3rd February 2002, 02:40
I know that you can use the vdfilters.avs file in an avisynth script, but this file does not include all of the filters the vdub has. How can I add filters to this so that I can use them in an avisynth script? Specificly, I would like to add the Warp Sharp filter, has anyone already done this?
Thanks,
TelemachusMH
Wilbert
5th February 2002, 16:52
Open vdfilters.avs in a texteditor and try to make your own vdfilter. Since I can't find anything (description) on the Warp Sharp filter I don't whether this is simple or not. If you give a description of that filter we can have a look at it.
Wilbert
TelemachusMH
5th February 2002, 19:44
I am not sure what kind of information you want, but the filter takes 1 perameter, an integer.
Here is the vdfilters.avs entry:
function VD_WarpSharp(clip clip, int "depth")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\warpsharp.vdf", "_VD_WarpSharp")
return clip._VD_WarpSharp(depth)
}
and Here is the avs script that I used:
Import("E:\TV Capture\Autoencode\vdfilters.avs")
LoadPlugin("C:\PROGRA~1\VIDEOE~1\GORDIA~1\mpeg2dec.dll")
LoadPlugin("C:\PROGRA~1\VIDEOE~1\GORDIA~1\InverseTelecine.dll")
LoadPlugin("C:\PROGRA~1\VIDEOE~1\GORDIA~1\Avisynth_Spatial.dll")
LoadVirtualDubPlugin("C:\Program Files\Video Encoding Software\Virtual dub\plugins\warpsharp.vdf", "VD_warpsharp")
mpeg2Source("E:\TV Capture\test dir\Test02.d2v")
InverseTelecine(40,10,15)
crop(3,0,634,480)
BicubicResize(368,272,0,0.75)
SpatialSoftenMMX(1,4,6,false,false,4,4,6,8).ConvertToRGB
VD_warpsharp (25).ConvertToYUY2
video = TemporalSmoother(4)
v1 = video.trim(1,10906)
v2 = video.trim(13794,22502)
v3 = video.trim(26118,35439)
return v1 + v2 + v3
Whenever I use this vitualdub gives me the error, "Error Fetching frame 7: Avisynth read error: Unsupported VBitmap method: BitBlt"
I don't know what is causing this. Any Ideas?
Thanks a lot,
TelemachusMH
Guest
5th February 2002, 21:04
I'll ask Avery about it. Standby...
Milkman Dan
6th February 2002, 23:53
WarpSharp isn't supported in AVIsynth because the LoadVirtualDubPlugin code doesn't fully support the VDub plugin API. so sayth Avery when I mailed him about it a month ago. He said he didn't understand it either, because the portion that was unsupported would be ridiculously easy to implement. I can produce the email if it is needed.
Basically, when I wrote a function that would use the WarpSharp filter, it told me (when serving a frame) that the Bitblt method was incorrect, or something to that effect.
BTW: The integer it takes should be multiplied by 1024, and divided by 400 or something. It's not a straight conversion from the GUI to the passed integer. I forget the exact conversion.
EDIT: Is that video = TemporalSmoother(4) line valid? Can you alias a function call to a variable like that?
TelemachusMH
7th February 2002, 00:20
EDIT: Is that video = TemporalSmoother(4) line valid? Can you alias a function call to a variable like that?
Works for me :D
Thanks for the help is there a different sharpen filter that I can use in an avisynth script (preferably not the sharpen command, It never worked too well)?
ARDA
7th February 2002, 00:42
##############################
# Xsharpen Donald Graft #
##############################
function VD_XSharp(clip clip, int "strength", int "treshold")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\xsharpen.vdf", "_VD_XSharp")
return clip._VD_XSharp(default(strength, 50), default(treshold, 50))
}
##
#This function has worked correctly for me,I hope that can help you
Guest
7th February 2002, 04:41
The problem is that Avisynth does not provide some of the VBitMap functions that VirtualDub filters can use. That means we can either add them to Avisynth or make a version of WarpSharp that replaces the BitBlt with memcpy(). The first is preferable but I am not equipped to do Avisynth builds. Anyway, better than both is to make a native Avisynth version of WarpSharp. I will add that to my to-do list. :-)
movmasty
14th February 2002, 10:30
sometimes i have to use avisynt when doing avi2avi conversion(then not really needed and at half the speed) just to use a couple of filter:
1)SpatialSoften, that is really good
2)SelectEvery(x,y,z), that would make vdub able to output any frame rate
any chances that these two filters will be available as vdub filters???
Guest
14th February 2002, 15:01
@movmasty
About SpatialSoften, there are other spatial smoothers already available for VirtualDub. Have you tried them? If so, and you believe they can't do what you want, tell me about it.
About SelectEvery, the VirtualDub architecture does not permit filters to change the number of frames. It is simply impossible to implement this filter in VirtualDub.
Blight
14th February 2002, 21:26
What I would like to see is a Navtive YUY2 version of WarpSharp ... not sure if RGB is important with that filter, but keeping it native in YUV would mean "Fast recompress" in VirtualDub, I hate having to convert to RGB for a single filter.
BTW, Bug in VDub (which I'll mail avery in a sec):
If you set VirtualDub to "Fast Recompress", it only seems to recompress on key-frames, it's as if you use "Direct Stream Copy" in that regard.
movmasty
15th February 2002, 02:36
@neuron2
i tryed all soften filters, spatialsoften of avisynth is over all in quality.
also the bicubic resize of asynth is good, i think that the p.bicubic0.6 of vdub still sharphens too much
-"the VirtualDub architecture does not permit filters to change the number of frames"
????
Vdub already changes the number of frames, just for integer ratio, /2,/3 ecc(decimation).
we just need a filter that say to drop a frame at fixed position
es. drop 1 frame every 5...
to go from 30 to 24fps, or from 25 to 15 e.g.
simply not encode that frame, and change frame rate to keep duration
cant be impossible to do
another thing to do is to make as many filters as possible, region-screen applicable, as the unsharpmask filter.
would be nice also to apply a filter only to the borders of screen,not just at the center like unsharp(kinda of reverse region option?)
as would be good to sharph the center of a movie, leave all around it untouched, and smooth just the borders.
or apply a filter only over,or below,any luminance threshold,also using a pic like mask,like Ulead media studio can do.
TelemachusMH
15th February 2002, 02:56
Originally posted by movmasty
-"the VirtualDub architecture does not permit filters to change the number of frames"
????
Vdub already changes the number of frames, just for integer ratio, /2,/3 ecc(decimation).
we just need a filter that say to drop a frame at fixed position
es. drop 1 frame every 5...
to go from 30 to 24fps, or from 25 to 15 e.g.
simply not encode that frame, and change frame rate to keep duration
cant be impossible to do
Virtualdub's archecture requires that for every frame that is put throught the filtering, one must come out. Because of this it is imposible to change the number of frames in any way. Virtualdub does all the decimation before they are sent through the filters. In this way virtualdub can change the framerate, but no fitler can.
Guest
15th February 2002, 06:06
@Blight
As a temporary step, I have posted a version of Warpsharp that works in Avisynth at http://home.attbi.com/~neuron2/warpsharp.zip
Blight
15th February 2002, 06:20
neuron2:
Thanks, but it still requires RGB, which sort of defeats the purpose.
I usually like to do sharpening before the resize as it kills a bit of the higher frequencies introduced by the sharpening. Doing all this in RGB is bad as you get 2 conversions... (once for warpsharp and then the encoder converts to YUV for compression).
Guest
15th February 2002, 06:29
@Blight
You must have missed the "As a temporary step" part of my post. :)
Blight
16th February 2002, 21:12
I'll be looking forward to the YUV native version ;)
Koepi
17th February 2002, 16:09
Ahoy,
nice to have you here Donald, didn't notice that earlier... :)
Sine temporal smoother filter from vdub and avisynth don't work as good as temporal cleaner (latest build is beta 5 I think), is it possible to use in avisynth as well? I didn't play around with using vdub filters in avisynth, but I'd really love to see it there :)
Any oppinions on this?
Best regards,
Koepi
ARDA
17th February 2002, 22:33
@Koepi
First of all thank you for the great job; you and h- are doing with Xvid codec.
Please keep on.
Temporal cleaner by Jim Casaburi is already included in vdfilters.avs but here you
have the script if you prefer
####################################
# Temporal Cleaner by Jim Casaburi #
####################################
function VD_TemporalCleaner(clip clip, int "threshold", int "pixel_lock",
\ int "threshold2", int "pixel_lock2", int "scene",
\ bool "partial", bool "yuv")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\tclean.vdf", "_VD_TemporalCleaner", 10)
return clip._VD_TemporalCleaner(default(threshold,10), default(pixel_lock,4),
\ default(threshold2,16), default(pixel_lock2,8), default(scene,30),
\ default(partial,false)?1:0, default(yuv,true)?1:0)
}
__________________
to use it in avisynth
ConvertToRGB()
VD_TemporalCleaner(10,4,16,8,30,false,true)
ConvertToYUY2()
__________________
These are the default values
For the opinions I will wait neuron2’s advices and suggestions and maybe
the surprise to have this filter native for avisynth too.
I hope that can help you
Arda
Guest
18th February 2002, 00:15
@ARDA and Koepi
When I finish up Decomb, I plan to address the whole area of temporal and spatial smoothers for Avisynth. I have some interesting ideas that may well result in useful tools for you.
Koepi
18th February 2002, 01:59
@ARDA:
Thanks for your help, I do appreciate it :)
@neuron2:
I'm curious what it'll be :)
Best regards,
Koepi
poopity poop
4th March 2002, 21:01
Is there some page that explains how to add vdub filters to an avisynth script? With syntax's and examples and such?
WarpEnterprises
16th August 2002, 12:02
neuron2 said some time ago:
The problem is that Avisynth does not provide some of the VBitMap functions that VirtualDub filters can use. That means we can either add them to Avisynth or make a version of WarpSharp that replaces the BitBlt with memcpy(). The first is preferable but I am not equipped to do Avisynth builds. Anyway, better than both is to make a native Avisynth version of WarpSharp. I will add that to my to-do list. :-)
As Avisynth2 is on the way has this interface problem been adressed?
Of course native Avisynth (esp. YUY2) plugins would be nice, but doubling the work if it's not necessary is a waste of time.
Btw, could someone (... :cool: neuron2 makes textbook-quality explanations...) please explain the method of warpsharp a little more in detail ("warping toward the edges" is quite short)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.