The following edits extend the object detection examples in ’hailo-rpi5-examples’ to optionally read from a RTSP stream topic and to write the pipeline detection stream to an RTSP Server in parallel to the output on the rpi5 screen.
Therefore edit the file hailo_rpi_common.py file and add the following lines:
read from RTSP stream:
def get_source_type(input_source):
# This function will return the source type based on the input source
# return values can be "file", "rpi", "rtsp" or "usb"
if input_source.startswith("/dev/video"):
return 'usb'
else:
if input_source.startswith("rpi"):
return 'rpi'
elif input_source.startswith("rtsp"): #check for streaming from a rtsp source stream
return 'rtsp'
else:
return 'file'
Thank you.
I’d be fiddling around looking at some older posts that seemed to refer to a previous version of the example python.
Your suggestions worked first time.
Much appreciated.
im using siyi a8 ip camera ,
SOURCE_PIPELINE AND get_source_type functions are working well and i can test perfectly without streaming processed data on rtsp but when i change display function im getting error after first frame like this:
Frame count: 1
Error: gst-resource-error-quark: Resource not found. (3), ../gst/rtsp-sink/gstrtspclientsink.c(3106): gst_rtsp_client_sink_send (): /GstPipeline:pipeline0/GstRTSPClientSink:rtspclientsink0:
Not Found
Shutting down… Hit Ctrl-C again to force quit.
Frame count: 2
probably im starting wrong my rtsp server ,i tried 2 different way to start but nothing change ,is there any chance to explain how your starting rtsp server ? libraries or code used extra