-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSQR is using too much CPU #86
Comments
So generally scanning images is going to use CPU. We've made strides to reduce the amount of CPU (and memory) that jsQR uses, especially in the v1 refactor. That said I certainly agree it could be better. #78 for example will cut down the CPU cycles per image by ~30% (when inverting is disabled) I think. Going to keep this issue open to track general CPU improvements but we should probably try to define some metrics etc or we'll never be able to close it. Not sure if you have any ideas around that? |
Is it possible to move some of the processing to service workers somehow? We also find that especially from a live stream, it becomes almost impossible to scan a QR code on a phone. |
Check this out https://github.com/tigranbs/reactive-qr |
Thanks that looks good, I will try to refactor it for Vue. |
Is there a way to destroy the scanner when it has grabbed a code? So it only is running when called. similar to this example: <script type="module"> const videoElem = document.getElementById('video'); // When you click a scan button, create the instance $('.scanner-btn').on('click', function () { const qrScanner = new QrScanner(videoElem, result => { $('#search_string').val(result); setTimeout(function () { $('#form').submit(); // After i submit the code for validation, destroy the instance ( since it uses alot of CPU) qrScanner.destroy(); }, 100); }); qrScanner.start(); }) </script>any help appreciated thanks |
JSQR is using a lot of CPU. When the cam is turned on, the use of cpu increases by 50%. How to solve this?
The text was updated successfully, but these errors were encountered: