简体   繁体   English

Media Foundation外部编解码器支持

[英]Media Foundation external codec support

I have wrote a program using Media Foundation API that takes an AVI files and decodes it's video samples into uncompressed RGB frames. 我编写了一个使用Media Foundation API的程序,该程序可以接收AVI文件并将其视频样本解码为未压缩的RGB帧。

Recently, I found an AVI file that contained both audio and video tracks, but the Windows Media Player was not playing the video track (audio was playing). 最近,我发现一个同时包含音频和视频轨道的AVI文件,但Windows Media Player没有播放视频轨道(正在播放音频)。

I tried to open the file with another player (Gom Player) and it suggested me to dowload additional codec pack: LEAD MJPG/MCMP Video Codec . 我试图用另一个播放器(Gom Player)打开文件,建议我下载其他编解码器包: LEAD MJPG / MCMP Video Codec After installing it the WMP started to decode and play video track. 安装后,WMP开始解码和播放视频轨道。 But after that I again was not able to decode the file using MF API. 但是之后,我再次无法使用MF API解码文件。

My guess is that Media Foundation is limited to what Windows ships. 我的猜测是Media Foundation仅限于Windows附带的产品。 Is that right? 那正确吗?

Also, is a way to tell Media Foundation to decode using externally installed codec? 另外,是否可以告诉Media Foundation使用外部安装的编解码器进行解码?

Media Foundation API offers extensibility however codecs acceptable by Media Foundation need to offer respective format: they should be available and registered as Media Foundation transforms. Media Foundation API提供了可扩展性,但是Media Foundation可接受的编解码器需要提供各自的格式:它们应该可用并注册为Media Foundation转换。 This is a rare case since Media Foundation is not popular overall and most of the downloadable codecs have DirectShow API interface, or Video For Windows API interface, but not the one for Media Foundation. 这是一种罕见的情况,因为Media Foundation总体上并不流行,并且大多数可下载的编解码器具有DirectShow API接口或Video for Windows API接口,但没有Media Foundation的接口。

If you had a suitable codec, Media Foundation would have picked it up. 如果您有合适的编解码器,Media Foundation会选择它。

Windows Media Player attempts to play via Media Foundation or, in case of failure, falls back to DirectShow. Windows Media Player尝试通过Media Foundation播放,或者在失败的情况下退回到DirectShow。 This explains why downloadable codec fixes Windows Media Player but not Media Foundation. 这解释了为什么可下载编解码器修复Windows Media Player而不修复Media Foundation的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM