Camera 2 Video Recording - Auto Flash Does Not Work

I have implemented a custom camera that records video using the camera2 API. It is possible to set the flash to β€œOn”, β€œoff” and β€œAuto”. Setting the flash to β€œAuto” does not work , while other settings work fine.

Here is the code:

private void updateFlash() { Log.e(TAG, "Flash = " + currentFlash); switch (currentFlash) { case Constants.FLASH_OFF: previewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF); break; case Constants.FLASH_ON: previewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_TORCH); break; case Constants.FLASH_TORCH: previewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_TORCH); break; case Constants.FLASH_AUTO: previewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH); break; } cameraCaptureSession.setRepeatingRequest(previewRequestBuilder.build(), null, null); } 

I have a lot of googled and almost all answers on stackoverflow for automatic flash, but no one worked.

Please, help. I do not understand what the problem is.

+8
android camera android-camera2
source share

No one has answered this question yet.

See similar questions:

26
Turn on the camera flash while recording video

or similar:

26
Turn on the camera flash while recording video
12
Android - Switch between front and rear cameras while recording video
4
Android Camera2 API switches back - front cameras
3
How to set up camera preview using Camera2 API at the same time for photos and videos?
one
Nexus 5X records upside down video using MediaRecorder and camera2
one
Turning on / off flash memory with Android camera2 API does not work
one
Camera Camera2 while recording
0
How to use android camera2 api to record 60 frames per second video with fixed exposure time
0
Is the Android camera zero when recording video using a custom camera?
0
Camera2 Flash: how to control flash settings when auto exposure is off (CONTROL_AE_MODE_OFF)

All Articles