android-camera2

Camera2 API Make Preview Fill Entire View

半世苍凉 提交于 2020-05-27 10:34:29
问题 I am using the Camera2Basic example from Google Samples (https://github.com/googlesamples/android-Camera2Basic) to display a camera preview inside a fragment. This fragment contains a RelativeLayout and a custom AutoFitTextureView. The latter can be found on the link above. I have adjusted the layout to center the preview and remove control buttons: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match

Is it possible to combine Preview, ImageAnalysis, and VideoCapture with CameraX?

雨燕双飞 提交于 2020-05-15 08:00:26
问题 Is it possible to bind Preview , ImageAnalysis , and VideoCapture at the same time? Combined in pairs, all possible combinations (ie. Preview + ImageAnalysis , Preview + VideoCapture , and ImageAnalysis + VideoCapture ) work perfectly fine but binding all three together throws the following exception. java.lang.IllegalArgumentException: No supported surface combination is found for camera device - Id : 1. May be attempting to bind too many use cases. at androidx.camera.camera2.internal

Android Camera2 front camera

﹥>﹥吖頭↗ 提交于 2020-05-12 11:13:46
问题 I recently noticed that the Camera API is deprecated and I found the new API called Camera2. I have read the documentation but I don't really understand it. So my question is: how do I preview the front camera with the new camera api? Just a preview, not recording. I want to use this new API because in the future I'm guessing the current Camera API will be replaced and stop working. So I want to be prepared and just sit and watch while everyone panics. XD 回答1: First of all, find out the id of

Full Screen Video Recording in Front Camera using camera2 api

倾然丶 夕夏残阳落幕 提交于 2020-05-12 02:52:15
问题 I have been stuck in this issue for days. I followed this Android's official camera-sample in Kotlin: android's camera-sample I raised an issue on github issue on 11 Feb 2020 but haven't received any feedback. My problem is: I used the sample as it is and only changed val cameraId = manager.cameraIdList[0] to val cameraId = manager.cameraIdList[1] for front camera. NOTE: It does not happen in rear camera. The front camera does not work and shows black bar on devices tested: Emulator: Pixel C

How to set infinity focus in camera2 api, android?

淺唱寂寞╮ 提交于 2020-05-11 07:28:25
问题 I wanna set my custom camera focus distance to infinity while using external fisheye lens, This is what I have done so far: builder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_OFF); builder.set(CaptureRequest.LENS_FOCUS_DISTANCE, 0.0f); But the result is so blurry. I am using Samsung S6 and Nexus 5. External lens's wide angle is 170 degree. Can anyone help? 回答1: If you are just talking about using the built-in camera's lens to achieve fisheye, then the lowest value you

How to fix video & audio out of sync issue on android Video Recording using Camera api 2?

北城余情 提交于 2020-04-16 05:49:44
问题 I am implementing video recording application using Camera2 api. I've used Google samples for video recording. However, there's an audio, video out of sync issue on some devices, such as Samsung J5, J6. I have changed MediaRecorder.AudioEncoder, MediaRecorder.VideoEncoder, VideoEncodingBitrate , but it could not help me. How to handle audio, video sync issue? 回答1: I've found a solution from this article. It mightn't be the best solution but it works. To solve the out of sync issue,

AndroidQ : How to access Dynamic Depth Format

耗尽温柔 提交于 2020-03-18 08:57:26
问题 Android Q features blogs mentions about a new feature Dynamic Depth Format. Starting in Android Q, apps can request a Dynamic Depth image which >consists of a JPEG, XMP metadata related to depth related elements, >and a depth and confidence map embedded in the same file on devices >that advertise support. But i am not able to find this file format . I tried parsing the jpeg for any metadata associated but i could not place the file. Has anyone tried accessing the file? 来源: https:/

Android 10 (api 29) camera2 api regression with wide-angle camera

僤鯓⒐⒋嵵緔 提交于 2020-02-27 12:58:46
问题 I'm using camera2 api in my camera app designed specifically for Google Pixel 3 XL. This device has two front facing cameras (wide-angle and normal). Thanks to multi-camera feature, I can access both physical camera devices simultaneously, and my app has a feature to toggle between those two cameras. Up until my recent upgrade to Android 10, I could accurately see two distinct results, but now my wide-angle capture frame has pretty much the same FOV (Field of View) as the normal camera one.

Android 10 (api 29) camera2 api regression with wide-angle camera

若如初见. 提交于 2020-02-27 12:58:39
问题 I'm using camera2 api in my camera app designed specifically for Google Pixel 3 XL. This device has two front facing cameras (wide-angle and normal). Thanks to multi-camera feature, I can access both physical camera devices simultaneously, and my app has a feature to toggle between those two cameras. Up until my recent upgrade to Android 10, I could accurately see two distinct results, but now my wide-angle capture frame has pretty much the same FOV (Field of View) as the normal camera one.

Android Camera2 executable failed to get frames

纵然是瞬间 提交于 2020-01-25 09:25:14
问题 I have one Camera2 NDK code to open the camera and get images. The code work fine via Android Application/Service, but if I compile and run it as executable the camera opened but I don't get any frames. Any idea? someone succeeded to do it? NOTE I create my own AImageReader via "AImageReader_new" I create my own ANativeWindow via "AImageReader_getWindow" NOTE2 (ADDED) The calls is a little different For Android Application/Service the calls like: public void onCreate() { JNIBridge