How to generate a picture file while using Gst-nvsegvisual plugin?

I am using the the Gst-nvsegvisual – deepstsream segmentation plugin to create an application.

In this application, instead display the segmentation picture on the window, I want to save that as a file. I try to set:

sink = gst_element_factory_make (“filesink”, “file-sink”);
nvsegvisual = gst_element_factory_make (“nvsegvisual”, “nvsegvisual”);

but I can not get gst_element_link_many() call work, it gives the error:
“Elements could not be linked: 1. Exiting”

I think that nvsegvisual caused the function call failed.

Can some one let me how to generate the picture file?


• Hardware Platform (Jetson / GPU) – dGPU
• DeepStream Version - 5.0
• JetPack Version (valid for Jetson only)
• TensorRT Version -7.0
• NVIDIA GPU Driver Version (valid for GPU only) - 450.80
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description) Gst-nvsegvisual

Can you refer to the sample of segmentaion? It is in /opt/nvidia/deepstream/deepstream-5.0/sources/apps/sample_apps/deepstream-segmentation-test.

solved the problem by using the following pipeline:

H264/JPEG–>decoder–>tee -->| – (batch size) ------>|–>streammux–> nvinfer–> nvsegvisual → vosd → |—> encode —>filesink (save the output in local dir)