views:

516

answers:

3

I have some simple WPF with a MediaElement which is, generally, working. I have some simple AVIs and WMVs which are working.

I have a DivX AVI that works fine in Media Player but doesn't render at all in the WPF MediaElement control. It plays the audio fine, but graphically has zero size and doesn't render any video!

I have tried using the WPF Media Kit at wpfmediakit.codeplex.com and manage to extract an error from that: Could not render any streams from the source Uri.

The RenderCapability.Tier reports 0x00020000 (Tier 2) - the graphics card should be capable!

+1  A: 

You need to use a codec that is supported under WPF. DivX isn't.

wefwfwefwe
How can one tell if a codec is supported by WPF?
Ronnie
A: 

MediaElement is just tha wrapper on Window Media Player 10.0 if have want to play any type of file which is not supporetd to WMP then u need to codec for it.link text

Firoz
Bad grammar aside, you didn't read his question where he outlines that it works fine in WMP and not in the WPF element.
snicker
+1  A: 

Are you on an x64 operating system? If so compile your application as x86 instead of any CPU. This will ensure your application will be able to load what are most likely 32bit DirectShow filters.

Jeremiah Morrill
Tried that and it makes no difference
Ronnie
"Could not render any streams from the source Uri" in my MediaUriElement means that DirectShow could not find any compatible filters to decode. Could your current divx decoder be restricted to certain players like WMP? The built in Microsoft AC3 codec is like this. Try installing ffdshow http://ffdshow-tryout.sourceforge.net/ and see what happens.
Jeremiah Morrill
Sorry - I lied - I hadn't successfully built x86 - it was still x64. I deeply apologise! Everything is working ok now when built as x86.It is a shame that that has to be done - but ho hum!
Ronnie
I finally found a codec pack at http://www.codecguide.com/ which has a 64 bit version and that is brill!
Ronnie