MediaElement Support in WPF - wpf

I am evaluating WPF and Silverlight for a Project. I find WPF to be most suited for our purpose since we require performance, graphics support, Office compatibility and the ability to support ActiveX controls. It is also a Desktop application. However there is one area where i find Silverlight to be superior - Media support. I would like to have the WPF mediaelement control to support MPEG4 (H.264) codec.
Can anyone please suggest if this is feasible somehow and if support for the same is in the roadmap of WPF?

The WPF MediaElement uses DirectShow under the convers (well it uses WMP, but WMP uses DShow), so as long as you have an h264 codec installed (Windows 7 comes with them), your MediaElement should be able to play h264 video.

The WPF MediaElement requires the Windows Media Player 10 or above (this can be some deployment problem, so please read the Redistributing Windows Media Player Software) and uses DirectShow filter (codecs) installed on the user's computer. A general rule is if you can play your file in WMP you can play it in MediaElement.
For Silverlight you can found here the Supported Media Formats, Protocols, and Log Fields.

I have some experience with WPF media element but it has some performance hit. so if u have to show image and video you can use D3DImage of WPF in SP1 of .NET 3.5 that is new control of WPF for DirectX interaction and it has better performance over media element. more on D3DImage

Related

WPF Webcam Integration

I am trying to get webcam integration working with a WPF application. There have been a few questions here about getting a webcam functioning in WPF, in this case for image capture. Many people recommend the VideoCaptureElement from the WPF MediaKit. We are currently using this, however it doesn't appear to be particularly performant, there is high CPU usage, and the application experiences slow down after regular use of the camera.
We are looking into either integrating a Silverlight hosted solution, or an ActiveX webcam control hosted using a WindowsFormsHost. Has anyone successfully used either approach in a WPF application?
We decided to drop WPF MediaKit because it proved not to work on certain cameras (to do with pixel formats), and the project wasn't actively being developed.
Instead, we are now using the Capture class in the Emgu CV project, which works very well. There are lots of articles online about using Emgu CV to perform webcam integration.

Play RTSP/MMS/Http live video feeds in WPF

I'd like to pull a live video feed into WPF but the MediaElement doesn't appear to support these protocols. An example video stream is here (BP oil leak live feed):
http://mfile.akamai.com/97892/live/reflector:45683.asx?bkup=45684
Are there any solutions for playing live streaming formats in WPF?
I had hopes for using the VideoLan DotNet component but it appears to be incompatible with the latest VLC releases:
http://vlcdotnet.codeplex.com/
If you're talking an IP Camera, point the WPF Chrome browser to it:
http://chriscavanagh.wordpress.com/2009/08/27/wpf-3d-chromium-browser/
(you'll need to license the Awesomium wrapper if it's a commercial app).
If it's just webcam stuff, use the WPF MediaKit:
http://wpfmediakit.codeplex.com/
I've run both in Windows 7.
Looks like this isn't currently possible in Windows 7:
Link

Why isn't WPF's MediaElement showing my DivX Video?

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!
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.
You need to use a codec that is supported under WPF. DivX isn't.

Video and Audio Editing components

I need to write a video and audio capability in a WPF application. It need to do video and voice capture with basic editing etc.
Does anyone know of any components that could get me going.
Directshow will be required for audio/video capture from a DV camera unless you are running Windows 7. Then you can use Media Foundation. In both cases, you will need .NET interface libraries, which are already completed (Directshow here and Media Foundation here). I'm not sure if the Media Foundation interface library has support for the new capture functionality though.
I would check out the SpeechRecognizer class, which is new in .NET 3.0. In fact the entire System.Speech namespace is a good starting place for voice capture.
As for video, MediaElement is a full-blown FrameworkElement designed to play audio and video, which can be embedded into your WPF applications.

How to stream Webcam in WPF?

Can I stream a live video in WPF application from my web cam? If yes, then How?
You will have to use DirectX Capture or something (is not in WPF right know, so use DirectX API's directly).
Look at: WPF Media Kit. It can grab the Vista Windows desktop manager DirectX Direct3D shared Surface, and use it as a visual brush in WPF. He does some nice things with it. Look at his blog where he explains it.
I hope this helps you on your way...
UPDATE 2009-11-06:
The VideoRenderElement Codeplex project has an example on how to stream webcam content.
This project looks like it would fit your requirment perfectly.
UPDATE 2013-02-18:
Alternatively one can use the Expression Encoder SDK. For an example you can look at the WPF-Webcam-Control article on CodeProject

Resources