Questions tagged [android-camerax]

If your issue is related to observed behavior, rather than API usage, please include information about the specific device (even if the device is an emulator).

807 questions
50
votes
11 answers

Converting ImageProxy to Bitmap

So, I wanted to explore new Google's Camera API - CameraX. What I want to do, is take an image from camera feed every second and then pass it into a function that accepts bitmap for machine learning purposes. I read the documentation on Camera X…
MaaAn13
  • 264
  • 5
  • 24
  • 54
36
votes
10 answers

How does CameraX library can turn ON/OFF the torch?

I am developing a feature with the possibility of switching the torch into ON/OFF states. Some days ago, we saw a new library from Google in io2019. I came up with an idea, why not use it. After some time, I don't see any possibilities to use the…
32
votes
6 answers

Can I record video with CameraX (Android Jetpack)?

Google has released the new CameraX library as part of Jetpack. It looks great for taking pictures, but my use case also require making video's. I tried googling for that, but couldn't find anything. So, is it possible to record videos with the…
Peter Fortuin
  • 5,041
  • 8
  • 41
  • 69
31
votes
1 answer

ImageAnalysis.Analyzer only fires once

In the latest alpha (alpha08) I can't seem to figure out how to correctly configure everything so that the my Analyzer runs normally. I can see it work once, then it never runs again. For various reasons I need to use a TextureView so I cannot swap…
Luke
  • 6,388
  • 3
  • 26
  • 35
22
votes
1 answer

CameraX - I/zygote: Rejecting re-init on previously-failed class java.lang.Class

I am developing a simple app based on the CameraX Jetpack support library through the provided getting started guide and a GitHub repo. Getting the error I/zygote: Rejecting re-init on previously-failed class…
talha06
  • 6,206
  • 21
  • 92
  • 147
17
votes
4 answers

How to switch to front camera on CameraX?

I've followed the steps here to get CameraX setup, and now I am trying to get a front facing camera button working. Here is my set up code: private lateinit var preview: Preview private fun startCamera() { // Create configuration object for…
Andrew Gable
  • 2,692
  • 2
  • 24
  • 36
16
votes
1 answer

CameraX is not configured properly. The most likely cause is you did not include a default implementation in your build such as 'camera-camera2

After updating from androidx.camera:camera-view:1.0.0-alpha32 to androidx.camera:camera-view:1.1.0-beta01 I receive the next error when using CameraX camerax_version = "1.0.2" // CameraX implementation…
user924
  • 8,146
  • 7
  • 57
  • 139
16
votes
3 answers

Is there a way to crop Image/ImageProxy (before passing to MLKit's analyzer)?

I'm using CameraX's Analyzer use case with the MLKit's BarcodeScanner. I would like to crop portion of the image received from the camera, before passing it to the scanner. What I'm doing right now is I convert ImageProxy (that I recieve in the…
16
votes
4 answers

How can I use a CameraView with Jetpack Compose?

Currently there's no equivalent to CameraView (and PreviewView) in Compose. Is it possible to wrap it and display it in a compose layout?
icefex
  • 523
  • 1
  • 7
  • 14
15
votes
1 answer

"Not Bound To A Valid Camera" CameraX Error

I was trying to follow the "Getting Started with CameraX" codelab from google and I tried to do it in Java instead of Kotlin but when I ran it and tried to take a picture it gave me an error that says not bound to a valid camera. I can't find where…
Mara
  • 163
  • 1
  • 6
15
votes
6 answers

Android CameraX image rotated

I have followed Google CameraX code lab to implement custom camera. Camera preview is fine but when i take image after image capture image is rotated. I am taking image in portrait mode but saved image is in landscape. Here is the method to…
14
votes
2 answers

How to use manual focus in Android CameraX?

I am trying to do manual focus on CameraX the same as I do in Camera2 API in Camera2 API I use the following code final CaptureRequest.Builder captureBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);…
moLand
  • 143
  • 1
  • 6
14
votes
6 answers

an error occurred by CameraX.bindToLifecycle()

java.lang.IllegalArgumentException: No supported surface combination is found for camera device - Id : 0. May be attempting to bind too many use cases. why the bindToLifecycle() only choose imageCapture or videoCapture? …
user6407556
  • 313
  • 2
  • 3
  • 7
14
votes
3 answers

What is Android CameraX?

What is Android CameraX? There is a session about CameraX planned in Google I/O 2019. What is it? Is it a new framework API? Is it a new library? https://events.google.com/io/schedule/events/8d400240-f31f-4ac2-bfab-f8347ef3ab3e Does it mean that…
Yuichi Araki
  • 3,438
  • 1
  • 19
  • 24
13
votes
6 answers

How to get available resolutions using CameraX on Android?

Is there a way to query the available camera resolutions using CameraX? With Camera2 this is possible using StreamConfigurationMap.getOutputSizes(). However, I can't find a way to do this using CameraX. It doesn't help that the documentation is…
Georgios
  • 4,764
  • 35
  • 48
1
2 3
53 54