What am I trying to execute? Hailo Rpi 5 detection example
I use this command to execute it: python basic_pipelines/detection.py -f --disable-sync -u -i rpi
Camera I use: Arducam B0353 with AR0234 sensor (CSI camera)
I use the Raspberry Pi Compute Module 5
Problem: Everything works fine, I have 7 fps (I think that’s rather low, but that’s not the main problem). The main problem is that the camera stream updates after ~5s → If I turn my camera away from me the stream will show it about 5s later. Simultaneously too the model not detecting a person anymore.
In addition I think the longer I run the script the longer the delay gets but I am not sure about this hypothesis.
When I stream only the camera outside of the example, the stream responds immediately.
Can anyone help me to fix this?
Sounds like you’re hitting a processing bottleneck that’s causing those frame delays. What model are you running that’s only getting 7 fps? Are you using the same pipeline setup as others?
Also, I noticed you’re using the -u (user frame) flag - if you don’t actually need it, I’d recommend removing it since it’s pretty CPU-intensive.
What’s likely happening:
Your delay is probably coming from buffering issues in the GStreamer pipeline, especially with how the Raspberry Pi camera source is configured. The current setup has some buffering that can pile up when your inference can’t keep pace with the camera feed.
A few things contributing to this:
The pipeline has a default 300ms latency setting that kicks in at startup, and while the camera captures at 30fps in its own thread, it doesn’t handle backpressure well when inference falls behind. Plus, even though QoS is disabled to prevent frame drops, this can actually make buffering worse since frames just accumulate instead of getting dropped.
Here’s what I’d try:
Lower the pipeline latency - try reducing it from 300ms down to something like 50ms
Tweak the buffering - consider changing the source pipeline to use max-buffers=1 and leaky-type=upstream to drop older frames more aggressively
Match your frame rates - make sure your camera capture rate actually matches what your processing can handle
Lower the input FPS - You can cap the frame-rate for 7 and see if you see the same issue or not!
You’re already using --disable-sync which should help, but if your inference is still slower than capture, you’ll keep getting buffer buildup.