HailoNet Error: gst_pad_push failed with status = -4

Hello, hailo moderators

I’d like to stream two USB cameras. But, I can’t even though I tried many things.
There is no issue when I run each one, “/dev/video0” or “/dev/video2”

gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw,width=320,height=240,framerate=5/1 ! queue ! videoscale ! videoconvert ! video/x-raw,format=RGB,width=640,height=640 ! queue ! hailonet hef-path=/home/test_camera/Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L-main/hailomodel/eeg_employee_2.hef batch-size=1 ! hailofilter function-name="filter" so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes/libyolo_hailortpp_post.so config-path=./resource/eeg_employee_2.json qos=false ! queue ! hailooverlay ! queue ! videoconvert ! autovideosink

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:04.587112626
Setting pipeline to NULL ...
Freeing pipeline ...

I tried to stream 2 USB cameras, but there was an error like the below

gst-launch-1.0 compositor name=comp sink_0::xpos=0 sink_1::xpos=640 ! videoconvert ! queue max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! hailonet hef-path=/home/test_camera/Benchmarking-YOLOv8-on-Raspberry-PI-reComputer-r1000-and-AIkit-Hailo-8L-main/hailomodel/eeg_employee_2.hef batch-size=2 ! queue max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! hailofilter function-name="filter" so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes/libyolo_hailortpp_post.so config-path=./resource/eeg_employee_2.json qos=false ! queue max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! deinterleave name=d d.src_0 ! queue max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! videoconvert ! hailooverlay ! queue max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! autovideosink sync=false d.src_1 ! queue max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! videoconvert ! hailooverlay ! queue max-size-buffers=5 max-size-bytes=0 max-size-time=0 ! autovideosink sync=false v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=5/1 ! queue max-size-buffers=5 ! videoscale n-threads=2 ! queue max-size-buffers=5 ! videoconvert n-threads=3 ! video/x-raw,format=RGB,width=640,height=640 ! videorate ! queue max-size-buffers=5 ! comp.sink_0 v4l2src device=/dev/video2 ! video/x-raw,width=320,height=240,framerate=5/1 ! queue max-size-buffers=5 ! videoscale n-threads=2 ! queue max-size-buffers=5 ! videoconvert n-threads=3 ! video/x-raw,format=RGB,width=640,height=640 ! videorate ! queue max-size-buffers=5 ! comp.sink_1

Setting pipeline to PAUSED …
Pipeline is live and does not need PREROLL …
Pipeline is PREROLLED …
Setting pipeline to PLAYING …
New clock: GstSystemClock
Redistribute latency…
HailoNet Error: gst_pad_push failed with status = -4
^Chandling interrupt.
Interrupt: Stopping pipeline …
Execution ended after 0:00:03.128398702
Setting pipeline to NULL …
Freeing pipeline …

Give me some guidance to resolve this.

Hi @ssms1225,

I see you’re encountering the gst_pad_push failed with status = -4 error. This typically happens when your GStreamer pipeline is struggling with data handling, usually due to buffer overflows or synchronization issues.

Here’s how you can resolve this:

  1. First, try adjusting your queue buffers:
queue max-size-buffers=20 max-size-bytes=0 max-size-time=0
  1. If that doesn’t help, lower your camera settings:
video/x-raw,width=320,height=240,framerate=5/1
  1. Enable threading support:
queue ! videoscale n-threads=2 ! videoconvert n-threads=3
  1. Try disabling sync if you don’t need precise timing:
autovideosink sync=false

You can test both cameras with this simplified pipeline:

gst-launch-1.0 compositor name=comp sink_0::xpos=0 sink_1::xpos=640 ! videoconvert ! autovideosink sync=false \
v4l2src device=/dev/video0 ! video/x-raw,width=320,height=240,framerate=5/1 ! queue ! comp.sink_0 \
v4l2src device=/dev/video2 ! video/x-raw,width=320,height=240,framerate=5/1 ! queue ! comp.sink_1

Try these adjustments and let me know if you’re still having issues!

Thanks for your response,

I believe that it’s improved quite a lot and this is current issue.
This is a snippet of my code and I confirmed that it’s working well with my customed lss_callback funtion.

    def _get_single_camera_pipeline(self):
        source = self.video_sources[0]
        pipeline_string = (
            f"v4l2src device={source} ! "
            f"video/x-raw, width=640, height=360, framerate=10/1 ! "
            f"videoscale n-threads=2 ! "
            f"videoconvert n-threads=3 qos=false ! "
            f"video/x-raw, format={self.network_format}, "
            f"width={self.network_width}, height={self.network_height}, "
            f"pixel-aspect-ratio=1/1 ! "
            f"tee name=t ! "
            f"hailonet hef-path={self.hef_path} batch-size=1 {self.thresholds_str} "
            f"force-writable=true ! "
            f"hailofilter function-name=\"filter\" so-path={self.default_postprocess_so} "
            f"config-path={self.json_config_path} qos=false ! "
            f"identity name=identity_callback_0 ! "
            f"hailooverlay ! "
            f"videoconvert n-threads=3 qos=false ! "
            f"fakesink sync={self.sync} name=hailo_display"
        )

        print(pipeline_string)
        return pipeline_string

Further more, guide me how to use multi-cameras like “/dev/video0” and “/dev/video2”
I feel almost there, but it’s not easy for me to get it.

Thanks, in advance.