View Full Version : last frame detecting
daftendireckt
9th October 2007, 15:48
Hello
I need to implement a plugin in order to write a picture from a movie. This picture is an average of the sequence.
My first question is:
how to detect the last frame of the movie to write the picture?
Thank in advance!
neuron2
9th October 2007, 15:57
You get the frame count from vi.num_frames. Then the GetFrame() function is passed the 0-based frame number n being requested. You can test for n == vi.num_frames - 1 to trigger your action. Another way is to trigger it in your filter's destructor. It depends on your specific requirements.
daftendireckt
9th October 2007, 16:33
You can test for n == vi.num_frames - 1 to trigger your action.
This is what I tried, but it didn't work.
vi.num_frames is always equal to 10810800 :o
neuron2
9th October 2007, 17:12
Is your source filter DirectShowSource()?
Try using the destructor.
Leak
9th October 2007, 18:42
This is what I tried, but it didn't work.
vi.num_frames is always equal to 10810800 :o
Errr... you aren't by chance using ffdshow's AviSynth filter?
In that case, the input clip will always be 10810800 frames long since ffdshow can't really tell how many frames the decoded stream really has - 10810800 simply has some nice mathematical properties and should be "long enough" for everybody.
Any particular reason you're not using a bog-standard AVS script file?
np: The Orb - Majestic (Mix 1) (U.F.Orb Remixes)
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.