I used QtGstreamer and deepstream plugin to build an app, the display was OK, but the boxes of objects jumped between sources. I finally found that in the “OnOsdSinkBinBufProbe” function ,the batch_id and source_id were not equal.
GstPadProbeReturn Camera::OnOsdSinkBinBufProbe(GstPad pad, GstPadProbeInfo info, gpointer u_data)
{
Camera pCamera = (Camera)u_data;
GstBuffer *buf = (GstBuffer *) info->data;
NvDsMetaList * l_frame = NULL;
if (!gst_buffer_is_writable (buf))
{
return GST_PAD_PROBE_OK;
}
NvDsBatchMeta *batch_meta = gst_buffer_get_nvds_batch_meta (buf);
int nIndex = 0;
for (l_frame = batch_meta->frame_meta_list; l_frame != NULL;
l_frame = l_frame->next) {
NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
std::cout << "source_id: " << frame_meta->source_id << " batch_id: " << frame_meta->batch_id
<< " surface_index: " << frame_meta->surface_index << " surface_type: " << frame_meta->surface_type << std::endl;
pCamera->ProcessFrameMeta(frame_meta, batch_meta);
}
return GST_PAD_PROBE_OK;
}
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 2 surface_index: 0 surface_type: 0
source_id: 2 batch_id: 0 surface_index: 0 surface_type: 0
source_id: 0 batch_id: 1 surface_index: 0 surface_type: 0
source_id: 1 batch_id: 2 surface_index: 0 surface_type: 0
As a result, the box of a person original from source0 may appear in source1.
I have been stucked for a few days. Could someone tell me what was wrong.Thanks very much
