[libcamera-devel] Success -- 2MP @ 30fps video recording on pinephone, with audio -- was Re: Video recording on PinePhone Re: libcamera on pinephone

Pavel Machek pavel at ucw.cz
Thu Aug 4 19:05:20 CEST 2022


Hi!

So... I have kind of success to report. With some rather interesting hacks, 2MP @ 30fps 
recording works on PinePhone, with audio. I needed few hacks to get there:

a) hacks to libcamera to get it working on PinePhone. This would be better solved in kernel.

b) hack to libcamera to support JPEG. Better version is on the list.

c) libcamera works with uncached frames. That's very very bad. Fortunately it also 
allocates 2MB to each JPEG frame, which is much too much and is easy to hack. If I limit 
frame size to 500KB, things work better. (Any idea how to do this cleanly? Frame size is 
clearly variable in JPEG mode.)

d) hack to cam to store frames on disk along with timestamps.

e) small utility to record audio in 33msec chunks on disk with timestamps. (pa_test.c)

f) GUI to display previews (at 4fps) and store event requests on disk. (ucam.py) Are there 
any tricks that can be used to decode JPEGs quickly? Preview size is something like 
600x400, so quite small compared to 2MP source if that helps.

g) utility to join the JPEGs with audio and turn it into mp4 using ffmpeg. (mpegize.py)

Solution is little "interesting" and produces a lot of disk i/o, but it clearly shows 
pinephone can do this...

Best regards,
                                                                                Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


More information about the libcamera-devel mailing list