Questions tagged [camera2]
142 questions
4
votes
2 answers
Android Camera2 API - lack of privileges on resume
I'm developing the app using Camera2 API. My problem looks like that:
when I hit the device's sleep button while the camera fragment is working and after that I wake up the device, the application restarts
12-10 10:59:10.423…

sliwkacz
- 387
- 2
- 4
- 18
4
votes
0 answers
Camera2 camera transform
I'm having an issue with the Camera2 API, I'm basicly working with Google sample code (Camera2Basic), but I do changed the TextureView size so it does not span on the entire screen, the screen also have a ToolBar.
The preview display I'm getting is…

Aviran
- 5,160
- 7
- 44
- 76
4
votes
1 answer
Taking picture with flash on camera2 gives picture "after" flash occured (i.e without flash)
I based my code on the sample from Google Camera2-Basic and added flash always support. But It looks like the picture is taken right after the flash has occur. I (almost) always get non flashed picture, even though the flash is triggered.
The…

gbero
- 3,890
- 1
- 26
- 30
4
votes
1 answer
How to setup camera preview with camera2 API for both photo and video at once?
My app provides a camera, which allows user to either take a picture or record a video. I have no possibility to know which action user is going to choose. So I need to provide camera preview for both actions. With old camera API there was no…

tanya_sv
- 41
- 3
4
votes
1 answer
Manual focus with flash using Android camera2
How to perform manual (Touch) focus with flash using Android camera2 api?
My captureRequest settings are:
1. type - TEMPLATE_PREVIEW
2. CONTROL_AE_MODE - CONTROL_AE_MODE_OFF
3. FLASH_MODE - FLASH_MODE_SINGLE
4. CONTROL_AF_TRIGGER -…

Maxim Metelskiy
- 1,389
- 14
- 29
3
votes
1 answer
Camera preview stretched after accepting granular permission
I have created a Camera App that uses both Camera and Camera2 API's. The problem comes when using Camera2 and Granular Permissions.
The App normally starts fine and the preview looks great. But only on the first launch, when the user accepts the…

Ezequiel Adrian
- 726
- 1
- 11
- 29
3
votes
1 answer
Crop rectangle subsection on camera2 and pass it to opencv for processing
I have managed to draw an overlay rectangle so that what's inside the rectangle is the only one to be processed and the app should ignore the rest of the camera region.link to Screenshot
The problem is I want to crop the above rectangle on…

ratross
- 31
- 3
3
votes
1 answer
How to use android camera2 api to record 60 fps video with fixed exposure time
I want to implement a app to record 60 fps with fixed exposure time. As device I have the Google Pixel. Since its native camera app can do 60 fps and it has hardware level LEVEL_3, I thought this won't be a problem but I can't get it working. With…

Jian
- 63
- 1
- 2
- 8
3
votes
1 answer
camera2's setVideoFramerate() doesn't have any effect
I'm developing my camera app for my LG G4 and I can't find a way to record at a constant framerate. I took the google sample Camera2 app to add my features.
When I want to record in UHD…

Raphaël
- 117
- 1
- 1
- 10
3
votes
2 answers
java.lang.IllegalStateException: Session has been closed; further changes are illegal
i know there are a lot of questions concerning exception above, but still couldn't find the answer and decided to ask by myself.
The exception is thrown sometimes, during capturing with camera2, sometimes going to background.
Exception shows in the…

user0770
- 797
- 3
- 11
- 22
3
votes
2 answers
Android camera2 API - Display processed frame in real time
I'm trying to create an app that processes camera images in real time and displays them on screen. I'm using the camera2 API. I have created a native library to process the images using OpenCV.
So far I have managed to set up an ImageReader that…

Mateo Hrastnik
- 533
- 1
- 7
- 20
3
votes
0 answers
Camera2 output surfaces fail with RenderScript Allocation on Android 5.0
I'm encountering an issue with using a RenderScript Allocation as the preview output surface using Android's Camera2 API on some Android 5.0 devices and I'm struggling to identify the cause.
I create the input allocation as below:
Type.Builder…

Michael
- 3,776
- 1
- 16
- 27
3
votes
2 answers
Android JavaCV + Camera2
trying to record video from camera by using javaCV,
// recoder settings:
private int imageWidth = 320;
private int imageHeight = 240;
private int frameRate = 30;
recorder = new FFmpegFrameRecorder(ffmpeg_link, imageWidth,…

Siarhei
- 2,358
- 3
- 27
- 63
3
votes
0 answers
Android: Camera 2 Api Size not in valid set
Hello I have a problem with camera 2 api. I am using the front camera and a surface view for display the preview.
When I get the list of sizes from StreamConfigurationMap, i have this list of sizes.
> 0 = {Size@5139} "1600x1200"
1 = {Size@5152}…

LittleFunny
- 8,155
- 15
- 87
- 198
3
votes
2 answers
Toggle Flashlight in Camera2 without Interrupting Preview
Just started using the Camera2 framework because of the increased control it provides over the low-level functions of the camera. However, I am having some trouble turning the flashlight on and off quickly. With the old Camera API, I could toggle…

Kent W. Nixon
- 31
- 3