Android Camera2 Createcapturerequest Returns All Black Pixels When Getting Yuv_420_888 Image
I have a Android camera2 API preview running ok in Kotlin using suspendCoroutine for all the surface setup and callbacks. But when I try to take a picture 5 seconds after the app
Solution 1:
While setting up your Camera preview, you implicitly chose some preview size. Generally speaking, your capture can use different size (even to YUV, which is essentially preview buffer, too).
But on many devices, uncoordinated choice of preview and capture sizes does not work well. The common phenomenon is that you must select preview size and Jpeg capture size to have same aspect ratio. I strongly recommend you to follow this practice for YUV, too.
You can use SurfaceTexture.setDefaultBufferSize if you want to keep the TextureView size fit the general layout.
Post a Comment for "Android Camera2 Createcapturerequest Returns All Black Pixels When Getting Yuv_420_888 Image"