Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd April 2002, 17:33   #1  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,335
new VirtualDub Filters Import File, v1.2

I attached a new version of the VirtualDub Filters Import File (v1.2), since there's nothing happening on Donalds webpage.

The main changes:

- changed Smart Deinterlace script and tested with v2.7b2
- script-list added which contains a list of all scripts present in
vdub_filters
- added filters:
- Smart Smoother HiQ by Klaus Post, tested with v1.1
- QS Deinterlace (optimized versions of Smart Deinterlace for
pentium II, III or IV users) by Pavel Kuznetsov, tested with
v0.50b and v0.52b
- Zoom by Avery Lee and Donald Graft, tested with v1.2
- rewrote the script for LogoAway by Krzysztof Wojdon, tested with
v3.5fix1

Last edited by Wilbert; 27th June 2002 at 10:24.
Wilbert is offline   Reply With Quote
Old 23rd April 2002, 20:03   #2  |  Link
dividee
Registered User
 
Join Date: Oct 2001
Location: Brussels
Posts: 358
Thanks Wilbert! I'll ask Donald to put it on his site as soon as he comes back.
__________________
dividee
dividee is offline   Reply With Quote
Old 23rd April 2002, 20:58   #3  |  Link
hakko504
Remember Rule One
 
hakko504's Avatar
 
Join Date: Oct 2001
Location: SWEDEN
Posts: 1,611
Beautiful! Well done Wilbert
__________________
/hakko

http://www.boardgamegeek.com
hakko504 is offline   Reply With Quote
Old 23rd April 2002, 21:58   #4  |  Link
Hanty
Good cop
 
Join Date: Nov 2001
Posts: 190
I can't tell you how pleased I am with this update. I simply cannot find the words. I'm now running my encoding with a 25% boost from putting all my filters in avisynth.

The only thing that could now possible be improved upon is to implent "Tolerance" in Transparency for the Logo filter.

A+ work.
__________________
<< Have you cleaned your pipes today? >>

"It's good to be king"
Hanty is offline   Reply With Quote
Old 24th April 2002, 15:02   #5  |  Link
Pko
Registered User
 
Join Date: Feb 2002
Posts: 140
Quote:
Originally posted by Hanty
The only thing that could now possible be improved upon is to implent "Tolerance" in Transparency for the Logo filter.
I have the settings to use all the options of "logo" filter, but unfortunately not here; I will post them this afternoon...

There are a few settings missing in "logo" filter, not only tolerance... Also, the filter has a bug (imho) when using animated logos (first image is showed twice, so the animation does not cycle well), I have a workaround for that but it is not very elegant. I do not know if that bug appears only when used from Avisynth (btw, when you use MANY times the plugin in a single script, Virtual Dub does not "like" it; it hangs or does some weird things. But the script compresses OK withe CCE)

A GREAT plugi, but slow... I hope Neuron2 will someday make an avisynth-native version
Pko is offline   Reply With Quote
Old 24th April 2002, 20:37   #6  |  Link
Pko
Registered User
 
Join Date: Feb 2002
Posts: 140
Here it is.
Code:
# Complete definition of "logo" plugin
global VirtualDub_plugin_directory = "D:\Virtual Dub\plugins"
function VD_Logo(clip clip, int "x", int "y", int "alpha", bool "transparent",
		   \ int "xr", int "xg", int "xb", int "tolerance", string "filename",
                       \  bool "animate", int "start", int "duration", int "loops",
                           \ int "fadein", int "fadeoutend", int "fadeoutlen")
{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\logo.vdf", "_VD_Logo", 1)
  return clip._VD_Logo(default(x,0), default(y,0), default(alpha,128),
    \ default(transparent,true)?1:0, default(xr,0), default(xg,0), default(xb,255),
    \ default(tolerance,0), default(filename,"d:\virtual dub\plugins\logo.bmp"), 
    \ default(animate,false)?1:0, default(start,0), default(duration,0), default(loops,0),
    \ default(fadein,0), default(fadeoutend,0), default(fadeoutlen,0))
}
# End of definition of plugin; the rest of the script is just an example

#Simplified versions of the interface to facilitate manipulation
# For animated logo in a static position
function RE(clip clip, int "h", int "v", int "start", int "loops") {
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\logo.vdf", "_VD_Logo", 1)
  return clip._VD_Logo(default(h,0), default(v,0), 128,
    \ 1, 0, 0, 0,
    \ 0, "E:\Movies\Recu0001.bmp", 
    \ 1, default(start,0), 1, default(loops,1),
    \ 0, 0, 0)
}

# For moving a static logo across the screen
function MV(clip clip, int "h", int "v", int "start", int "duration") {
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\logo.vdf", "_VD_Logo", 1)
  return clip._VD_Logo(default(h,0), default(v,0), 128,
    \ 1, 0, 0, 0,
    \ 0, "E:\Movies\Recu0001.bmp", 
    \ 0, default(start,0), default(duration,0), 0,
    \ 0, 0, 0)
}

# Now the example
# V01.d2v is simply a 480x480 NTSC video; use any you have at hand
# it MUST be NTSC and MUST be 480x480; uncomment "ConvertFPS(29.97)"
# and/or "BicubicResize(480,480)" below to convert if necessary

