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).
Questions tagged [android-camerax]
807 questions
8
votes
6 answers
How to zoom camera using Android CameraX API?
I have tried to zoom camera with below code using CameraX.
First I get a Preview from CameraX and tried to perform zoom using Preview like below.
var config = CameraX.getDefaultUseCaseConfig(PreviewConfig::class.java, lensFacing)
var preview =…

Patel Pinkal
- 8,984
- 4
- 28
- 50
7
votes
3 answers
Native Camera View in Flutter does not occupy the whole width and height
I am trying to integrate CameraX inside my flutter project. I am doing so via platform channels. I don't want to integrate any third party lib.
Here is a screenshot of the camera only occupying one third of the height in Android
Below is my…

BraveEvidence
- 53
- 11
- 45
- 119
7
votes
1 answer
CameraX black screen preview on some devices
I am using camerax to capture images in my android app.
Everything is working fine for me but some users are reporting black preview screen when using camerax activity.
But when users opens the app from recents app, the preview seems to work.
So, I…

Akash Chaudhary
- 701
- 11
- 28
7
votes
0 answers
Does CameraX support macro focus?
I am currently trying to implement a functionality for macro focus in Android. Both, Camera1 API and Camera2 API offer the possibility for FOCUS_MODE_MACRO/AF_MACRO.
For CameraX, I found FocusMeteringAction.FLAG_AF which is obviously not the macro…

D. Muff
- 183
- 1
- 1
- 9
7
votes
1 answer
Why FirebaseVisionImage.fromMediaImage() produces OutOfMemoryError
CameraX is build, analyze() method is called and an image is passed and then closed (deleted) with close() method. From this image FirebaseVisionImage is created and passed for processing (text recognition). Code samples and code labs differs and…

Sorel
- 91
- 6
7
votes
3 answers
How to decrease frame rate of Android CameraX ImageAnalysis?
How to decrease the frame rate to 1 fps in image analysis so that I don't detect barcode multiple times. In my use-case, scanning the same barcode multiple times with a 1-second interval should increment a counter. So I want it to work correctly.…

Abhimanyu
- 11,351
- 7
- 51
- 121
7
votes
2 answers
Camerax run in service . How to get lifecycleowner or run without it inside a foreground service?
Use case : is that I have to run camera in background inside a service without any activity or fragment
Blocker : New camerax session is bind to lifecycleowner but the service don't have any .So how to get this object or run without it ?
Already…

ArpitA
- 721
- 7
- 17
7
votes
1 answer
What is it exactly? Error: vendor.camera.aux.packagelist
Currently trying out the new CameraX. Anyone know what's the problem. I should have all the permissions needed.
Here is my entire logcat.
2019-12-08 03:57:56.716 11667-11667/com.example.camerax E/libc: Access denied finding property…

Samuel Hauptmann van Dam
- 87
- 1
- 6
7
votes
1 answer
How can I display a negative mode preview with CameraX in Android?
I'm learning CameraX API, and CameraXBasic is a office sample code.
CameraFragment.kt in CameraXBasic project displays a real camera preview.
Now I hope to display a negative mode preview. How can I do with CameraX API? Is there a sample…

HelloCW
- 843
- 22
- 125
- 310
7
votes
0 answers
Camerax failing to get supported resolutions
I'm using CameraX to build a camera with with the Preview and Analysis use cases. I've built and run my application locally on an emulator and device. However after I publish to google play I'm getting the following stacktrace reported by…

Paymahn Moghadasian
- 9,301
- 13
- 56
- 94
7
votes
2 answers
CameraX make ImageAnalysis same size as Preview
I want to be able to get the exact image for analysis step as I get in preview.
I have preview use case:
val metrics = DisplayMetrics().also { binding.codeScannerView.display.getRealMetrics(it) }
val screenAspectRatio =…

SMGhost
- 3,867
- 6
- 38
- 68
7
votes
1 answer
Android CameraX - face detection while recording video
I'm using the new library CameraX with Firebase ML Kit in Android and detecting faces every frame the device can.
So I set CameraX like that:
CameraX.bindToLifecycle(this, preview, imageCapture, faceDetectAnalyzer)
All working flowless, now, while…

GMX
- 950
- 1
- 14
- 29
7
votes
3 answers
Setting target resolution for CameraX not working as in documentation
I want to capture photos with fixed resolution (i.e. 1200x1600) using CameraX library.
So according to documentation I can set target resolution for ImageCaptureConfig:
val imageCaptureConfig = ImageCaptureConfig.Builder()
…

Nominalista
- 4,632
- 11
- 43
- 102
7
votes
4 answers
Android: How to crop images using CameraX?
I want to take a photo and crop out a square of 25x25 dp from the center using CameraX. I have read that cropping is possible using ImageCapture but unfortunately there are almost no similar examples out there so far.
val imageCaptureConfig =…

KunBa
- 235
- 5
- 12
7
votes
2 answers
Android CameraX GLSurfaceView
Please, can someone provide good example of using CameraX library with GLSurfaceView, can't find any information.

Nikita Unkovsky
- 631
- 1
- 7
- 13