Deepstream output as RTSP Stream


I am currently struggling to setup my deepstream pipeline.

Hardware Platform: Tesla T4
DeepStream Container Version: 6.1.1-triton
CUDA Version: CUDA Version 11.7

What I am trying to do:
I have a kubernetes cluster where I run a deployment that creates a pod with a Deepstream container and a OpenVPN Client Container. My input is an RTSP Server on my Iphone that is connected to the same OpenVPN Server. I see on my Iphone that the Deepstream container is connected (client = 1).
My issue is the connection to the RTSP Stream that the Deepstream container creates to see its output. My Deepstream Container is reachable (ping test) with my PC that is also connected to the same OpenVPN Server but I am not able to stream its output. ffplay gives me Error 503 (Service Unavailable) and VLC Media is also not able to connect to the RTSP Stream.

Simple Graph:
Iphone → Deepstream Container → My PC
Both arrows are RTSP Streams. First one works.

Here is the log file of my Kubernetes pod:
deepstream_container.log (24.1 KB)

The Error Message is bascially the last 8 Lines:

WARN rtspmedia rtsp-media.c:3272:wait_preroll: failed to preroll pipeline
WARN rtspmedia rtsp-media.c:3652:gst_rtsp_media_prepare: failed to preroll pipeline
ERROR rtspclient rtsp-client.c:1077:find_media: client 0x1eaf5c0: can’t prepare media
ERROR rtspclient rtsp-client.c:2963:handle_describe_request: client 0x1eaf5c0: no media
WARN rtspmedia rtsp-media.c:3272:wait_preroll: failed to preroll pipeline
WARN rtspmedia rtsp-media.c:3652:gst_rtsp_media_prepare: failed to preroll pipeline
ERROR rtspclient rtsp-client.c:1077:find_media: client 0x1eaf6f0: can’t prepare media
ERROR rtspclient rtsp-client.c:2692:handle_setup_request: client 0x1eaf6f0: media ‘/ds-test’ not found

I would be glad if someone could help me find a solution for my issue? :(

There are some logs like “Unable to try format: Unknown error -1” in your log file, seems the format of the RTSP stream cannot be recognized by your decodebin.
There is a similar error in this topic Nvv4l2decoder error, not sure if it helps for your case.

from the logs, it is because “media ‘/ds-test’ not found”. it seemed there is no ds-test out rtsp stream.

  1. which sample are you testing? or which sample are you referring to?
  2. can run fine? you can play with 127. 0.0.1 in deestream docker instead of playing with VLC on the PC.

Regarding the first question reply:
In the mentioned topic there was a problem with the decoder. I exchanged the Nvv4l2decoder by skipping it with something else with this code:

def on_autoplug_select(decodebin, pad, caps, factory):
    # The name of the elements that we want to skip
    elements_to_skip = ['nvv4l2decoder']
    if factory.get_name() in elements_to_skip:
        return True
        return False

and then adding it to the uri_decode_bin like this:
uri_decode_bin.connect("autoplug-select", on_autoplug_select)

It fixed the error message now but it did not resolve my problem unfortunately.

Regarding the second question reply:
When I try to connect to the stream with the wrong endpoint like /blabla or empty endpoint I will get the error message: rtspclient rtsp-client.c:1036:find_media: client 0x7fad30005f80: no factory for path
rather than rtspmedia rtsp-media.c:3272:wait_preroll: failed to preroll pipeline

To showcase this I made a new log file with GST_Debug = 4 (very long log file):
deepstream_container2.log (546.9 KB)
I am connecting to the deepstream container 3 different times, this is visible by the different time stamps.

  1. /ds-test
  2. /blabla
  3. empty

I am not able to tell which sample I am referring to since I did not created this project by myself but here is the code that creates the RTSP Server:

    def __start_rtsp_server(
        rtsp_port_num: int = 8553,
        rtsp_endpoint: str = "/ds-test",
        updsink_port_num: int = 5400,
        codec: str = "H264",
        """start RTSP server for RTSP output source."""
        server =
        server.props.service = "%d" % rtsp_port_num
        server.props.address = ""
        server.attach(None)"\n *** DeepStream: Launched RTSP Streaming at rtsp:// ***\n\n" % rtsp_port_num)

        factory =
            '( udpsrc name=pay0 port=%d buffer-size=524288 caps="application/x-rtp, media=video, clock-rate=90000, encoding-name=(string)%s, payload=96 " )'
            % (updsink_port_num, codec)
        server.get_mount_points().add_factory(rtsp_endpoint, factory)

I will test out if can fun fine but I need a bit more time and I wanted to provide some information in the meantime.

Thank you very much for the support!

I tried to change the input to a video file rather than RTSP Stream and reversed my decoder change and it looks like there is still an issue with the decoder. It is stuck with this error:
libav gstavauddec.c:628:gst_ffmpegauddec_drain:<avdec_aac0> send packet failed, could not drain decoder

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

  1. from the logs, hardware decoding failed, and softeware decoder was selected.
  2. is a sample to use rtsp input and output, you can compare the code with yours.
  3. to narrow down this issue, you can use local deepstream sample file as input. there will be no decoding issue.