0

I know a webapp can access media devices like microphones and webcams, and other hardware like a smartphone's GPS. As far as I know, that's done with tightly constrained protocols for each specific type of device.

However, I have an advanced scientific camera. It is only useful with a computer - it ships with a desktop application for controlling it and taking photos. It also ships with a C/C++ SDK to interface with it in your own applications.

The browser obviously doesn't recognize it as a webcam. Even if it did, all but the most basic functionality would be ignored. The camera is on the client side. Is it possible to write a webapp that can interface with that camera and use all of its features? I'm not looking for a full solution, I just don't even know what to google.

Any amount of hand-rolled solution is fair game here. Anything from plain JavaScript to browser plug-ins to a custom desktop middleware psuedo-driver to sit between the hardware and the camera and the browser. Even binding the client to a specific OS is fine.

kdbanman
  • 10,161
  • 10
  • 46
  • 78
  • 1
    I think you really need support from the vendor on this one. Then a driver and only after that it becomes a browser/javascript problem. The vendor would advertise such a feature, so if he doesn't chances are there's no way you can do that. Drivers would only need to support a protocol (like TWAIN for scanners). I don't know anymore about this topic. – pid Jun 22 '15 at 15:33
  • You didn't specify anything about what kind of webapp that would be. If, for example, your backend is a Node server, you could write your own extension which could execute C/C++ code. – marekful Jun 22 '15 at 15:33
  • Also, the OS is important. Is it Windows or Linux? It looks like this is a topic for another StackExchange site (ServerFault)? Or the tags are pretty misleading. – pid Jun 22 '15 at 15:35
  • @marekful, the backend is irrelevant, I want to access the camera from the client side. – kdbanman Jun 22 '15 at 15:35
  • According to your linked page the camera interfaces via ethernet? Surely it would be a matter of issuing network commands via whatever interface it supports? That interface is going to be a big factor in the solution – CodingIntrigue Jun 22 '15 at 15:38
  • @pid, this definitely isn't a ServerFault community problem. I want a web application client to interface with hardware on the client side. The SDK is for windows, which is the only OS specific thing I can think of. Targetting windows is fine. – kdbanman Jun 22 '15 at 15:39
  • @RGraham, that's a fine idea, but a client webapp has no access to a client's private network. – kdbanman Jun 22 '15 at 15:40

1 Answers1

1

You can do basic video capture and screen grabs with Silverlight: https://msdn.microsoft.com/en-us/library/ff602282(v=vs.95).aspx

It also scriptable by Javascript: https://msdn.microsoft.com/en-us/library/cc645085(v=vs.95).aspx

Problem is, Silverlight is going away. Officially not until October 2021 though so that might still be an option until the browser vendors come online with HTML 5 Media Capture and Streams: http://w3c.github.io/mediacapture-main/getusermedia.html

Anything beyond basic capture though, your probably looking at a custom browser extension to control the camera's functions thought it's provided API

Rob Kraft
  • 216
  • 3
  • 6
  • Excellent, thank you. That agrees with my suspicions and the comments on my question. The browser extension solution is the one I'll explore. – kdbanman Jun 22 '15 at 17:31