Questions tagged [camera2]
142 questions
3
votes
2 answers
Difference between setRepeatingRequest and setRepeatingBurst?
API level 21 introduced camera2, with it setRepeatingRequest and setRepeatingBurst. I have read the doc here, but still cannot catch the difference between the two. Any idea?

m-ric
- 5,621
- 7
- 38
- 51
3
votes
0 answers
Converting YUV image to RGB results in greenish picture
I am getting an Image in the YUV_420_888 format as the result of a capture using the Camera2 APIs. I need to convert the image to the RGB format, but the colors of the resulting image are wrong.
This is the function that performs the conversion,…

Alessandro Roaro
- 4,665
- 6
- 29
- 48
2
votes
1 answer
Android Camera2 - CONTROL_AE_REGIONS not working on Samsung devices
Using Android Camera2, I want to use a region to ignore the top 25% of the image when computing the exposure. I'm using this:
// Compute the metering rectangle to ignore the top 25% of the picture:
Rect newRect = new Rect(mActiveArraySize.left,…

Tim Autin
- 6,043
- 5
- 46
- 76
2
votes
2 answers
Android Camera2 API preview sometimes distorted
I am building a custom camera with the Camera2 API.
So far the camera works very well except for the preview which is distorted sometimes. Let's say I open the camera 7 times in a row. All of the attempts are succesful and the 8th time the camera…

Dennis
- 818
- 2
- 10
- 23
2
votes
0 answers
Camera2 CameraDevice.TEMPLATE_MANUAL
I want to capture pictures through Camera2 API, and I need to control the exposure time. But when I set CameraDevice.TEMPLATE_MANUAL or just set the exposure time, I get black picture. When I cancel the setting, I can get the right picture…

T.Cris
- 53
- 6
2
votes
2 answers
Android Camera2, take picture continuously
I need to take pictures continuously with Camera2 API. It works fine on high end devices (for instance a Nexus 5X), but on slower ones (for instance a Samsung Galaxy A3), the preview freezes.
The code is a bit long, so I post only the most relevant…

Tim Autin
- 6,043
- 5
- 46
- 76
2
votes
1 answer
Read a dng file as a 2d array of pixels in android
I have a DNG file that my camera2 application generates. I want to read that file as a part of another android application and process the values at a pixel level. I haven't found a way to read the same. Are there any approaches I can use?

InquisitiveCoder
- 171
- 1
- 11
2
votes
0 answers
Can't open front android built in camera
When I run my code for opening the front camera I just see a black screen that is getting brighter to the bottom (Looks like a camera capture).
My Code:
public class Cam extends Activity
{
@Override
protected void onCreate(Bundle…

God
- 1,238
- 2
- 18
- 45
2
votes
0 answers
android camera2 preview is less focused than default camera
Preview quality is not as good as default camera app. Check difference in hair in this link.
I implemented camera2 with help of android-Camera2Basic.
Both images are 4:3 ratio. I think is something to do with CaptureRequest that you set for…

Pastafarian
- 49
- 6
2
votes
2 answers
Android 5.x Shutter Speed
I am trying to get supported shutter speed parameters but I am now sure how to get those ranges.
For ISO-values
String supportedIsoValues = camParams.get("iso-values"); //supported values, comma separated String
…

NoSleep
- 127
- 1
- 10
2
votes
1 answer
Auto exposure implementation
I'm working on custom AE implementation using android Camera2 API. Current idea is hold the mean brightness of image at some gray level (128 for example). So algorithm could be described as this:
calculate currentEV (using current shutterSpeed,…

Maxim Metelskiy
- 1,389
- 14
- 29
2
votes
0 answers
android Camera2 preview to record switch issue
From this google Camera2Video example, we can see it start preview mode firstly, then if user click record button, we will close preview session and create a record session to start record. After record finished, we will close record session and…

lucky1928
- 8,708
- 10
- 43
- 92
2
votes
2 answers
Android Camera2, I aquire YUV image from ImageReader. U and V buffers have only one row(stride) data, the rest is zero
This is how I instantiate the ImageReader.
Size[] sizes = configs.getOutputSizes(ImageFormat.YUV_420_888);
mImageReader = ImageReader.newInstance(width, height, ImageFormat.YUV_420_888, 2);
…

Lyubomir Dinchev
- 330
- 3
- 12
2
votes
2 answers
YUV_420_888 to ARGB turns green
I've got some code below .. it converts YUV_420_888 (android camera2 api) image format to ARGB8888 and saves it to a jpeg .. however the result is almost completely green .. any idea how to get this to work as expected??
private ByteBuffer…

Arjun
- 322
- 4
- 20
2
votes
3 answers
Front Camera2 API GLSurfaceview
I'm trying to access the front facing camera through the Camera2 API using an actual device
the problem occurs when trying to
cameraManager.openCamera(..,..,..)
try {
CameraCharacteristics characteristics =…

Wael hamadeh
- 755
- 1
- 6
- 14