vue-qrcode-reader icon indicating copy to clipboard operation
vue-qrcode-reader copied to clipboard

Possible Features to Adjust Camera Expossure

Open mich1342 opened this issue 6 months ago • 5 comments

Hi,

Could we adjust the expossure of the camera? It would be great to scan QR Code shown in a display like OLED screen

mich1342 avatar Dec 14 '23 15:12 mich1342

Looks like there the API offers something related to exposure:

https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#exposuremode

Haven‘t tested but I suspect browser support is bad (especially Safari). Anyway, adding a prop for this shouldn’t be too hard.

gruhn avatar Dec 14 '23 20:12 gruhn

Just add a comment here: There's a write-up on how to properly apply this constraint and check for its support: https://webrtchacks.com/bad-lighting-fix-with-javascript-webcam-exposure/#post-3807-_ttmtkt8og756

And here is a playground to tweak with the constraints: https://live.mdnplay.dev/en-US/docs/Web/API/Media_Capture_and_Streams_API/Constraints/sample.Example_Constraint_exerciser.html

I'm able to control the exposure time of the camera video in this playground with the following constraints object:

{
  "advanced": [
    {
      "exposureMode": "manual",
      "exposureTime": 200
    }
  ]
}

Sec-ant avatar Dec 15 '23 04:12 Sec-ant

Ok so this probably just boils down to adding two props here. Maybe exposure-mode and exposure-time. Adding the values to the cameraSettings object here. That should automatically trigger the watcher that requests a camera. The cameraSettings object is passed to this function which then calls runStartTask here. And in runStartTask we can somehow implement the logic mentioned in this article:

Just add a comment here: There's a write-up on how to properly apply this constraint and check for its support: https://webrtchacks.com/bad-lighting-fix-with-javascript-webcam-exposure/#post-3807-_ttmtkt8og756

gruhn avatar Dec 15 '23 12:12 gruhn

This issue has been marked as stale. If there is no further activity it will be closed.

github-actions[bot] avatar Feb 14 '24 00:02 github-actions[bot]

I can look into this after vacation (~2.18).

Sec-ant avatar Feb 14 '24 03:02 Sec-ant

This issue has been marked as stale. If there is no further activity it will be closed.

github-actions[bot] avatar Apr 15 '24 02:04 github-actions[bot]