Comments (8)
Relevant log output
N/A
I'm sorry if this comes across as rude, but I don't understand why people leave out the log output. This is literally the only piece of information I need to investigate this, yet you leave it out.
Closing this issue for now, sorry. If you add logs I can re-open.
from react-native-vision-camera.
@mrousavy Sorry about that. I had never gotten xcode logs before! Thank you for challenging me, and I believe I figured out how.
Bridge call to: deviceContexts
[GESTURE HANDLER] Initialize gesture handler for view <RNSScreenView: 0x12827fe00; frame = (0 0; 390 844); autoresize = W+H; gestureRecognizers = <NSArray: 0x2826cbba0>; animations = { UIPacingAnimationForAnimatorsKey=<CABasicAnimation: 0x2828e1b80>; opacity=<CASpringAnimation: 0x2828e1be0>; }; layer = <CALayer: 0x2828f6880>> reactTag: 365; frame = {{0, 0}, {390, 844}}; layer = <CALayer: 0x2828f6880>
Camera: Back Camera | Format: (3840x2160 photo / 3840x2160@60 video @ 60fps)
VisionCamera.didSetProps(_:): Updating 27 props: [onInitialized, cameraId, enableBufferCompression, onCodeScanned, photoHdr, collapsable, onStarted, lowLightBoost, isActive, pixelFormat, video, enableFpsGraph, onError, fps, onStopped, onViewReady, enableHighQualityPhotos, enableFrameProcessor, enableZoomGesture, orientation, videoHdr, audio, format, flex, exposure, zoom, photo]
VisionCamera.configure(_:): configure { ... }: Waiting for lock...
VisionCamera.configure(_:): configure { ... }: Updating CameraSession Configuration... Difference(inputChanged: true, outputsChanged: true, videoStabilizationChanged: true, orientationChanged: true, formatChanged: true, sidePropsChanged: true, torchChanged: true, zoomChanged: true, exposureChanged: true, audioSessionChanged: true)
VisionCamera.configureDevice(configuration:): Configuring Input Device...
VisionCamera.configureDevice(configuration:): Configuring Camera com.apple.avfoundation.avcapturedevice.built-in_video:0...
VisionCamera.configureDevice(configuration:): Successfully configured Input Device!
VisionCamera.configureOutputs(configuration:): Configuring Outputs...
VisionCamera.configureOutputs(configuration:): Adding Photo output...
VisionCamera.configureOutputs(configuration:): Adding Video Data output...
VisionCamera.configureOutputs(configuration:): Successfully configured all outputs!
VisionCamera.configureFormat(configuration:device:): Configuring Format (3840x2160 | [email protected] (ISO: 33.0..3168.0, Pixel Formats: [VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.rgb, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown]))...
VisionCamera.configureFormat(configuration:device:): Successfully configured Format!
VisionCamera.onCameraStarted(): Camera started!
VisionCamera.onSessionInitialized(): Camera initialized!
VisionCamera.configure(_:): Beginning AudioSession configuration...
VisionCamera.configureAudioSession(configuration:): Configuring Audio Session...
VisionCamera.configureAudioSession(configuration:): Adding Audio input...
VisionCamera.configureAudioSession(configuration:): Adding Audio Data output...
VisionCamera.configure(_:): Committed AudioSession configuration!
[GESTURE HANDLER] Initialize gesture handler for view <RNSScreenView: 0x127754000; frame = (0 0; 390 844); autoresize = W+H; gestureRecognizers = <NSArray: 0x2826f5890>; animations = { UIPacingAnimationForAnimatorsKey=<CABasicAnimation: 0x282f01360>; position=<CASpringAnimation: 0x282f01300>; }; layer = <CALayer: 0x282f22460>> reactTag: 549; frame = {{0, 0}, {390, 844}}; layer = <CALayer: 0x282f22460>
Camera: Front Camera | Format: (3840x2160 photo / 3840x2160@60 video @ 60fps)
VisionCamera.didSetProps(_:): Updating 2 props: [cameraId, format]
VisionCamera.configure(_:): configure { ... }: Waiting for lock...
VisionCamera.configure(_:): configure { ... }: Updating CameraSession Configuration... Difference(inputChanged: true, outputsChanged: true, videoStabilizationChanged: true, orientationChanged: true, formatChanged: true, sidePropsChanged: true, torchChanged: true, zoomChanged: true, exposureChanged: true, audioSessionChanged: false)
VisionCamera.configureDevice(configuration:): Configuring Input Device...
VisionCamera.configureDevice(configuration:): Configuring Camera com.apple.avfoundation.avcapturedevice.built-in_video:1...
VisionCamera.configureDevice(configuration:): Successfully configured Input Device!
VisionCamera.configureOutputs(configuration:): Configuring Outputs...
VisionCamera.configureOutputs(configuration:): Adding Photo output...
VisionCamera.configureOutputs(configuration:): Adding Video Data output...
VisionCamera.configureOutputs(configuration:): Successfully configured all outputs!
VisionCamera.configureFormat(configuration:device:): Configuring Format (3840x2160 | [email protected] (ISO: 23.0..2208.0, Pixel Formats: [VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.rgb, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown]))...
VisionCamera.configureFormat(configuration:device:): Successfully configured Format!
VisionCamera.onSessionInitialized(): Camera initialized!
tcp_input [C57.1.1.1:3] flags=[R] seq=3256765643, ack=0, win=0 state=LAST_ACK rcv_nxt=3256765643, snd_una=2470308156
tcp_input [C57.1.1.1:3] flags=[R] seq=3256765643, ack=0, win=0 state=CLOSED rcv_nxt=3256765643, snd_una=2470308156
tcp_input [C57.1.1.1:3] flags=[R] seq=3256765643, ack=0, win=0 state=CLOSED rcv_nxt=3256765643, snd_una=2470308156
tcp_input [C58.1.1.1:3] flags=[R] seq=2265444067, ack=0, win=0 state=LAST_ACK rcv_nxt=2265444067, snd_una=3653737952
tcp_input [C58.1.1.1:3] flags=[R] seq=2265444067, ack=0, win=0 state=CLOSED rcv_nxt=2265444067, snd_una=3653737952
tcp_input [C59.1.1.1:3] flags=[R] seq=2720296222, ack=0, win=0 state=LAST_ACK rcv_nxt=2720296222, snd_una=3467708932
tcp_input [C59.1.1.1:3] flags=[R] seq=2720296222, ack=0, win=0 state=CLOSED rcv_nxt=2720296222, snd_una=3467708932
tcp_input [C59.1.1.1:3] flags=[R] seq=2720296222, ack=0, win=0 state=CLOSED rcv_nxt=2720296222, snd_una=3467708932
tcp_input [C59.1.1.1:3] flags=[R] seq=2720296222, ack=0, win=0 state=CLOSED rcv_nxt=2720296222, snd_una=3467708932
nw_connection_copy_connected_local_endpoint_block_invoke [C91] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
nw_connection_copy_connected_remote_endpoint_block_invoke [C91] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
nw_connection_copy_protocol_metadata_internal_block_invoke [C91] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
from react-native-vision-camera.
Thanks for posting logs, yes this is exactly what I need, but it doesn't look like you are calling focus here? At least I don't see any focus logs..
from react-native-vision-camera.
@mrousavy Okay so I added more console logs to my code. The camera starts as a back camera (which you will see in the logs). I tapped focus and it logged the focus events. Then I swapped to front camera and it is saying "Device does not support focus!". As stated though, on the native iOS camera app, I can tap all over and get it to focus.
My focus code:
const onFocusTap = useCallback(
({ nativeEvent: event }: GestureResponderEvent) => {
if (!device?.supportsFocus) {
console.log("Device does not support focus!!")
return
}
console.log("FOCUSING CAMERA: x:", event.locationX, "y:", event.locationY)
camera.current?.focus({
x: event.locationX,
y: event.locationY,
})
},
[device?.supportsFocus],
)
More logs:
Camera: Back Camera | Format: (3840x2160 photo / 3840x2160@60 video @ 60fps)
VisionCamera.didSetProps(_:): Updating 27 props: [onInitialized, cameraId, enableBufferCompression, onCodeScanned, photoHdr, collapsable, onStarted, lowLightBoost, isActive, pixelFormat, video, enableFpsGraph, onError, fps, onStopped, onViewReady, enableHighQualityPhotos, enableFrameProcessor, enableZoomGesture, orientation, videoHdr, audio, format, flex, exposure, zoom, photo]
VisionCamera.configure(_:): configure { ... }: Waiting for lock...
VisionCamera.configure(_:): configure { ... }: Updating CameraSession Configuration... Difference(inputChanged: true, outputsChanged: true, videoStabilizationChanged: true, orientationChanged: true, formatChanged: true, sidePropsChanged: true, torchChanged: true, zoomChanged: true, exposureChanged: true, audioSessionChanged: true)
VisionCamera.configureDevice(configuration:): Configuring Input Device...
VisionCamera.configureDevice(configuration:): Configuring Camera com.apple.avfoundation.avcapturedevice.built-in_video:0...
VisionCamera.configureDevice(configuration:): Successfully configured Input Device!
VisionCamera.configureOutputs(configuration:): Configuring Outputs...
VisionCamera.configureOutputs(configuration:): Adding Photo output...
VisionCamera.configureOutputs(configuration:): Adding Video Data output...
VisionCamera.configureOutputs(configuration:): Successfully configured all outputs!
VisionCamera.configureFormat(configuration:device:): Configuring Format (3840x2160 | [email protected] (ISO: 33.0..3168.0, Pixel Formats: [VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.rgb, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown]))...
VisionCamera.configureFormat(configuration:device:): Successfully configured Format!
VisionCamera.onCameraStarted(): Camera started!
VisionCamera.onSessionInitialized(): Camera initialized!
VisionCamera.configure(_:): Beginning AudioSession configuration...
VisionCamera.configureAudioSession(configuration:): Configuring Audio Session...
VisionCamera.configureAudioSession(configuration:): Adding Audio input...
VisionCamera.configureAudioSession(configuration:): Adding Audio Data output...
VisionCamera.configure(_:): Committed AudioSession configuration!
[GESTURE HANDLER] Initialize gesture handler for view <RNSScreenView: 0x10f878c00; frame = (0 0; 390 844); autoresize = W+H; gestureRecognizers = <NSArray: 0x2829339f0>; layer = <CALayer: 0x28270cac0>> reactTag: 555; frame = {{0, 0}, {390, 844}}; layer = <CALayer: 0x28270cac0>
'FOCUSING CAMERA: x:', 160, 'y:', 381.6666564941406
VisionCamera.focus(point:): Focusing (0.45221167831059306, 0.5737230121116377)...
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0305 14:39:44.975244 1801515008 JSIExecutor.cpp:376] Memory warning (pressure level: TRIM_MEMORY_RUNNING_CRITICAL) received by JS VM, running a GC
[I] <libMMKV.mm:301::-[MMKV onMemoryWarning]> cleaning on memory warning mmkv.default
[I] <MMKV.cpp:308::clearMemoryCache> clearMemoryCache [mmkv.default]
[I] <MemoryFile.cpp:103::close> closing fd[0x15], /var/mobile/Containers/Data/Application/1AAC40AC-AF6C-418A-9DF0-01149577BE07/Documents/mmkv/mmkv.default
'FOCUSING CAMERA: x:', 327, 'y:', 322.3333282470703
VisionCamera.focus(point:): Focusing (0.3819115263590879, 0.2219589257503949)...
'FOCUSING CAMERA: x:', 172.66665649414062, 'y:', 393
VisionCamera.focus(point:): Focusing (0.4656398104265402, 0.5470423243935953)...
Swapped to front facing camera:
Camera: Front Camera | Format: (3840x2160 photo / 3840x2160@60 video @ 60fps)
VisionCamera.didSetProps(_:): Updating 2 props: [cameraId, format]
VisionCamera.configure(_:): configure { ... }: Waiting for lock...
VisionCamera.configure(_:): configure { ... }: Updating CameraSession Configuration... Difference(inputChanged: true, outputsChanged: true, videoStabilizationChanged: true, orientationChanged: true, formatChanged: true, sidePropsChanged: true, torchChanged: true, zoomChanged: true, exposureChanged: true, audioSessionChanged: false)
VisionCamera.configureDevice(configuration:): Configuring Input Device...
VisionCamera.configureDevice(configuration:): Configuring Camera com.apple.avfoundation.avcapturedevice.built-in_video:1...
VisionCamera.configureDevice(configuration:): Successfully configured Input Device!
VisionCamera.configureOutputs(configuration:): Configuring Outputs...
VisionCamera.configureOutputs(configuration:): Adding Photo output...
VisionCamera.configureOutputs(configuration:): Adding Video Data output...
VisionCamera.configureOutputs(configuration:): Successfully configured all outputs!
VisionCamera.configureFormat(configuration:device:): Configuring Format (3840x2160 | 3840x2160@60.0 (ISO: 23.0..2208.0, Pixel Formats: [VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.yuv, VisionCamera.PixelFormat.rgb, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown, VisionCamera.PixelFormat.unknown]))...
VisionCamera.configureFormat(configuration:device:): Successfully configured Format!
VisionCamera.onSessionInitialized(): Camera initialized!
Device does not support focus!!
Device does not support focus!!
Device does not support focus!!
Device does not support focus!!
nw_connection_copy_connected_local_endpoint_block_invoke [C55] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
nw_connection_copy_connected_remote_endpoint_block_invoke [C55] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
nw_connection_copy_protocol_metadata_internal_block_invoke [C55] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
from react-native-vision-camera.
@mrousavy Hello Marc, just to follow up, I replicated the exact same thing with my friends iPhone 13 Pro and my iPhone 12. Both say the front camera doesn't support focus, but they both can be focused on the native camera app.
from react-native-vision-camera.
Hey @ChristopherGabba - well honestly I don't really know how this can happen - I am basically just checking the value of isFocusPointOfInterestSupported
- I don't know why this is false
in your case.
And I think the com.apple.avfoundation.avcapturedevice.built-in_video:1
device is the default front camera. Are there any other front camera devices on that phone? Maybe a true depth one? Idk...
from react-native-vision-camera.
@mrousavy Interesting.... I looked up the specs:
It would appear that it doesn't have an actual focal lens for the front facing camera. Instead they used a software based approach to focus.
Explanation I found:
The iPhone 12's front-facing camera does not have a traditional focus lens like the one you might find in a DSLR camera. Instead, it uses a fixed-focus lens system, which is common in most smartphones' front-facing cameras. This means that the lens does not physically move to focus on subjects at different distances. However, the camera is designed to keep the subject in focus within a typical range of distances suitable for selfies and video calls.
The front-facing camera of the iPhone 12 uses sophisticated software algorithms to ensure that the subject is in clear focus and to adjust the depth of field digitally, creating a sharp image with a blurred background effect in Portrait mode, if desired. This is achieved through a combination of the camera's fixed optics and the phone's processing capabilities.
This may be same the for the iPhone 13 Pro as well. If this is the case, do you have any recommendations on how to solve this issue with the front facing camera for these ranges of iPhones?
from react-native-vision-camera.
Well I have honestly no idea how to workaround this issue - if focus(..)
doesn't work then there's nothing I can do, I am literally just calling the iOS Camera focus API.
from react-native-vision-camera.
Related Issues (20)
- 🐛 onRecordingFinished returns width: 0, height: 0 on every recording HOT 14
- 💭 Code scans only in the top right corner HOT 2
- 🔧 I had issue building !! HOT 1
- 🔧 cannot build!! HOT 1
- 🐛 Whats the meaning of life HOT 1
- 💭 Hans Pie recipe HOT 2
- 💭 Possible to zoom with useSkiaFrameProcessor? HOT 6
- 💭 How to set Low video resolution HOT 3
- 🐛 In production, runAsync does not work inside a useSkiaFrameProcessor HOT 1
- 🐛 Cannot zoom on Android when using useSkiaFrameProcessor HOT 5
- ✨ Request for Adding Additional Cinematic Modes HOT 1
- 🐛 The picture looks blurry ( out of focus) in Camera View but comes out focused after clicking on Ipad HOT 11
- 🐛 ERROR Frame Processor Error: Failed to lock HardwareBuffer for reading!, js engine: VisionCamera HOT 5
- 🐛 [capture/invalid-path] Unable to take photos or videos with custom path with Android using expo file system. HOT 5
- 💭 How to wrap an overlay around the preview and render a square output HOT 3
- 💭 Issue with FrameProcessorsUnavailableError HOT 3
- 💭 Lanscape mode issue. HOT 3
- 🐛 iOS front Camera landscape mode issue. HOT 1
- 🔧 Build fails after upgrading to targetSdkVeersion 34 HOT 9
- 🐛 Wrong Orientation on `takePhoto` (`takeSnapshot` is working properly) HOT 9
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.