RossJones

I am trying to use a DirectShow filter in MediaElement, and although it works in WMP it does not work in a MediaElement. The author has suggested that maybe MediaElement requires the VMR9 in renderless mode with a custom allocator-presenter but I didn't know so I am asking :)

Also what are my debugging options I have hooked up the relevant error event but nothing fails, it all seems to work, I just see a blank area instead of the expected video.

I don't know if it is relevant but this filter is for DVB-T and as I mentioned works (very) well in WMP.

Any help appreciated.


Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Nicholas Palmer

I doubt this helps, but the MediaElement does not use VMR9 or VMR7, it uses a custom renderer.



Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

RossJones

Thanks Nicholas, but it didn't, I appreciate the reply though - more than I've got from anywhere else ;)

I was under the impression that if something played in WMP then it would also play in a MediaElement.

This is currently stopping me shipping the WPF version of our software, and I don't seem to be able to get any help from anywhere - frustrating as I'd rather ship our WPF app than the WinForms version :( I bet I'd get the help if I was allowed to say how big the first customer was - I guess I'll come back when WPF has had a bit more love.




Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Rob Relyea

Ross-

Sorry you haven't gotten the help you need...

Please fire me an email and I'll get you in contact with the right person... Rob.Relyea at microsoft dot com

Thanks, Rob Relyea
Program Manager, WPF Team
http://rrelyea.spaces.live.com





Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Nicholas Palmer

A couple things to check:

Does it work in graphedit (via render file)

What are the media types the filter is using

Do you get anything in the MediaFailed event

I had developed a custom filter and found I needed some more registry keys to make it work in the media element:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Multimedia\WMPlayer\Extensions\.anet]
"Permissions"=dword:0000000f
"Runtime"=dword:00000007

Check if those keys exist for your filetype and if not try adding them for the file extention you are using.

Another good resource is using the sys internals registry monitor, that is what I used to find out I needed the above keys.

--nick





Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Tom Mulcahy - MSFT

MediaElement uses the EVR with a custom IMFVideoPresenter.

I'm not sure what kind of debugging support you're looking for, but how about loading your app in a debugger, setting the debugger to break when the filter dll is loaded, then setting breakpoints to see if the filter is successfully connected to DirectShow

I may be able to help from the MediaElement side of things. If you think the filter is connected successfully and the problem lies within MediaElement (and Nick's suggestions don't help), email me at tmulcahy at microsoft dot com.





Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Nicholas Palmer

Now I have a question...

I thought the EVR only existed on Vista. How does that work on XP

Thanks.





Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Tom Mulcahy - MSFT

We ship it with WPF. On Vista, we use the version that ships with the OS. On XP we install a copy as part of the WPF setup.



Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

RossJones

Does it work in graphedit (via render file)

Yes. And of course it works in WMP.

>What are the media types the filter is using

The filter uses a *.dvb file which is an XML description that it uses to pull data from the dvb-t card.

>Do you get anything in the MediaFailed event

Nothing. No exceptions, no mediafailed.

>I had developed a custom filter and found I needed some more registry keys to make it >work in the media element:

>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Multimedia\WMPlayer\Extensions\.anet]

>"Permissions"=dword:0000000f

>"Runtime"=dword:00000007

Good find. I am tempted to do the hour commute (it is 7PM) to just go try this out, I am that stressed over it :) I guess I will avoid risking the wrath of my wife and try it when I get in in the morning.

The filter by the way is this one (just in case you ever want a DVB-T filter) http://www.dsp-worx.de/ n=11 - The author claims it is alpha but it is rock solid on all of the cards we've tried it on. Obviously we can host in WMP, but if I can get it working in MediaElement then I can have all of the overlay niceness that I currently have (with alpha'd tickers over fading-in video).

I'll let you know, and failing that I'll drop Tom a line. WPF is a fantastic solution for Digital Signage and if I can get this working it could be on a few thousand displays soon (ish).

On a related note, whoever decided that the MS Press book on Directshow should be Out of Print should be told off - sternly :(





Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Nicholas Palmer

I installed that filter and it did make those keys so I guess that's not the problem...



Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Tom Mulcahy - MSFT

Another suggestion: Have you tested the filter for compatibility with the EVR

In GraphEdt, you can remove the VMR that you probably have hooked up and replace it with the EVR.





Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

RossJones

I shall give that a try as soon as I am in tomorrow, unfortunately someone unplugged the aerial on the vista box so VPN'ing in wasn't helpful :(

The chap who writes the filter has released the source, unfortunately it is O. Pascal and I've lost my Delphi 3 installation disks :)




Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

RossJones

Problem found.

I changed to the Enhanced Video Renderer as suggested, and whilst the properties for the filter show a steadily rising framecount I get no output :(

I'll mention this to the original dev, and should he not wish to make the change I guess it is back to the drawing board.

Thanks for all your help Tom and Nicholas, I appreciate it and you can officially put me on your "Owe's me a beer" list.


Edit: Now I am very confused.  As you may have noticed I don't know a great deal about DirectShow, but I have a graph that works or not based on whether I am using the VMR or EVR (VMR works etc) with the aforementioned DVB-T filter.

Using any other MP2 content and the Elecard MPEG 2 Decoder I can get the content to play with the MediaElement however it does NOT play in GraphEdt when the EVR is used, instead showing the same behaviour as the DVB filter (increasing framerate but no video).  I assume this is a flaw with GraphEdt so I am pretty lost.




Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

Nicholas Palmer

I may be wrong, but I think the EVR only supports Windowless/Renderless modes, meaning it won't display output without having it's configuration interfaces setup and thus won't display anything in GraphEdit.

If you really want to test the filter with the EVR, you'd have to write some code.

--nick





Re: Windows Presentation Foundation (WPF) VMR9 and MediaElement

RossJones

If the EVR is setup can I assume that it is automatically added to the Graph by WPF at runtime Is it documented how MediaElement will build the graph Am I just looking in the wrong places, or is this stuff not documented very well I don't mean to be insulting but this is my first foray into non 'backend' code and finding info seems abnormally difficult.

Do you think if I ask very nicely that the next version of MediaElement expose the filter graph it is using that it might make it in