cgraus

We are about to go beta on a WPF product and we're finding that video plays slow at times, is jerky, and sometimes after playing several videos, the video control does not show anything at all. We have up to four media controls in panes, our app uses transparent windows, but the hotfix for that issue did not help. Any suggestions appreciated. It seems intermittent, the same PC one day will only fail in playing videos that have a bit rate of 5000, other days, they all fail.


Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

Clinton Rocksmith


Hi,

I've had the same problem with some testing that I did. I take it that you are using MediaElements

For reliability and flexibility I dumped that idea and went over to DirectShow which is NOW built into the Windows Platform SDK plus the DirectX august 2007 release.

I was trying this through C# and I am aware that you can access things through interop to the underlying C++ DirectShow.

I personally have decided just to go C++ and leave the WPF for the moment for other tasks.

The videos I've tried to play are VERY large bitrates, DV camcorder styles. And with HD resolutions pushing 1920x1080 I need to ensure (for my project) that it is streamlined.

Can you give a bit more description as to what you're programming in

Cheers

Clinton





Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

cgraus

Our is a C# app, and we are also trying to play large bit rate videos. I'm thinking of wrapping the winforms media control to try and solve it ( I need to come up with a fix in the next 6 hours or so ). Yes, we have a control for showing media ( images or videos ) and it contains a media element. We have up to four of them on the screen at once, but we constrain the app to only playing one video at a time






Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

Mike Brown

Christian,

I think you're running into the TransparentWindow/Animation issue in WPF on XP. Unfortunately it also seems that the hotfix microsoft provides for that issue doesn't appear to alleviate it in this case. Here comes Winforms/WPF Interop to the rescue. I've wrapped the Windows Media Player activeX control into a WPF control using WindowsFormHost and exposed functions and properties for you to playback video.

Let me know if this helps.

--Mike






Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

cgraus

Thanks Mike, the winforms wrapper is a revelation, I wonder why WPF doesn't expose a non 3D media player, given how poor the performance of the built in ones is. This has totally fixed my problem and it's no exaggeration to say that it's given me a releasable product. I guess WPF still has some rough edges.






Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

Jeremiah Morrill

On this forum, I hear so many people having problems with video playback performance with MediaElement. It has me a little nervous because our application heavily relies on it. I do admit that it does eat up a little bit more CPU than just using a DirectShow renderer, but not by much. I have been doing 4 or 5 videos at the same time at DVD quality (704x480), no video tearing or jerkyness. Just a happy WPF application.

I guess I'll consider myself lucky. Does anyone know how a decent GPU (ie, ATI 1900, NVIDIA 7600-8600 vs. ATI 9200) affects MediaElement playback I guess I'm still confused on the nitty-gritty details of which WPF features benefit from hardware acceleration.

-Jer





Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

cgraus

Our videos are higher res ( 1280x720 ) and have a bit rate of 5000. We had the issue across a wide variety of computers, including ones with very good graphics cards.






Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

æaluif åpkejf ølajksdf sa

Have anyone tried this :

http://msdn2.microsoft.com/en-us/library/ms748870.aspx

If anyone has gotten this to work, please send me an e-mail.

<Grid Name="grid1">
<WindowsFormsHost Name="wfh">
<ax:AxWindowsMediaPlayer x:Name="axWmp"/>
</WindowsFormsHost>
</Grid>

Regards

Ole Haugen

fidopels@hotmail.com





Re: Windows Presentation Foundation (WPF) Slow video in WPF ?

Mike Brown

Ole,

This is the solution that worked, Wrapping the Windows Media Player ActiveX control in a Winforms Host. However we did a few things to make the the control almost seamlessly interchangeable with the MediaElement.