title: mp4-h264 video decoding with Media Foundation
body: <p>I'm testing how to integrate libavcodec (http://en.wikipedia.org/wiki/Libavcodec) using MS Media Foundation SDK, in order to decode h264-lossless format video to YUV/RGB raw data</p>
  
  <p>I have 2 question:</p>
  
  <ol>
  <li><p>I have had issues to load mp4 video encoded with h264/AVC (in regular, not lossless format) into MFPlayer (compiled in VS2010 from MF SDK examples), the error code was: bad byte stream. 
  The same error occurred, when I tried to load the same video as  stream (source reader code taken from <a href="http://msdn.microsoft.com/en-us/library/dd389281%28v=VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd389281%28v=VS.85%29.aspx</a>) or as session using trans-codding  example. 
  May be anyone may share experience how to use Media Foundation to load mp4-h264 video.</p></li>
  <li><p>I should to integrate third-party codec to Media Foundation based decoding.
  According to MSDN, Media Foundation has some support to third-party codecs, however I didn't find example that does decoding using third-party codec.
  May be someone did that ? or may reference to usable example how to do that.</p></li>
  </ol>
  
  <p>Thanks in advance,
  Ze'ev</p>