views:

525

answers:

4

Ok, so I have seen a ton of stuff on capturing an image from a web cam but I want to capture video. I want to be able to control quality, length and size of file that will be transferred.

It is part of an ASP.NET MVC C# web application and would appreciate any guidance in finding info on this topic, as well as any comments on efficiency , security, etc.

Thanks

+1  A: 

What exactly do you want? Do you have a WebCam on the server and want to display something to the user? In that case, look at WIA, there are .net Wrappers for it.

Or do you have a WebCam on the client and want to upload Video to the server? For that, you need something on the Client Side. As Silverlight doesn't support WebCams, you could use Flash. Not exactly sure how to upload it, but I think you can send a bytestream (via POST) to a Method that accepts a byte[] as Input.

Edit: As you want to capture a webcam on the client, you need to write someone client-side. Flash is the most common choice, and there is a related question here that you could use as a starting point. The hard part is getting the video, uploading it to the server should be straight-forward after that.

Michael Stum
On the client, I want them to be able to create a video profile.
Dustin Laine
+3  A: 

For security reasons, linking to external hardware devices is not a capability that is permitted by most browsers. You will need to use a technology like Flash or ActiveX that has a binary presence on the client's computer and can bypass the browser security model; ASP.NET MVC all by itself won't cut it.

John Feminella
+1  A: 

I've done this several times at work. You'll have to do this either with an active x control that you write or you can use a distributed active x control that the web cam manufacturer makes (logitech used to make one, etc).

If you want a live preview on the actual page itself, direct show is a good bet. TWAIN (from what I remember) doesn't give you the ability to preview the feed.

Things that will impact your implementation:

  • Do you want it embedded in the page or is popping open a new window ok?
  • Do you want a live feed
  • What web cams do you want to support

There are some other things that have an impact, but you just need to be aware that your clients are going to have to install some client side software that you write (or that their webcam manufacturer provides)

Oh and MVC has nothing to do with it, thats just the server side technology that renders content on the server.

Allen
+1  A: 

Your best bet is to use Silverlight 4 to get access to the user's webcam. At the moment Silverlight 4 is still in beta but it won't take long until it goes out of beta. Silverlight uses a subset of the .net framework so you can reuse your existing knowledge.

Check out: http://silverlight.net/learn/

ZippyV