PDA

View Full Version : A custom filter


actionman133
11th April 2004, 15:34
Here is some code for a filter that will change the apparent framerate of progressive material without actually changing the true framerate. It works by adding and removing fields rather than frames, and maintains better motion than removing full frames.

This is great for speeding up or slowing down film material that you plan to release on DVD or TV, because each frame is still seen, as long as the speed is less than 2x the original rate. It's also very fast.

Function AlterFPS (clip Last, float Speed, bool "Weaving") {

Weaving = Default (Weaving, False)
Original = Framerate

AssumeFPS (Speed, True)
ChangeFPS (2 * Original)
(Speed == Original) ? Trim (0, -1) ++ Last : Last

(Weaving == True) ? SeparateFields.SelectEvery (4, 0, 3).Weave : Last

}

Any suggestions on improvement? and ive also put up a poll to see if anyone would like to have this implemented into the AVISynth code, or make into a plugin. I think it's useful...

mf
11th April 2004, 16:10
You don't need to code anything simple like that. Now by your poll option "code", you mean "script", or do I need to vote for "no way" ?

stickboy
11th April 2004, 20:56
If you can do it with a script, I think it's better as a script. Unless you plan on re-inventing a number of wheels, your plug-in merely would call Invoke() a lot, so there wouldn't be much gain.
Originally posted by actionman133
Function AlterFPS (clip Last, float Speed, bool "Weaving") {Hm, never seen anyone name a parameter "last" before. Slick.
Any suggestions on improvement? and ive also put up a poll to see if anyone would like to have this implemented into the AVISynth code, or make into a plugin. I think it's useful...Do you mean making it a plug-in versus bundling it into the core? I think the core has enough ...FPS() functions as it is...

actionman133
12th April 2004, 02:10
thanks about the 'last variable' comment. i use it in all of my functions to make the script neater. but i kinda got shot down about implementing it... oh well, thats why i posted it.