Search code examples
androidandroid-camera2android-camerax

Get camera ISO / shutter speed using CameraX or Camera2


I'm trying to get the current preview's shutter speed and ISO settings.

I cannot find a way to do this using CameraX or Camera2. Is this not something that is available?

Failing that, is there a way to get the settings that were used to take a photo?


Solution

  • For Camera2, this information is available in the CaptureResult objects you get for every captured image, via onCaptureCompleted. However, not all devices support listing this information; only devices that list the READ_SENSOR_SETTINGS capability will do this. That includes all devices that list hardware level FULL or better, and may include some devices at the LIMITED level.

    Specifically, you want to look at SENSOR_SENSITIVITY for ISO and SENSOR_EXPOSURE_TIME for shutter speed.

    If you want the values used for a JPEG capture, look at the CaptureResult that comes from the CaptureRequest you used to request the JPEG.