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
9
votes
3 answers

Tap to adjust focus / exposure in CameraX

I would like to implement the standard UX of tapping a point on the preview to adjust the auto-focus and auto-exposure points to the place where they tapped. I found the Preview.focus() function, however it says that it needs dimensions in the…
phreakhead
  • 14,721
  • 5
  • 39
  • 40
9
votes
4 answers

How to set a correct aspect ratio using CameraX?

I'm following the CameraX codelab and I'm getting a wrong aspect ratio on the preview even using setTargetAspectRatio and setTargetResolution methods. private fun startCamera() { // Create configuration object for the viewfinder use case val…
nglauber
  • 18,674
  • 6
  • 70
  • 75
9
votes
5 answers

Android CameraX doesn't show anything

I've implemented a new sample, here is a link which describes new CameraX api from Google codelabs, but TextureView doesn't show anything and throw next exception: OpenGLRenderer: [SurfaceTexture-0-7609-1] dequeueImage: SurfaceTexture is not…
Max
  • 123
  • 3
  • 8
8
votes
1 answer

How can I use a PreviewView inside jetpack compose?

I was trying to use a CameraX PreviewView inside of a Composable via AndroidView, but the preview is stretched and the right half is clipped as you can see in the screenshot. Nevertheless the view seems to occupy the correct space. This problem only…
user15444913
8
votes
1 answer

java.lang.IllegalAccessException: Tried to access visual service WindowManager from a non-visual Context

I've been struggling to implement a camera function into my app in a way that doesn't generate the below error: E/ContextImpl: Tried to access visual service WindowManager from a non-visual Context:com.camtest.App@385f002 Visual services, such as…
CragMonkey
  • 808
  • 1
  • 11
  • 22
8
votes
2 answers

CameraX Image analysis's imageproxy size and PreviewView size are not the same

I'm trying to use Firebase's MLKit for face detection with Camerax. I'm having a hard time to get Image analysis's imageproxy size to match PreviewView's size. For both Image analysis and PreviewView, I've set setTargetResolution() to PreviewView…
Rocky666
  • 91
  • 1
  • 5
8
votes
0 answers

CameraX works on Android Q but not on Android R

I am trying to create a custom camera app using CameraX by following the example from Google Codelabs. The tutorial specifically states: We recommend using an AVD that is based on Android 11 or higher. It is working fine with API 29 (Android 10)…
Kellin Strook
  • 487
  • 1
  • 5
  • 18
8
votes
1 answer

Is it possible to apply real time filter to android-camerax?

I'm using cameraX for recording video. I need to apply real time filters to the camera preview using android-gpuimage or any other library. Is it possible? if yes kindly provide an example. @SuppressLint("RestrictedApi") private fun…
arcworks27
  • 83
  • 1
  • 4
8
votes
2 answers

Android CameraX analyse image stream

I want to analyse a stream of image frames and do some computation on it. However, with CameraX, the ImageAnalysis implementation class seems to get called only once - on camera bind. My question is: How do I run the analysis on a continuous stream…
DebD
  • 373
  • 3
  • 20
8
votes
1 answer

Just toggle flash with CameraX

Sorry about my English, I dont speak very well. I have an app that comumnicates with an arduino device by blinking flash. I notice that both Camera1 and Camera2 have issues to work into all Android devices, so I builded a settings screen that user…
8
votes
3 answers

CameraX Image take picture slow

I am using CameraX Here is my image capture : mImageCapture = ImageCapture.Builder() .setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY) .setTargetAspectRatio(screenAspectRatio) …
Rasul
  • 727
  • 7
  • 20
8
votes
3 answers

How to use CameraX with PreviewView?

I can't find out how to use camerax with previewview.
Mohamed Ben Romdhane
  • 1,005
  • 3
  • 11
  • 22
8
votes
2 answers

OutputFileResults returned by OnImageSavedCallback has an invalid Uri

I am using CameraX API to take pictures in my android app, save them and then display them from their path. With the previous version alpha-09 I was able to do so with onImageSaved(File file). However with the alpha-10 I have to use…
Paul Souteyrat
  • 400
  • 6
  • 16
8
votes
0 answers

Firebase mlKit Barcode scanner mlKit with camera X not working on android Pie

I'm trying to scan QR code using Firebase ML kit but I cannot start camera on android Pie (Nokia 6.1 Plus). However, same code is working properly on Android Oreo Redmi 6 A This is my gradle: implementation…
8
votes
2 answers

What is the correct way of starting and stopping camera using CameraX?

I've started exploring CameraX library along with sample app and I've noticed some inconsistency in managing lifecycle. In this thread I will talk only about preview use case as it is mostly related to lifecycle. In the sample app, in…
Nominalista
  • 4,632
  • 11
  • 43
  • 102
1 2
3
53 54