Apply Filters to Only a Certain Part of a Video

This forum is for questions and discussion of all the aspects of handling your footage. If you have questions about capturing/ripping footage, AviSynth, or compression/encoding/converting, look here.

Apply Filters to Only a Certain Part of a Video

Postby LittleAtari » Thu Mar 12, 2009 2:52 am

I'm cleaning up a video after it's been edited and found that some filters really benefit certain parts of the video, but really harm other parts. So how do I apply filters for only certain parts of a video?

I managed to find this on a message board somewhere, but I don't completely understand it:
Code: Select all
avisource("X:/stuff/example.avi")

function filterchain1(clip c) {
    c
    # do some filtering here
    return last
}

function filterchain2(clip c) {
    c
    # NASTY EVIL BLUR OR SOMETHING HERE
    return last
}

trim(0,500).filterchain1()+trim(501,550).filterchain2()+trim(551,0).filterchain1()

I've tried messing around with it and I get lost. I understand that I need to make clips out of my video, so I do this:
Code: Select all
beginning = DirectShowSource("ComeAlive06  (windows playback).mov")
clip1 = beginning.trim(0, 183)

So far AVIsynth doesnt complain, so i go and make my filterchain:
Code: Select all
function filterchain1(clip1) {
    c
   sangnom(2)
    return last
}
trim(0,183).filterchain1()

Here I get an error saying that trim has invalid arguments and it's referring to the last trim and not the one I used on clip1.

Also, before anyone says anything about mov. I made the video in FCP on OS X and have tried numerous export methods, so please don't complain about it unless it has anything to do with how this script is working.
User avatar
LittleAtari
 
Joined: 22 May 2005

Re: Apply Filters to Only a Certain Part of a Video

Postby Scintilla » Thu Mar 12, 2009 6:17 am

Look up the ApplyRange() function in the AVISynth documentation.

I think there may also be, included with the AMVapp, a script function called SceneAdjust() that does something similar (and if you don't have it, you can find the function here).
ImageImage
:pizza: :pizza: Image :pizza: :pizza:
User avatar
Scintilla
(for EXTREME)
 
Joined: 31 Mar 2003
Location: New Jersey
Status: Quo

Re: Apply Filters to Only a Certain Part of a Video

Postby LittleAtari » Thu Mar 12, 2009 11:27 pm

Scintilla wrote:Look up the ApplyRange() function in the AVISynth documentation.

I think there may also be, included with the AMVapp, a script function called SceneAdjust() that does something similar (and if you don't have it, you can find the function here).

Thanks a lot. I went with applyrange since I seemed to pick up on that first. It's amazing. Thank you.
User avatar
LittleAtari
 
Joined: 22 May 2005


Return to Footage Help

Who is online

Users browsing this forum: No registered users and 1 guest