Comments (11)
Related to #2862 & maybe #2684
from react-native-vision-camera.
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.
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.
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.
@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.
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.
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.
Hey - just created a PR to maybe fix this - can you test if that works for you? #2897 π
from react-native-vision-camera.
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.
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.
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)
- π§ Not able to build expo dev client when using any of the given frame processing plugin for OCR HOT 2
- π [Android] isActive change doesn't happen fast enough causing device/camera-already-in-use error when switching to native camera app HOT 1
- π§ Execution failed for task ':react-native-vision-camera:compileReleaseKotlin'. HOT 3
- π§ This API is provided only for React Native frameworks and not intended for general users. This API can change between minor versions in alignment with React Native frameworks and won't be considered a breaking change. HOT 10
- π Android: Frameprocessor HOT 7
- π Focus not work HOT 1
- π Memory leak Android HOT 6
- π [iOS] Did someone manage to get to reasonable FPS with ML Kit Pose Detection (native frame processor plugin)? HOT 2
- π Lifecycle methods for native frame processors HOT 5
- π How to access GPS location tags in photo metadata? HOT 4
- π takePhoto() function working very slowly on Android HOT 3
- π§ A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction HOT 12
- π How does RNVC interact with OS camera settings? HOT 1
- π Is there a migration guide from V3 to V4? HOT 2
- π§ :react-native-vision-camera:compileDebugKotlin FAILED HOT 2
- Torch does not work on CodeScannerπ HOT 3
- π Hello, Which version of react-native-vision-camera supports RN 0.67? HOT 1
- Build failed with face-detector pluginπ§ HOT 3
- π Torch does not work on CodeScanner HOT 2
- π How to translate preview point to screen point with resizeMode contain? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-vision-camera.