mpeg2source("E:\Movies\V01.d2v")
#ConvertFPS(29.97)
#BicubicResize(480,480)

#This shows an animated translucid box (contained in "Recu0001.bmp"
#to "Recu0011.bmp") across the screen in 10 different positions
#also moves a static version of the box from position to position
RE(33,33,0,20)
animate(240,300,"MV",33,33,240,1,117,33,300,1)
RE(117,33,301,20)
animate(540,600,"MV",117,33,540,1,201,33,600,1)
RE(201,33,601,20)
animate(840,900,"MV",201,33,840,1,285,33,900,1)
RE(285,33,901,20)
animate(1140,1200,"MV",285,33,1140,1,369,33,1200,1)
RE(369,33,1201,20)
animate(1440,1500,"MV",369,33,1440,1,33,369,1500,1)
RE(33,369,1501,20)
animate(1740,1800,"MV",33,369,1740,1,117,369,1800,1)
RE(117,369,1801,20)
animate(2040,2100,"MV",117,369,2040,1,201,369,2100,1)
RE(201,369,2101,20)
animate(2340,2400,"MV",201,369,2340,1,285,369,2400,1)
RE(285,369,2401,20)
animate(2640,2700,"MV",285,369,2640,1,369,369,2700,1)
RE(369,369,2701,25)
It is very slow and does not display 100% OK in Virtual Dub, but compresses well in CCE.

I attach the "Recu*.bmp" files converted to PNG and then compressed. You should decompress them and convert them back to BMP.
Notice that files 2 & 3, 4 & 5, 6 & 7, 8 & 9, 10 & 11 are the same; this is because of a bug in the plugin: the first file in the animation appears twice, so to have smooth animation I show *ALL* files twice. Since there are 6 different images that show in 2 frames each, the image cycles aprox. 5 times each 2 seconds.
Pko is offline   Reply With Quote
Old 24th April 2002, 22:23   #7  |  Link
Hanty
Good cop
 
Join Date: Nov 2001
Posts: 190
Awesome stuff Pko, to think I placed a request for this just 24 hours ago.

Just to make sure I have all the variabels correct:

VD_Logo(0,0,0,transparent=true,0,0,128,30,c:\HaTE.bmp,animate=false,10,10,0,0,0)

Will correspond to this in vdub :



Right?
__________________
<< Have you cleaned your pipes today? >>

"It's good to be king"
Hanty is offline   Reply With Quote
Old 25th April 2002, 10:55   #8  |  Link
Pko
Registered User
 
Join Date: Feb 2002
Posts: 140
Quote:
Originally posted by Hanty
Just to make sure I have all the variabels correct:

VD_Logo(0,0,0,transparent=true,0,0,128,30,c:\HaTE.bmp,animate=false,10,10,0,0,0)

Will correspond to this in vdub :



Right?
No, I think it is not correct... at least it is not clear (for me) if it is, since the third parameter is 0 and that means "alpha=0", so all the BMP will be transparent and nothing will appear! also, you should put quotes around the file name. BTW, IMHO it is not a good idea to mix named parameters with unnamed parameters... That is, or call the plugin with all parameters in order or call it with just the ones you need using them with their name, but do not mix because I do not know if a named parameter uses a "slot" in the naming order or not... it is difficult to debug and probably will not be accepted by Avisynth.

So, if I am not mistaken, you can call the plugin with the parameters that appear in the JPG in any of this ways:

1) unnamed parameters
VD_Logo(last,0,0,128,1,0,0,0,30,"c:\hate.bmp",0,10,10,0,0,0,0)

2) named parameters (only pass those that are different from defaults, and you can put them in any order)
VD_Logo(xb=0,tolerance=30,filename="c:\hate.bmp",start=10,duration=10)
Pko is offline   Reply With Quote
Old 26th April 2002, 17:39   #9  |  Link
LotharZ
Registered User
 
Join Date: Oct 2001
Posts: 47
@Wilbert
I saw in the scripts.txt file that optimized 2D Cleaner by Jaan Kalda works under yuv-space, but i tried and nothing. It says that only RGB32 is suported

Any idea?

Here is the .avs file:
--------------------
# PLUGINS
LoadPlugin("C:\DivX\GK\mpeg2dec.dll")
#
# SOURCE
mpeg2source("F:\DVDs\SilencioCorderos\Trailer\xvid\trailer.d2v")
#
# CROPPING
crop(10,12,704,551)
#
# RESIZING
BicubicResize(640,352,0.333,0.333)
#
# FILTERS
Import("F:\DVDs\vdub_filters.avs")
#ConvertToRGB()
VD_2DCleaneroptk7(5,2,2)
#ConvertToYUY2()
------------------------
LotharZ is offline   Reply With Quote
Old 2nd May 2002, 10:34   #10  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,335
Sorry for the late response, but I took a few days off You right, all the VDub plugins work under in RGB32 space and not in YUV space (I had some misunderstanding and did some mistesting, sorry about that).

@Pko,

