RTSP Stream source detect unavailability and replace Logo until its available

Rahibe Meryem rahibemeryem at gmail.com
Fri Jul 21 12:29:43 UTC 2023


Hi,

I have 16 rtsp sources (cam) I am looking a solution to detect unavailable rtsp source whether starting the program or after a while , and replace the stream output with a logo until its available again. The pipeline has many plugins object detection etc. 

Is there any way to do this ? 


Example pipe for 2 cam : 


gst-launch-1.0 funnel name=fun 

! queue name=custom_pre_convert_0 leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 



! videoconvert n-threads=1 qos=false 

! video/x-raw,format=RGB 

! queue name=custom_pre_cropper1_q leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! customcropper so-path=/local/workspace/custom/apps/h8/gstreamer/libs/post_processes//cropping_algorithms/libwhole_buffer.so function-name=create_crops use-letterbox=true resize-method=inter-area internal-offset=true name=cropper1 customaggregator name=agg1 cropper1. 

! queue name=bypess1_q leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! agg1. cropper1. 

! queue name=custom_pre_detector_q leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! customnet hef-path=/local/workspace/custom/apps/h8/gstreamer/general/multi_person_multi_camera_tracking/resources/yolov5s_personface_reid.hef scheduling-algorithm=1 vdevice-key=1 

! queue name=detector_post_q leaky=no max-size-buffers=1000 max-size-bytes=0 max-size-time=0 

! customfilter so-path=/local/workspace/custom/apps/h8/gstreamer/libs/post_processes//libyolo_post.so qos=false function_name=yolov5_personface_letterbox config-path=/local/workspace/custom/apps/h8/gstreamer/general/multi_person_multi_camera_tracking/resources/configs/yolov5_personface.json 

! queue name=detector_pre_agg_q leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! agg1. agg1. 

! queue name=custom_pre_tracker leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! customtracker name=custom_tracker custom-objects-blacklist=custom_landmarks,custom_depth_mask,custom_class_mask,custom_matrix class-id=1 kalman-dist-thr=0.7 iou-thr=0.7 init-iou-thr=0.8 keep-new-frames=2 keep-tracked-frames=4 keep-lost-frames=8 qos=false std-weight-position-box=0.01 std-weight-velocity-box=0.001 

! queue leaky=no max-size-buffers=60 max-size-bytes=0 max-size-time=0 

! customfilter function-name=alp_crop config-path=aliveliDereliX use-gst-buffer=true so-path=/local/workspace/custom/apps/h8/gstreamer/libs/post_processes/libalpullu_crop.so 

! queue name=custom_pre_cropper2_q leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! customcropper so-path=/local/workspace/custom/apps/h8/gstreamer/libs/post_processes//cropping_algorithms/libre_id.so function-name=create_crops internal-offset=true name=cropper2 customaggregator name=agg2 cropper2. 

! queue name=bypess2_q leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! agg2. cropper2. 

! queue name=pre_reid_q leaky=no max-size-buffers=10 max-size-bytes=0 max-size-time=0 

! customnet hef-path=/local/workspace/custom/apps/h8/gstreamer/general/multi_person_multi_camera_tracking/resources/repvgg_a0_person_reid_2048.hef scheduling-algorithm=1 vdevice-key=1 

! queue name=reid_post_q leaky=no max-size-buffers=10 max-size-bytes=0 max-size-time=0 

! customfilter so-path=/local/workspace/custom/apps/h8/gstreamer/libs/post_processes//libre_id.so qos=false 

! queue name=reid_pre_agg_q leaky=no max-size-buffers=10 max-size-bytes=0 max-size-time=0 

! agg2. agg2. 

! queue name=custom_pre_gallery leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! customgallery similarity-thr=.4 gallery-queue-size=100 class-id=1 

! queue name=custom_post_gallery leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! videoscale n-threads=2 add-borders=false qos=false 

! video/x-raw, width=800, height=450, pixel-aspect-ratio=1/1 

! queue name=custom_pre_draw leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! customfilter use-gst-buffer=true so-path=/local/workspace/custom/apps/h8/gstreamer/libs/apps/re_id//libre_id_overlay.so qos=false 

! queue name=custom_post_draw leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 

! streamiddemux name=sid compositor name=comp start-time-selection=0 sink_0::xpos=0 sink_0::ypos=0 sink_1::xpos=640 sink_1::ypos=0 sink_2::xpos=1280 sink_2::ypos=0 sink_3::xpos=1920 sink_3::ypos=0 sink_4::xpos=0 sink_4::ypos=640 sink_5::xpos=640 sink_5::ypos=640 sink_6::xpos=1280 sink_6::ypos=640 sink_7::xpos=1920 sink_7::ypos=640 sink_8::xpos=0 sink_8::ypos=1280 sink_9::xpos=640 sink_9::ypos=1280 sink_10::xpos=1280 sink_10::ypos=1280 sink_11::xpos=1920 sink_11::ypos=1280 sink_12::xpos=0 sink_12::ypos=1920 sink_13::xpos=640 sink_13::ypos=1920 sink_14::xpos=1280 sink_14::ypos=1920 sink_15::xpos=1920 sink_15::ypos=1920 

! queue name=custom_video_q_0 leaky=no max_size_buffers=30 max-size-bytes=0 max-size-time=0 

! videoconvert n-threads=2 qos=false 

! queue name=custom_display_q_0 leaky=no max_size_buffers=300 max-size-bytes=0 max-size-time=0 

! fpsdisplaysink video-sink=xvimagesink name=custom_display sync=false text-overlay=true rtspsrc async-handling=true location='rtsp://custom:custom2023@172.16.100.20:554/cam/realmonitor?channel=25&subtype=0' name=xource_0 message-forward=true 

! decodebin 

! queue name=custom_preprocess_q_0 leaky=no max-size-buffers=32 max-size-bytes=0 max-size-time=0 

! decodebin3 

! queue leaky=downstream max-size-buffers=32 max-size-bytes=0 max-size-time=0 

! videoscale n-threads=8 

! video/x-raw,pixel-aspect-ratio=1/1 

! videoconvert n-threads=8 

! video/x-raw,pixel-aspect-ratio=1/1 

! custompython qos=false module=/local/workspace/custom/apps/h8/gstreamer/general/multi_person_multi_camera_tracking/add_metadata.py function=test0 

! fun.sink_0 sid.src_0 

! queue name=comp_q_0 leaky=downstream max-size-buffers=5 max-size-bytes=0 max-size-time=0 

! comp.sink_0 rtspsrc async-handling=true location='rtsp://custom:custom2023@172.16.100.20:554/cam/realmonitor?channel=64&subtype=0' name=xource_1 message-forward=true 

! decodebin 

! queue name=custom_preprocess_q_1 leaky=no max-size-buffers=32 max-size-bytes=0 max-size-time=0 

! decodebin3 

! queue leaky=downstream max-size-buffers=32 max-size-bytes=0 max-size-time=0 

! videoscale n-threads=8 

! video/x-raw,pixel-aspect-ratio=1/1 

! videoconvert n-threads=8 

! video/x-raw,pixel-aspect-ratio=1/1 

! custompython qos=false module=/local/workspace/custom/apps/h8/gstreamer/general/multi_person_multi_camera_tracking/add_metadata.py function=test1 

! fun.sink_1 sid.src_1 

! queue name=comp_q_1 leaky=downstream max-size-buffers=5 max-size-bytes=0 max-size-time=0 

! comp.sink_1


More information about the gstreamer-devel mailing list