[Sony Xperia XZ2 Compact ROMs, Kernels, Recoveries,] AntonioBiscuit:
Camera, video recording and related

As of Binaries v7:

Stills:

RAW (.dng) support for both back and front cameras.

Back camera:

Definition is different from stock and varies depending on the photo mode:

17.1Mpx (5,472 x 3,104, 16:9) in RAW (.dng) (The number of pixels with .dng is not shown the same in Google Photos and Image Glass)

15.9Mpx (5,312 x 2,988, 16:9) in JPEG mode

It is not the 19.1Mpx (5,056 x 3,792, 4:3) maximal stock definition.

From my searches, the IMX400 sensor is natively 5,520 x 3,840 (19.2 Mpx), but it is a multi-aspect sensor.

The maximum definition in 4:3 mode is 5,056 x 3,792 (19Mpx) while it is 5,504 x 3,096 (17Mpx) in 16:9 mode.

So maybe only the 4:3 mode of the sensor neeeds to be either implemented or enabled since basically every pixel in 16:9 mode is usable on RAW.

It is not a killer for me since I now have .dng that is way better for me than the JPEG I used to edit with in stock Android, but it is something you should be aware of.

Front camera:

Not much to say, except that it has the exact same definition as stock (1944 x 2592, 4:3). It can also shoot in RAW and all the pixels are usable in both JPEG or DNG mode.

ISO range (back camera only):

Not the same as what you used to have in stock. You used to have 40 to 3,200 ISO accessible in stock Android.

Now, you have 100 to 12,000 ISO.

Auto-focus (back camera only):

You will miss the nice auto-focus you had in stock Android.

The autofocus is dumb and may struggle even on non-moving objects sometimes. It can definetly be a handicap when taking photos everyday.

It is also much slower than stock, but maybe because of other limitations in the camera implementation.

Exposure/Shutter (back camera only):

The shutter does not set by default to 1/60s or 1/50, nor even 1/30s which are acceptable to shoot photos and video (to some extent), but will go down to 1/15s most of the time in auto mode in case of "low light".

The exposure changes and transitions faster compared to stock or fades less.

The shutter is not working optimally, because of some sort of camera limitation.

Flash:

The light (torch/flash) is bright as hell compared to what it used to be on stock Android.

You now have a nice torch to use everyday with its good brightness.

It seems to heat up pretty fast though and must use a lot more power, so I would not use it for a large amounts of time.

Filtering:

There are now some more filtering options. Whether you like them or not will depend or your taste, but you have a bit more options.

White balance:

Some more options and presets too.

Video:

DO NOT LEAVE STOCK ANDROID YET IF VIDEO IS IMPORTANT TO YOU

The XZ2C camera in video has a lot of potential and I have been able to record some gorgeous images in a lot of scenarios.

You can disable denoiser and most other filterings to preserve detail or just keep the denoiser to get less compression artefacting and a better image overall in low light scenarios. You can get the encoder to go as high as 120Mbit/s HEVC in 4K and get a pretty good looking image at the end.

You could record at a steady 30 Frames per second in 4K with fixed exposure/ISO in stock Android, no frame drop whatsoever. I think this is the most important thing.

But what you get here is 15/20 Frames per second no matter what definition or frame rate you choose, even in manual mode (fixed exposure/ISO).

Because of this and the other issues (mainly the autofocus and exposure), I think that it is a sensor compatibility issue rather than an encoder issue.

The camera image preview is limited to 15/20FPS in both photo and video mode, which could explain a lot of things:

There has to be a link between the preview frame rate, the default 1/15s shutter, in part why the autofocus is so slow, and the fact that the camera cannot record video higher than 15/20FPS.

The sensor refresh rate or some sensor setting absolutely neeeds to be changed in order to get at least 30 frames per second.

It does not matter to me at all if video is a little bit cropped.

I usually crop my videos or zoom a tiny bit at the end or when recording anyways. 30FPS is more important to me right now.

I even wish to have 60FPS 4K video too but I don't know if it is possible to get it with this sensor. Maybe 60FPS 1440p is doable if 4K is not.

There is no slow-motion video yet (240FPS 1080p, 960FPS 720p/1080p) but i wish to see it too someday. Being able to get working slow-motion without filtering and a higher bitrate than stock would look gorgeous.