Forking the output from tracker to a nvvidconv and streamdemux elements

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Xavier AGX
• DeepStream Version 6.0.1
• JetPack Version (valid for Jetson only) 4.6
• TensorRT Version 8.2.1

Hi there,

I have n RTSP sources that are processed by Deepstream pipeline and produce another n RTSP streams (and it works fine) just like the following schema:

2 RTSP streams … → streammux → pgie → tracker → streamdemux → … perform stuff to create 2 RTSP streams

Now I need to get the output of the tracker, fork it and send it to another branch where I will create another RTSP stream, just like the following:

2 RTSP streams … → streammux → pgie → tracker:
→ streamdemux → … perform stuff to create 2 RTSP streams
→ nvvidconv → tiler … perform other stuff to create another RTSP stream

This is the code:

    print("Linking elements in the Pipeline")
    #Fork into several branches, as much as the number of stream in my batch
    for i in range(number_sources):
        print("demux source", i, "\n")
        srcpad1 = streamdemux.get_request_pad("src_%u"%i)
        if not srcpad1:
            sys.stderr.write(" Unable to get the src pad of streamdemux \n")
        sinkpad1 = nvvidconv[i].get_static_pad("sink")
        if not sinkpad1:
            sys.stderr.write(" Unable to get sink pad of nvvidconv \n")
    #Fork for the tiler branch

The issue is: when a do a second link ( “” ) it returns False, GST_PAD_LINK_WAS_LINKED. So I guess I can’t do and then another How do I link such branch?

You can try to add tee plugin to add a new branch. The tracker plugin can just link one plugin.

So this is the schema you proposed:
tracker → nvtee:
→ streamdemux
→ nvvidconv

I tried to link the first branch (nvtee → streamdemux). This is the code:
    teesourcepad = teeforking.get_static_pad("vid_src")
    if not teesourcepad:
        sys.stderr.write(" Unable to get the src pad of teeforking \n")
    demuxsinkpad = streamdemux.get_static_pad("sink")
    if not demuxsinkpad:
        sys.stderr.write(" Unable to get the sink pad of demux \n")

Now, there is nothing getting out from pipeline. My linking seems to be OK, isn’t it? So, do you have any tip of what is wrong?

By the way, this is how I created the tee element and added it to pipeline:

teeforking = make_elm_or_print_err("nvtee", "nvtee")

You can refer to our demo code:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.