I am rendering a video file with a FilterGraph consisting of a VMR9 instance. The FilterGraph is created automatically with GraphBuilder->RenderFile(). Basically my setup is described here: http://www.codeproject.com/Articles/9206/Using-the-DirectShow-Video-Mixing-Renderer-filte
The thing is: I would like to detect some video internals like FPS, duration etc. After the call to RenderFile() the video is displayed correctly with MediaControl->StopWhenReady() and plays with Run() and Pause(). To detect the frame rate I try to grab the AM_MEDIA_TYPE struct from the VMR9's input pin:
VRM->FindPin("VMR Input0", pin); // S_OK
pin->ConnectionMediaType(&mt); // VFW_E_NOT_CONNECTED
In my opinion the filter graph should be created correctly with a call to RenderFile() and therefore this pin should be connected to my input stream. Why is it not the case and what is the way to proceed in this matter?
Microsoft provides some functions (http://msdn.microsoft.com/en-us/library/windows/desktop/dd375791%28v=vs.85%29.aspx) to traverse the graph and look for specific interfaces like IID_IAMStreamConfig that would allow the access to AM_MEDIA_TYPE. But these options fail in my implementation. The only pin I can access is the above mentioned.
Thanks in advance!