Comments (13)
This only seems to happen when using runAsync
. If I use runAtTargetFps
(tested with 15 FPS for now), it works seamlessly.
from react-native-vision-camera.
I made a minimal reproducer.
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
runAsync(frame, () => {
'worklet'
foo(frame)
console.info('run frame processor')
})
}, [])
And the definition of foo
should be
const foo = (frame: Frame) => {
'worklet'
frame.height
}
When foo
doesn't include any access to frame
's property(height
here), the frame processor doesn't stop.
from react-native-vision-camera.
@mrousavy I messed up with issues I'm subscribed π this don't have anything to do with worklets-core. Sorry.
But anyway, what solved this "freeze" issue for me was incrementing frame ref count before doing anything else with frame. Ex:
const faces = detectFaces( frame )
const internal = frame as FrameInternal
// incremend frame ref before doing any task with frame
internal.incrementRefCount()
runOnJs(
faces,
frame
).finally( () => {
'worklet'
// decrement frame ref after all tasks
internal.decrementRefCount()
} )
@bglgwyng Hope this helps
from react-native-vision-camera.
I fixed this issue in my latest PR to main.
Ref counting now works properly on iOS as well
from react-native-vision-camera.
@mfkrause Hey, you're using my face detection package, glad it's helping you π
I had the same problem and as a workaround I added frame data inside detection result data, so instead of using frame.height
try using result.frame.height
.
For me this works.
The most strange thing is that on androi it works, you can use frame data directly without any issue but on IOS it freezes after some frames
from react-native-vision-camera.
Check this, get the result and operate on the current processor and not on the callback
luicfrr/react-native-vision-camera-face-detector#28
from react-native-vision-camera.
Hey - I think this issue has been fixed in VisionCamera 4.0.0. π₯³
Please try V4 and let me know if you still experience this issue;
- if not, please consider π sponsoring me on GitHub π to support the development of VisionCamera and thank me for my time spent on fixing bugs and building new features.
- if you still see this issue, please comment and we can re-open this. But please update your native logs with the native (Xcode/Android Studio) logs from running VisionCamera V4 so I can investigate this.
from react-native-vision-camera.
more accurately; react-native-worklets-core 1.x.x fixed this issue I think.
from react-native-vision-camera.
I think we need to reopen this issue.
I still observe the same behavior with [email protected] and [email protected].
from react-native-vision-camera.
Ah shit. Well can we create a new issue with logs from latest react-native-vision-camera and rnwc then?
from react-native-vision-camera.
@mrousavy I created a new issue on worklets-core repo with all logs from latest versions
from react-native-vision-camera.
Great, thanks
from react-native-vision-camera.
Thanks! But isn't it a workaround? runAsync
internally increases/decreases the ref count. Should we perform this redundant operation?
from react-native-vision-camera.
Related Issues (20)
- π [V4][Android] Release crash: maxImages (6) has already been acquired HOT 1
- π§ 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 11
- π 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
- π§ HOT 1
- Torch does not work on CodeScannerπ HOT 1
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.