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
Related
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.
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
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.
I am trying to evaluate which technology is best for my needs.
I need to display a video I get from some remote device, and let a user
interactively draw on it lines, polygons etc.
I searched and couldn't find any existing applications with this ability
(all the flash applications only displayed video).
Could anyone point me to such an application?
I haven't seen a specific app that allows you to do that, but I can tell you it would be fairly trivial to build it in Flex. You would simply create a transparent Sprite over the video clip, then use the Drawing API bound to various mouse events to do your drawing.
The final image can be saved by using BitmapData.draw() over the container that holds both the video and the canvas, and you can pass a bytearray encoded as PNG or JPG to a server-side script to save it.
I can't speak to Silverlight as I've never used it - but a Flex dev could build a basic sample of this for you in Flex in about 20 mins just as a proof of concept.
Where does your expertise lie?
Silverlight you could knock up a proof of concept rather easily and as Myk points out you could do the same in Flex. So your best bet is really whichever technology your current expertise lies in.
In Silverlight you could use a InkPresenter control above a MediaElement control in about 2 minutes up and running with a video file.
I think the hard part is finding a way to display realtime video from your specific device.
Silverlight supports streaming video so having that device talk with Windows Media Server or Silverlight Streaming sounds like the best bet.
Julie Lerman wrote an Silverlight app that you can draw on Images:
http://thedatafarm.com/blog/tablet/drawing-in-silverlight-article-in-msdn-magazine/
the article was presented at a magazine:
http://msdn.microsoft.com/en-us/magazine/cc721604.aspx
Hopes this helps.
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