Hello everyone,
I’m currently working on modernizing several projects that I had running on CM3 and CM3+ using MMAL and directly interfacing with raspivid. These projects involved a Pi Camera V2, capturing at 1080p and almost reaching 60 fps while consuming only about 6-8% of CPU.
Now, I’ve started migrating to a Raspberry Pi 5 (8GB) running Raspberry Pi OS 64-bit Bookworm (Linux rpitestdev 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux), and I'm planning to use the Camera PI V3 and the Global Shutter (GS) Camera for my projects. My objective is to eventually use CM3+ and CM4 in my final projects to modernize the software and camera systems, but I’m currently testing everything on the Raspberry Pi 5, as it's easier for development and experimentation. Additionally, I want to use OpenCV for some basic operations.
So far, I’ve been testing the GS Camera with libcamera-vid, capturing at 1080p60, and I’m seeing CPU usage between 180% and 200%. Is this behavior normal?
I understand that switching from MMAL to libcamera might have some CPU overhead due to its more standardized software stack, but is this much increase in CPU usage expected?
In my original projects, I worked directly with the frames provided by the Pi Camera V2 and saved them in H.264, then later encoded them into MP4. Now, with the GS Camera, I’ve developed a simple C++ application (as I use C++ for all my projects) to grab the framebuffers using libcamera, but even this basic task is consuming around 150% CPU.
I’ve also been experimenting with GStreamer pipelines, trying something like this:
However, despite trying multiple configurations, I haven’t been able to get the pipeline to record video normally. I’m unsure what else to try.
My ultimate goal is to capture the frames in my C++ program so that I can process them with OpenCV and other operations. However, the CPU usage when using libcamera is quite high, and I’m looking for advice on how to reduce this or suggestions for a more efficient GStreamer pipeline that I could integrate with OpenCV.
Any help or insights would be greatly appreciated!
Thanks in advance!
I’m currently working on modernizing several projects that I had running on CM3 and CM3+ using MMAL and directly interfacing with raspivid. These projects involved a Pi Camera V2, capturing at 1080p and almost reaching 60 fps while consuming only about 6-8% of CPU.
Now, I’ve started migrating to a Raspberry Pi 5 (8GB) running Raspberry Pi OS 64-bit Bookworm (Linux rpitestdev 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux), and I'm planning to use the Camera PI V3 and the Global Shutter (GS) Camera for my projects. My objective is to eventually use CM3+ and CM4 in my final projects to modernize the software and camera systems, but I’m currently testing everything on the Raspberry Pi 5, as it's easier for development and experimentation. Additionally, I want to use OpenCV for some basic operations.
So far, I’ve been testing the GS Camera with libcamera-vid, capturing at 1080p60, and I’m seeing CPU usage between 180% and 200%. Is this behavior normal?
I understand that switching from MMAL to libcamera might have some CPU overhead due to its more standardized software stack, but is this much increase in CPU usage expected?
In my original projects, I worked directly with the frames provided by the Pi Camera V2 and saved them in H.264, then later encoded them into MP4. Now, with the GS Camera, I’ve developed a simple C++ application (as I use C++ for all my projects) to grab the framebuffers using libcamera, but even this basic task is consuming around 150% CPU.
I’ve also been experimenting with GStreamer pipelines, trying something like this:
Code:
gst-launch-1.0 libcamerasrc camera-name="/base/axi/pcie@120000/rp1/i2c@88000/imx296@1a" ! video/x-raw,colorimetry=bt709,format=NV12,width=1456,height=1080,framerate=60/1 ! videoconvert ! x264enc tune=zerolatency bitrate=2000 ! mp4mux ! filesink location=output_video_1.mp4
My ultimate goal is to capture the frames in my C++ program so that I can process them with OpenCV and other operations. However, the CPU usage when using libcamera is quite high, and I’m looking for advice on how to reduce this or suggestions for a more efficient GStreamer pipeline that I could integrate with OpenCV.
Any help or insights would be greatly appreciated!
Thanks in advance!
Statistics: Posted by Redhunt — Sun Oct 20, 2024 12:22 pm