Migration from VideoRendererElement to WPF MediaKit?

Nov 7, 2011 at 5:37 PM

Hi all,

first of all, I would like to thank Mr. Jeremiah Morril for being the reference of rendering video on Windows, your projects are a great and useful work, thanks a lot!

I have been using the VideoRendererElement to eficiently render uncompressed video with a WPF user control exposed to COM. The video is obtained via RTSP from the network and pushed to DirectShow using the MediaElement hack. Although the solution is a hack (nice hack!), I decided to use it because it gives good performance for my requirements (I need to play live video smoothly inside an advanced WPF UI).

The thing is, lately I have started to have some problems with the VideoRendererElement when I try to change the source of the video (making a teardown of the VRE and a new Initialization of DirectShow). Sometimes, after the Play() of the MediaElement, nothing happens and consequently the "magic does not happen"... ;) After many debugging time not clear results were achieved.

For this reason, I was looking for some new release of the VideoRendererElement that solves problems but nothing appears. However, I have seen that the (excellent) WPF MediaKit is in a very advanced state and it seems to be maintained. After reading some posts and information regarding the WPF MediaKit, my two questions about this issue are the following:

1.- Could I obtain the same performance for rendering uncompressed buffers with WPF MediaKit instead of VideoRendererElement?

2.- Is there an easy way to migrate an application that uses VideoRendererElement to use WPF MediaKit? Anyboyd attempted to do it?

Thanks in advanced to everyone,

Domingo.

Coordinator
Nov 7, 2011 at 5:47 PM
If you are just rendering uncompressed pixels. You can try InteropBitmap or WriteableBitmap. I have an example of each in my project here and here. You may have to modify as I have a hard coded colorspace logic in there.

-Jer

On Mon, Nov 7, 2011 at 10:37 AM, dlopez72 <notifications@codeplex.com> wrote:

From: dlopez72

Hi all,

first of all, I would like to thank Mr. Jeremiah Morril for being the reference of rendering video on Windows, your projects are a great and useful work, thanks a lot!

I have been using the VideoRendererElement to eficiently render uncompressed video with a WPF user control exposed to COM. The video is obtained via RTSP from the network and pushed to DirectShow using the MediaElement hack. Although the solution is a hack (nice hack!), I decided to use it because it gives good performance for my requirements (I need to play live video smoothly inside an advanced WPF UI).

The thing is, lately I have started to have some problems with the VideoRendererElement when I try to change the source of the video (making a teardown of the VRE and a new Initialization of DirectShow). Sometimes, after the Play() of the MediaElement, nothing happens and consequently the "magic does not happen"... ;) After many debugging time not clear results were achieved.

For this reason, I was looking for some new release of the VideoRendererElement that solves problems but nothing appears. However, I have seen that the (excellent) WPF MediaKit is in a very advanced state and it seems to be maintained. After reading some posts and information regarding the WPF MediaKit, my two questions about this issue are the following:

1.- Could I obtain the same performance for rendering uncompressed buffers with WPF MediaKit instead of VideoRendererElement?

2.- Is there an easy way to migrate an application that uses VideoRendererElement to use WPF MediaKit? Anyboyd attempted to do it?

Thanks in advanced to everyone,

Domingo.

Read the full discussion online.

To add a post to this discussion, reply to this email (WPFMediaKit@discussions.codeplex.com)

To start a new discussion for this project, email WPFMediaKit@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
Microsoft MVP - Client Application Development
HJT, Inc Software Developer

Nov 8, 2011 at 3:19 PM

Thanks for the quick answer!

I am trying with the InteropBitmap from your example, but my buffer is YUY2 and I cannot find a YUV format in the PixelFormats collection. Do you how to do it in this case? I would prefer not to convert to RGB before (for performance reasons) but I do not know if the InteropBitmap can manage with YUV as it seems...

Thanks again.