already i set batch-size =2 to nvstreammux
and i got the ‘source_id’ of ‘frame_meta’ at your suggestion
and i tested to gstnvinfer, but this looks strange when after inference
- source_id seems to correct in gst_nvinfer_process_full_frame
code
GstNvInferFrame frame;
frame.converted_frame_ptr = memory->frame_memory_ptrs[idx];
frame.scale_ratio_x = scale_ratio_x;
frame.scale_ratio_y = scale_ratio_y;
frame.obj_meta = nullptr;
frame.frame_meta = nvds_get_nth_frame_meta (batch_meta->frame_meta_list, i);
frame.frame_num = frame.frame_meta->frame_num;
frame.batch_index = i;
frame.input_surf_params = in_surf->surfaceList + i;
g_print("before infer frame source_id %d var i = %d\n",frame.frame_meta->source_id, i);
output =
before infer frame source_id 0 var i = 1
before infer frame source_id 1 var i = 0
before infer frame source_id 0 var i = 1
before infer frame source_id 1 var i = 0
- source_id same to “1.” in gst_nvinfer_input_queue_loop
code
for (i = 0; i < batch->frames.size (); i++) {
input_frames.push_back (batch->frames[i].converted_frame_ptr);
g_print("input loop source_id = %d var i = %d\n", batch->frames[i].frame_meta->source_id, i);
}
...
output =
before infer frame source_id 1 var i = 0
before infer frame source_id 0 var i = 1
input loop source_id = 1 var i = 0
input loop source_id = 0 var i = 1
before infer frame source_id 1 var i = 0
before infer frame source_id 0 var i = 1
input loop source_id = 1 var i = 0
input loop source_id = 0 var i = 1
- source_id seems to incorrect when after inference in gst_nvinfer_output_loop
code
for (guint i = 0; i < batch->frames.size (); i++) {
GstNvInferFrame & frame = batch->frames[i];
NvDsInferFrameOutput &frame_output = batch_output->frames[i];
auto obj_history = frame.history.lock ();
/* If we have an object's history and the buffer PTS is same as last
* inferred PTS mark the object as not being inferred. This check could be
* useful if object is inferred multiple times before completion of an
* existing inference. */
if (obj_history != nullptr) {
if (obj_history->last_inferred_frame_num == frame.frame_num)
obj_history->under_inference = FALSE;
}
guint id = frame.frame_meta->source_id;
g_print("output source_id %d var i = %d\n", id, i);
.....
output =
before infer frame source_id 1 var i = 0
before infer frame source_id 0 var i = 1
input loop source_id = 1 var i = 0
input loop source_id = 0 var i = 1
output source_id 0 var i = 0 < incorrect
output source_id -738111664 var i = 1 <incorrect
before infer frame source_id 1 var i = 0
before infer frame source_id 0 var i = 1
input loop source_id = 1 var i = 0
input loop source_id = 0 var i = 1
output source_id 0 var i = 0 < incorrect
output source_id 0 var i = 1 < maybe incorrect
I think there is a problem during the inference. Where can I get the information?
temporarily, I hypothesized that the frame order after inference is the same as the frame order at the time of entry.
So I’m processing the process by buffering the “source_id” at point “2.”