Log in

View Full Version : Filtering a given frame range


acro29
11th April 2008, 12:41
I want to apply a blur fillter (Blur) to video.
The problem is I have a scene between the 960~2500 frames I do not want to blur...
How do I tell the fillter to ignore those frames?
I think it should be something like this:

from frame 0 to 960 apply blur
from frame 2500 till the last frame aplly blur.

now how do I exectute this, and is it even possible?

Cheers.

Gavino
11th April 2008, 13:31
Check out the ApplyRange (http://avisynth.org/mediawiki/ApplyRange) filter.

J_Darnley
11th April 2008, 14:17
a = Trim(0,960).Blur()
b = Trim(961, 2500)
c = Trim(2501, 0).Blur()
a ++ b ++ c

acro29
11th April 2008, 15:50
Thanks, seems to be working just fine Darnley.

Why is the a,b,c needed if I may ask. (I am still newbie)

And how does this works, Trim is used to exclude frames... the '.' tells the Trim to act diffrently then ?

DarkT
11th April 2008, 15:53
http://avisynth.org/stickboy/
--->RemapFrames
--->ReplaceFramesSimple(Filter1.Filter2.Filter3, mappings="[FrameNumberBegin FrameNumberEnd]")

[P]ako
11th April 2008, 16:05
You don't need the a, b, c. You can just do:

trim(0,960).Blur() \
++ trim(961,2500) \
++ trim(2501,0).Blur()

The "dot" tells the next filter (Blur) to work on the result of the previous filter (Trim).

Prettz
11th April 2008, 16:13
A style I always use when I have different filter chains I want to apply to different parts of a video is like this:

src = last
a = src.SomeFilter()
b = src.SomeFilter().SomeOtherFilter()
c = src.AnotherFilter()

a.Trim(###,###) ++ b.Trim(###,###) ++ a.Trim(###,###) ++ c.Trim(###,###) ++ a.Trim(###,###) ++ ...

This is very nice when you have a whole lot of different segments that get special filtering different from your "main" filter chain.

acro29
12th April 2008, 10:08
I understang the dot Thanks, but what about the Trim function.

If I understand it corectly it used to 'Exclude' frames from the video. How does it work in this case, it doesnt Exclude them' but define them as frame range.

Comatose
12th April 2008, 10:16
Trim creates a clip from the frame range you define, f.e. Trim(1000,1999) creates a clip composed of frames 1000-1999 from the last clip.

So:
zeroto960=trim(0,960).blur()
middle=trim(961,2499)
_2500toend=trim(2500,0).blur()
zeroto960+middle+2500toend

or:
#trim(0,960).blur()+trim(961,2499)+trim(2500,0).blur()
trim(0,960).blur() \
+trim(961,2499) \
+trim(2500,0).blur()

or, another alternative (DarkT's suggestion, and also my favorite):
(load RemapFrames.dll)
ReplaceFramesSimple(blur(), mappings="[0 960] [2500 35000]")
(assume that frame 35000 is the end frame. you can't use 0 here to tell it to continue all the way to the end)