[libcamera-devel] Video recording on PinePhone Re: libcamera on pinephone

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jul 6 19:21:15 CEST 2022


On Tue, Jul 05, 2022 at 11:16:30PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > qcam looks like a step in right direction, but .. it needs two streams
> > > to be able to take photos, and we don't that capability on pinephone.
> > > 
> > > For taking photos, I see two possibilities:
> > > 
> > > a) Do the viewfinder in low resolution, then switch to high
> > > resolution, take a photo, and switch back. Unfortunately pipeline
> > > reconfiguration is rather slow (> 2 seconds?) on pinephone.
> > 
> > 2 seconds is a lot, there may be a way to reduce that, it should be
> > investigated.
> 
> I was optimistic. It is more like 7 seconds.

In a way that's good news, it means there's even more room for
improvement :-)

> > > b) Run the chip in high resolution all the time, downscaling for
> > > viewfinder. Should result in less shutter lag, but viewfinder will be
> > > limited to 15 fps and will need more cpu power.
> > 
> > Could the GPU be used to scale the full resolution down ?
> 
> Probably. But I find CPUs easier to use.

It's probably easier, yes, but if the CPU isn't powerful enough, then
help from the GPU is an option that should be considered.

GPUs can perform scaling pretty much for free, but they usually can't
output YUV natively. Tricks can be done with multi-pass rendering
though.

> > > Camera seems to be
> > > able to do JPEG natively, does it make sense to try to get that to work?
> > 
> > That's an option, but if you want to have a viewfinder at the same time,
> > you would then need to decompress the frames. Furthermore, MJPEG for
> > videos isn't great, as the compression ratio will be low.
> 
> PinePhone has rather weak CPUs. 4 of them, but not great. I don't
> think I can encode something better than MJPEG in 1280x720. So, JPEG
> should be good solution for PinePhone.
> 
> (But likely dead-end as it will be unavailable on PinePhone Pro /
> Librem -- if I understand it correctly).
> 
> > Any hope of getting the A64 video encoder to work ?
> 
> A64 video encoder? https://forum.pine64.org/showthread.php?tid=9231 ?
> Hmm. Looks interesting but a lot of work.

It could be, I haven't looked, but that's certainly what would give you
the best performances for video encoding.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list