locked
width and height of the video frame RRS feed

  • Question

  • Hi,

    I am rendering a video file and just displaying.

    m_pGraph->RenderFile(m_MediaFile, NULL);

    What is the simplest way to learn the video properties. Especially, I want to learn the width and height of the video frames.

    Thanks.

    Saturday, February 17, 2007 10:32 AM

Answers

All replies

  • Query IBasicVideo on the filter graph manager, and use IBasicVideo::get_VideoWidth and get_VideoHeight.

    http://msdn2.microsoft.com/en-us/library/ms784633.aspx

    http://msdn2.microsoft.com/en-us/library/ms784632.aspx

    http://msdn2.microsoft.com/en-us/library/ms784631.aspx

     

    Saturday, February 17, 2007 11:27 AM
  • IBasicVideo does not work with EVR filter, as the documentation says. How can I get the height and width of the video source if I am using EVR filter?

    Thanks,
    V, Kishore
    Monday, January 25, 2010 10:41 AM
  • Use IPin::ConnectionMediaType on the EVR's input pin you want the dimensions for and then examine the media type.
    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Monday, January 25, 2010 1:51 PM
  • Yes, I did give it a try and it is reporting invalid values of width as 720 and height as 480. Even when I use properties page in GraphEdit, it shows the same. But, when I play the clip once, stop it and then check the pin's properties, it shows the correct width and height. Not sure if it is a bug...
    Wednesday, January 27, 2010 3:30 AM
  • Likely, you need to Pause the graph before examining the media type on the input pin so that the renderer actually has a sample to work with.  You don't need to call Run, just Pause.
    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    Wednesday, January 27, 2010 5:51 AM