Please provide complete information as applicable to your setup.
• Hardware Platform (GPU)
• DeepStream Version 7.0
• TensorRT Version 8.6.1
• NVIDIA GPU Driver Version (535)
When using nvmsgbroker with rtsp source with nvurisrc bin, getting more messages than the expected count. When running for 1 stream, it works fine, but when more no. of sources, the message count sometimes triples than what it should have been originally. This is the piece of code that I’m working with:
py_nvosd_text_params.x_offset = 10
py_nvosd_text_params.y_offset = 12
if ENABLE_KAFKA:
data = json.dumps(data)
_add_custom_meta_to_buffer(data, gst_buffer,frame_meta)
py_nvosd_text_params.font_params.font_name = "Serif"
py_nvosd_text_params.font_params.font_size = 10
py_nvosd_text_params.font_params.font_color.set(1.0, 1.0, 1.0, 1.0)
This is the function:
def _add_custom_meta_to_buffer(meta_str, buf,frame_meta):
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(buf))
user_event_meta = pyds.nvds_acquire_user_meta_from_pool(batch_meta)
msg_meta = pyds.alloc_nvds_event_msg_meta(user_event_meta)
msg_meta = pyds.NvDsEventMsgMeta.cast(msg_meta)
msg_meta.type = pyds.NvDsEventType.NVDS_EVENT_ENTRY
msg_meta.objType = pyds.NvDsObjectType.NVDS_OBJECT_TYPE_PERSON
obj = pyds.alloc_nvds_person_object()
obj = pyds.NvDsPersonObject.cast(obj)
obj.cap = meta_str
msg_meta.extMsg = obj
msg_meta.extMsgSize = sys.getsizeof(pyds.NvDsPersonObject)
if(user_event_meta):
user_event_meta.user_meta_data = msg_meta
user_event_meta.base_meta.meta_type = pyds.NvDsMetaType.NVDS_EVENT_MSG_META
pyds.nvds_add_user_meta_to_frame(frame_meta, user_event_meta)
else:
Gst.error("Error in attaching event meta to buffer\n")
This is the pipeline:
nvmsgconv.set_property("config", "dstest4_msgconv_config.cfg")
nvmsgconv.set_property("payload-type", 0)
nvmsgbroker.set_property("proto-lib", "/opt/nvidia/deepstream/deepstream/lib/libnvds_kafka_proto.so")
nvmsgbroker.set_property("conn-str", KAFKA_URL.replace(":",";"))
nvmsgbroker.set_property("topic",KAFKA_TOPIC)
nvmsgbroker.set_property("sync", 1)
print("Adding elements to Pipeline \n")
pipeline.add(pgie)
pipeline.add(tracker)
pipeline.add(sgie1)
pipeline.add(sgie2)
pipeline.add(nvanalytics)
pipeline.add(tiler)
pipeline.add(nvvidconv)
pipeline.add(nvosd)
pipeline.add(tee)
pipeline.add(queuemsg1)
pipeline.add(queuemsg2)
pipeline.add(nvmsgconv)
pipeline.add(nvmsgbroker)
if SINK_TYPE=="filesink":
pipeline.add(nvvidconv2)
pipeline.add(capsfilter)
pipeline.add(encoder)
pipeline.add(codeparser)
pipeline.add(container)
pipeline.add(sink)
elif (SINK_TYPE=="fakesink") or (SINK_TYPE=="eglsink"):
pipeline.add(sink)
elif SINK_TYPE=="rtspsink":
pipeline.add(nvvidconv_postosd)
pipeline.add(encoder)
pipeline.add(sink)
print("Linking elements in the Pipeline \n")
streammux.link(pgie)
pgie.link(tracker)
tracker.link(sgie1)
sgie1.link(sgie2)
sgie2.link(nvanalytics)
nvanalytics.link(tiler)
tiler.link(nvvidconv)
nvvidconv.link(nvosd)
nvosd.link(tee)
queuemsg1.link(nvmsgconv)
nvmsgconv.link(nvmsgbroker)
if SINK_TYPE=="filesink":
queuemsg2.link(nvvidconv2)
nvvidconv2.link(capsfilter)
capsfilter.link(encoder)
encoder.link(codeparser)
codeparser.link(container)
container.link(sink)
elif (SINK_TYPE=="fakesink") or (SINK_TYPE=="eglsink"):
queuemsg2.link(sink)
elif SINK_TYPE=="rtspsink":
queuemsg2.link(nvvidconv_postosd)
nvvidconv_postosd.link(encoder)
encoder.link(sink)
sink_pad=queuemsg1.get_static_pad("sink")
tee_msg_pad=tee.get_request_pad('src_%u')
tee_stream_pad=tee.get_request_pad("src_%u")
if not tee_msg_pad or not tee_stream_pad:
sys.stderr.write("Unable to get request pads\n")
tee_msg_pad.link(sink_pad)
sink_pad=queuemsg2.get_static_pad("sink")
tee_stream_pad.link(sink_pad)
# create an event loop and feed gstreamer bus mesages to it
loop = GLib.MainLoop()
bus = pipeline.get_bus()
bus.add_signal_watch()
bus.connect ("message", bus_call, loop)
nvanalytics_src_pad=nvanalytics.get_static_pad("src")
if not nvanalytics_src_pad:
sys.stderr.write(" Unable to get src pad \n")
else:
nvanalytics_src_pad.add_probe(Gst.PadProbeType.BUFFER, nvanalytics_src_pad_buffer_probe, 0)
GLib.timeout_add(PERF_INTERVAL, perf_data.perf_print_callback)
This is the msgconv_config:
[sensor0]
enable=1
type=Camera
[place0]
enable=1
id=1
[analytics0]
enable=1
id=XYZ
What could be reason for this?
Cause when running with 1, 10fps rtsp source, I get a total of 600 messages in a minute. But when running 4, 10fps rtsp sources, I get close to 7000 messages in a minute.
This seems to work file when working with file source.