PDA

View Full Version : Selective filtering.. is this possible?


Stigma
2nd February 2003, 21:08
Heya,

I have been unable to find an answer to this question i have: Is it possible to use a command so that the filtering will only apply to a part of the material? Say for example there is a cartoon episode, but in the middle there is a bunch of real-life footage where your cartoon filters dont work very well. Can you set avisynth to switch OFF at frame X and ON again at frame Y ?

Or better yet, can you change between filters A and B at those frames?

This also leads me to a related question. Can you somehow specify the bitrate to be used in a 2-pass for a certain stretch of frames? For example if you want a variable bitrate, but you dont want more then 800 kbp/s from frame 100-450, can this be set by modifying the log file or something?

All answers that may shed light, or links to post i have not been able to find are greatly appreciated.

-Stigma

Belgabor
2nd February 2003, 21:21
There is no direct way to do this, you have to 'shred' your video to segments with Trim statements, apply the filters to those and reassemble the result. e.g.:

src = AVISource(...)
a = src.Trim(Range1)
b = src.Trim(Range2)
a.FilterToUseForRange1() ++ b.FilterToUseForRange2()

philippas
2nd February 2003, 21:29
Use the trim() function. An example will make this clearer:

film=avisource("C:\clip.avi").trim(start,end).filter()
cartoon=avisource("c:\clip.avi")..trim(end+1,0).OtherFilter()
film+cartoon
start,end are frame numbers.

Check the documentation of avisynth for further details.

philippas
2nd February 2003, 21:32
@Belgabor
You just beat me in speed as i was typing my reply :D

Stigma
2nd February 2003, 21:39
Aha! I ...*think* I understood that ^_^

I guess il give it a try to make sure, and then coem back if there are more questions. Thanks a lot for the fast reply's.

Anyone know anything about the second question? (Selecting a fixed bit rateor quality level for a range).

-Stigma

Manao
2nd February 2003, 22:06
For your second question, it is possible with Xvid, with the credit settings. But you can only apply those twice during a movie, due to the vfw interface ( which stay clean this way, it would have been a lot more complicated otherwise ). I never tried divx5, but there should also be a credit range waiting to be set.

philippas
2nd February 2003, 22:13
For the second question:

Nandub had the ecf feature where you could override the codecs decisions and specify a bitRate or drf for a range of frames. I wouldn't recommend it though, nowadays xvid is much better. Maybe it's possible through stats editing in xvid, try koepi's stats editor from he's site, not sure though if it enables you to set manually the bitRate.
Anyway this is not related with avisynth but rather with the codec that you're using.