Skip to content
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

CameraView in .net MAUI taking too much time for scanning barcode and QR code #19097

Closed
vplife1 opened this issue Nov 29, 2023 · 4 comments
Closed

Comments

@vplife1
Copy link

vplife1 commented Nov 29, 2023

Description

CameraView Performance Issue: Slow Barcode/QR Code Scanning

I am experiencing a significant performance issue with the CameraView in my .NET MAUI app when scanning barcodes and QR codes. The scanning process is taking much longer than expected, leading to delays in my application.

UI Code
<Label x:Name="barcodeResult" FontSize="20"/> <cv:CameraView x:Name="cameraView" WidthRequest="300" HeightRequest="200" CamerasLoaded="cameraView_CamerasLoaded" BarCodeDetectionEnabled="True" BarcodeDetected="cameraView_BarcodeDetected"/>

Scan code
`private void cameraView_CamerasLoaded(object sender, EventArgs e)
{
if (cameraView.Cameras.Count > 0)
{
cameraView.Camera = cameraView.Cameras.First();
MainThread.BeginInvokeOnMainThread(async () =>
{
await cameraView.StopCameraAsync();
await cameraView.StartCameraAsync();
});
}
}

    private void cameraView_BarcodeDetected(object sender, Camera.MAUI.ZXingHelper.BarcodeEventArgs args)
    {
        MainThread.BeginInvokeOnMainThread(() =>
        {
            barcodeResult.Text = $"{args.Result[0].BarcodeFormat}: {args.Result[0].Text}";
        });
    }`

Steps to Reproduce

Launch the .NET MAUI app.
Navigate to the page containing the CameraView for barcode/QR code scanning.
Attempt to scan a barcode or QR code.
Observe the time it takes for the scanning process to complete.

Expected Behavior:
I expect the barcode/QR code scanning process to be quick and responsive, providing results promptly.

Actual Behavior:
The scanning process is noticeably slow, and there is a significant delay before the results are obtained.

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

NA

Relevant log output

No response

@vplife1 vplife1 added the t/bug Something isn't working label Nov 29, 2023
@Ghostbird
Copy link
Contributor

Are you sure this is a MAUI issue? AFAIK there is no CameraView in MAUI.

@vplife1
Copy link
Author

vplife1 commented Nov 29, 2023

@Ghostbird yes it's not a MAUI control, I am using this third-party control "Camera.MAUI" for scanning Barcode and QR code

@DxsSucuk
Copy link

Shouldn't the Issue then be created here: https://github.com/hjam40/Camera.MAUI/issues

@drasticactions
Copy link
Contributor

Shouldn't the Issue then be created here: https://github.com/hjam40/Camera.MAUI/issues

I agree, this issue should go to the creators of the control. If there's an issue that they are having that is causing the slow performance that's specific with MAUI, we can make a new issue for that.

@drasticactions drasticactions closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants