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??