Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Direct Show graph - how to get the current fps?

I have an instance of IFilterGraph - my own graph with video filters (source, transofrm and renderer). How can I obtain the current fps (video frame rate) of running graph?

Regards Dominik

like image 840
cubesoft Avatar asked Sep 15 '10 15:09

cubesoft


1 Answers

Probably the easiest way is to create a SampleGrabber filter with a custom callback, and calculate it yourself.

See:

ISampleGrabber

ISampleGrabber::SetCallback

ISampleGrabberCB

Each time your callback function is called, you have received a new frame. You probably should put this just before the renderer.

Also, depending on your graph, some filter could have information about frame rate, but the SampleGrabber method would work with any graph.

like image 178
raven Avatar answered Sep 21 '22 15:09

raven