PDA

View Full Version : vdub logo filter


FreQi
12th December 2001, 09:59
I've been trying to get the LoadVirtualdubPlugin filter to work with no luck. I am using avisynth 1 beta 5, nandub 1 RC2, and logo 1.3 beta 4 by Donald Graft. I have a 150 frame animated logo that works when using the NanDub video -> filter setup.

I followed the instructions in the vdfilters.avs, but over the course of testing, I simply copied the function to my test.avs. here:

LoadVirtualdubPlugin("C:\Program Files\nandub\plugins\logo.vdf", "VD_Logo", 1)
AVISource("e:\Test.avi")
Trim(4806,11490).Crop(0,2,352,238).BicubicResize(352,240)
VD_Logo(286,4,128,1,255,0,255,"C:\Program Files\nandub\logo2\logo0000.bmp",1,50,1,1)

When I try to open the avs in nandub, I get "Invalid arguments to function VD_Logo"

I don't understand why. It's what the function in vdfilters.avs seems to want. My guess is the interface for the logo filter is expecting more arguments than what the vdfilters.avs function lists, such as the "transparent tollerance" which isn't listed as an option.

hakko504
12th December 2001, 11:14
VD filters use RGB input as opposed to AVIsynth who works in YUV space. Simply adding ConvertToRGB before the VD_logo call and everything should work ok. You also might have to use 'Full processing mode' in nandub or add ConvertToYUV after the vd_logo call.

LoadVirtualdubPlugin("C:\Program Files\nandub\plugins\logo.vdf", "VD_Logo", 1)
AVISource("e:\Test.avi")
Trim(4806,11490).Crop(0,2,352,238).BicubicResize(352,240)
ConvertToRGB
VD_Logo(286,4,128,1,255,0,255,"C:\Program Files\nandub\logo2\logo0000.bmp",1,50,1,1)
ConvertToYUV #only if you still want to use fast-recompress in nandub

FreQi
12th December 2001, 11:46
I still get the same error, Invalid arguments to function VD_Logo. I've always used Full Processing mode before since I used NanDub to place the logo, but I've been doing VCD's in addition SBC Divx's, which is why I'd like to move the process of placing a logo to avisynth: so it'll be is both encodes.

Evaldas
17th December 2001, 01:53
Originally posted by hakko504
ConvertToYUV #only if you still want to use fast-recompress in nandub
[/CODE] [/B]

This ConvertToYUV doesn't work. When I try to open i VDub, I get error: Avisynth open failure: I don't know what "ConvertToYUV" means. I tried ConvertToYUY2, and it worked! So this is misstyping or this is an error at my side.

FreQi
18th December 2001, 19:05
I ended up writing to the logo filter author Donald Graft because I was getting that error about the invalid arguments. It turns out the version of the filter I was using does indeed have additional arguments. Here are the arg types for logo v1.3b4:

mfd->x = argv[0].asInt();
mfd->y = argv[1].asInt();
mfd->alpha = argv[2].asInt();
mfd->transparent = !!argv[3].asInt();
mfd->xr = argv[4].asInt();
mfd->xg = argv[5].asInt();
mfd->xb = argv[6].asInt();
mfd->tolerance = argv[7].asInt();
strcpy(mfd->filename, *argv[8].asString());
mfd->animate = !!argv[9].asInt();
mfd->start = argv[10].asInt();
mfd->duration = argv[11].asInt();
mfd->loops = argv[12].asInt();
mfd->fadeinlen = argv[13].asInt();
mfd->fadeoutend = argv[14].asInt();
mfd->fadeoutlen = argv[15].asInt();

Don says you can get this information from the source code, so if you have a different version and need the args, look there before mailing him.

I also wrote a logo function that I put in my avs files just because it was convienient since I always use the same logo. My logo is 150 framess long, it's animated with that annoyin pink used as the transparency. The function takes only one argument: the frame to start the animation. The function figures the rest:

function FreQi(clip clip, int startframe)
{ LoadVirtualdubPlugin("c:\program files\nandub\plugins\logo.vdf", "LogoFilter", 1)
endframe = startframe + 150
return clip.LogoFilter(286, 4, 128, 1, 255, 0, 255, 0,
\ "C:\Program Files\nandub\logo2\logo0000.bmp", 1,
\ startframe, 1, 1, 0, endframe, 0)
}

So to use it, do something like this:

ConvertToRGB
FreQi(20)
ConvertToYUY2

BTW, you need the ConvertToYUY2 to open the avs in TMPGEnc too. And when I encoded something in nandub without ConvertToYUY2, the image came out upside down and green and black. It was weird.

Anyway, this should be a good replacement for the logo function in the vdfilters.avs if you use that:

function 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 "fadeinlen", 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:\virtualdub\plugins\logo.bmp"),
\ default(animate,false)?1:0, default(start,0), default(duration,0), default(loops,0),
\ default(fadeinlen,0), default(fadeoutend,200), default(fadeoutlen,0))
}