Open zexueteh opened 1 month ago
Can you try setting your pixelFormat
to rgb
or yuv
to see if there's a difference?
Trying in the Example App pixelFormat
to yuv
produces similar results
however rgb
turns the filter grey, as seen here
Does it render if you do not pass a paint
to the render(..)
function?
Yup, it does render, but theres definitely some overhead due to the frameprocessor.
Then it surely is the paint
(or the shader) that's wrong. I think this is more of a question than a VisionCamera bug report.
Overhead; yea I can see that it only runs at 3 FPS on this Android phone - is that an old phone? @wcandillon I think this is something we might need to investigate - it's either the makeNonTextureImage()
, or our makeImageFromPlatformBuffer(...)
function that's really slow here... ๐ค
I would like to check the performance of the makeImageFromPlatformBuffer
function on Android. I would be interesting to know about the phone being used here as well as parameters that would allow me to reproduce the issue (e.g a video file that has the same properties).
Hi @mrousavy I dont think its an issue with the paint
or shader, as
Granted, the device I'm testing on is very old (Huawei P10 was released 2017). I was wondering if it could be due to these 2 runtime errors as seen in the logs, and would there be any ways to catch them.
2024-06-04 16:49:17.184 8524-8524 GLConsumer com.mrousavy.camera.example E [SurfaceTexture-0-8524-1] checkAndUpdateEglState: invalid current EGLContext
2024-06-04 16:49:17.185 8524-8524 surfaceTexture com.mrousavy.camera.example E Exception updateTexImage java.lang.IllegalStateException: Unable to update texture contents (see logcat for details)
@wcandillon What are some information specifically that i could provide about the phone? Also, how would i be able to check the performance of makeImageFromPlatformBuffer
?
Ah interesting - i didnt read those logs my bad. It looks like an error, yep. Not sure if it's RN Skia related or VisionCamera related tho
@wcandillon there's quite a few places in the codebase where RN Skia just swallows errors and logs them to the console (and returns null, or doesnt do anything) - I think throwing an Error (which will be propagated to JS) is better, especially in this case here.
I too get a blank screen, maybe different from OP...when I start my Android device - after running a full build on EAS - I get an error on my device:
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNSkiaModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","LogBox","SourceCode","Timing","AppState","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","Networking","Appearance","DevLoadingView","HeadlessJsTaskSupport","DeviceInfo","UIManager","DeviceEventManager","RNCSafeAreaContext","IntentAndroid","NativeAnimatedModule","SoundManager","I18nManager","ImageLoader","RNCAsyncStorage","StatusBarManager","StatusBarManager"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","LinkingManager","PlatformLocalStorage","RNC_AsyncSQLiteDBStorage","FrameRateLogger","KeyboardObserver","ModalManager","Worklets","RNSkiaModule"]}, js engine: hermes
I thought to try my emulator and it complains about minSdkVersion
on Android needing to be on 26.
All I get is a white screen for my camera view.
"react-native": "0.73.6",
"react-native-vision-camera": "^4.0.1",
"react-native-worklets-core": "^1.3.0",
"react-native-fast-tflite": "^1.2.0",
"vision-camera-resize-plugin": "^3.1.0"
I updated all the packages related to camera/frameprocessor/worklets, and now camera is working.
EDIT: Actually, I am unable to use useSkiaFrameProcessor
on my Android device.
ERROR [session/recoverable-error: An unknown error occurred while creating the Camera Session, but the Camera can recover from it.]
What's happening?
Hi @mrousavy, thank you for the great work with this library.
However, I have been having issues with applying filters using useSkiaFrameProcessors, even when using the boilerplate provided in the docs. I've tried two implementations
The camera preview ends up being just the filter, without any image. Please refer to the code and logs from both cases below.
I'm wondering whether this might be a hardware issue? I'm currently developing on an old Huawei P10 (released in 2017, Android 9). Ive had a friend run the app on a Samsung S23 Ultra and he did not encounter this issue.
Reproduceable Code
Relevant log output
Camera Device
Device
Huawei P10 (Android 9.0)
VisionCamera Version
4.0.5
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information