mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
5.11k stars 984 forks source link

Adjusting the Camera Resolution for Flutter Web App #899

Open Davvel opened 9 months ago

Davvel commented 9 months ago

Can this bar / qr code reader have a way to increase camera resolution when reading bar codes from a flutter web application. Small bar codes are giving me problems to read.

ROBERT-MCDOWELL commented 9 months ago

it really depends on you device, its zoom and focus. however less than 1cm length is not possible, unless a macro zoom I guess. also html5-qrcode is limited to JavasScript sandbox, meaning that all hardware issues are often related to the browser/OS settings, drivers and hardware quality. html5-qrcode has a zoom and focus settings (check the docs) but it really depends of how the browser and os permissions are set and the drivers.

Davvel commented 9 months ago

Just to clarify, this is the futter package I am using "qr_bar_code_scanner_dialog.dart" and I tried my best to see if I can find a setting where I can increase the default camera resolution or scan speed but could not find anything that works. I am trying to use this package from an android mobile phone which is accessing a flutter web application hosted on firebase.

ROBERT-MCDOWELL commented 9 months ago

any other wrapper language like dart etc.. depend on JavaScript sandbox and btw all concerning hardware settings and control depend on OS and browser permissions and driver capacity. you can have android on a samsung A53 and it works well because the camera drivers and permissions are all fine to control from html5-qrcode the zoom and focus, but another device with the same OS and settings cannot.

Davvel commented 9 months ago

The bar codes I am trying to read can be read perfectly by the dynamsoft library for flutter as they have a setting for camera resolution and once I set it to high or veryHigh it could scan these small bar codes. The bar codes are 2mm high by 3.5cm wide.

ROBERT-MCDOWELL commented 9 months ago

so why not to use dynamsoft and insist to use html5-qrcode? btw I guess the camera is set to low resolution for default pixel size. maybe you should increase the camera resolution to 1080p

Davvel commented 9 months ago

Hi Robert, do you know how I can increase the camera resolution from the application?

ROBERT-MCDOWELL commented 9 months ago

check the geUserMedia function

Davvel commented 9 months ago

Thanks for all your help, All values I touched in the getUserMedia did not give me errors but did not make any change in the bar code scanning so far. I am still hopeful that there is a way of taking benefit from the mobile camera from a flutter web app.

ROBERT-MCDOWELL commented 9 months ago

at what resolution you camera is set for now?

Davvel commented 9 months ago

I could not find a way to set or read the current camera resolution. Not sure if you could guide me in what to add in flutter demo I have. Thanks.