How do I play movies in a C# WinForm application - winforms

I am trying to play a movie (wmv,avi,mpg,etc.) in a winforms application. I would like the user to be able to start, stop and pause.
I'm not looking for a full answer ... I just need pointed in the right direction. I've already did some searching on google but could not find anything useful. I can continue searching but I know the stackoverflow community rocks.
So, please point me in the right direction!
Thanks.

I think this is probably the path of least resistance:
http://msdn.microsoft.com/en-us/library/bb383953.aspx

You could use Windows Media Player ActiveX control.
You could also embed a WPF control that contains a MediaElement control.

Another alternative is to use the VLC library instead of Windows Media Player. The VLC Forums have a number of wrappers that can be used in C#.
I have not done a comparison of VLC versus Windows Media Player, but it is alot less resource intensive then the WPF media elements.
If I remember correctly VLC also has built in support for alot of video formats, potentially making it a better choice I guess.

One possibility is to use the Forms.WebBrowser class. This will give you an embedded web browser so you can install what ever player and plugins you need.

It depends on how complicated you want to get, but I've had luck implementing DirectShow before. It's definitely more complicated than a drop on control, but it's really flexible for different formats and loading codecs.

Related

Use Adobe Flash/AIR VOIP in Winforms

Since there are no answers yet, I'm going to rewrite this question in hopes of an answer (I don't mind discussion, but I know SO is about Q&A). It appears security checks/prompts make it unfeasible to use Flash Player. With this in mind, the question still stands, but please answer based on experience using AIR.
I have a Winforms app written in C# that I need to add VOIP to. I really like how well the Flash Player VOIP solution works, the AEC (echo cancel) is awesome. I know they use Speex, but the implementation is still a lot of work even using Speex, so I'd like to use Adobe's solution directly in my app.
Has anyone done this? What issues will I have? A few I can think of:
IPC between AIR and Winforms app. I assume this is easy and several options, including sockets/network, file i/o, maybe others.
Based on this
Content running in the AIR application sandbox does not need the
permission of the user to access the microphone
I don't think security warnings will be an issue? I'm not sure what a sandbox is yet, but as long as my AIR app can run in this and still talk with my winforms app, then shouldn't be an issue.
I assume the voice capture including enhancements (AEC, NS, Speex, etc) are supported in AIR?
Are there any samples I can run that use voice capture in AIR?

WPF video recording

Im building a WPF 4.0 application and I want to include the ability to have a web-cam beside the PC running the app and I want to be able to record a video message. I cannot find any articles on this, and it seems like it might be a bit tricky...
Has anyone had any experience with this or know where to start?
lots of good stuff out there, eg:
http://easywebcam.codeplex.com/
http://khason.net/blog/webcam-control-with-wpf-or-how-to-create-high-framerate-player-with-directshow-by-using-interopbitmap-in-wpf-application/
http://blogs.msdn.com/b/cmarchal/archive/2006/08/25/724224.aspx
EDIT: for recording:
http://blogs.msdn.com/b/uberdemo/archive/2008/03/27/capturing-a-webcam-stream-to-a-wmv-file-from-within-a-wpf-application.aspx
http://videorendererelement.codeplex.com/

Realtime 1394 firewire video in a WPF app via directx or other method

Are there any controls that anyone is aware of that I can use to stream firewire video into a WPF app. I do not need camera control or capture just the video. I need WPF hosting because I'll be adding WPF content on top.
I was hoping that with the addition of having direct X surfaces in WPF something like this might appear.
Ideally looking for something relatively high level (not a direct show guy at all).
Thanks,
Brian
There are a couple really good video rendering packages for WPF. This guy Jeremiah Morrill has a blog where he discusses his numerous render projects. There's the WPF Win32 render project, and a number of low-level techniques he documents for how to access accelerated playback, Media Foundation .NET, DVD controls, etc... I believe his blog is titled "Jer's One Stop Shop".
Reading over his blog in general is a good idea if you are in to video/WPF. Last I checked, "MediaKit", one of his more comprehensive projects, enables easy use of DirectShow (simple xaml and your off and running, so don't worry) and other well known native interfaces. It's very robust and actively maintained, if not that specific project, check into some of the recent API's he's contributing on, some various Win7 media support also.
The only reason I'd bring up this other project, Augmented Reality, is that you remarked about adding content "on top". You should definitely check out wpfAugRel if your doing a lot of video production. Where to get an add on for it eludes me, but I'm sure you can find it off that site, but it allows for you to script in python some fairly slick real-time video production.
-- edit --
Right, look at this google code page, it has some video's (picture's worth a thousand words right?), but regardless, it allow's you to mix in 3D content into live-action, through the use of "marker" prop's, essentially bit's of paper with some easily machine recognizable feature's, that facilitate their underlying engine to inject computer rendered output into a real world scene, highly dynamic, so you can toss these marker's around and the 3D content move's fluidly... anyhow good luck.
Check out this article by UberDemo. It captures video into a WMV file with Windows Media Encoder and WPF. There is a paragraph about how to do the preview in a WPF application.

