I am going to do homographic mapping inside dsexample plugin using bbox infos.
Now is just testing all plugins interfacing.
I have all necessary requirements inside gstdsexample.h and gstdsexample.cpp
.
Added new
gboolean process_mapping; inside struct _GstDsExample{}
so that I have three processes like
if (dsexample->process_full_frame) {
}else if(dsexample->process_mapping){
}else {
}
inside
static GstFlowReturn
gst_dsexample_transform_ip (GstBaseTransform * btrans, GstBuffer * inbuf)
{}
Then create dsexample inside deepstream_test3.cpp
GstElement *pipeline = NULL, *streammux = NULL, *sink = NULL, *pgie = NULL,
*nvvidconv = NULL, *dsexample = NULL, *nvosd = NULL, *tiler = NULL;
Other necessary processes as follows are also done.
dsexample = gst_element_factory_make ("dsexample", "example-plugin");
if (!pgie || !tiler || !nvvidconv || !dsexample || !nvosd || !sink) {
g_printerr ("One element could not be created. Exiting.\n");
return -1;
}
/* Set properties of the dsexample element */
g_object_set (G_OBJECT (dsexample), "full-frame", FALSE, NULL);
g_object_set (G_OBJECT (dsexample), "blur-objects", FALSE, NULL);
g_object_set (G_OBJECT (dsexample), "process-map-objects", TRUE, NULL);
Finally added into bin
gst_bin_add_many (GST_BIN (pipeline), pgie, tiler, dsexample, nvvidconv, nvosd, transform, sink, NULL);
/* we link the elements together
* nvstreammux → nvinfer → nvtiler → nvvidconv → nvosd → video-renderer */
if (!gst_element_link_many (streammux, pgie, tiler, dsexample, nvvidconv, nvosd, transform, sink, NULL)) {
g_printerr (“Elements could not be linked. Exiting.\n”);
return -1;
}
Currently is I just test probing meta infos.
if (dsexample->process_full_frame) {
}else if(dsexample->process_mapping){
NvDsMetaList * l_obj = NULL;
NvDsObjectMeta *obj_meta = NULL;
for (l_frame = batch_meta->frame_meta_list; l_frame != NULL; l_frame = l_frame->next)
{
NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
guint person_count = 0;
guint num_rects = 0;
for (l_obj = frame_meta->obj_meta_list; l_obj != NULL; l_obj = l_obj->next) {
obj_meta = (NvDsObjectMeta *) (l_obj->data);
if (obj_meta->class_id == PGIE_CLASS_ID_PERSON) {
person_count++;
num_rects++;
//g_print ("Soruce_id left top width height :%d %f %f %f %f\n",frame_meta->source_id, obj_meta->rect_params.left,obj_meta->rect_params.top,obj_meta->rect_params.width,obj_meta->rect_params.height);
}
}
g_print ("Soruce id = %d Frame Number = %d Number of objects = %d Person Count = %d\n", frame_meta->source_id, frame_meta->frame_num, num_rects, person_count);
}
}else {
}
When I run nothing is printed to console, why?
But speed slow down a lot.
Before dsexample is plugged in, I can have 5 fps for 5 video sources.
After plugin added, can achieve only 1-2 fps.
But I just do only meta info prints.
Is my sequence in adding into bin not correct?
Why the speed slow down a lot compared to getting meta infos from tiler_src_pad_buffer_probe
.
All my files modified are attached.
What could be wrong?
deepstream_test3_app.c (17.1 KB)
gstdsexample.cpp (36.3 KB)
gstdsexample.txt (4.1 KB)