admin wrote:What does 1.2 bring to the table?
So, if i remember properly, it's in the 1.2 that have been added two significant features, with the
prefetch possibility.
Also, on the version i've provided, Phareon has updated all the internal filters to the new sdk 1.2, so, looking at the code may also serves as exemple.
The first is the possibily to change the frame rate inside a plugin. If you want to see how this is done, you can look at my
Remove Frame filter in my VDub filters package on my github. This filter is realy simple because it does almost nothing...
It's a decimate function. Never done an increase frame rate (add frames instead of removing). Of course, the default settings of my filter are made to match the settings needed for my IVTC filter.
A warning about this kind (decimate here) of feature. If for exemple you have a chain of 4 filters, and you put a decimate filter which remove 1 frame on 2 (half the frames) on 3rd positions, it will nevertheless impact the whole filter chain. If, like me, you were expecting that the filters before the decimate will receive all the frames on their input, and only the filters after the decimate will receive only half the frames, big mistake ! (My IVTC filter to work properly needs all the frame in the correct order on the input).
It seems that before doing the process, VDub run the whole video "at blank", just to check what frames will realy be needed, and then, after, during the process, send to the chain filter only the frame needed. So, if you have a decimate 1/2 in the chain, the whole chain will finaly receive only 1/2 frames, unless...
- You trick VDub like i've done in my
Remove Frame filter, to make it beleive you'll need all the frames in input.
- In the filter chain you have a filter with
LAG feature, but don't know exactly if it's just the fact of being present, or if there is some rule including the value of the lag.
The second is the possibility to have access to "any" input frame you want. If you filter needs to work with previous and/or next frames, no need anymore to have an internal buffer to store them. And if you needs next frames, also no need anymore to use the
LAG feature. With the
prefetch feature, when in the
Run function you are processing the frame N, you can also have access to the N+i or N-i input frame. If you need also to have access to previous output frames, that i don't know if you also have the possibility, or if you have to handle it yourself with an internal buffer.
Again, for exemple, you can check my filters on my github, or also look at the code of some internal filters of VDub.
I don't remember exactly in how detail these features are explained in the sdk doc.
These features are interesting and greatly help the filter developpement. But, as far as i know, i think that if you're using this features, your filter cannot be load anymore in avisynth.