Source_id in frame_meta is Not Working Properly

I’m developing a custom plugin using DeepStream 5.0 on T4 platform.

Base on gst-dsexample, I’m trying to implement a simple function to add some texts for display on selected video sources.

I’m doing this by changing gst_dsexample_transform_ip function in gstdsexample.cpp:

  // Iterating through frames in batched meta from diff. sources
  for (l_frame = batch_meta->frame_meta_list; l_frame != NULL;
      l_frame = l_frame->next) {
    frame_meta = (NvDsFrameMeta *) (l_frame->data);
    if (frame_meta->source_id == 0) // Add to video source with id 0
      attach_metadata_full_frame(dsexample, frame_meta); // Add NvDsDisplayMeta to display on screen
  }

My intention is to add text on video source with id 0, but when I run the program with 2 input sources from file, the texts keep jumping between the input videos.

What app are you using? If it your own app, please provide the source codes or how can I reproduce your problem in my side.

Your test app is wrong. The nvdsosd should be downstream of nvdsmultistreamtiler, please refer to deepstream-test3 for the correct pipeline order.