Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th December 2004, 00:39   #1  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I'm so embarrased of asking this question...(applying a filter to a frame range)

I am currently trying to rip one of my DVDs and one scene in particular has more blocks and noise than the rest of the video. I'd like to apply a filter on a given frame range? Yeah, I should know this by now, but I never had to do this before, and I couldn't find anything about this in the Avisynth docs.


++
Chainmax is offline   Reply With Quote
Old 11th December 2004, 02:02   #2  |  Link
tedkunich
Potentate
 
Join Date: Mar 2003
Posts: 219
pssst... ApplyRange
tedkunich is offline   Reply With Quote
Old 11th December 2004, 05:34   #3  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Thanks.
Chainmax is offline   Reply With Quote
Old 11th December 2004, 21:15   #4  |  Link
Nicholi
Registered User
 
Join Date: Apr 2003
Location: Lancaster, CA
Posts: 89
Alternatively you could use this method, which is in Yatta.

Code:
PresetClip0=Preset0()
PresetClip6=Preset6()
PresetClip0.Trim(0,1252)+PresetClip6.Trim(1253,1502)+PresetClip0.Trim(1503,0)
Defining the presets earlier in the script as such.

Code:
function Preset0(clip c) {
#Name: Basic Filtering
c
SmoothMe()
SharpenMe()
return last
}
Really nice and simple because it's just a button (or key) to press as you are visually watching the stream in Yatta. I find it nifty at least.
Nicholi is offline   Reply With Quote
Old 12th December 2004, 17:56   #5  |  Link
Corran
Registered User
 
Corran's Avatar
 
Join Date: Jun 2004
Location: Chicago
Posts: 19
Code:
####################################################################
# SceneAdjust by Corran     Adapted from Scintilla's Tweakscene    #
# Usage:  SceneAdjust(start,end,filters)                           #
#                                                                  #
# To use filters that use strings like deen("a3d",1)               #
#      you need to use triple quotes.                              #
# e.g. SceneAdjust(30,80,filters="""deen("a3d",1).mftoon()""")     #
####################################################################

function sceneadjust(clip a, int "start", int "end", string "filters")  {
start = Default(start,0)
end = Default(end,a.framecount)

part1 = (start <= 1) ? a.Trim(0,-1)  : a.trim(0,start-1)
part3 = (end >= a.framecount-1) ? a.trim(0,-1) : a.trim(end+1,a.framecount)
a=part1+Eval("a."+filters).trim(start,end)+part3
a = (start <= 1)? a.trim(1,a.framecount) : a
(end >= a.framecount-1) ? a.trim(0,a.framecount-2):a
}
...it has been a long time since I wrote this. I think the limitation was that it couldn't apply filters to the first 2 and last 2 frames of the clip. (Safety feature to prevent Trim() from screwing up the frame count.)

If you only have one function to apply then applyrange would be better and faster.

I made this for ease of use and I don't really plan on updating it.
Corran is offline   Reply With Quote
Old 12th December 2004, 21:18   #6  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
Yes, using Trim in user-defined functions is dangerous if the frame numbers are variable.

The internal ApplyRange function has some limitations. My JDL_ApplyRange function basically does what Nicholi and Corran said but in a safe way and without start/end frame limitations.

Last edited by stickboy; 12th December 2004 at 21:22.
stickboy is offline   Reply With Quote
Old 12th December 2004, 21:27   #7  |  Link
Corran
Registered User
 
Corran's Avatar
 
Join Date: Jun 2004
Location: Chicago
Posts: 19
Quote:
Originally posted by stickboy
Yes, using Trim in user-defined functions is dangerous if the frame numbers are variable.

The internal ApplyRange function has some limitations. My JDL_ApplyRange function basically does what Nicholi and Corran said but in a safe way and without start/end frame limitations.
-_- I wish I had found that before making my own...
Corran is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.