Capturing RAW and JPEG Images Simultaneously with CameraX and Camera2Interop

85 views
Skip to first unread message

Kavan Gondalia

unread,
Sep 4, 2024, 3:01:52 AMSep 4
to Android CameraX Discussion Group

Hi Team,

I hope this email finds you well.

Our team is currently developing a customized camera application using CameraX. We have successfully implemented a solution that allows us to capture images in RAW format using CameraX along with Camera2Interop.

Our next goal is to capture images in both RAW and JPEG formats simultaneously. While we know that when using Camera2 directly, the .addTarget method can be used to add multiple surfaces, enabling the capture of multiple image formats, we are curious whether a similar approach is possible within CameraX.

Is there a recommended way to achieve simultaneous RAW and JPEG image capture using CameraX? Any insights or guidance on this would be greatly appreciated.

Looking forward to your suggestions.

Best regards,
Kavan Gondalia

Scott Nien

unread,
Sep 4, 2024, 5:11:41 AMSep 4
to Kavan Gondalia, Android CameraX Discussion Group
Hi Kavan, 
It's not possible to take pictures with RAW and JPEG simultaneously using Camera2Interop for now, but we already plan to add this capability (RAW / JPEG capturing at the same time) to our 1.5 release.  If things go well , you should be able to use it a couple months later. 

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/ff0317b6-6432-440b-91ba-fff371889ae6n%40android.com.

Kailiang Chen

unread,
Sep 4, 2024, 11:53:49 AMSep 4
to Scott Nien, Kavan Gondalia, Android CameraX Discussion Group
Hi Kavan,

Yes, we plan to release the official APIs for RAW in CameraX soon.
Let us know if you have other use cases regarding RAW or RAW + JPEG image capture.

Kailiang Chen

unread,
Sep 4, 2024, 1:10:27 PMSep 4
to Kavan Gondalia, Android CameraX Discussion Group
Hi Kavan,

We recommended using CameraX instead of Camera2 or mixed CameraX with Camera2.
Camera2Interop is our experimental API so you could consider shifting to our official API for RAW and RAW + JPEG when it's ready.

For multiple lenses capturing (concurrent capture), currently CameraX is supporting front and back cameras (logical cameras) at the same time (a.k.a concurrent camera).
You can bind Preview + ImageCapture use cases and try taking pictures of each camera. 

If you want to take a picture with two front cameras (physical camera), unfortunately it depends on device  capability and we are not supporting it now.
If you want to take a picture with front + back cameras (logical cameras) as a whole, we are working on this now (for video capture, we already supported it).

Our Camera2Interop is not supporting multiple lens capture.
Could you share more details on what you want to do with "multiple lenses capturing (concurrent capture)" ?

Best,
Kailiang


On Wed, Sep 4, 2024 at 9:44 AM Kavan Gondalia <kavan.g...@playpowerlabs.com> wrote:
Hi Kailiang,

Thanks for the response.
We've already tweaked the code such a way that we could capture RAW Image with CameraX and some minor usage of Interop.

We're currently focusing on capturing RAW as well as JPEG image simultaneously.

Also another thing I had in my mind, does CameraX support multiple lenses capturing (concurrent capture)? Or anyhow I can achieve using Interop? Or do you suggest to shift to Camera2 instead?

Kavan Gondalia

unread,
Sep 5, 2024, 1:34:57 AMSep 5
to Android CameraX Discussion Group, kail...@google.com, Kavan Gondalia

Hi Kailian,

Thank you for your detailed response.

I wanted to clarify that by "multiple lenses capturing (concurrent capture)," I am referring to the need to capture and display footage from two different lenses simultaneously using two separate PreviewView components. The captured image could either be a single composite preview of both lenses or two separate images from each lens. This would involve any combination of available rear cameras on the device, such as a standard lens and a wide-angle lens, similar to what is demonstrated in this video: Video Link.

Best regards,
Kavan

Kailiang Chen

unread,
Sep 5, 2024, 2:46:32 AMSep 5
to Kavan Gondalia, Android CameraX Discussion Group
Hi Kavan,

Thanks for the clarification.

The feature you are requesting is multi-camera (multiple physical cameras such as ultra-wide / wide / tele lens) concurrent preview / capture.
CameraX is not supporting this feature now.

The video you attached for Samsung s24 Ultra is only exposing this feature by their default camera app, and it's not accessible via public APIs.
Only limited devices are supporting REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA and you can query and open multiple physical cameras via CameraX API.
This sample could be a reference. 

We could explore whether it's feasible and how many devices are supporting it if you file a feature request.

Best,
Kailiang







Reply all
Reply to author
Forward
0 new messages