How can I get each frame in camera2 api in android studio like PreviewCallback in camera api and ImageAnalysis.Analyzer in camerax?

0

Issue

How can I get each frame in Camera2 api in android studio like PreviewCallback in Camera api and ImageAnalysis.Analyzer in Camerax? I looked at other questions but they do not answer my question properly.

Solution

Basically, use ImageReader. Configure it for YUV_420_888, and get its Surface to use as part of Camera session configuration.

Then include its Surface in each CaptureRequest you send to the camera, and process new frames in ImageReader.OnImageAvailableListener().

Answered By – Eddy Talvala

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More