最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - getUserMedia lock focusexposure - Stack Overflow

programmeradmin0浏览0评论

I am using navigator.getUserMedia with constraints to access the user's webcam, using the feed as the source of an HTML <video> and then copying its stream to drawImage a <canvas> context. I'm doing all this so I can take a snapshot at intervals.

What I would like to do is, once the page starts taking snapshots, lock the getUserMedia camera's focus/exposure, so that in between snapshot intervals the environment can change without the light balance changing or the camera refocusing.

Does anyone know if this is possible on the JS side?

I am using navigator.getUserMedia with constraints to access the user's webcam, using the feed as the source of an HTML <video> and then copying its stream to drawImage a <canvas> context. I'm doing all this so I can take a snapshot at intervals.

What I would like to do is, once the page starts taking snapshots, lock the getUserMedia camera's focus/exposure, so that in between snapshot intervals the environment can change without the light balance changing or the camera refocusing.

Does anyone know if this is possible on the JS side?

Share Improve this question asked Mar 29, 2015 at 1:12 Jody HeavenerJody Heavener 2,8745 gold badges44 silver badges72 bronze badges 6
  • 7 Not yet. Unfortunately, WebRTC does not allow photo-level access to cameras, but a new Image Capture spec is being worked on to solve this. None of the browsers implement it yet though. – jib Commented Apr 6, 2015 at 0:36
  • 1 Chrome Beta 56 does ship with a first draft of the Image Capture API. See the release info: androidpolice./2016/12/14/… – geekonaut Commented Dec 21, 2016 at 20:56
  • Look at this example : jsfiddle/zlatnaspirala/u2f9wbzh , ok this is not webrtc . It is possible 100%. Look at webrtc-experiment. (recording , capture etc...) – Nikola Lukic Commented Feb 17, 2017 at 8:21
  • Possible duplicate of Take photo when the camera is automatically focused – Marcus Commented Sep 15, 2019 at 6:25
  • @Marcus this question is years older but
发布评论

评论列表(0)

  1. 暂无评论