Log in

View Full Version : How to apply DeFreq to part of the source video


JeanMarc
2nd February 2009, 14:55
I have captured analog TV with intermittent diagonal interferences. I found out I was able to filter them out with Fizick's DeFreq filter. Since the interferences appear on a small part of the video, I am trying to find a way to simply apply the filter on a specified range of frames.
I have been using and enjoying simple Avisynth scripts, but I am still a newbie, and introducing this type of control structure in my script is beyond my current skill level.

What I would like to do is implement something like the following function in AviSynth script language:
If (frame_number>n1 AND frame_number<n2)
DeFreq(fx=10.8,fy=3.8)
Endif
I know that AviSynth is not an imperative language and doesn't support this type of code, but there seems to be workarounds...I just couldn't find any script I could use.
Any suggestion would be greatly appreciated.

Alex_ander
2nd February 2009, 15:27
You have at least 2 standard choices:
1. ApplyRange() - look into AviSynth docs
2.Trim() for separating frame range for the filtered part (easier to get correct expression at first attempt):

Trim(0,1000)++Trim(1001,2000).DeFreq(fx=10.8,fy=3.8)++Trim(2001,0)

JeanMarc
2nd February 2009, 18:32
Alex_ander,

:thanks:for the quick response.

This is a very simple method, and it works perfectly for me. I originally thought that ApplyRange works only with internal filters. I just put in ApplyRange(29696, 32144,"DeFreq",10.8,3.8) and it did the trick!:)

I also see how I can also use Trim to process separately the segments that are affected, this will be another option.