Re: Get frame rate with VMR
From: Rover Shen (rovershen_at_hotmail.com)
Date: 06/30/04
- Next message: Joe Johnson: "Re: possible to connect 2 graphs?"
- Previous message: Alessandro Angeli [MVP::DigitalMedia]: "Re: Filter access to parent Graph"
- Next in thread: The March Hare (MVP): "Re: Get frame rate with VMR"
- Reply: The March Hare (MVP): "Re: Get frame rate with VMR"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Joe Johnson: "Re: possible to connect 2 graphs?"
- Previous message: Alessandro Angeli [MVP::DigitalMedia]: "Re: Filter access to parent Graph"
- Next in thread: The March Hare (MVP): "Re: Get frame rate with VMR"
- Reply: The March Hare (MVP): "Re: Get frame rate with VMR"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|