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. |
1st January 2010, 18:01 | #1 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,492
|
ApplyRange range in filter
I'm writing a few plugins and using applyrange to only apply them to certain sections of video. This all works fine until I try to use a filter that needs to know how far into the section it is being applied (such as when applying a moving mask from another file).
Code:
PVideoFrame __stdcall selectivecolour::GetFrame(int n, IScriptEnvironment* env) { I've previously made wrapper functions in AVS to actually split the video, but is there an easier way? David |
1st January 2010, 22:54 | #2 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
If you use the Trim/Splice model instead of ApplyRange, you will get the segment frame number.
Code:
... A=Trim(0, 123) B=Trim(124, 567).selectivecolour(... # global frame 124 will be local frame 0 C=Trim(568, 0) A + B + C ... Code:
... X=Last Y=selectivecolour(... # global frame n will be local frame n A=X.Trim(0, 123) B=Y.Trim(124, 567) C=X.Trim(568, 0) A + B + C ... |
Thread Tools | Search this Thread |
Display Modes | |
|
|