Questions tagged [android-camera2]

The android.hardware.camera2 package provides an interface to fully control many apsects of camera device, e.g. CameraDevice, CaptureRequest-CaptureResult flow, Surfaces, ProcessingImages, setting camera parameters, setting request parameters and so on. It replaces the deprecated Camera class.

From Android Documentation

This package models a camera device as a pipeline, which takes in input requests for capturing a single frame, captures the single image per the request, and then outputs one capture result metadata packet, plus a set of output image buffers for the request. The requests are processed in-order, and multiple requests can be in flight at once. Since the camera device is a pipeline with multiple stages, having multiple requests in flight is required to maintain full framerate on most Android devices. To enumerate, query, and open available camera devices, obtain a CameraManager instance.

Individual CameraDevices provide a set of static property information that describes the hardware device and the available settings and output parameters for the device. This information is provided through the CameraCharacteristics object, and is available through getCameraCharacteristics(String).

1641 questions
0
votes
1 answer

Android: Camera2 API crashes when trying to record a second time

I've been trying for hours now, still can't seem to get this to work.. Using this as reference. I coded an application that records and saves a video. I have no problems running the reference application but many issues occurred when i ran my own…
Tix
  • 449
  • 1
  • 8
  • 27
0
votes
1 answer

How to render the view from the opened hardware.camera2 camera?

I want to display what Android camera films on the mCameraView: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mCameraView = (SurfaceView)…
mercury0114
  • 1,341
  • 2
  • 15
  • 29
0
votes
1 answer

Recording with Correct FPS in Android (120FPS CamcorderProfile Not Working)

I'm using the following code to request that my phone (LG G5) record using the High Speed High Quality profile, which specifies 120FPS and 720p. CamcorderProfile mProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH_SPEED_HIGH); …
calben
  • 1,328
  • 3
  • 18
  • 33
0
votes
1 answer

Android Camera2 API - Overwrite old images

I am using the code given at https://github.com/googlesamples/android-Camera2Basic and images are being saved in the activity storage with @Override public void run() { ByteBuffer buffer = mImage.getPlanes()[0].getBuffer(); …
Julian
  • 146
  • 2
  • 9
0
votes
2 answers

Android: How to improve the performance of my camera

I develop an android camera app! I use camera2 to implement the camera module! The problem is that when I take a picture with it, the size of the image is too high, something about 9MB!!! So my gallery is too slow! What is the reason of it? I test…
Zeinab
  • 43
  • 10
0
votes
0 answers

Implement zoom with camera2 api

Hello I am new to android. I am working on app which uses camera2 api and I am trying to implement Zoom. I figured out a method but there is no affect on the zoom while testing the camera app on my android phone (means, there is no zoom when I pinch…
shah lamaan
  • 35
  • 2
  • 6
0
votes
1 answer

implement zoom in Camera2 api.

I am new to android and working on android camera2 api. I am unable to implement zoom in Camera2 api. I am making a magnifier app. Do I need to change the settings to Macro modeor Auto focus will do that for me? I want to implement zoom using…
shah lamaan
  • 35
  • 2
  • 6
0
votes
0 answers

camera2 api how to capture on face detection programatically

I want to save image only if face is detected, currently it is saving even if face is not present. I want to capture only if the face detected, I am using android face API for face detection. My code:here i want to save image only if there are faces…
Abhi
  • 193
  • 1
  • 2
  • 11
0
votes
1 answer

Attempt to invoke "...CameraCaptureSession.abortCaptures()" on a null object

Trying to use Facebook Live api with my android app. I am using camera2 to pull up the camera on my live streaming activity but am getting this error: java.lang.NullPointerException: Attempt to invoke virtual method 'void…
0
votes
2 answers

Android Camera2 api, Swap cameras quickly on the go

I'm making an Android app using the Camera2 api. I want to be able to switch between the front and back camera, but it takes an awful lot of time to do so no matter how i try to implement it. After what i understand, you can't open both cameras at…
0
votes
0 answers

android start new thread call JNI function crashed

public class MainActivity extends AppCompatActivity { private ProcessWithQueue mprocessWithQueue; private LinkedBlockingQueue mframeQueue; private NDKUtils ndk = new NDKUtils(); @Override protected void onCreate(Bundle…
0
votes
2 answers

Display bitmap image in an alert dialog in fragment

I add a new image to Camera2Fragement class to display bitmap image in an alert dialog but I only get empty dialog without any image. What am i doing wrong. Is it related to fragment where we can not upload the image to image view or another…
Nani
  • 97
  • 13
0
votes
0 answers

How to implement camera effect on image capture using camera api in android?

I am designing a camera app using camera api not camera2 api, which open back camera and on button click it capture image but does not show any effect as like my phone camera app. How can i implement effect when start capturing image it slightly…
Abhishek Joshi
  • 361
  • 1
  • 7
  • 17
0
votes
0 answers

Full screen preview Android camera2

I'm building my own camera using google example: https://github.com/googlesamples/android-Camera2Basic . The problem is that this camera is not fullscreen,i've tryed with this changes in this metod: private void setUpCameraOutputs(int width, int…
Jt1995
  • 149
  • 2
  • 15
0
votes
0 answers

Capture the same image in different resolutions - Camera2, Android

Do you know if it's possible to capture exactly the same frame in two different resolutions using the Camera2 API? I want to capture an image at 1280x720 pixels and an other one at the maximum resolution accepted for the camera, and it has to be…
user6346502
1 2 3
99
100