English 中文(简体)
ASP.NET Application Webcam Capture
原标题:

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

最佳回答

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.

问题回答

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.

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/

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.





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签