Reduce CPU usage in RPI 5 example

I’m using the detection example on my RPI 5.
At the moment even with your mp4 sample I’m getting to 33% CPU usage.

and with rpi input I’m in 100% CPU.
Is there a way to reduce it?

for an example, I don’t want to see the video stream while inferencing frames.

in addition, Can you point me to the pipeline to a more detailed documentation for the pipeline string syntax? I tried to tweak it a little bit but without success

Hey @erez

Reducing CPU Usage:
To reduce CPU load during inference, you can disable the video display if you don’t need to see the output stream. By turning off the video rendering, you free up processing resources. For instance, in a GStreamer pipeline, you can remove the video sink element, such as autovideosink, and replace it with a fakesink element, which discards the output without rendering it. This approach significantly reduces the CPU overhead.

Here’s an example of how to modify the pipeline:

gst-launch-1.0 <input-source> ! <decoder> ! <inference-pipeline> ! fakesink

The fakesink element prevents the video from being displayed, thus minimizing CPU usage.

Pipeline Documentation:
For detailed information about the pipeline string syntax, you can refer to the GStreamer documentation, which is often used for handling video streams and media inference. Additionally, please visit the Hailo developer documentation of TAPPAS at Hailo Developer Zone.
Also check out the Guide at hailo-rpi5-examples/doc/basic-pipelines.md at main · hailo-ai/hailo-rpi5-examples · GitHub
The pipeline is built on GStreamer, and more documentation with examples is being developed to assist you in working with these pipelines.

Regards,
Omri

Thanks for your reply.

What is the best resolution and video format that will save CPU time on processing video?

When specifying rpi input I’m getting 100% CPU.

What are the options to reduce the CPU usage?
Is there an option to provide smaller image?

I modified the script to use the fakesink.

The CPU is doing almost nothing! thanks a lot!
You should create a production grade demo repository. it will help a lot…

1 Like

We have several production-grade demos, but we cannot make them open-source due to collaborations with our partners. However, we are actively working on upgrading our example suite to optimize them for Raspberry Pi (RPI) and to include production-ready applications.

Our current efforts are focused on:

  • Optimizing existing examples for efficient performance on RPI hardware
  • Adding production-ready applications to our collection

This initiative aims to offer a more practical and comprehensive set of examples that developers can use as a reference when building their own applications. These optimized examples will highlight best practices for developing efficient, production-ready software, especially on RPI platforms.

Regards