camera2

How can I draw on a video while recording it in android, and save the video and the drawing?

心不动则不痛 提交于 2019-12-21 20:39:16
问题 I am trying to develop an app that allows me to draw on a video while recording it, and to then save both the recording and the video in one mp4 file for later use. Also, I want to use the camera2 library, especially that I need my app to run for devices higher than API 21, and I am always avoiding deprecated libraries. I tried many ways to do it, including FFmpeg in which I placed an overlay of the TextureView.getBitmap() (from the camera) and a bitmap taken from the canvas. It worked but

Camera2 API - How to set long exposure times

╄→尐↘猪︶ㄣ 提交于 2019-12-20 20:03:06
问题 I'm trying to capture images with 30 seconds exposure times in my app (I know it's possible since the stock camera allows it). But SENSOR_INFO_EXPOSURE_TIME_RANGE (which it's supposed to be in nanoseconds) gives me the range : 13272 - 869661901 in seconds it would be just 0.000013272 - 0.869661901 Which obviously is less than a second. How can I use longer exposure times? Thanks in advance!. 回答1: The answer to your question : You can't. You checked exactly the right information and

android Camera2 API + TextureView overlay for drawing on camera preview

眉间皱痕 提交于 2019-12-19 02:47:18
问题 So, I need to overlay the camera2 preview and draw a rectangle on the preview video image by layering a transparent overlay on top. I started with a basic Camera2 code here: https://github.com/googlesamples/android-Camera2Basic the above use TextureView for camera preview. Next, I added the following class to project private class CustomView extends SurfaceView { private final Paint paint; private final SurfaceHolder mHolder; private final Context context; public CustomView

camera2 face detection call back

爱⌒轻易说出口 提交于 2019-12-12 09:09:11
问题 I'm trying to use the face detector in the camera2 api. I set the preview builder to use the face detector: previewBuilder.set(CaptureRequest.STATISTICS_FACE_DETECT_MODE, CameraMetadata.STATISTICS_FACE_DETECT_MODE_FULL); CR = previewBuilder.build(); CS = session; CS.setRepeatingRequest(CR, CScallback, null); But I don't understand where the code hits when it detects a face? Does it return a face in the CameraCaptureSession.CaptureCallback? Where does it send back the info about the detected

What are all the automatic parameters of android's camera2 API

我只是一个虾纸丫 提交于 2019-12-12 04:05:46
问题 I'm developing a camera app using the Android camera2 API, And I need the camera to have always the same configuration, like focus, white balance, exposure, etc. I already disabled AF, AE and AWB, but it still seems to automatically set the white balance. I was wondering if is there some other automatic configuration I should disable. I didn't find anything like it on Google. 来源: https://stackoverflow.com/questions/35138243/what-are-all-the-automatic-parameters-of-androids-camera2-api

Camera2 api problems firing flash/no flash images

落花浮王杯 提交于 2019-12-11 06:32:50
问题 I will explain my case. I'm trying to do an application in which every 5 seconds will take an image, one without flash, and then after 5 seconds one with flash, and repeat this every time. So it will take one without flash, one with flash, one without flash, one with flash... infinitely. The case is that with my code I can do this in some devices, but the same code won't work in others as I want. i.e: BQ Aquaris X5 Plus : The no-flash image is correct, but the flash image will be just white.

60/120fps preview data on an Android device?

百般思念 提交于 2019-12-10 01:47:46
问题 We would like to process 120 fps (or 60fps) camera preview data using Neon assembly or GPU shaders to perform a simple image processing operation (eg 3x3 convolution). We are NOT interested in displaying the image on the screen so the camera data should go directly to a SurfaceTexture. We thought we could do this using Camera2 API on a Nexus 5 using CameraConstrainedHighSpeedCaptureSession but have been unsuccessful. There is no currently functional code on the internet (at least the part we

Android: Camera2 Bad argument passed to camera service

梦想的初衷 提交于 2019-12-07 03:19:34
问题 Can somebody what I have done wrong... I wanted to capture the image which I have a preview screen using SurfaceView. I am able to show the preview on the surface view. This is my code to capture the image if (mCameraSession == null && mCameraDevice == null) return; ImageReader reader = ImageReader.newInstance(mTexturePreviewSize.getWidth(), mTexturePreviewSize.getHeight(), ImageFormat.JPEG, 1); reader.setOnImageAvailableListener(imageAvailableListener, mBackgroundHandler); Surface surface =

Android camera2 API get focus distance in AF mode

房东的猫 提交于 2019-12-06 21:21:40
问题 I'm working with Android camera2 API. I can get focus distance value using LENS_FOCUS_DISTANCE in manual focus mode. However, the property is always zero in AF mode. Is there any way to get focus distance in AF mode? 回答1: Shortest distance from frontmost surface of the lens that can be brought into sharp focus. If the lens is fixed-focus, this will be 0. http://developer.android.com/intl/es/reference/android/hardware/camera2/CameraCharacteristics.html In other way, if you want to manage focus

Android camera2 API - Display processed frame in real time

你说的曾经没有我的故事 提交于 2019-12-06 07:59:34
问题 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 receives images in YUV_420_888 format like this. mImageReader = ImageReader.newInstance( mPreviewSize.getWidth(), mPreviewSize.getHeight(), ImageFormat.YUV_420_888, 4); mImageReader.setOnImageAvailableListener(mOnImageAvailableListener,