• Issue Type( questions, new requirements, bugs) Question
I am implementing a padbuferprobe method similar to the one in deepstream_user_metadata_app. This can be seen below.
static GstPadProbeReturn
osd_sink_pad_buffer_probe (GstPad * pad, GstPadProbeInfo * info,
gpointer u_data)
{
GstBuffer *buf = (GstBuffer *) info->data;
NvDsMetaList * l_frame = NULL;
NvDsMetaList * l_user_meta = NULL;
NvDsUserMeta *user_meta = NULL;
gchar *user_meta_data = NULL;
int i = 0;
NvDsBatchMeta *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) {
NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
/* Validate user meta */
for (l_user_meta = frame_meta->frame_user_meta_list; l_user_meta != NULL;
l_user_meta = l_user_meta->next) {
user_meta = (NvDsUserMeta *) (l_user_meta->data);
user_meta_data = (gchar *)user_meta->user_meta_data;
if(user_meta->base_meta.meta_type == NVDS_USER_FRAME_META_EXAMPLE)
{
g_print("\n************ Retrieving user_meta_data array of 16 on osd sink pad\n");
for(i = 0; i < USER_ARRAY_SIZE; i++) {
g_print("user_meta_data [%d] = %d\n", i, user_meta_data[i]);
}
g_print("\n");
}
}
frame_number++;
}
return GST_PAD_PROBE_OK;
}
In my program this buffer probe is attached to the src of nvof plugin so the NVDSOpticalFlowMeta should be attached. How to I get this metadata and print it. For example how would I get the optical flow vector at each 4x4 block for a specific frame?
To start I changed this line.
if(user_meta->base_meta.meta_type == NVDS_USER_FRAME_META_EXAMPLE)
to this
if(user_meta->base_meta.meta_type == NVDS_OPTICAL_FLOW_META)
I can confirm this if statement returns true but I don’t know how to gather the optical flow metadata from the user_meta. From what I can tell, the nvdsmeta.h doesn’t include NvDsOpticalFlowMeta so I don’t know how it relates to the other metadata structures. This also leads me to another question. Would I need to add an include statement at the beggining of my app like this to include the nvdsopticalflowmeta structure?
#include "nvds_opticalflow_meta.h"
Additional Information The app that I’m working on is a modification of the deepstream-nvof-test.c. My modified pipeline looks something like this .
uridecodebin -> nvstreammux -> nvof *-> tee -> queue2 -> nvofvisual -> tiler -> transform -> sink
\_> queue1 -> nvmsgconv -> nvmsgbroker
Once again the probe is attached to the src of the nvof plugin denoted by *
Any help or input would be much appreciated.

