9

Is it somehow possible, in javascript, to retrieve technical information about the device camera, such as focal length?

NB: my goal is not to extract EXIF tags from an existing file (like in Read meta data from image file with javascript) but to find information about the current device camera.

Community
  • 1
  • 1
sdabet
  • 18,360
  • 11
  • 89
  • 158
  • possible duplicate of [Read meta data from image file with javascript](http://stackoverflow.com/questions/5929356/read-meta-data-from-image-file-with-javascript) - I believe this is what you are looking for. Because as you know focal length, iso, etc is stored in metadata – Adjit Apr 27 '15 at 16:07
  • @Adjit I don't have any image file actually. – sdabet Apr 27 '15 at 16:11
  • You're talking about a camera attached to the computer and/or handheld device? – Jamie Barker Apr 27 '15 at 16:11
  • @JamieBarker Precisely. I'm talking about the device's camera. – sdabet Apr 27 '15 at 16:12
  • No. Chrome supports [choosing the camera](http://stackoverflow.com/questions/14610945/how-to-choose-input-video-device-for-webrtc) but with little provided information. Unfortunately for your case, access to external resources and devices via the browser is limited. – chRyNaN Apr 27 '15 at 16:14
  • And you're only looking for solutions in the browser? – nils Apr 27 '15 at 17:20
  • @nils Yes, definitely. – sdabet Apr 27 '15 at 17:45
  • possible duplicate of [How do I extract the metadata of a local image in Javascript?](http://stackoverflow.com/questions/15562372/how-do-i-extract-the-metadata-of-a-local-image-in-javascript) – TylerH Apr 29 '15 at 21:40

1 Answers1

2

Coming to a Firefox browser near you (apparently in version 39):

https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices.

The MediaDevices.enumeratedDevices() method collects information about the media input and output devices available on the system.

Doesn't look like it will contain the information you want, but potentially will be available in the future. W3C Editors Draft.

Jamie Barker
  • 8,145
  • 3
  • 29
  • 64