Re: Get frame rate with VMR

From: Rover Shen (rovershen_at_hotmail.com)
Date: 06/30/04


Date: Wed, 30 Jun 2004 23:48:14 +0800


"The March Hare (MVP)" <phil@ndsm.maps> ????
news:2ikp6y0cvh9k$.gw2fx7d4auqk$.dlg@40tude.net...
> On Tue, 29 Jun 2004 16:29:04 +0800, Rover Shen wrote:
>
> Thank you for quoting properly :)
>
> > Thanks for your reply. Here is my code:
> > //pWC is pointer to IVMRWindowlessControl9 interface
> > //I have called IGraphBuilder->Render and IMediaControl->Run
> > IQualProp*pProp=NULL;
> > hr=pWC->QueryInterface(IID_IQualProp,(void**)&pProp);
> > if(SUCCEEDED(hr)){ //it really succeeds!
> > int fps;
> > hr=pProp->get_AvgFrameRate(&fps);
> > if(SUCCEEDED(hr)) //it succeeds too
> > //I got the result: fps=0
> > pProp->Release();
> > }
>
> Have you tried pausing and stopping the graph before querying for the
frame
> rate? It may not give an accurate report based on the info below but it's
> worth a shot.
>
> Here is more info from the VIDEOINFOHEADER Structure in the docs:
>
> The value of AvgTimePerFrame is usually set by the source filter, which
> obtains the value from the media stream. This value can be used to
> calculate the authored frame rate, which is the intended frame rate for
the
> video to be rendered. During playback, the system may not be able to
render
> the stream at the authored rate, so the actual frame rate may be less.
This
> can happen if the machine's resources become over-committed. Also, the
> monitor's refresh rate can interfere with the playback rate of the video.
> For example, if the intended rate is 60,000/1001 (NTSC TV) and the
> monitor's refresh rate is 60Hz, the intended rate and the actual rate will
> never match. To retrieve the actual frame rate achieved during playback,
> use the IQualProp::get_AvgFrameRate method on the video renderer.
>
> During playback, applications can retrieve the authored frame rate as
> follows:
>
> If the old Video Renderer filter is rendering, call the
> IBasicVideo::get_AvgTimePerFrame method.
> If the Video Mixing Renderer (VMR) is rendering, call
> IPin::ConnectionMediaType on the input pin and examine the format block.
> The VMR supports multiple input streams, and they are not required to have
> the same frame rates.
> To obtain the authored frame rate of a video file without rendering it,
use
> IMediaDet::get_FrameRate.
>

Thanks for the information.
I tried all those methods, here are the results:

1. IBasicVideo. I can't get the interface throug IGraphBuilder interface.
2. IPin. The returned media type does not include correct information, only
majortype and subtype available.
3. IMediaDet. Can't return correct fps with sometimes. Sometimes return a
VFW_E_INVALIDMEDIATYPE error.

How can I do?

B.R.
Rover



Relevant Pages

  • Re: Length of avi is incorrect when recording at low frates?
    ... I'm not a video expert so this may be a simple question for some. ... I have an application that simply records video to a file while rendering ... using a Philips SPC 900NC camera and I set the frame rate to 10 fps. ... Why would recording at different frame rates affect the length of the video ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Get frame rate with VMR
    ... calculate the authored frame rate, which is the intended frame rate for the ... monitor's refresh rate can interfere with the playback rate of the video. ... use the IQualProp::get_AvgFrameRate method on the video renderer. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: PXA255 video performance
    ... we use an EPSON video controller for hardware ... need to improve its performance to increase frame rate. ... improve the performances of your video player. ... memory through the external BUS and may impact playback performances ...
    (microsoft.public.windowsce.platbuilder)
  • D3DPRESENT_INTERVAL_ONE oftenly drops frames under Vista
    ... windowed mode with a window covering the whole screen. ... D3DPRESENT_INTERVAL_ONE oftenly does not deliver the desired frame rate to ... the rendering window. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: profiler which does not just sum up used time
    ... I have an app doing rendering and it occationally gets preempted and when that happens I lose a few frames. ... I can not live with even a single lost frame unless the rendering is very complex, ... In the former case, obviously you do have some wiggle room for a slightly lower frame rate, since performance on differing hardware is going to vary. ... it's almost always the case that _smoothness_ is valued more highly than actual frame rate. ...
    (microsoft.public.dotnet.languages.csharp)