I am using raspberry pi 5 with AIhat , hailo 8l , for object detection , it is connected to ip camera which is connected to pi with ethernet cable , the issue is that my camera do not have h.264 codec , show it give me h.265 , to handle this i have made chages in gstreamer_helper_pipeline.py , now i get frames but the the hailo outut frames are pixalted and many time blank brown screen , i am not able to resolve this please help here is the change elif source_type == ‘rtsp’:
source_element = (
f’rtspsrc location=“{video_source}” protocols=tcp latency=100 name=src ’
f’do-rtsp-keep-alive=true drop-on-latency=true ’
f’src. ! ’
f’{QUEUE(name=f"{name}_queue_rtp", leaky=“downstream”, max_size_buffers=5)} ! ’
f’application/x-rtp,media=video ! ’
f’rtph265depay ! ’
f’{QUEUE(name=f"{name}_queue_parse", leaky=“downstream”, max_size_buffers=5)} ! ’
f’h265parse config-interval=-1 ! ’
f’video/x-h265,stream-format=byte-stream,alignment=au ! ’
f’{QUEUE(name=f"{name}_queue_decode", leaky=“downstream”, max_size_buffers=5)} ! ’
f’avdec_h265 max-threads=4 ! ’
)
Hi @Ankit_Rai,
The original RTSP pipeline in hailo-apps already uses decodebin , which auto-detects and decodes both H.264 and H.265 - no code changes needed.
Can you please try:
elif source_type == 'rtsp':
source_element = (
f'rtspsrc location="{video_source}" name={name} ! '
f'{QUEUE(name=f"{name}_queue_decode")} ! '
f'decodebin name={name}_decodebin ! '
)
Thanks,
tried this but got this error
(venv_hailo_apps) kalpvaig@kalpvaig2:~/hailo-apps/hailo_apps/python/pipeline_apps/detection $ python3 detection10.py --input “rtsp://admin:Kalpvaig%23%24007@192.168.10.108:554/stream2” --arch hailo8l --hef-path monkey-person–640x640_quant_hailort_multidevice_1.hef --labels-json /home/kalpvaig/hailo-apps/resources/json/labels_monkey-person.json --use-frame INFO | common.core | All required environment variables loaded successfully. INFO | common.core | Found HEF in resources: /usr/local/hailo/resources/models/hailo8l/monkey-person–640x640_quant_hailort_multidevice_1.hef INFO | detection.detection_pipeline | Resources | hef=/usr/local/hailo/resources/models/hailo8l/monkey-person–640x640_quant_hailort_multidevice_1.hef | post_so=/usr/local/hailo/resources/so/libyolo_hailortpp_postprocess.so | post_fn=filter_letterbox | labels_json=/home/kalpvaig/hailo-apps/resources/json/labels_monkey-person.json WARNING | gstreamer.gstreamer_app | hailo_display not found in pipeline ERROR | gstreamer.gstreamer_app | GStreamer Error: gst-stream-error-quark: Internal data stream error. (1), debug: ../libs/gst/base/gstbasesrc.c(3187): gst_base_src_loop (): /GstPipeline:pipeline0/GstRTSPSrc:source/GstUDPSrc:udpsrc0: streaming stopped, reason not-linked (-1) WARNING | gstreamer.gstreamer_app | Shutdown initiated Shutting down… Hit Ctrl-C again to force quit. ERROR | gstreamer.gstreamer_app | Exiting with error
Hi @Ankit_Rai,
Looks like decodebin doesn’t always handle H.265 RTSP streams correctly on the Pi 5. Your manual pipeline approach was on the right track.
First, make sure the required GStreamer plugins are installed:
sudo apt install gstreamer1.0-libav gstreamer1.0-plugins-bad
gst-inspect-1.0 avdec_h265 # should show the element details
gst-inspect-1.0 rtph265depay # should show the element details
Testing the raw stream:
gst-launch-1.0 rtspsrc location="rtsp://path" protocols=tcp latency=500 ! rtph265depay ! h265parse ! avdec_h265 ! videoconvert ! autovideosink
Then replace the RTSP block in gstreamer_helper_pipelines.py:
elif source_type == 'rtsp':
source_element = (
f'rtspsrc location="{video_source}" name={name} protocols=tcp latency=500 ! '
f'{QUEUE(name=f"{name}_queue_rtp")} ! '
f'rtph265depay ! '
f'{QUEUE(name=f"{name}_queue_parse")} ! '
f'h265parse ! '
f'{QUEUE(name=f"{name}_queue_decode")} ! '
f'avdec_h265 ! '
f'videoconvert ! '
)
Key fixes vs. your original attempt:
protocols=tcp- prevents UDP packet loss over Ethernetlatency=500- gives more buffer for network jitter- Removed
max-threads=4, config-interval=-1, leaky=downstream and extra caps filters that were causing issues - Added
videoconvertafter decode - this was likely the cause of the brown/blank frames
Thanks,