How do I implement an address location bar (bread crumb control) similar to that in Windows Vista's File Explorer?

The explorer control in Windows Vista is very handy and I would like to be able to incorporate it in an application written in WPF. I've been unable to find a stock control that is part of the Framework. This application is being specifically developed for Windows Vista and therefore, having the same look and feel as the OS is desirable.
One could use the Microsoft.Win32.OpenFileDialog, but the problem with that is that it looks nothing like Vista's so it sticks out like a sore thumb.
Any thoughts on a good implementation would be most helpful. I would like to stay away from Third Party components if possible, but am definitely open to all suggestions.
Actipro makes a really good WPF breadcrumb control. There's also an open source WPF breadcrumb control that I might actually give a try.
I haven't yet tried it but look at VistaBridge... It gives you all the Vista look dialog boxes!
There is a replacement for the Microsoft.Win32 file dialogs on my blog that gives you the Vista look without the complexity of VistaBridge and is also backward compatible with XP.
http://www.nbdtech.com/blog/archive/2008/07/15/Vista-style-open-and-save-dialogs-with-WPF-without-using.aspx
At the risk of sounding self-serving, the best Breadcrumb control for WPF you can find is here:
http://www.teraque.com/Products/Explorer-Chrome-Suite
I've spent a year trying to reverse engineer the Window's Vista control because none of the off-the-shelf products provided the right look-and-feel. You will run into the limitations of all of the suggestions above sooner or later. And, having been through it myself, I can tell you that trying to embark on developing the controls yourself will take you months. The oddities surrounding the overflow logic alone will be enough to eat up two months just to get it right.
Good luck. If there's anything I can answer for you, please feel free to contact me.
Donald Roy Airey
Donald.Roy.Airey#teraque.com
If you are coding for the .net Framework 3.5, calling for the common dialog should display the correct Vista era dialog.
Sorry, appears I was mistaken. In previous projects, I was using this library to call the Vista dialogs.

Graph visualisation in Silverlight

I have a data structure that represents a directed graph and I'm looking for a good Silverlight visualisation to allow me to navigate from node to node, preferably with some nice animation.
Does anyone know of any good UI controls or frameworks for this kind of display? Even a sample from another field (maybe a social network?). My graphs don't have many nodes so performance won't be an issue.
I've seen the Prefuse library for Java (and Flash) which would be ideal. The "Degree of Interest" visualisation is the kind of thing I'm after, but I can't find anything in Silverlight.
Thanks for any tips.
There's an open source option that's part of the Silverlight Bag-O-Tricks. Check it out and see a demo here (use the first demo link):
http://www.codeplex.com/BagOTricks
There's also a WPF version:
http://j832.com/bagotricks/
Try this one
http://graphlight.codeplex.com/
I made a graph library for Silverlight, that uses Dot as basis.
Please check out: http://dot2silverlight.codeplex.com/
I am making some improvements to support more shapes and types of arrows.
daniela
Must admit I haven't tryed it out yet my self but quickgraph looks promissing
#Rune FS
QuickGraph has no visualisation capabilities, at least not for Silverlight. It just handles the graph data structures and algorithms.
QuickGraph does make it easy to construct a graph and output to Directed Graph Markup Language (DGML) which can be viewed in VS 2010. I just checked in changes to the project and I noticed that it has been designed to be built for inclusion into Silverlight. So perhaps you could use it in conjunction with a silverlight DGML viewer

Resources