Hailo15 gstreamer problem

I am working with a hailo15 sbc.

Using a rtsp link I am collecting the video from the camera to the hailo and here I perform the model inference and send it to my pc.

Everything is working correctly except that the video is very very slow when doing the inference and sending it. I think that the hailo accelerator is not being used. How can I fix this?

I comment here the pipelines that I have used.

For the pc
gst-launch-1.0 udpsrc port=5000 caps=“application/x-rtp,media=video,encoding-name=H264” ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink ! autovideosink

For the hailo
gst-launch-1.0 rtspsrc location=rtsp://usr:pass@ip/Streaming/channels/1/ ! decodebin ! videoconvert ! videoscale ! video/x-raw,format=NV12,width=1920,height=1080 ! hailonet hef-path=/home/root/apps/detection/resources/yolov5m_wo_spp_60p_nv12_fhd. hef ! hailofilter function-name=yolov5 config-path=/home/root/apps/detection/resources/configs/yolov5.json so-path=/usr/lib/hailo-post-processes/libyolo_post.so qos=false ! hailooverlay ! videoconvert ! x264enc tune=zerolatency ! rtph264pay pt=96 config-interval=1 ! udpsink host=ip port=5000

Hi Oscar,

It is possible to use hardware accelerated elements for encoding instead of software elements, which can overload the CPU and cause the video to become very slow.

For the PC pipeline, you can use the recommended pipeline from the Hailo camera apps repository:

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=H264 ! queue max-size-buffers=30 max-size-bytes=0 max-size-time=0 leaky=no ! rtpjitterbuffer mode=0 ! queue max-size-buffers=30 max-size-bytes=0 max-size-time=0 leaky=no ! rtph264depay ! queue max-size-buffers=30 max-size-bytes=0 max-size-time=0 leaky=no ! h264parse ! avdec_h264 ! queue max-size-buffers=30 max-size-bytes=0 max-size-time=0 leaky=downstream ! videoconvert n-threads=8 ! queue max-size-buffers=30 max-size-bytes=0 max-size-time=0 leaky=no ! fpsdisplaysink text-overlay=false sync=false

You can also use this reduced version, which I tested and works well:

gst-launch-1.0 udpsrc port=5000 caps=“application/x-rtp,media=video,encoding-name=H264” ! queue leaky=0 ! rtph264depay ! h264parse ! avdec_h264 ! queue max-size-buffers=30 leaky=2 ! videoconvert ! autovideosink

For the Hailo pipeline, I recommend using hardware accelerated GStreamer elements such as hailoh264enc, as well as adding queues, for example:

gst-launch-1.0 -v rtspsrc location=rtsp://usr:pass@ip/Streaming/channels/1/ ! decodebin ! videoconvert ! videoscale ! video/x-raw,format=NV12,width=1920,height=1080 ! hailoupload ! hailonet hef-path=apps/detection/resources/yolov5m_wo_spp_60p_nv12_fhd.hef ! queue max-size-buffers=30 leaky=2 ! hailofilter function-name=yolov5 config-path=/home/root/apps/detection/resources/configs/yolov5.json so-path=/usr/lib/hailo-post-processes/libyolo_post.so qos=false ! hailooverlay ! queue max-size-buffers=30 leaky=2 ! hailoh264enc ! rtph264pay ! udpsink port=5000 host=

Regards,
Kimberly Carvajal
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com