The problem of NvDsPreProcessBatchMeta data get out!

Run the “deepstream-preprocess-test” test case. Command line:./deepstream-preprocess-test config_preprocess.txt config_infer.txt file:// video1.mp4. I Can get “NvDsPreProcessBatchMeta” with these code:
pgie_src_pad_buffer_probe(GstPad *pad, GstPadProbeInfo *info,
gpointer u_data)
{
GstBuffer *buf = (GstBuffer *)info->data;
guint num_rects = 0;

NvDsDisplayMeta *display_meta = NULL;

NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta(buf);

#if 1
NvDsMetaList *l_user_meta = NULL;
NvDsUserMeta *user_meta = NULL;
for (l_user_meta = batch_meta->batch_user_meta_list; l_user_meta != NULL;
l_user_meta = l_user_meta->next)
{
user_meta = (NvDsUserMeta *)(l_user_meta->data);
if (user_meta->base_meta.meta_type == NVDS_PREPROCESS_BATCH_META)
{
GstNvDsPreProcessBatchMeta *preprocess_batchmeta =
(GstNvDsPreProcessBatchMeta *)(user_meta->user_meta_data);

  guint roi_cnt = 0;
  for (auto &roi_meta : preprocess_batchmeta->roi_vector)
  {

But I can not get “preprocess_batchmeta” with deepstream-app “createpipeline callback function”.
deepstream-app config like this :
[pre-process]
enable=1
config-file=config_preprocess.txt

[primary-gie]
enable=1
gpu-id=0
input-tensor-meta=1
output-tensor-meta=1
batch-size=1
nvbuf-memory-type=0
config-file=config_infer.txt

createpipeline callback function like this:
static void after_gie_usermeta(AppCtx *appCtx, GstBuffer *buf,
NvDsBatchMeta *batch_meta, guint index){
NvDsMetaList *l_user_meta = NULL;
NvDsUserMeta *user_meta = NULL;
for (l_user_meta = batch_meta->batch_user_meta_list; l_user_meta != NULL;
l_user_meta = l_user_meta->next){
user_meta = (NvDsUserMeta *)(l_user_meta->data);
if (user_meta->base_meta.meta_type == NVDS_PREPROCESS_BATCH_META){
GstNvDsPreProcessBatchMeta *preprocess_batchmeta =
(GstNvDsPreProcessBatchMeta *)(user_meta->user_meta_data);

        guint roi_cnt = 0;
        for (auto &roi_meta : preprocess_batchmeta->roi_vector){

create pipeline code like this:
if (!create_pipeline(appCtx[i], nullptr,
after_gie_usermeta, perf_cb, overlay_graphics)) {
NVGSTDS_ERR_MSG_V(“Failed to create pipeline”);
return_value = -1;
should_goto_done = true;
break;
}

I debug the code, but the “batch_meta->batch_user_meta_list” pointer is null,then I can not get the ““preprocess_batchmeta””.
There is some wrong with my code in deepstream-app??

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

You can refer to our source code from deepstream_app.c. The probe function is actually added to the OSD sink pad.

  if (config->osd_config.enable) {
    NVGSTDS_ELEM_ADD_PROBE (instance_bin->all_bbox_buffer_probe_id,
        instance_bin->osd_bin.nvosd, "sink",
        gie_processing_done_buf_prob, GST_PAD_PROBE_TYPE_BUFFER, instance_bin);
  } else {
    NVGSTDS_ELEM_ADD_PROBE (instance_bin->all_bbox_buffer_probe_id,
        instance_bin->sink_bin.bin, "sink",
        gie_processing_done_buf_prob, GST_PAD_PROBE_TYPE_BUFFER, instance_bin);
  }

You can try to add that to the src pad of nvinfer like the deepstream_preprocess_test.

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