Log in

View Full Version : ApplyRange Hullabaloo


DarkFoon
23rd August 2004, 07:48
I can usually figure out my own problems with avisynth, but this one just keeps throwin' me for a loop.
I want to use applyrange to turn a selection of frames greyscale. But whenever I use it, i get one of two errors,
1) "invalid arguements to fuction Applyrange"
2) "I don't know what greyscale is"

I read the documentation for the filter, and it made sense.
What am I doing wrong?

My script follows below:


v=mpeg2source("flcl1.d2v",cpu=0,idct=4,ipp=true,moderate_h=20 ,moderate_v=40 ,showq=false,fastmc=false,cpu2=" ")
a=EvilMPASource("flcl 1.mpg", normalize = false)
AudioDub(V,A)
applyrange(27311, 31412, "greyscale")
tweak(sat=1.50, coring=false)
converttoyuy2(interlaced=true)
guavacomb(mode="NTSC", recall=10, activation=10, maxvariation=35)
peachsmoother(noisereduction=50, stability=30, spatial=100, showmotion=false, readout=false)
fielddeinterlace(full=true, threshold=7, blend=true, dthreshold=3, show=false)
Levels(0, 0.9, 255,0, 255, coring=false)
bilinearresize(480,480)
converttorgb32(interlaced=false)

Thanks!

WyldeF1r3
23rd August 2004, 07:59
I haven't been here in god knows how long, so applyrange might have been updated and bugfixed, but the last I heard, it hated functions without perameters (ie grescale(), undot(), etc) that's probably your problem (that and you left out the () after greyscale)

go here http://www.avisynth.org/stickboy/jdl-range.avsi

and copy that whole page into a txt file and save it as whateveryouwant.avs then insert this line at the top of your avs file

Import("x:\path\whateveryouwant.avs") (replacing all names as necessary)

then replace your applyrange line with

JDL_ApplyRange(27311, 31412, "greyscale()")

and you ought to be all set


you also might want to change back into yv12 before using fielddeinterlace (unless of course you're not using 2.5) and your (480,480) resize seems a little odd to me too, but maybe you meant to do it. Also your conversion to rgb32 at the end seems strange to me as well. It also looks like you're leaving out inverse telecine.

stickboy
23rd August 2004, 09:32
It's not mentioned in the changelist, but the problem with ApplyRange/Animate's inability to use functions that take no additional arguments should be fixed in 2.5.5 alpha (http://forum.doom9.org/showthread.php?s=&threadid=73520).

For yet another alternative, see this thread about using a wrapper function (http://forum.doom9.org/showthread.php?s=&threadid=56536).
Originally posted by WyldeF1r3
(that and you left out the () after greyscale)The syntax he used is correct for use with ApplyRange.

manono
23rd August 2004, 09:55
This will greyscale it:

ApplyRange(FrameStart,FrameEnd,"Tweak",0.0,0.0,0.0,1.0)

DarkFoon
24th August 2004, 00:02
Thank you everyone for your help! I used the Tweak function, but the others I will look into for the good of expanding my knowledge.

to WyldeF1r3:
480x480 seems strange because I am converting to SVCD. The reason I dont use converttoyv12() again is because I read that multiple colorspace conversions degrades quality; that, and I don't need to go to back yv12. The conversion to RGB32 is needed so that TMPGenc will accept the input from Vdub. The flow chart is as follows:
avisynth -> Virtualdub (for clipping) -> TMPGenc
If there is an easier way to do trimming in avisynth than
trim()++trim()
which cut the wrong sections of video everytime I tried to correct it, I am open to suggestions.
I would love to use IVTC, but I don't for two reasons:
1) I don't have the time to hand correct the "bad areas" of video for the Decomb Filter pack.
2) My SVCD burning app doesnt allow 23.976fps files.
I heard something about YATTA! last night, and it looks like its worth a try; so that fixes my first problem, but if anybody knows any fixes to my second problem, or has suggestions for this procedure, I'm all ears.

Thanks again!

manono
24th August 2004, 06:50
Hi-

2) My SVCD burning app doesnt allow 23.976fps files.

Encode at 23.976fps, and then run Pulldown.exe on it afterwards to set the flags so that it outputs 29.97fps. You can find it here:

http://www.doom9.org/Soft21/svcdtools/pulldown.zip

There are some GUI's available for it if you're not comfortable with CLI, but I can't remember where I got them. But a search should turn them up easily enough.