title: DirectShow get video properties
body: <p>I want to extract <strong>video properties</strong> from the media file. More precisely, I am interested in:</p>
  
  <p><strong>width, height, duration, frame rate, bit rate, frame count, codec</strong>.</p>
  
  <p>So far what I have done:</p>
  
  <p>I have built the <strong>GraphBuilder</strong> (pGraph).</p>
  
  <p>I get <strong>duration</strong> from <strong>IMediaSeeking</strong> interface.</p>
  
  <p>I get <strong>frame count</strong> dynamically as decoder is decoding frames using <strong>ISampleGrabber</strong></p>
  
  <p>I managed to get height, width and an average sample duration (and calculate frame rate = avg sample duration * sample count) from IBasicVideo interface but it is working only when I call <strong>pGraph->RenderFile()</strong> on the GraphBuilder. When I use <strong>pGraph->AddSourceFilter()</strong> method to add a source this option does not work.</p>
  
  <p>So my question is: Is there a good way to get all of these information at once or not. If there is no, please tell me how do I extract the rest of properties (just to recall, I already have frame count and duration) </p>