[libcamera-devel] Success -- 2MP @ 30fps video recording on pinephone, with audio -- was Re: Video recording on PinePhone Re: libcamera on pinephone
Eric Curtin
ecurtin at redhat.com
Fri Aug 5 15:33:27 CEST 2022
On Thu, 4 Aug 2022 at 18:05, Pavel Machek via libcamera-devel
<libcamera-devel at lists.libcamera.org> wrote:
>
> 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.
We did write a JPEG decompressor in this file recently:
src/cam/sdl_texture_mjpg.cpp
using libjpeg, that's fairly standard and quick. Feel free to reuse that.
>
> 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