android-camera2

Change CONTROL_AE_EXPOSURE_COMPENSATION propostional to seekbar progress in Camera2 API

 ̄綄美尐妖づ 提交于 2019-12-13 14:23:05
问题 I'm currently working on Androids Camera 2 API and my current problem is, that I cannot set the CONTROL_AE_EXPOSURE_COMPENSATION . I want to exposure between -2 to 2 . Here is my code. public void setExposure(double exposureAdjustment) { Range<Integer> range1 = mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE); int minExposure = range1.getLower(); int maxExposure = range1.getUpper(); float newCalculatedValue = 0; if (exposureAdjustment >= 0) { newCalculatedValue

How to draw objects on TextureView Camera stream preview and record the stream with objects?

荒凉一梦 提交于 2019-12-13 08:50:39
问题 I need help with an application I am working on. The application has to have a custom Camera interface to record a video with audio and have to add some objects in realtime on the TextureView canvas. Old Camera API is deprecated, so I have to use Camera2 API to render the live preview on TextureView. My goal is to draw some objects on top of the TextureView Canvas, could be some text/jpg/gif while the camera stream renders in the background and being able to record the video with my overlay

How to take multiple photos without preview using Camera2 API in Android?

不羁岁月 提交于 2019-12-13 03:25:37
问题 I need to capture multiple photos using Camera2 API after particular interval, say 5 seconds. I need to do it without preview. I am able to capture a single photo without preview, but I need to know how to capture multiple photos? Once the camera is opened, I don't want to set all parameters again and again, I just want to capture photos after particular interval and once all photos are captured, then I will close the camera. Also only first time the image is getting captured. Second time

Fixed frame rate using android Camera2 api

六月ゝ 毕业季﹏ 提交于 2019-12-12 17:15:53
问题 I'm very new to android. I'm trying to develop an application using android camera2 api and i want to maintain a steady frame rate for that. I could not find any example on how to achieve a fixed frame rate. By experimenting i can see that application gets around 5-7 FPS. but it's varying. A detailed method to get a fixed frame rate is highly appreciated. Thanks in advance. 回答1: Have you set the AE target FPS range to what you want? What resolution are you trying to read? On LEGACY-level

Camera2 Api..java.lang.IllegalArgumentException: Surface had no valid native Surface

荒凉一梦 提交于 2019-12-12 10:44:46
问题 I was trying so long for Camera2 api integration to my app.Its working fine for capturing image at first.But when i snap second time the preview was not coming.I tested it in genymotion nexus 5 emulator.Tried with all examples.Preview was not coming for snapping at second time.Getting this error also. java.lang.IllegalArgumentException: Surface had no valid native Surface... and i followed this 2 codes http://inducesmile.com/android/android-camera2-api-example-tutorial/?cid=519 Github

Android code to add filtering effects using camera2 API in real time?

一世执手 提交于 2019-12-12 05:05:28
问题 I am writing an android camera app using camera2 API. I want to know how to add various filtering effects i.e sepia, negative in android camera surface as a list. Please help to solve the same. 回答1: You can set CONTROL_EFFECT_MODE like this: mPreviewRequestBuilder.set(CaptureRequest.CONTROL_EFFECT_MODE, CaptureRequest.CONTROL_EFFECT_MODE_SEPIA); 来源: https://stackoverflow.com/questions/40079276/android-code-to-add-filtering-effects-using-camera2-api-in-real-time

Capture flash/no-flash images quickly using Android Camera2 API

谁都会走 提交于 2019-12-12 03:36:42
问题 I am writing an android application to capture flash/no-flash image pair quickly when a user presses capture button. For writing my application I referred to Camera2Basic app here. From Android documentation, I found that for flash to fire, the preview request builder should have AE_MODE set to AE_MODE_ON_ALWAYS_FLASH . I am using three request builders: preview , noflash and flash The difference between three is: preview : AE_MODE set to AE_MODE_ON_ALWAYS_FLASH and AF_MODE set to CONTROL_AF

Camera2 API: can it output two cameras into same surface?

半腔热情 提交于 2019-12-11 17:06:08
问题 I have specific requirement to connect signal from two Cameras into one surface. Each camera would fill half of the surface. The surface would be either displayed or reside in OpenGL texture. Is this at all possible using Camera2 API? First thing is specifying target rectangle for projection on surface, second thing is if two cameras can use single surface as output. Reason for this is that our hardware delivers one picture signal split into two Android cameras, and there is need to connect

Why Camera2 API working not correct?

*爱你&永不变心* 提交于 2019-12-11 17:05:04
问题 I using code Camera2 API at: https://github.com/googlesamples/android-Camera2Basic. If i take picture time 1: afState =4, it is take picture ok. But if I take picture time 2: afState=1, it can't take picture. My Phone: Using android 7.0 private fun capturePicture(result: CaptureResult) { val afState = result.get(CaptureResult.CONTROL_AF_STATE) if (afState == null) { captureStillPicture() } else if (afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED || afState == CaptureResult.CONTROL_AF

How to convert YUV to bitmap in landscape orientation?

徘徊边缘 提交于 2019-12-11 16:07:35
问题 First Method When I set javasetRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); or java setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); Camera2 is running fine and save image from imageavailablelistener. Second Method When I set java setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); or java setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); It will exit from the app and cannot save image Conversion Credit YUV Image to