views:

2267

answers:

6

I'm using a WPF MediaElement to render HD video in an application. When the size of the MediaElement gets over about 300 units square the video stutters and the computer is nearly totally unresponsive. I need to render the video full screen.

Has anybody had success rendering fullscreen video using the WPF MediaElement?

What were the processor/video specs of the computer used?

Is there a better way to get video displayed in a WPF application?

EDIT:
Timothy: I need to be able to put text or other elements over the graphic, so I think that hosting WMP is out.

Currently I am not doing any layers nor opacity/transparency.

I'm running in XP currently. I hope to be able to run the application in both Vista and XP.

Mike: I was reading some of Jeremiah Morrill's posts on the MSDN forums prior to coming back and checking on this post. I found my way to some of his libraries and will be testing them out. Thanks.

UPDATE:

It appears that the problem is on my development machine. On the test machine things are running fine. My development machine is dual headed w/ 2 1650x1080 CRTs with a ATI Radon X1650 series card with 256MB of memory.

When using the WPF perfmon tool it indicates that everything is hardware rendered, but the performance sucks. For now I'm just going to go with it as I know the code runs fine on the machines we distribute it with. At some point in the future I'll try to dig into why it performs so poorly on my development machine. (all machines are XP).

Thanks for all the suggestions.

+1  A: 

Jeremiah Morrill has recently released a specialized WPF library that supports displaying HD Media (among other features)

Mike Brown
A: 

It sure doesn't seem to work correctly. It may be that testing for the opacity of other layers slows it down too much. Have you tried running the test with Aero turned off?

It has been suggested that hosting Windows Media Player may be the way to go.

Walkthrough: Hosting an ActiveX Control in Windows Presentation Foundation by Using XAML

Timothy Lee Russell
A: 

What is the resolution/format of your HD video?

I have done a 720p WMV on a dual core 2.6ghz fullscreen without issues, but it has a NVidia 9800GXT in it. What is the CPU usage of the HD video in just WMP? Remember that there is some overhead with rendering anything within WPF. So if you are running near 100% CPU, rendering to WPF may be just enough to set it over. Also if your GPU is too slow, you may also suffer choppy video.

-Jeremiah

A: 

I think this is only a problem in Windows XP. It seems that the video playback is not updating with the vsynch. So it updates the screen whenever it feels like it. In Vista, the video rendering of WPF is smarter some how.

GeekyMonkey
A: 

Using correct vsync should solve the problem, and it is not necessarily related to the wpf and vista. Some ATI cards come with graphic drivers that have the vsync option turned off by default. Hope this helps.

komplikator
A: 

Old thread, but just like to share my own experience. My guess is that your distribution machines are single monitor. I ever had a second monitor on my laptop and found that the first seconds of a video where not visible, and schocking video afterwards. Removing and disable the additional monitor solved the problems. I have seen more reports that the media element has problems in a dual monitor environment.

bart