-
-
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
❓ Preview stretched in my app but not in the example on same device #2311
Comments
#2142 Maybe the same issue |
I found why the preview is stretched on my app. So How can I solve my problem with the landscape orientation ? |
Hey! Does this fix your issue maybe? #2377 (still testing) |
Hey! After 8 hours of debugging, I finally found the culprit! I fixed the preview stretching issue in this PR: #2377 If you appreciate my dedication and free support, please consider 💖 sponsoring me on GitHub 💖 so I can keep providing fixes and building out new features for my open-source libraries in my free time. |
Hello, I've tested the 3.7.1 and i've still the issue. In the version 3.7.0, I've made a patch. I've added the below line in PreviewView.kt file private val aspectRatio: Float get() = size.width.toFloat() / size.height.toFloat() and replace the method onMeasure by below lines @SuppressLint("DrawAllocation")
} This patch resolved my issue |
Created a PR to fix this issue once and for all: #2519 💪🚀 Try the PR and see if it works (by checking out that branch and running the example app) |
Hello @mrousavy, i've tested the 3.9.0-beta.2 and there's still de issue. You can see below the preview scene and how the photo taken looks like |
This is landscape mode - Orientation is not yet fully supported in VisionCamera. See this issue for details: #1891 |
Is there a release planned soon that fixes this issue ? |
What? I just liked the orientation issue |
Hello @mrousavy, i've tested the 3.9.0-beta.6 version, i have these log in my Logcat I suppose this is why my preview view is zoomed... I hope it can help you to fix the issue. |
@Flocurry are you in landscape mode or portrait |
I'm in landscape mode |
Yea okay, only portrait works atm. See #1891 for more details. |
Hello @mrousavy . Is it normal that the 4.0.0-beta.4 fix the landscape mode issue for the camera preview ? With this version, sometimes I have the below error when I open the camera 'Camera.onError(session/invalid-output-configuration): Failed to configure the Camera Session because the output/stream configurations are invalid!', { [session/invalid-output-configuration: Failed to configure the Camera Session because the output/stream configurations are invalid!] and this error disappear if i go back and reopen the camera. |
Hello @mrousavy, the above issue persists with the 4.0.0-beta.6 version |
Which issue? Preview stretching or output configuration error? I cannot reproduce the output configuration error anymore in the latest beta. |
I reproduce the output configuration error. When I run your example (tag v4.0.0-beta.6 ) on my Galaxy Tab Active4 Pro, the preview is black and I have the log [ERROR][MEMMGR ] camximagebuffer.h:668 IsInValidUsageState() [RealTimeFeatureZSLPreviewRawYUV_com.qti.node.memcpy6_OutputPortId0_ ][0xb40000706466d500] Client trying to use after releasing the ImageBuffer |
Hello @mrousavy I've tested the v4.0.0-beta.7 and it fixes the output configuration issue Many thx ❤️ |
Question
I don't understand why my camera preview is stretched in my Android app but not with your example on my tablet device...
What I tried
I use the same CameraPage.tsx file in my app like in your example.
The format below props given to the camera component is the same in my app than in your example
{
"format":{
"autoFocusSystem":"contrast-detection",
"fieldOfView":85.2381275912114,
"maxFps":30,
"maxISO":1600,
"maxZoom":4,
"minFps":1,
"minISO":100,
"photoHeight":1600,
"photoWidth":2560,
"pixelFormats":[
"yuv",
"native"
],
"supportsDepthCapture":false,
"supportsPhotoHdr":false,
"supportsVideoHdr":false,
"videoHeight":960,
"videoStabilizationModes":[
"off",
"off"
],
"videoWidth":1440
}
}
VisionCamera Version
3.6.17
Additional information
The text was updated successfully, but these errors were encountered: