Using tee and appsink with nvstreammux

Hello I want to make a pipeline with multiple sources and multiple branches and one of the branches is c++ application that does some processing on the extracted batch of images from the nvstreammux plugin. my goal is that I want the reading and decoding of the sources to happen one time. The processing that I want to do in the c++ application is not only some opencv operations but it also includes some Eigen3 operations. can you help by giving some examples on how to use the nvstreammux with the gstreamer tee and the appsink plugins.

deepstream-appsrc-test is the sample for appsrc and appsink

Tee can be used as normal. No special code is needed.

Thanks for your fast reply. That really helped.

Could you refer me to some sample implementation for converting the NvBufSurface to vector of cv::Mat. The deepstream-appsrc-test does not access the buffer it only access the metadata. I have tried this code to access the buffer and I can access it but I can not convert it.

NvBufSurface *surface = NULL;
memset(&in_map_info, 0, sizeof(in_map_info));
if (!gst_buffer_map(buf, &in_map_info, GST_MAP_READ))
  g_print("Error: Failed to map gst buffer\n");
surface = (NvBufSurface *);

Hi ahmed.t.mohamed,

Please help to open a new topic. Thanks