CameraX 1.5 introduces support for capturing slow-motion and high frame-rate videos as well as unprocessed, uncompressed still images. These capabilities are enabled by the new SessionConfig API, which streamlines camera setup and configuration.
One of our most anticipated features, slow-motion video, is now available. You can now capture high-speed video (e.g., 120 or 240 fps) and encode it directly into a dramatic slow-motion video. Alternatively, you can record at the same high frame rate to produce exceptionally smooth video.
To determine whether high-speed capture is supported, developers can use Recorder.getHighSpeedVideoCapabilities(). This method returns a videoCapabilities value that you can use directly to instantiate a HighSpeedVideoSessionConfig. When instantiating the session config, it is required to specify isSlowMotionEnabled = true. Otherwise, a high frame-rate video will be recorded.
Another major enhancement in the CameraX API is the Feature Group API, which allows developers to combine multiple feature simultaneously, while ensuring the camera session is always stable. Currently, it supports HDR (HLG), 60 fps, Preview Stabilization, and Ultra HDR. Support for 4K recording and ultra-wide zoom is in the works, the CameraX team says. The Feature Group API also allows you to prioritize capture features so you obtain the best possible combination for your use case. For example, you might create a feature group that includes HDR, followed by 60 FPS, followed by preview stabilization and the API will do its best to ensure those features are enabled in the order you specified, if possible.
On the front of image capture, CameraX 1.5 now supports RAW capture for improved control over post-processing:
This gives you access to the unprocessed, uncompressed image data directly from the camera sensor, enabling professional-grade editing and color grading. The API supports capturing the DNG file alone, or capturing simultaneous JPEG and DNG outputs.
You can use ImageCapture.getImageCaptureCapabilities to ensure the current device supports the OUTPUT_FORMAT_RAW_JPEG option and then configure an appropriate ImageCapture.Builder instance.
Another enhancement in image capture is the ability to use camera extensions, such as night mode, bokeh, or face retouch, in combination with Ultra HDR. This significantly improves both color fidelity and dynamic range when using the extensions.
As mentioned, the new features are managed through the new SessionConfig API, which centralizes camera setup and configuration. This new API is also lifecycle-aware, which means you do not need to explicitly call unbind or unbindAll when updating the camera settings from one configuration to another. Additionally, it enables deterministic frame rate management, which ensures you achieve the specified frame rate provided it is supported by the current device.
As a final note, CameraX 1.5 also introduces a host of additional minor features, including dynamic video capture muting, low-light boost, improved handling of insufficient storage conditions, support for the NV21 image format, and adjustable torch strength.
