-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
🐛 Camera Glitchy on Initial Switch From Front to Back #2525
Comments
I think that's what it looks like when the camera is initializing — most apps (like the native iOS camera) provide a static loading view or a blurred view of the last active frame until the camera is ready. Handling this better is on my to-do list for my own app, but I just checked and it looks like onInitialized gets called when the camera is fully ready — have you tried using that to set a loading state? |
I have also seen that in ShadowLens. Could you please add logs though, as without logs I will need to close the issue. |
Ok, not sure if this is helpful, but: I spent some time on this today and attempted to use the My app allows users to choose from 4 photo quality settings; the first 3 affect the value of
In this video (recorded on an iPhone 14 pro), I'm switching to and from the camera screen and flipping the device orientation first in the "quality" setting, and then in the "max" setting (max iso). The former works as expected, but the latter causes the camera view to visibly resize when it first starts up and each time it flips from front to back. |
Looks much better already with the BlurView! I'd still say there is a little jump here, maybe this is a bug in VisionCamera, I'm not sure. That's what I need the logs for, otherwise I can't help. |
@mrousavy What logs would be helpful for you to see? Also, @stevengoldberg thank you for posting that video. That is the same behavior that I am observing as well. I would probably take the approach of showing a blurred view of the last frame because you can still see the glitchy behavior underneath, but I appreciate the demonstration. How are you controlling when to show it? I know you mention those 3 callbacks, but a larger example would be awesome. The issues that @stevengoldberg refer to in his video are the same that I am experiencing as well. |
Sure @griffinbaker12 — I've found that navigating to a screen with the Therefore I have it set up basically like this:
@mrousavy here are some of the camera logs from my iPhone 14 pro when I switch from front to back camera, as in the video I posted:
|
@stevengoldberg makes sense, thx for the help on this. |
Found a solution! 💪😄 #2537 |
I just tested this with 3.9.0 and the resizing is still visible when I use the Video here: https://imgur.com/a/3ZPeG38 Here are the logs from the camera taken while switching from front to rear:
|
Those aren't logs from VisionCamera/your app. Can you run your app through Xcode and share the logs in that console please? I need to see if the session is being configured more than once |
Sorry about that — here are those logs (taken when switching from front to back camera):
|
What's happening?
This is a continuation of an issue that was closed (somewhat) prematurely, but when attempting to switch between the camera using different zooms and the properly initialized device array I observe:
"It seems that the glitchy behavior from before happens the first time in a given session that I open the camera and attempt to switch from front to back. If I close the camera and re-open within the same session, the switch looks as it does in the video when I switch from front to back the second time in a given session. Is this normal behavior, or can it be improved in some way?
Thank you!"
RN.Vision.Cam.Updated.MP4
Reproduceable Code
Relevant log output
Camera Device
Device
iPhone 15 Pro
VisionCamera Version
3.6.8
Can you reproduce this issue in the VisionCamera Example app?
No, I cannot reproduce the issue in the Example app
Additional information
The text was updated successfully, but these errors were encountered: