CameraX 1.5: Unlocking Advanced Video Recording and Image Capture on Android
Revolutionize your Android camera experience with CameraX 1.5!
CameraX 1.5 brings a host of exciting new features to Android, empowering developers to create stunning visual content. One of the most anticipated additions is the ability to capture slow-motion and high frame-rate videos, as well as unprocessed, uncompressed still images. This is made possible by the new SessionConfig API, which streamlines camera setup and configuration.
Slow-Motion Videos: Capturing the Action
Now, you can capture high-speed videos at 120 or 240 fps and encode them directly into dramatic slow-motion footage. Alternatively, you can record at the same high frame rate for exceptionally smooth videos. To check if high-speed capture is supported, developers can use the Recorder.getHighSpeedVideoCapabilities() method. When creating a HighSpeedVideoSessionConfig, remember to set isSlowMotionEnabled to true for the desired effect.
Feature Group API: Combining Features for Stability
Another significant enhancement is the Feature Group API, which allows developers to combine multiple features simultaneously while ensuring a stable camera session. Currently, it supports HDR (HLG), 60 fps, Preview Stabilization, and Ultra HDR. The CameraX team is working on adding support for 4K recording and ultra-wide zoom. The Feature Group API also lets you prioritize capture features, ensuring the best possible combination for your use case. For instance, you can create a feature group with HDR, followed by 60 FPS, and then preview stabilization, and the API will enable these features in the specified order, if possible.
RAW Image Capture: Unlocking Professional Editing
CameraX 1.5 now supports RAW capture, giving you access to unprocessed, uncompressed image data directly from the camera sensor. This enables professional-grade editing and color grading. You can capture just the DNG file or simultaneously capture JPEG and DNG outputs. Use ImageCapture.getImageCaptureCapabilities to check if the device supports the OUTPUTFORMATRAW_JPEG option, and then configure an appropriate ImageCapture.Builder instance.
Camera Extensions: Enhancing Image Capture
Another exciting enhancement is the ability to use camera extensions like night mode, bokeh, or face retouch in combination with Ultra HDR. This significantly improves color fidelity and dynamic range. These extensions can be seamlessly integrated into your image capture workflow, taking your photos to the next level.
Centralized Camera Setup with SessionConfig API
The new features are managed through the SessionConfig API, which centralizes camera setup and configuration. This API is lifecycle-aware, eliminating the need to explicitly call unbind or unbindAll when updating camera settings. It also enables deterministic frame rate management, ensuring you achieve the specified frame rate, provided it is supported by the current device.
Additional Minor Features: Refining the Experience
CameraX 1.5 introduces several minor features to refine your camera experience. These include dynamic video capture muting, low-light boost, improved handling of insufficient storage conditions, support for the NV21 image format, and adjustable torch strength. These subtle improvements enhance the overall camera functionality and user experience.
What do you think about these new CameraX 1.5 features? Do you have any questions or thoughts on how these features can be used? Share your opinions and experiences in the comments below!