mrousavy / react-native-vision-camera

šŸ“ø A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.34k stars 1.07k forks source link

šŸ’­ How can I access iOS TrueDepth Camera? #2605

Closed giannavia closed 6 months ago

giannavia commented 7 months ago

Question

I've got an iphone 14 and I trying to use TrueDepth Camera to check how an object is.

Probably this is the wrong approach but this is what I did:

  1. I called useCameraDevices() and got a list of devices.
  2. Filtered out deviced which "isMultiCam" is false
  3. The list devices ends up with a single element
  4. I picked a format which "supportsDepthCapture" is true

This is what my camera element looks like:

<Camera style={{ width: '100%', aspectRatio: 16 / 9 }} device={trueDepthCamera} format={trueDepthCameraFormat} isActive={isCameraActive && isFocused} enableDepthData={true} ref={camera} />

However, I can't find any depth data. I've added a Frame Processor Plugin as well and still couldn't see any depth data.

Can you guys help me here ?

What I tried

No response

VisionCamera Version

"react-native-vision-camera": "^3.9.0",

Additional information

mrousavy commented 6 months ago

See this feature request: https://github.com/mrousavy/react-native-vision-camera/issues/2628