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

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:

$ ./ still photo.jpg
$ ./ still photo.png
$ ./ still --resolution 720p photo.jpg
$ ./ movie --resolution 1080p15 pinecones.mkv
^c to end recording
$ ./ --help
usage: [-h] [--resolution {1080p,max,720p60,720p25,720p,1080p15,720p30,1080p10,720p24,720p50}] [--camera {rear,front}] [--debug] {still,movie} filename

PinePhone camera tool

positional arguments:

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
Photo taken in 1080p mode

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 in 1080p15 mode:

This isn't using the hardware h264 encoder yet, it produces a relatively high bitrate h264 stream using the software encoder running on the ultrafast preset.