android-camera2

Android set camera2 focus only once on beginning of timelapse

房东的猫 提交于 2020-01-05 05:56:10
问题 I want to make simple app that is making captures for timelapse. Finally I have made it. But I am wondering whether it is possible to lock focus only once, on first photo? And later use that saved value about focus (if possible)? Generally it is a good idea? I thought that every several seconds calling lockFocus() is too expensive. While device is placed fixed, motionless. Actually I have code like to google sample code. I am setting CaptureRequest.Builder field CONTROL_AF_TRIGGER to CONTROL

Android java.lang.IllegalArgumentException: previewSize must not be taller than activeArray

妖精的绣舞 提交于 2020-01-03 19:35:05
问题 My application was working good in large number of phones. However, when I installed it in my old android phone the following error is thrown and application crashes while taking the photo. Android java.lang.IllegalArgumentException: previewSize must not be taller than activeArray Photo Capturing code: public class Camera1 extends AppCompatActivity { private static final String TAG = "AndroidCameraApi"; private TextureView textureView; private static final SparseIntArray ORIENTATIONS = new

Xamarin Camera2Basic sample throws exception after UnlockFocus call

不羁的心 提交于 2020-01-03 02:08:28
问题 Downloaded Xamarin Camera2Basic project Initially all works correctly as it's begin tested in Visual Studio 2017 emulator. Commented out code inside "CameraCaptureStillPictureSessionCallback.cs" as shown below to allow the still image captured to be displayed on the emulator screen after clicking the "Take Picture" button: public override void OnCaptureCompleted(CameraCaptureSession session, CaptureRequest request, TotalCaptureResult result) { //Owner.ShowToast("Saved: " + Owner.mFile); //Log

Android Camera2 API - Set AE-regions not working

匆匆过客 提交于 2020-01-01 16:23:25
问题 In my Camera2 API project for Android, I want to set a region for my Exposure Calculation. Unfortunately it doesn't work. On the other side the Focus region works without any problems. Device: Samsung S7 / Nexus 5 1.) Initial values for CONTROL_AF_MODE & CONTROL_AE_MODE mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO); mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON); 2.) Create the MeteringRectangle

Android Camera2 API - Set AE-regions not working

笑着哭i 提交于 2020-01-01 16:23:07
问题 In my Camera2 API project for Android, I want to set a region for my Exposure Calculation. Unfortunately it doesn't work. On the other side the Focus region works without any problems. Device: Samsung S7 / Nexus 5 1.) Initial values for CONTROL_AF_MODE & CONTROL_AE_MODE mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO); mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON); 2.) Create the MeteringRectangle

Where does android.hardware.camera2.full come from?

自闭症网瘾萝莉.ら 提交于 2020-01-01 08:57:07
问题 I am trying to implement a camera app. and checking examples. Some examples contain following manifest feature: uses-feature android:name="android.hardware.camera2.full . I have checked official documents and google examples and none of them mentioning existing this feature. (or I am missing some). What is the source of this feature and what is the difference between android.hardware.camera ? Edit: What confuses me was those examples on googlesamples : https://github.com/googlesamples/android

Camera2 API Issue

怎甘沉沦 提交于 2019-12-30 07:46:27
问题 I make some camera App use camera2 APi example camera2 api google sample, so my camera output not full screen then i read from camera2 api isue to solve that i have to change this in Onmeasure at AUtofitTextureView class: if (width < height * mRatioWidth / mRatioHeight) { from < to > so like here : if (width > height * mRatioWidth / mRatioHeight) { then my camera view fix to fullscreen but Now i have other issue, my capture image is bigger than my preview. please check my screen capture from

Android Camera2 API Cropping Video

偶尔善良 提交于 2019-12-30 06:55:30
问题 I'm trying to record a video using Android Camera2 API. I'm trying to crop video as a square by setting the SCALER_CROP_REGION in the request builder. I'm using the following code but it doesn't seem to work mCameraDevice.createCaptureSession(surfaces, new CameraCaptureSession.StateCallback() { @Override public void onConfigured( CameraCaptureSession cameraCaptureSession) { mCaptureSession = cameraCaptureSession; try { mIsRecording = true; /////****** this where i'm setting the coping mZoom =

Android Camera2 - Draw circle focus area

孤街醉人 提交于 2019-12-25 16:47:35
问题 I'm trying to develop a custom application that uses Camera 2 API and I would like to add the feature "tap to focus". In other words, when I tap on the screen to focus, it shows a circle of the focus area. How can I draw the circle focus area? I followed the Google Camera2Basic example. Thank you. 回答1: May be enough is draw circle of tap area, not focus area? In this case You can save X and Y pos of tap and use it as center of circle. And You can use any tutorial for drawing over camera

Android camera2 api openCamera error

会有一股神秘感。 提交于 2019-12-25 07:49:13
问题 I want to make a simple flashlite application using camera2 api. I am using the following code: public class FlashLightUtilForL { private CameraCaptureSession mSession; private CaptureRequest.Builder mBuilder; private CameraDevice mCameraDevice; private CameraManager mCameraManager; public FlashLightUtilForL(Context context) { try { mCameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE); //here to judge if flash is available CameraCharacteristics