You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have setup a fresh basic expo development build project, created a default camera page and tried to use the useSkiaFrameProcessor hook. Nothing is inside it, except the frame.render() function.
When I try to open the camera preview, I get the following exception with a black preview screen: Frame Processor Error: Exception in HostFunction: Failed to convert NativeBuffer to SkImage!, js engine: VisionCamera
After playing around I tried to change the "pixelFormat" prop to rgb. That fixes the exception from occuring, but shows a "rgb-preview-image"?
Using the normal useFrameProcessor hooks works without any issues.
I am testing on the following device: Samsung S24+ with Android 14
I have attached a small part of the logcat logs before the exception appears, the basic expo project as a zip and
also the full logcat logs from android studio as a text file for both pixel formats.
VideoCapture com.anonymous.lorcanascanner D cameraCaptureResult timestampNs = 1721106362091877, current system uptimeMs = 816185653, current system realtimeMs = 1721106446
skia com.anonymous.lorcanascanner D Could not create EGL image, err = (0x300c)
RNSkia com.anonymous.lorcanascanner I Failed to convert HardwareBuffer to OpenGL Texture!
ReactNativeJS com.anonymous.lorcanascanner E Frame Processor Error: Exception in HostFunction: Failed to convert NativeBuffer to SkImage!, js engine: VisionCamera
Thank you for providing detailed information about your issue. It looks like a valid bug with the use of useSkiaFrameProcessor.
A few things to consider: Have you tried reproducing this issue in the VisionCamera Example app? This will help us determine if it's specific to your project setup. Also, please ensure your environment matches the library requirements and test with different pixel formats.
If the problem persists, providing specific logs from adb logcat during the error occurrence will be useful for mrousavy.
Let’s keep this open while we gather more insights!
Note: If you think I made a mistake, please ping @mrousavy to take a look.
I can confirm that something similar is happening in the example project on my S24. Switching the useFrameProcessor hook to a useSkiaFrameProcessor hook and adding a frame.render() call before the runAtTargetFps() results in the following error.
Frame Processor Error: Cannot get Platform Buffer - getNativeBuffer() requires HardwareBuffers, which are only available on Android API 26 or above. Set your app's minSdk version to 26 and try again.
When I edit the build.gradle file's minSdkVersion as recommended to 26, the app returns the same multicoloured preview image for a few seconds and then crashes. In my case though, when I set the pixelFormat prop to 'rgb' then I get a few frames of normal camera function before it hangs then exits.
I have attached what I think are the relevant logs from Android Studio but I have never used it before now so apologies if they are some not very helpful ones.
What's happening?
I have setup a fresh basic expo development build project, created a default camera page and tried to use the useSkiaFrameProcessor hook. Nothing is inside it, except the frame.render() function.
When I try to open the camera preview, I get the following exception with a black preview screen:
Frame Processor Error: Exception in HostFunction: Failed to convert NativeBuffer to SkImage!, js engine: VisionCamera
After playing around I tried to change the "pixelFormat" prop to rgb. That fixes the exception from occuring, but shows a "rgb-preview-image"?
Using the normal useFrameProcessor hooks works without any issues.
I am testing on the following device: Samsung S24+ with Android 14
I have attached a small part of the logcat logs before the exception appears, the basic expo project as a zip and
also the full logcat logs from android studio as a text file for both pixel formats.
lorcana-scanner.zip
Logcat-pixelFormatRGB.txt
Logcat-pixelFormatYUV.txt
If there is anything else, that I can provide for debugging this issue, let me know. I am happy to help.
Reproduceable Code
Relevant log output
Camera Device
Device
Samsung S24+ (Android 14)
VisionCamera Version
4.6.4
Can you reproduce this issue in the VisionCamera Example app?
I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Additional information
The text was updated successfully, but these errors were encountered: