Git Product home page Git Product logo

Comments (11)

santiagofm avatar santiagofm commented on June 16, 2024

Related to #2862 & maybe #2684

from react-native-vision-camera.

santiagofm avatar santiagofm commented on June 16, 2024

While debugging I came accross the bindToLifecycle doc that clearly states:

...
Currently up to 3 use cases may be bound to a Lifecycle at any time. Exceeding capability of target camera device will throw an IllegalArgumentException.
...

So this issue seems to be an api limitation?

I can consistently repro this when I ahve more than 3 "video outputs" enabled at the same time(preview, photo, codescanner, frame processors) and it works fine when I remove any of them.

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 16, 2024

Can you try setting qualityPrioritization="speed"?

I built VisionCamera to not have that limitation (that was a huge issue in native Camera APIs, so it's hard to work around this issue)

from react-native-vision-camera.

santiagofm avatar santiagofm commented on June 16, 2024

Can you try setting qualityPrioritization="speed"?

I built VisionCamera to not have that limitation (that was a huge issue in native Camera APIs, so it's hard to work around this issue)

I guess you meant photoQualityBalance but yeah, same result.

Isn't it a limitation on the camera api itself?

...
Currently up to 3 use cases may be bound to a Lifecycle at any time. Exceeding capability of target camera device will throw an IllegalArgumentException.
...

from react-native-vision-camera.

santiagofm avatar santiagofm commented on June 16, 2024

@mrousavy Sorry if I'm missing something implementation wise, but it seems like we are assuming all devices will support binding any number of use casesβ€” or at least that the camera api will disregard if not supported. Which doesn't seem to be the case and the camera API will just throw an exception.

Seems like we should be using the hardware_level of the device to determine the number of use cases that are supported? Not sure how the one thing translates to the other though.

I will try to fold the code scanner into my custom frame processor to reduce the number of use cases and workaround this. We cannot use multiple Camera components at the same time right? Even if one of them has the preview disabled?

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 16, 2024

but it seems like we are assuming all devices will support binding any number of use cases

No;

  • On iOS, I am explicitly checking if this is supported and Frame Processors and Video Capture have been carefully put together into a single video stream
  • On Android, CameraX already uses a similar feature under the hood called "stream sharing". So you could use any number of outputs here, although that feature is still in beta.

from react-native-vision-camera.

santiagofm avatar santiagofm commented on June 16, 2024

but it seems like we are assuming all devices will support binding any number of use cases

No;

  • On iOS, I am explicitly checking if this is supported and Frame Processors and Video Capture have been carefully put together into a single video stream
  • On Android, CameraX already uses a similar feature under the hood called "stream sharing". So you could use any number of outputs here, although that feature is still in beta.

Aha! Sorry, I didn't know that was a thing on Android(iOS works perfectly btw); unfortunately it doesn't seem to work as we would want it to :/

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 16, 2024

Hey - just created a PR to maybe fix this - can you test if that works for you? #2897 πŸ™

from react-native-vision-camera.

santiagofm avatar santiagofm commented on June 16, 2024

Hey - just created a PR to maybe fix this - can you test if that works for you? #2897 πŸ™

Will test it later today πŸ™ŒπŸ» !

I ended up implementing the barcode recognizer with mlkit on a frame processor to reduce the number of outputs btw, that seems to work fine.

from react-native-vision-camera.

santiagofm avatar santiagofm commented on June 16, 2024

Hey - just created a PR to maybe fix this - can you test if that works for you? #2897 πŸ™

Hey! I just tested on a Xiaomi Redmi 13C and it's still throwing the error. I'm using 4 video outputs: preview, take photo programatically, built-in code scanner, frame processors.

from react-native-vision-camera.

mrousavy avatar mrousavy commented on June 16, 2024

Well then that means that the StreamSharing feature is not working properly on that specific phone.

We'd need to report that bug to Google/CameraX.
I don't have the time to do that right now, so I'd really appreciate it if you took the time to do that (I mean it's also in your interest to get that fixed)

from react-native-vision-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.