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

Pavel Machek pavel at ucw.cz
Tue Jul 12 23:26:24 CEST 2022


Hi!

> > I'd like to fix libcamerasrc if it doesn't work on the PinePhone.
> > There's ongoing work on colorimetry support by Rishikesh as part of his
> > GSoC (initial patches are on the list) which should help. What are the
> > other issues ?
> 
> Where can I find these patches? If possible, a branch with such work already
> committed would be even better. I can help debug libcamerasrc.
> : )

Actually, libcamerasrc started working for me, probably after tweaking
the frame rates. But it is flakey. Do you still need help with that?

I'm trying to get 1920x1080 recording working. Both

  export GST_DEBUG=libcamera*:7
  export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer
  gst-launch-1.0 libcamerasrc camera-name=/base/i2c-csi/rear-camera at 4c ! image/jpeg,width=1920,height=1080 ! filesink location=/tmp/delme.unk ; ls -al /tmp/delme.unk

and

gst-launch-1.0 v4l2src
device=/dev/v4l/by-path/platform-1cb0000.csi-video-index0 !
'image/jpeg,width=1920,height=1080,framerate=30/1' ! filesink
location=/tmp/delme.jpg

and

build/src/cam/cam  -c /base/i2c-csi/rear-camera at 4c -spixelformat=JPEG,width=1920,height=1080 -C2000 -F/tmp/delme2.jpg

somehow work, and result can be decoded using

time gst-launch-1.0 filesrc location=delme.unk ! jpegparse ! filesink
location=delme2.unk sync=false

or recoverjpeg, but I'm not getting 30fps. Any idea how to debug that?
Cam gives this output:

[20:33:40.613760494] [45406]  INFO Camera camera.cpp:1029 configuring streams: (0) 1920x1080-JPEG
cam0: Capture 2000 frames
74020.749785 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 2073600
74020.783102 (30.01 fps) cam0-stream0 seq: 000001 bytesused: 2073600
74020.883095 (10.00 fps) cam0-stream0 seq: 000004 bytesused: 2073600
74020.949774 (15.00 fps) cam0-stream0 seq: 000006 bytesused: 2073600
74021.016443 (15.00 fps) cam0-stream0 seq: 000008 bytesused: 2073600
74021.049787 (29.99 fps) cam0-stream0 seq: 000009 bytesused: 2073600
74021.116423 (15.01 fps) cam0-stream0 seq: 000011 bytesused: 2073600
74021.183135 (14.99 fps) cam0-stream0 seq: 000013 bytesused: 2073600
74021.249781 (15.00 fps) cam0-stream0 seq: 000015 bytesused: 2073600
74021.283130 (29.99 fps) cam0-stream0 seq: 000016 bytesused: 2073600
74021.349781 (15.00 fps) cam0-stream0 seq: 000018 bytesused: 2073600
74021.416448 (15.00 fps) cam0-stream0 seq: 000020 bytesused: 2073600
74021.483129 (15.00 fps) cam0-stream0 seq: 000022 bytesused: 2073600
74021.516472 (29.99 fps) cam0-stream0 seq: 000023 bytesused: 2073600
74021.583113 (15.01 fps) cam0-stream0 seq: 000025 bytesused: 2073600
74021.649812 (14.99 fps) cam0-stream0 seq: 000027 bytesused: 2073600
74021.716462 (15.00 fps) cam0-stream0 seq: 000029 bytesused: 2073600
74021.749793 (30.00 fps) cam0-stream0 seq: 000030 bytesused: 2073600
74021.816460 (15.00 fps) cam0-stream0 seq: 000032 bytesused: 2073600
74021.883135 (15.00 fps) cam0-stream0 seq: 000034 bytesused: 2073600
74021.949807 (15.00 fps) cam0-stream0 seq: 000036 bytesused: 2073600
74021.983156 (29.99 fps) cam0-stream0 seq: 000037 bytesused: 2073600
74022.049812 (15.00 fps) cam0-stream0 seq: 000039 bytesused: 2073600
74022.116485 (15.00 fps) cam0-stream0 seq: 000041 bytesused: 2073600
74022.183168 (15.00 fps) cam0-stream0 seq: 000043 bytesused: 2073600
74022.216487 (30.01 fps) cam0-stream0 seq: 000044 bytesused: 2073600
74022.283157 (15.00 fps) cam0-stream0 seq: 000046 bytesused: 2073600
74022.349811 (15.00 fps) cam0-stream0 seq: 000048 bytesused: 2073600
74022.416469 (15.00 fps) cam0-stream0 seq: 000050 bytesused: 2073600
74022.449820 (29.98 fps) cam0-stream0 seq: 000051 bytesused: 2073600
74022.516478 (15.00 fps) cam0-stream0 seq: 000053 bytesused: 2073600
74022.583155 (15.00 fps) cam0-stream0 seq: 000055 bytesused: 2073600
74022.649820 (15.00 fps) cam0-stream0 seq: 000057 bytesused: 2073600
74022.683160 (29.99 fps) cam0-stream0 seq: 000058 bytesused: 2073600
74022.749821 (15.00 fps) cam0-stream0 seq: 000060 bytesused: 2073600
74022.816500 (15.00 fps) cam0-stream0 seq: 000062 bytesused: 2073600
74022.883148 (15.00 fps) cam0-stream0 seq: 000064 bytesused: 2073600
74022.916514 (29.97 fps) cam0-stream0 seq: 000065 bytesused: 2073600

I'd really like 30fps for video recording. Any ideas how to debug
that?

Rafael, could you try the last ("cam") command line for me? There's
small chance that your fixed kernel would do a difference there. (And
you'll get useful 1080p recording if it works!)

Best regards,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20220712/f4b9961a/attachment.sig>


More information about the libcamera-devel mailing list