Skip to content

Instantly share code, notes, and snippets.

@magdamiu
Last active August 9, 2022 11:14
Show Gist options
  • Save magdamiu/b9caca8de54648307d8051a55e999cde to your computer and use it in GitHub Desktop.
Save magdamiu/b9caca8de54648307d8051a55e999cde to your computer and use it in GitHub Desktop.
Setup FPS for ImageAnalysis
fun applyFrameRateOnImageAnalysis(): ImageAnalysis {
val imageAnalysisBuilder = ImageAnalysis.Builder()
val camera2InterOp = Camera2Interop.Extender(imageAnalysisBuilder)
camera2InterOp.setCaptureRequestOption(
CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_OFF
)
camera2InterOp.setCaptureRequestOption(
CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE,
Range(60, 60)
)
return imageAnalysisBuilder.build()
}
@457r0n4u7
Copy link

I am interested to use the setCaptureRequestOption feature however struggling to integrate it. Do you have a minimal working example for CameraX?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment