Log in

View Full Version : How to apply a conditional operator based on frame number?


leonid_makarovsky
16th November 2004, 20:20
Hello,

I'd like to completely fill some of the frames with black color. Say I want all the frames from the beginning to frame #50 to be filled with black. How would the AVS script look like? Thanks.

--Leonid

Karyudo
16th November 2004, 20:50
Not to be too much of a jerk, but you have read the manual over at http://www.avisynth.org/, right?

Off the top of my head, I don't know how to do specifically what you want. But I'd take a look at BlankClip() and Trim()... or maybe even Levels().

When asking questions such as yours, I find you generally get faster and more favourable responses if you give it a shot (with a code sample) yourself, first.

stickboy
17th November 2004, 08:58
Originally posted by leonid_makarovsky
I'd like to completely fill some of the frames with black color. Say I want all the frames from the beginning to frame #50 to be filled with black. How would the AVS script look like? Thanks.Choose your poison:
ApplyRange(0, 50, "Levels", 0, 1.0, 255, 0, 0)
AudioDub(Blackness(last, length=51) ++ Trim(51, 0)
\ last)
or you could use my JDL_Blackout (http://www.avisynth.org/stickboy/) function in conjunction with ApplyRange.ApplyRange(0, 50, "JDL_Blackout")

lark
18th November 2004, 12:06
how about
ConditionalFilter( BlankClip( <figure out your params> ), last, "current_frame", "<", "51" )
regards
t :)

leonid_makarovsky
23rd November 2004, 00:04
Thanks for the help everyone. I basically just created rather large script that looked like:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb521.dll")
clip = AVISource("M:\IronMaiden\IronMaiden-a.avi")
main = Trim(clip, 620, 75354)
ending = Trim(clip, 0, 99)
blankout = BlankClip(ending, length = Framecount(ending), pixel_type = "YUY2", color=$000000)
clip = main ++ blankout
clip = Telecide(clip, order=1)
clip = Decimate(clip, cycle=5, mode=0)
clip = LanczosResize(clip, 352, 480)
return clip


It worked. Thanks.

--Leonid