I want to communicate inference results and video to another app

Dear all,

I want to communicate the inference results and video for each frame to another application with deepstream.
How should I implement it?

Thank you.

We have a sample to upload data to server. Please check deepstream-test4.

Way 1. Refer to dsexample, add the code in it to send inference metadata and video data to your another app

Way 2. Refer to test1, add the code in probe (it’s blocking) to send inference metadata and video data to your another app


I tried it with reference to “dsexample” and the following, but it doesn’t work, so please help me.


I want to communicate images and data of each stream after executing nvstreamdemux.
When I tried it, I got all the same images. How can I get an image of each stream?
After nvstreamdemux, I think it will be another access method because it is non batched.


input1 -----> nvstreammux ---> nvinfer ---> nvstreamdemux -----> my_transfer_element1
         |                                                  |
input2 ---                                                  ---> my_transfer_element2

send_buf is the same for my_transfer_element1 and my_transfer_element2.

NvBufSurface *surface = NULL;
  NvDsBatchMeta *batch_meta = NULL;
  NvDsFrameMeta *frame_meta = NULL;
  NvDsMetaList *l_frame = NULL;
  guint i;

  sink = GST_TCP_CLIENT_SINK (bsink);

  g_return_val_if_fail (GST_OBJECT_FLAG_IS_SET (sink, GST_TCP_CLIENT_SINK_OPEN),

  gst_buffer_map (buf, &map, GST_MAP_READ);
  GST_LOG_OBJECT (sink, "writing %" G_GSIZE_FORMAT " bytes for buffer data",

  surface = (NvBufSurface *) map.data;
  batch_meta = gst_buffer_get_nvds_batch_meta(buf);

  for (l_frame = batch_meta->frame_meta_list; l_frame != NULL; l_frame = l_frame->next) {
    frame_meta = (NvDsFrameMeta *) (l_frame->data);
    guint len = surface->surfaceList[frame_meta->batch_id].dataSize;

    gchar *send_buf = (gchar *)malloc(len);
    if (send_buf == NULL) {


How about not use demux? You can get batch buffer after nvinfer.