mbaros
mbaros

Reputation: 845

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.

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

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 . After installing it the WMP started to decode and play video track. But after that I again was not able to decode the file using MF API.

My guess is that Media Foundation is limited to what Windows ships. Is that right?

Also, is a way to tell Media Foundation to decode using externally installed codec?

Upvotes: 2

Views: 1502

Answers (1)

Roman Ryltsov
Roman Ryltsov

Reputation: 69632

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

If you had a suitable codec, Media Foundation would have picked it up.

Windows Media Player attempts to play via Media Foundation or, in case of failure, falls back to DirectShow. This explains why downloadable codec fixes Windows Media Player but not Media Foundation.

Upvotes: 5

Related Questions