PDA

View Full Version : Pls Help! How can I import Region Remove filter into Avisynth


hawk123
27th June 2006, 11:42
Hi, any one tried before/know how to import the Region Remove filter in VDub into Avisynth?

Here is the code I have tried w/o any success:
LoadPlugin("D:\AviSynth 2.5\plugins\DGDecode.dll")
mpeg2source("I:\RegionRemoveTry.d2v")


function VD_RRemover(clip clip, int "removeWidth", int "removeHeight",
\ int "removeX", int "removeY",
\ bool "border", int "frameWidth", int "frameHeight",
\ bool "ignoreTop", bool "ignoreBottom", bool "ignoreLeft", bool "ignoreRight",
\ bool "softEdges", int "softPixels",
\ bool "softONOFF", int "softFRAME",
\ int "rangeStart", int "rangeStop", int "totalRanges")
{
LoadVirtualdubPlugin("D:\VirtualDub\plugins\RegionRemove.vdf", "_VD_RRemover", 1)
return clip._VD_RRemover(default(removewidth,20), default(removeHeight,20),
\ default(removeX,128), default(removeY,128),
\ default(border,false)?1:0, default(framewidth,20), default(frameHeight,20),
\ default(ignoreTop,false)?1:0, default(ignoreBottom,false)?1:0, default(ignoreLeft,false)?1:0, default(ignoreRight,false)?1:0,
\ default(softEdges,false)?1:0, default(softPixels,0),
\ default(softONOFF,false)?1:0, default(softFRAME,0),
\ default(rangeStart,0), default(rangeStop,50), default(totalRanges,2))
}

ConvertToRGB()
VD_RRemover(20,20,100,102,false,20,20,false,false,false,false,false,0,false,0,200,2)
ConvertToYUY2(interlaced=true)


I think it should be due to last few lines in the script regarding the rangeStart, rangeStop and totalRanges as there is a counter in the original Region Remove's script.

Any one know please help.
Your comments and helps are welcome and much appreciated.
TQ

neuron2
27th June 2006, 11:58
Your arguments do not correspond to those in the source code of the version 1.1 that I looked at (see below). If you are using a different version, please post a link to it.

mfd->removeWidth = argv[0].asInt();
mfd->removeHeight = argv[1].asInt();
mfd->removeX = argv[2].asInt();
mfd->removeY = argv[3].asInt();
mfd->softEdges = int2bool(argv[4].asInt());
mfd->softONOFF = int2bool(argv[5].asInt());
mfd->ignoreTop = int2bool(argv[6].asInt());
mfd->ignoreBottom = int2bool(argv[7].asInt());
mfd->ignoreLeft = int2bool(argv[8].asInt());
mfd->ignoreRight = int2bool(argv[9].asInt());
mfd->softPixels = argv[10].asInt();
mfd->softFRAME = argv[11].asInt();
setRanges(mfd, NULL, *argv[12].asString());

hawk123
28th June 2006, 03:22
Hi, neuron2,

TQ for your reply.
But, I not really understand fully your post as I'm not a programmer and have not any programming xp.

Your arguments do not correspond to those in the source code of the version 1.1 that I looked at (see below)
Yupe, I have checked the RegionRemove.cpp c/w the filter. It is exactly similar to what you have posted. It's v1.1.

What I know is a little avisynth script I learnt from Avisynth's homepage regarding the import of VDub's filter. I'm still very new to all these programming stuff.

Can you tell me what is the meaning of the code you posted in your reply and what is the language used in writing the filter?

neuron2
28th June 2006, 03:31
If you have version 1.1, I'll make the import script for you. Will that be satisfactory?

neuron2
28th June 2006, 04:00
Here is the correct import script. I regret to inform you that not all of the filter parameters are exported into the scripting environment (i.e., border), and that the ranges are encoded into a string. This is a deficiency of the original filter and is not a deficiency of the import script.

avisource("test.avi")

function VD_RRemover(clip clip,
\ int "removeWidth", int "removeHeight",
\ int "removeX", int "removeY",
\ bool "softEdges", bool "softONOFF",
\ bool "ignoreTop", bool "ignoreBottom",
\ bool "ignoreLeft", bool "ignoreRight",
\ int "softPixels",
\ int "softFRAME",
\ string "ranges")
{
LoadVirtualdubPlugin("RegionRemove.vdf", "_VD_RRemover", 1)
return clip._VD_RRemover(default(removewidth,20), default(removeHeight,20),
\ default(removeX,128), default(removeY,128),
\ default(softEdges,false)?1:0, default(softONOFF,false)?1:0,
\ default(ignoreTop,false)?1:0, default(ignoreBottom,false)?1:0,
\ default(ignoreLeft,false)?1:0, default(ignoreRight,false)?1:0,
\ default(softPixels,0),
\ default(softFRAME,0),
\ default(ranges,""))
}

ConvertToRGB()
VD_RRemover()

hawk123
28th June 2006, 07:00
If you have version 1.1, I'll make the import script for you. Will that be satisfactory?

TQ. I'm very very satisfied :D :D :D and you are so efficient. Just half an hour you have written me a working script.

Here is the correct import script. I regret to inform you that not all of the filter parameters are exported into the scripting environment (i.e., border), and that the ranges are encoded into a string. This is a deficiency of the original filter and is not a deficiency of the import script.

The border just a minor thing. I'm not really concern w/o it. Your script works perfect for me. I have copied it and ran through it. It's just perfect.

Once again Thanks you for your kindness.