Creating multiple pipelines

I am looking at creating multiple gstreamer pipelines and I was wondering if it’s possible to create the following pipelines the following way:

pipeline 0: rtsp_source → uridecodebin->nvstreammux->nvinfer(pgie)->appsink_0
pipeline 1: appsource → post-processing-gstreamer-plugin ->appsink_1

My appsource will copy the gpu buffer in pipeline 0 to another region in the GPU memory, for example, I would copy the gpu buffer data from pipeline 0 to a cv::GpuMat and my pipeline 1 will process the data in the cv::GpuMat. In this scenario, will pipeline 1 run asynchronously w.r.t pipeline 0. I know that it is possible to do so in Gstreamer pipelines that don’t use the Deepstream SDK and in that case it would be a H2H copy, where as in my case it would be a Device to Device copy.

This should be possible by using NvBufSurf APIs. There is a sample which may help to understand how to use the APIs. Please look at

Thank you for your response. I guess my question wasn’t clear. My question is more about whether the two pipelines can run in async , if pipeline 0 uses the gstreamer elements from the Deepstream SDK and pipeline 1 only uses gstreamer elements from the gstreamer library.

If the plugins in second pipeline support CUDA buffers, you may use NvBufSurf APIs to demonstrate device to device memory copy. If the plugins support CPU buffers only, you need to have device to host memory copy.

Hi, If the plugins in the second pipeline support CUDA buffers and need to perform CUDA API calls, can the two pipelines be run asynchronously.


Running two pipelines simultaneously in one process should work. Once concern is that metadata can be lost in certain condition. A condition is discussed in the post:

1 Like