Cannot view ouput rtsp stream using rtpsrc

Hi,

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU): RTSP
**• DeepStream Version: 6.4
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
**• Issue Type( questions, new requirements, bugs): questions

=====

I have a DeepStream pipeline that produces output to an RTSP stream. The pipeline successfully infers from input video/RTSP cam, and the output RTSP stream can be viewed using VLC.

However, I want to read the output RTSP stream using OpenCV built with GStreamer, or even directly using GStreamer, but have had no success.

The pipelines I’ve tried are:

uridecodebin uri=rtsp://localhost:8303/output ! decodebin ! videoconvert ! video/x-raw,format=BGR ! appsink drop=1

rtspsrc location=rtsp://localhost:8303/output timeout=30000 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=BGR ! appsink drop=1

rtspsrc location=rtsp://localhost:8303/output timeout=60000 ! queue max-size-buffers=2 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=BGR ! appsink drop=1

udpsrc port=5400 ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! appsink drop=1

I used default factory of RTSP server:

factory = GstRtspServer.RTSPMediaFactory.new()
factory.set_launch(
        f'( udpsrc name=pay0 port={udpsink_port} buffer-size=524288 '
        f'caps="application/x-rtp, media=video, clock-rate=90000, '
        f'encoding-name=(string){encoding_name}, payload=96 " )')
    factory.set_shared(True)

Has anyone had success with reading the output RTSP stream without using VLC?

can this pipeline “gst-launch-1.0 rtspsrc location=rtsp://address ! fakesink” run well? if can’t, could you share some log? you can use network tool to check the difference between VLC play and gstreamer play.

Hi @fanzh,

Thank you for your help, it was my mistake related to the network settings. This pipeline works:
rtspsrc location=rtsp://localhost:8303/output ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=BGR ! appsink drop=1

However, the time needed for this step: cap = cv2.VideoCapture(gst, cv2.CAP_GSTREAMER) in Opencv is slow(took about 5seconds), this is similar with playing using VLC(5-15s).

What could be the root cause of this?

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

it should be related to the encoder’s I frame interval. if using hardware encoder please refer to this topic. if using software encoder please refer to this topic.

Thank you, @fanzh , I will try it.

Sorry for the late reply, Is this still an DeepStream issue to support? Thanks!