Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Get black screen when useSkiaFrameProcessor #3355

Open
4 of 5 tasks
phuocsanh opened this issue Jan 7, 2025 · 1 comment
Open
4 of 5 tasks

🐛 Get black screen when useSkiaFrameProcessor #3355

phuocsanh opened this issue Jan 7, 2025 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@phuocsanh
Copy link

What's happening?

I use useSkiaFrameProcessor, i get black screen but it work when useFrameProcessor.

Reproduceable Code

<VisionCamera
            style={StyleSheet.absoluteFill}
            device={device}
            fps={fps}
            isActive
            ref={ref}
            exposure={0}
            torch={flash}
            format={format}
            // video
            // photo
            // videoHdr={videoHdr}
            // photoHdr={photoHdr}
            enableFpsGraph={true}
            enableZoomGesture={false}
            pixelFormat={pixelFormat}
            outputOrientation="device"
            // photoQualityBalance="speed"
            // animatedProps={cameraAnimatedProps}
            onStarted={() => console.log('Camera started!')}
            onStopped={() => console.log('Camera stopped!')}
            onPreviewStarted={() => console.log('Preview started!')}
            onPreviewStopped={() => console.log('Preview stopped!')}
            onOutputOrientationChanged={o =>
              console.log(`Output orientation changed to ${o}!`)
            }
            onPreviewOrientationChanged={o =>
              console.log(`Preview orientation changed to ${o}!`)
            }
            onUIRotationChanged={degrees =>
              console.log(`UI Rotation changed: ${degrees}°`)
            }
            onError={onError}
            {...props}
          />
and use: 
export const DetectScreen = () => {
  // const frameProcessor = useLandmarks({isPose: true});
  // const frameProcessor = useFrameProcessor(frame => {
  //   'worklet';
  //   console.log('DetectScreen', frame.width);
  // }, []);
  const frameProcessor = useSkiaFrameProcessor(frame => {
    'worklet';
    console.log('DetectScreen', frame.width);
  }, []);
  return (
    <View flex>
      <Camera frameProcessor={frameProcessor} />
    </View>
  );
};

Relevant log output

2025-01-07 12:52:49.791  7678-7678  OpenGLRenderer                             
 E  [SurfaceTexture-0-7678-12] updateAndRelease: EGLConsumer is not attached to an OpenGL ES context

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-left",
  "hardwareLevel": "full",
  "maxZoom": 8,
  "minZoom": 1,
  "maxExposure": 24,
  "supportsLowLightBoost": false,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": false,
  "isMultiCam": false,
  "minFocusDistance": 0,
  "minExposure": -24,
  "name": "0 (BACK) androidx.camera.camera2",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"
}

Device

xiaomi redmi note 7

VisionCamera Version

"react-native-vision-camera": "^4.6.1", "react-native-worklets-core": "1.3.3",

Can you reproduce this issue in the VisionCamera Example app?

No, I cannot reproduce the issue in the Example app

Additional information

@phuocsanh phuocsanh added the 🐛 bug Something isn't working label Jan 7, 2025
@maintenance-hans maintenance-hans bot changed the title 🐛 Get black screen when useSkiaFrameProcessor 🐛 Get black screen when useSkiaFrameProcessor Jan 7, 2025
Copy link

Guten Tag, Hans here! 🍻

Thank you for your detailed issue report. Based on ze information you've provided, it seems like you're encountering a problem with useSkiaFrameProcessor resulting in a black screen.

However, I noticed you mentioned logs indicating "EGLConsumer is not attached to an OpenGL ES context", which suggests a potential issue with rendering. Do you have any additional logs from adb logcat that occurred when you experienced this issue? More logs would be very helpful for mrousavy to debug this problem.

Also, make sure that all dependencies are up to date and check if the issue persists on a different device.

If you wish to support this project more directly, consider becoming a sponsor here. This helps keep ze project alive and thriving!

Note: If you think I made a mistake, please ping @mrousavy to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant