joms
1
Is this possible on an RPi 5?
This is my current working command line for one camera, but I’m not sure how to add more camera sources or create a pipeline for two cameras."
gst-launch-1.0 -v libcamerasrc name=source ! video/x-raw, format=RGB, width=640, height=640 ! queue name=source_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=source_videoscale n-threads=2 ! queue name=source_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert n-threads=3 name=source_convert qos=false ! video/x-raw, format=I420, pixel-aspect-ratio=1/1 ! queue name=detection_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=detection_videoscale n-threads=2 qos=false ! queue name=detection_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! video/x-raw, pixel-aspect-ratio=1/1 ! videoconvert name=detection_videoconvert n-threads=2 ! queue name=detection_hailonet_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailonet name=detection_hailonet hef-path=/home/user/yolov8s_final_20241020.hef batch-size=2 nms-score-threshold=0.5 nms-iou-threshold=0.5 output-format-type=HAILO_FORMAT_TYPE_FLOAT32 force-writable=true ! queue name=detection_hailofilter_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailofilter name=detection_hailofilter so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes/libyolo_hailortpp_post.so config-path=/home/user/labels.json qos=false ! queue name=identity_callback_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! identity name=identity_callback ! queue name=hailo_display_hailooverlay_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailooverlay name=hailo_display_hailooverlay ! queue name=hailo_display_videoconvert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert name=hailo_display_videoconvert n-threads=2 qos=false ! queue name=hailo_display leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=8554 sync=true
omria
2
Hey @joms
Here’s how you can set up a GStreamer pipeline for two RPi Camera Module 3 cameras on your Raspberry Pi 5. I’ll show you two options:
- Separate Streams (sends each camera to different UDP ports):
gst-launch-1.0 -v \
libcamerasrc camera-name=Camera0 ! video/x-raw, format=RGB, width=640, height=640 ! \
queue ! videoscale ! videoconvert ! \
hailonet hef-path=/home/user/yolov8s_final_20241020.hef ! \
hailofilter ! hailooverlay ! videoconvert ! \
x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=8554 sync=true \
libcamerasrc camera-name=Camera1 ! video/x-raw, format=RGB, width=640, height=640 ! \
queue ! videoscale ! videoconvert ! \
hailonet hef-path=/home/user/yolov8s_final_20241020.hef ! \
hailofilter ! hailooverlay ! videoconvert ! \
x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=8556 sync=true
- Combined Display (shows both cameras in one window):
gst-launch-1.0 -v \
libcamerasrc camera-name=Camera0 ! video/x-raw, format=RGB, width=640, height=640 ! queue ! videoscale ! videoconvert ! hailonet ! hailofilter ! hailooverlay ! videoconvert ! compositor name=mixer \
libcamerasrc camera-name=Camera1 ! video/x-raw, format=RGB, width=640, height=640 ! queue ! videoscale ! videoconvert ! hailonet ! hailofilter ! hailooverlay ! videoconvert ! mixer. \
mixer. ! videoconvert ! autovideosink
Remember to replace the hef-path
and other parameters with your actual paths and settings. Let me know if you need help adjusting any parameters!
joms
3
@omria thank you so much I’ll try this
1 Like
joms
4
Here are my testing result
2 camera with 2 rtsp output works
gst-launch-1.0 -v libcamerasrc camera-name=/base/axi/pcie@120000/rp1/i2c@80000/imx477@1a ! video/x-raw, format=RGB, width=640, height=640 ! queue name=source_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=source_videoscale n-threads=2 ! queue name=source_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert n-threads=3 name=source_convert qos=false ! video/x-raw, format=I420, pixel-aspect-ratio=1/1 ! queue name=detection_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=detection_videoscale n-threads=2 qos=false ! queue name=detection_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! video/x-raw, pixel-aspect-ratio=1/1 ! videoconvert name=detection_videoconvert n-threads=2 ! queue name=detection_hailonet_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailonet name=detection_hailonet hef-path=/home/user/yolov8s_final_20241020.hef batch-size=2 nms-score-threshold=0.5 nms-iou-threshold=0.5 output-format-type=HAILO_FORMAT_TYPE_FLOAT32 force-writable=true ! queue name=detection_hailofilter_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailofilter name=detection_hailofilter so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes/libyolo_hailortpp_post.so config-path=/home/user/labels.json qos=false ! queue name=identity_callback_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! identity name=identity_callback ! queue name=hailo_display_hailooverlay_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailooverlay name=hailo_display_hailooverlay ! queue name=hailo_display_videoconvert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert name=hailo_display_videoconvert n-threads=2 qos=false ! queue name=hailo_display leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=8554 sync=true
libcamerasrc camera-name=/base/axi/pcie@120000/rp1/i2c@88000/imx708@1a ! video/x-raw, format=RGB, width=640, height=640 ! queue name=source_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=source_videoscale n-threads=2 ! queue name=source_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert n-threads=3 name=source_convert qos=false ! video/x-raw, format=I420, pixel-aspect-ratio=1/1 ! queue name=detection_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=detection_videoscale n-threads=2 qos=false ! queue name=detection_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! video/x-raw, pixel-aspect-ratio=1/1 ! videoconvert name=detection_videoconvert n-threads=2 ! queue name=detection_hailonet_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailonet name=detection_hailonet hef-path=/home/user/yolov8s_final_20241020.hef batch-size=2 nms-score-threshold=0.5 nms-iou-threshold=0.5 output-format-type=HAILO_FORMAT_TYPE_FLOAT32 force-writable=true ! queue name=detection_hailofilter_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailofilter name=detection_hailofilter so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes/libyolo_hailortpp_post.so config-path=/home/user/labels.json qos=false ! queue name=identity_callback_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! identity name=identity_callback ! queue name=hailo_display_hailooverlay_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailooverlay name=hailo_display_hailooverlay ! queue name=hailo_display_videoconvert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert name=hailo_display_videoconvert n-threads=2 qos=false ! queue name=hailo_display leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=8555 sync=true
2 camera combine output to video desktop not working :
gst-launch-1.0 -v libcamerasrc camera-name=/base/axi/pcie@120000/rp1/i2c@80000/imx477@1a ! video/x-raw, format=RGB, width=640, height=640 ! queue name=source_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=source_videoscale n-threads=2 ! queue name=source_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert n-threads=3 name=source_convert qos=false ! video/x-raw, format=I420, pixel-aspect-ratio=1/1 ! queue name=detection_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=detection_videoscale n-threads=2 qos=false ! queue name=detection_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! video/x-raw, pixel-aspect-ratio=1/1 ! videoconvert name=detection_videoconvert n-threads=2 ! queue name=detection_hailonet_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailonet name=detection_hailonet hef-path=/home/user/yolov8s_final_20241020.hef batch-size=2 nms-score-threshold=0.5 nms-iou-threshold=0.5 output-format-type=HAILO_FORMAT_TYPE_FLOAT32 force-writable=true ! queue name=detection_hailofilter_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailofilter name=detection_hailofilter so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes/libyolo_hailortpp_post.so config-path=/home/user/labels.json qos=false ! queue name=identity_callback_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! identity name=identity_callback ! queue name=hailo_display_hailooverlay_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailooverlay name=hailo_display_hailooverlay ! queue name=hailo_display_videoconvert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert name=hailo_display_videoconvert n-threads=2 qos=false ! queue name=hailo_display leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert ! compositor name=mixer \
libcamerasrc camera-name=/base/axi/pcie@120000/rp1/i2c@88000/imx708@1a ! video/x-raw, format=RGB, width=640, height=640 ! queue name=source_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=source_videoscale n-threads=2 ! queue name=source_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert n-threads=3 name=source_convert qos=false ! video/x-raw, format=I420, pixel-aspect-ratio=1/1 ! queue name=detection_scale_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoscale name=detection_videoscale n-threads=2 qos=false ! queue name=detection_convert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! video/x-raw, pixel-aspect-ratio=1/1 ! videoconvert name=detection_videoconvert n-threads=2 ! queue name=detection_hailonet_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailonet name=detection_hailonet hef-path=/home/user/yolov8s_final_20241020.hef batch-size=2 nms-score-threshold=0.5 nms-iou-threshold=0.5 output-format-type=HAILO_FORMAT_TYPE_FLOAT32 force-writable=true ! queue name=detection_hailofilter_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailofilter name=detection_hailofilter so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes/libyolo_hailortpp_post.so config-path=/home/user/labels.json qos=false ! queue name=identity_callback_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! identity name=identity_callback ! queue name=hailo_display_hailooverlay_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! hailooverlay name=hailo_display_hailooverlay ! queue name=hailo_display_videoconvert_q leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert name=hailo_display_videoconvert n-threads=2 qos=false ! queue name=hailo_display leaky=no max-size-buffers=3 max-size-bytes=0 max-size-time=0 ! videoconvert ! mixer. mixer. ! videoconvert ! autovideosink