How to set additional data in source for multi RTSP and how to get those data in pgie/sgie buffer probe?

Hardware Platform : GPU
DeepStream Version : 6.2
Language: C++

for (unsigned int i = 0; i < num_sources; i++)
  {
    //----------get each rtsp urls and create sources ----------

    Json::Value &obj = setting[i];
    std::string RTSPUrl = obj["RTSPUrl"].asString();

    //---------- Create sources ---------
    GstPad *sinkpad, *srcpad;
    gchar pad_name[16] = {};

    GstElement *source_bin = NULL;
    
    source_bin = create_source_bin(i, g_strdup(RTSPUrl.c_str()));
    
    if (!source_bin)
    {
      g_printerr("Failed to create source bin. Exiting.\n");
      return -1;
    }

    gst_bin_add(GST_BIN(pipeline), source_bin);

    g_snprintf(pad_name, 15, "sink_%u", i);
    sinkpad = gst_element_get_request_pad(streammux, pad_name);
    if (!sinkpad)
    {
      g_printerr("Streammux request sink pad failed. Exiting.\n");
      return -1;
    }

    srcpad = gst_element_get_static_pad(source_bin, "src");
    if (!srcpad)
    {
      g_printerr("Failed to get src pad of source bin. Exiting.\n");
      return -1;
    }

    if (gst_pad_link(srcpad, sinkpad) != GST_PAD_LINK_OK)
    {
      g_printerr("Failed to link source bin to stream muxer. Exiting.\n");
      return -1;
    }
    
//
//
// here i want to add additional different data from setting[i] for different sources, 
// that can be accessible from sgie_src_pad_buffer_probe. Purpose is to handle different action for different sources.
//
//
//

    gst_object_unref(srcpad);
    gst_object_unref(sinkpad);
  }

while looping for creating multiple sources, add addtional info to sources that can be accessible from sgie_src_pad_buffer_probe.

please refer to sample \opt\nvidia\deepstream\deepstream-6.2\sources\apps\sample_apps\deepstream-gst-metadata-test\deepstream_gst_metadata.c, it uses gst_buffer_add_nvds_meta add user meta.

in the sample example gst_buffer_add_nvds_meta is used which requires buffer and other callback and meta transformation functions. how do i get buffer in sourcebin? Isn’t there any simple way to add data simple as string? Looks like a lot to do.

I just need to add information to identify inferencing is happening based on which source and handle action based on the associated information with each rtsp source.

Also, is it possible to retrieve rtsp source in sgie? I will be running multi RTSPs, So it’s necessary to know which rtsp is generating the detection data .

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

please refer to opt\nvidia\deepstream\deepstream-6.2\sources\apps\sample_apps\deepstream-user-metadata-test\deepstream_user_metadata_app.c, it will use nvds_add_user_meta_to_frame to add user information.

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