View Full Version : Conditional Filter equivalent syntax in avs 2.5?
Tofusensei
7th March 2003, 08:16
Hi,
This might be a silly question, but I've been going through the avs docs like a madman trying to figure out how to apply different filter chains to different segments of a video.
If you guys are familiar w/ Conditional Filter for virtualdub, this is exactly what it allowed you to do.
For example, lets say frames 1-1000 need a lot less filtering than frames 1001-2000. What would the syntax be in avs 2.5 to apply different filter chains to each group of frames?
Thanks in advance.
Manao
7th March 2003, 10:27
It would be something like that :
video = Source("...")
part_one = video.trim(0,1000).bilinearresize(640,352)
part_two =video.trim(1001,2000).lanczosresize(640,352)
return part_one + part_two
You can chain as many filters as you want behind the dot, you can also do something like
foo = foo.filter()
or
foo = foo.filter() + foo2.filter2() ......
Originally posted by Tofusensei If you guys are familiar w/ Conditional Filter for virtualdub, this is exactly what it allowed you to do.[/B]
yep ... that's what i beg for time to time, an equivalent in avisynth. pity, but haven't got so far :-(
Originally posted by Tofusensei
... how to apply different filter chains to different segments of a video ...
the only way i know is trimming out the segments & handling one by one. quite tedious but it worth in some instances. not perfect as this tuning fine tunig is almost impossible.
the bests
y
Tofusensei
7th March 2003, 10:33
Ahh, I see the syntax using the dots. :)
Quite messy, no? I have maybe 15 filters running for certain segments of video, is why.
It'd be nice to have a syntax like:
For(Frames=2001-3000)
{
FilterA(x,y)
FilterB(x,y,z)
}
But I guess we can survive. Thank you very much.
WarpEnterprises
7th March 2003, 13:42
Why don't you try this one:
version().showframenumber #here comes your source
BlurOnlyThis(50,60,1.5) #blurs frames 50...60 only
return last
#now define your special treatment - e.g. removing logos,...
function BLurOnlyThis(clip c, int start, int stop, float HowMuch) {
tmp=Blur(c, HowMuch)
return trim(c,0,start-1) ++ trim(tmp,start,stop) ++ trim(c,stop+1,0)
}
Belgabor
7th March 2003, 14:13
Heya Tofu,
If you want to evade defining functions, you could also do this:
AviSource()
part1=Trim()
part2=Trim()
#part1 Filtering
part1.Filter1()
Filter2()
...
part1_filtered=FilterLast()
#part2 Filtering
part2.Filter1()
Filter2()
...
part2_filtered=FilterLast()
#Stuff it together
part1_filtered ++ part2_filtered
Cheers
Belgabor
sh0dan
7th March 2003, 17:43
Guess it would make sense to create an ApplyRange(clip,first_frame, last _frame, Filter, args....). Shouldn't actually be that hard. I'll see what I can do!
Tofusensei
8th March 2003, 10:20
Thanks sh0dan, you're a hero. *_*
Thank you to everyone else to, for your advice :)
And Belg, long time no see, I need you to help me out on an .ogm project I am thinking of undertaking. I think it'll be right up your alley ;)
/me has never used .ogm ^_^
Belgabor
9th March 2003, 04:40
Heh, me still lurking on irc, just drop me a /msg :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.