I will add this script in the next version. Can you sent me/attach the bmp files? I'm also very interested in your guide about this stuff ...
Wilbert is offline   Reply With Quote
Old 12th May 2002, 15:50   #11  |  Link
Acaila
Retired
 
Acaila's Avatar
 
Join Date: Jan 2002
Location: Netherlands
Posts: 1,529
A few days ago sh0dan posted the new version of his Smart Smoother High Quality filter in the VirtualDub forum. The new version 2.01 requires an updated function to work in Avisynth, I've taken the liberty of writing it. Could you put this in your new VDFilters file?

Code:
##########################################
# Smart Smoother HiQ by Klaus Post, v2.01#
#					 #
# diameter (3-13, odd),			 #
# threshold (1-200), amount (1-254)      #
# difference (0-50)                      #
# mode = "average" or "weighted"	 #
##########################################

function VD_SmartSmoothHiQ(clip, int "diameter", int "threshold", int "amount", string "mode",
	\  bool "grayscale", bool "weighted_difference", int "maintain_diffweight")

{
  LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\SmoothHiQ.vdf", "_VD_SmartSmoothHiQ")
  mode = default(mode, "weighted")
  mode = (mode=="average") ? 0 : (mode=="weighted") ? 1 : -1 
  Assert(mode>=0, """VD_SmartSmoothHiQ: "mode" parameter must be "average" or "weighted"""")
  return clip._VD_SmartSmoothHiQ(default(diameter,5), default(threshold,50), 0, default(amount,254),
	\  mode, default(grayscale,false)?1:0, default(weighted_difference,true)?1:0, default(maintain_diffweight,0))
}

# example:
# ConvertToRGB()
# VD_SmartSmoothHiQ(5,50,254,"weighted")
# ConvertToYUY2()

Last edited by Acaila; 16th May 2002 at 13:28.
Acaila is offline   Reply With Quote
Old 13th May 2002, 10:03   #12  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,335
Very nice! I will add it in the next version...
Wilbert is offline   Reply With Quote
Old 16th May 2002, 12:37   #13  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Very nice - I'll include a reference to the include file in the documentation for the next release.

"weighted_average" is perhaps a bit misleading. In the documentation I refer to this as "weighed with difference". That way it'll be called the same as in VD.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 16th May 2002, 13:30   #14  |  Link
Acaila
Retired
 
Acaila's Avatar
 
Join Date: Jan 2002
Location: Netherlands
Posts: 1,529
I had confused it with the weighted average boolean (which is already in "mode").

I corrected the script.

Thanks.
Acaila is offline   Reply With Quote
Old 22nd May 2002, 11:47   #15  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,335
@sh0dan

I will add your newest version (v2.11) in the coming version.

@all

I have a question about the preroll argument of this script (and the script of SmartSmoother itself)

########################################
# Smart Smoother by Donald Graft, v1.1 #
# not written by me ... #
########################################

function VD_SmartSmoother(clip clip, int "diameter", int "threshold", bool "interlaced")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\smooth.vdf", "_VD_SmartSmoother", 1)
return clip._VD_SmartSmoother(default(diameter,5),
\ default(threshold,25), default(interlaced,false)?1:0)
}

I noticed that the preroll (third argument of LoadVirtualdubPlugin) is taken to be one here. While it is now being defined as zero in SSHiQ which is based on SmartSmoother. Since it doesn't crash and I assume it doesn't use future frames it should be ok?

Is there any reason it is taken as one in SmartSmoother or can we take it also as zero ?
Wilbert is offline   Reply With Quote
Old 22nd May 2002, 16:50   #16  |  Link
Acaila
Retired
 
Acaila's Avatar
 
Join Date: Jan 2002
Location: Netherlands
Posts: 1,529
As I understood it, the preroll value is for buffering that amount of frames before the filter starts processing. Since neither SmartSmoother nor SmartSmootherHiQ use future or past frames to do their work they don't need any frames buffered.
At least that's what I assumed when writing that script a few posts up. As since it works....
Acaila is offline   Reply With Quote
Old 23rd May 2002, 10:09   #17  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,335
SmartSmoother has an option interlaced:true/false. Maybe setting interlaced to true uses future frames?
Wilbert is offline   Reply With Quote
Old 23rd May 2002, 12:53   #18  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
No - Smart Smoother does not use previous frames. Enabling Interlaced mode just skips every second line when blurring. So it must be a misunderstanding.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 24th May 2002, 10:21   #19  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,335
So, the filter operates only on the top field? Is that the case with every filter where you can select interlaced?

Isn't it better to seperate the fields and apply the filter on both fields and combine them together again (except that it takes twice as long)?
Wilbert is offline   Reply With Quote
Old 25th May 2002, 00:36   #20  |  Link
dividee
Registered User
 
Join Date: Oct 2001
Location: Brussels
Posts: 358
I think it does exactly what you suggest (filter each field separately), but it doesn't take twice as long, since each field only as half the number of pixels and most filters speed is linear regarding framesize.
In avisynth, such an option wouldn't be needed since you could just do
SeparateFields.SmartSmoother(...).Weave
__________________
dividee
dividee is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.