The camera on the PinePhone isn't very well tested since there is no easy way to get frames from the rear or front camera, even though the kernel has supported the camera's for a while.
This is a python script that can do various camera tasks on the PinePhone when running on postmarketOS, it might work in other distributions if it has the right dependencies and kernel config.
The required dependencies for postmarketOS are:
$ apk add python3 v4l-utils imagemagick ffmpeg
Then you need the camera script itself, you can fetch it from the sourcehut repository:
$ wget https://git.sr.ht/~martijnbraam/python-pinecamera/blob/master/camera.py
This script allows taking pictures and recoding movies. It also automatically corrects the orientation of photos based on data from the accelerometer. Here is some example use:
$ ./camera.py still photo.jpg
$ ./camera.py still photo.png
$ ./camera.py still --resolution 720p photo.jpg
$ ./camera.py movie --resolution 1080p15 pinecones.mkv
^c to end recording
$ ./camera.py --help
usage: camera.py [-h] [--resolution {1080p,max,720p60,720p25,720p,1080p15,720p30,1080p10,720p24,720p50}] [--camera {rear,front}] [--debug] {still,movie} filename
PinePhone camera tool
positional arguments:
{still,movie}
filename
optional arguments:
-h, --help show this help message and exit
--resolution {1080p,max,720p60,720p25,720p,1080p15,720p30,1080p10,720p24,720p50}, -r {1080p,max,720p60,720p25,720p,1080p15,720p30,1080p10,720p24,720p50}
--camera {rear,front}, -c {rear,front}
--debug, -d
It's also interesting to note that switching between 720p and 1080p mode changes the cropping of the sensor significantly. The 1080p photos produce more detail, but the 720p ones are a wider field of view.
It should be possible to get better picture quality out of these sensors. A lot of detail is lost because of the agressive noise reduction happening on the OV5640 sensor. It should be possible to produce better results by post processing the raw photos that aren't denoised by the sensor.
Finally a video recording made using camera.py in 1080p15 mode: