[libcamera-devel] Getting 30fps from libcamerasrc

Pavel Machek pavel at ucw.cz
Sat Jul 30 19:48:19 CEST 2022


Hi!

> > So... with some hacks, I can get 30fps 2MPix recording on
> > pinephone... from the "cam" utility. Which will have trouble with
> > audio.
> 
> Indeed :-) "cam" is meant to be a test tool, not an end-user
> application, so you've certainly reached the limits of its scope if you
> want audio.
> 
> > When I try to use libcamerasrc (and gstreamer), I get down to 10fps or
> > so, but it looks more like artifical limit then performance one. Is it
> > so? How can I request 30fps?
> 
> What gstreamer pipeline do you use ? I don't have a pinephone, but
> running
> 
> GST_PLUGIN_PATH=$(pwd)/src/gstreamer gst-launch-1.0 \
> 	libcamerasrc camera-name='\\_SB_.PCI0.RP05.PXSX.TBL3.TBTU.RHUB.UB32-2:1.0-046d:0893' ! \
> 	'video/x-raw,width=1280,height=720' ! \
> 	fpsdisplaysink sync=0 text-overlay=false video-sink=glimagesink -v
> 
> on my laptop with a UVC webcam gives me 30fps. Can you try something
> similar, possibly using the a fakesink first, on the pinephone ?


I'm using this for testing:

export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer
time gst-launch-1.0 libcamerasrc camera-name=/base/i2c-csi/rear-camera at 4c ! \
 	image/jpeg,width=1280,height=720 ! \
	fakesink num-buffers=300

300 buffers at 30fps should be 10 seconds, but it is 20 (Execution
ended after 0:00:19.754754217).

[15:21:14.721221932] [43406]  INFO Camera camera.cpp:1029 configuring streams: (0) 1280x720-JPEG
Redistribute latency...
Got EOS from element "pipeline0".
Execution ended after 0:00:19.754754217
Setting pipeline to NULL ...
Freeing pipeline ...
1.28user 4.92system 27.17 (0m27.174s) elapsed 22.86%CPU

Thanks for the fpsdisplaysink hints. I can do:

export GST_PLUGIN_PATH=$(pwd)/build/src/gstreamer
time gst-launch-1.0 libcamerasrc camera-name=/base/i2c-csi/rear-camera at 4c ! \
        image/jpeg,width=1280,height=720 ! \
        fpsdisplaysink sync=0 text-overlay=false video-sink=fakesink -v

But I still get 15 fps:

/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 306, dropped: 0, current: 15.18, average: 15.25
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:20.654809024

Same 15 fps with 1920x1080.

/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 274, dropped: 0, current: 15.01, average: 15.09
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:18.833098702

I noticed you are using raw, not JPEG; let me try that... I still get
15 fps.

Any ideas? Any idea why you are only getting 30fps? I assume your hw
should be capable of getting 60fps at that resolution? What kind of
fps do you get with cam?

Thanks and 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/20220730/639e20fe/attachment.sig>


More information about the libcamera-devel mailing list