android-camera2

Set brightness/contrast in video capture using Android Camera2

岁酱吖の 提交于 2019-12-03 06:11:49
I made a video capture app with Camera2 API by following this guide, Is there a provision to change brightness/contrast/exposure settings of the video programatically? I'm trying to capture some low-lit video footage, and I wish to increase the exposure. The documentation here seems to apply only for still pictures. Any such way for video capture, using Camera2 API? All the configuration that you need should be in CaptureRequest , for example for brightness here . So, to implement it with the guide you follow, it's in the part 5. of the main steps listed in the readme, you need to use the

Difference Between Camera and Camera2 in Android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 05:15:50
I'm building an App which is similar to social media where people can share photos and videos like Instagram. That's why Camera is very important for my app. Now camera2 API is confusing me. I want to run my app on API level 11+ . I know camera2 is only available in API level 21+ So, I need to design two APIs one(camera) for older version and second(camera2) for higher version. Problem is that I just started to learn Android and I do not know what is the main difference between these two APIs. What main features are available in Camera2 API ? Or Is there any drawback of Old Camera API ? I need

Camera2basic app, has very dark preview in Android 6.0 LGG3

試著忘記壹切 提交于 2019-12-03 01:27:55
The new API, perhaps only on LG G3, seems to have something changed. I'm using the sample code . On my nexus 4, the code runs perfectly, but on LGG3 updated to Android 6.0 it does not. Any ideas? I played with the settings, but no luck, this still works fine on Nexus 4: mPreviewRequestBuilder.set(CaptureRequest.BLACK_LEVEL_LOCK, false); mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AWB_LOCK, false); mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AWB_MODE, CaptureRequest.CONTROL_AWB_MODE_AUTO); mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_LOCK, false); mPreviewRequestBuilder.set

Camera2 set preview (View) and get preview callbacks

北城余情 提交于 2019-12-02 17:28:17
问题 I want to get preview from Camera2 and also byte[] callback for processing frames mImageReader = ImageReader.newInstance(largest.getWidth(), largest.getHeight(), ImageFormat.RAW_SENSOR,1); mImageReader.setOnImageAvailableListener( mOnImageAvailableListener, mBackgroundHandler); . SurfaceTexture texture = mTextureView.getSurfaceTexture(); assert texture != null; // We configure the size of default buffer to be the size of camera preview we want. texture.setDefaultBufferSize(mPreviewSize

Need to display a camera preview inside a circular view

三世轮回 提交于 2019-12-02 17:23:32
问题 I need to implement a circular camera preview. I am using camera2 api with TextureView. I added the layout as follows: <FrameLayout> <TextureView/> <CircularImageView/> <FrameLayout/> Doing this I am getting the below result: As you can see, the camera preview is displayed in a square, but I want that to be a circular one, also keeping the yellow image in the background. How can I achieve this ? I did refer few examples on similar questions perviously asked but they are done using old camera

How to manually control Camera2 manual focus?

吃可爱长大的小学妹 提交于 2019-12-02 15:52:53
问题 Problem My phone support all manual configuration. Tested with (https://github.com/pinguo-yuyidong/Camera2) which allow us to adjust using seekbar. I want to set a fix value in Lens Focus Distance when preview is started until I close the app. After I set AF mode to off and set the Lens Focus Distance with a value. The preview does not show any effect but the Focus 2 value is changed. How can I overcome this problem? Sample Code (Java) private CaptureRequest mPreviewRequest; private void

Need to display a camera preview inside a circular view

情到浓时终转凉″ 提交于 2019-12-02 09:54:33
I need to implement a circular camera preview. I am using camera2 api with TextureView. I added the layout as follows: <FrameLayout> <TextureView/> <CircularImageView/> <FrameLayout/> Doing this I am getting the below result: As you can see, the camera preview is displayed in a square, but I want that to be a circular one, also keeping the yellow image in the background. How can I achieve this ? I did refer few examples on similar questions perviously asked but they are done using old camera api and not TextureView. Any help is appreciated. Instead of CircularImageView, you need a regular

Camera2 set preview (View) and get preview callbacks

情到浓时终转凉″ 提交于 2019-12-02 08:52:48
I want to get preview from Camera2 and also byte[] callback for processing frames mImageReader = ImageReader.newInstance(largest.getWidth(), largest.getHeight(), ImageFormat.RAW_SENSOR,1); mImageReader.setOnImageAvailableListener( mOnImageAvailableListener, mBackgroundHandler); . SurfaceTexture texture = mTextureView.getSurfaceTexture(); assert texture != null; // We configure the size of default buffer to be the size of camera preview we want. texture.setDefaultBufferSize(mPreviewSize.getWidth(), mPreviewSize.getHeight()); // This is the output Surface we need to start preview. Surface

Camera2 preview stretched when cropping with SCALER_CROP_REGION

橙三吉。 提交于 2019-12-02 06:04:54
问题 I want to display a preview in fullscreen using camera2 api. The camera size I selected is 4160x3120 (16:9) and my screen is 1080x1920 (9:16). Therefore if I want the preview to be right scaled I have to crop the camera output : Rect zoomCrop = new Rect(0, 0, 1755, 3120); captureRequestBuilder.set(CaptureRequest.SCALER_CROP_REGION, zoomCrop); The cropped preview should be of size 1755x3120 which has a ratio of 9:16 as well. Still the preview is streched. Question : Am I using SCALER_CROP

Why camera2 supported preview size width always bigger than height?

风流意气都作罢 提交于 2019-12-02 05:09:54
I'm working on a project which using camera2 API. When I get the list of supported output preview size using: StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); Size[] choices = map.getOutputSizes(SurfaceTexture.class); the output size list always return values which have width>height despite the fact that screen's width When I use getResources().getDisplayMetrics() (or any similar method) to check width/height it's always return width And based on the value I see that in 2 cases the width/height are likely swap their value. (w: 1920, h: