开发者

mp4-h264 video decoding with Media Foundation

开发者 https://www.devze.com 2023-03-31 12:52 出处:网络
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

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

I have 2 question:

  1. 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 http://msdn.microsoft.com/en-us/library/dd389281%28v=VS.85%29.aspx) or as session using trans-codding example. May be anyone may share experience how to use Media Foundation to load mp4-h264 video.

  2. 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.

Thanks in advance, Ze'ev


(2) 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.

This is possible. Basically, it involves writing a Media Foundation Transform for the third party decoder. Look into your SDK installation directory. Go to Microsoft SDKs -> v7.0 -> Samples -> Multimedia -> Mediafoundation -> Decoder. It contains a sample MPEG1 decoder MFT. What you need to do is appropriately inherit IMFTransform interface and implement its methods. For example, a media client will call ProcessInput() method to provide your decoder MFT with media samples. Similarly it will call ProcessOutput() to get the decoded output. In short, MFT acts as a wrapper for the third party decoder.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号