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

iOS Camera resolution crash #112

Open
SubashManian opened this issue Apr 22, 2020 · 7 comments
Open

iOS Camera resolution crash #112

SubashManian opened this issue Apr 22, 2020 · 7 comments

Comments

@SubashManian
Copy link

Bar Code scanner won't run iPhone 8 device while set it max resolution. if i set resolution to medium at the time it work's fine but can't able to scan the lower quality bar code in printed copies.

While i set it to max resolution for android it takes the resolution automatically based on the device configuration. but it's not work on iOS

CameraMlVision<List>(
resolution: ResolutionPreset.max,
overlayBuilder: (c) {
return Container(
decoration: ShapeDecoration(
shape: _ScannerOverlayShape(
borderColor: Theme.of(context).primaryColor,
borderWidth: 3.0,
),
),
);
},
detector: FirebaseVision.instance.barcodeDetector().detectInImage,
onResult: (List barcodes) {
},
onDispose: () {
detector.close();
},

@Kleak
Copy link
Contributor

Kleak commented Apr 23, 2020

You should open an issue on the camera plugin since we use it under the hood.

@SubashManian
Copy link
Author

But while set to max resolution iphone 8 memory consumption is more than gb and it leads to crash

@Kleak
Copy link
Contributor

Kleak commented Apr 23, 2020

The only thing we do in this package is getting the video stream from camera plugin and plug it into flutter_firebase_ml_vision plugin.
and we can't fix problem in those package so you will have to open issue on their repository.

@SubashManian
Copy link
Author

SubashManian commented May 11, 2020

Hi @Kleak
I have updated both the flutter and camera plugin to the latest version and tested with high & max resolution with their official sample project, it works fine.
Also i have checked the memory usage it doesn't exceeds 500MB, but when i test the official example of flutter_camera_ml_vision with high & max resolution, it crashes.
please advice

I have attached the image of camera result in max resolution
Flutter Camera Memory

@vasilich6107
Copy link

vasilich6107 commented May 13, 2020

@SubashManian the memory leak crash is known feature of this package. The same works for android.
#103

This package has slightly outdated camera and ml_vision packages.
I could not definitely tell where is the root cause of memory leak.//

There is no much hope for now that this package will be updated...
The easiest way is to copy all the code to your project and adjust according to your needs.

@jaumard
Copy link
Collaborator

jaumard commented May 13, 2020

In fact the leak is probably the usage of both camera and ml_vision, because the frame is going from native camera to dart, then go back to native code on ml_vision to process. I think it's this frame process that give us the leak. And there is currently no way to fix that except doing everything in native.

But if you actually find an easy fix I'll gladly review and merge it. But from what I have search I didn't find any one and I don't have time to dig more

@vasilich6107
Copy link

Vote for the issue
flutter/flutter#60409 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants