Latency Measurement for nvmsgconv and nvmsgbroker Not Displayed in DeepStream Test 4

Hardware Platform: GPU Nvidia L4
DeepStream Version: 7.1
TensorRT Version: Docker
Issue Type: Question / New Requirement

How to reproduce the issue?
I am using the deepstream-test4 Python sample application to measure the latency of various components in the DeepStream pipeline. I have enabled latency measurement by setting the following environment variables:

export NVDS_ENABLE_LATENCY_MEASUREMENT=1

export NVDS_ENABLE_COMPONENT_LATENCY_MEASUREMENT=1

I also added probes to the sink pads of nvmsgconv and nvmsgbroker to capture their latency using the pyds.nvds_measure_buffer_latency() function. However, while I can see latency measurements for other components like nvv4l2-decoder, nvstreammux, and primary-inference, there is no latency information displayed for nvmsgconv and nvmsgbroker.

Here is an example of the output I am getting:

************BATCH-NUM = 1440**************

Source id = 0 Frame_num = 1440 Frame latency = 1.7441e+12 (ms)

Comp name = nvv4l2-decoder in_system_timestamp = 1744096968090.020996 out_system_timestamp = 1744096968138.118896 component latency= 48.097900

Comp name = nvstreammux-Stream-muxer source_id = 0 pad_index = 0 frame_num = 1441 in_system_timestamp = 1744096968138.142090 out_system_timestamp = 1744096968139.289062 component_latency = 1.146973

Comp name = primary-inference in_system_timestamp = 1744096968139.295898 out_system_timestamp = 1744096968141.241943 component latency= 1.946045

Comp name = onscreendisplay in_system_timestamp = 1744096968141.457031 out_system_timestamp = 1744096968141.466064 component latency= 0.009033

Despite adding probes for nvmsgconv and nvmsgbroker, their latency is not being displayed in the logs.

Requirement details:
I would like to measure and display the latency for nvmsgconv and nvmsgbroker in the same way as other components. Is there a specific configuration or additional step required to enable latency measurement for these components? Or are these components not supported for latency measurement in the current DeepStream version?

I have a setup that should send an event per frame to a Kafka broker. When I increase the number of RTSP input streams (15 RTSP input streams at 15 fps), the OSD output is synchronized with the inputs and there doesn’t seem to be any latency, but I receive fewer events than expected. Is it advisable to send one event per frame? This is why I’m trying to identify the source of the issue in this manner…

Any guidance or suggestions would be greatly appreciated. Thank you!

1 Like
  1. About “but I receive fewer events than expected”, what events do you want to receive?
  2. Currently, nvds_measure_buffer_latency does not measure latency in nvmsgconv and nvmsgbroker because nvds_set_input_system_timestamp and nvds_set_output_system_timestamp are not called in these two plugins. but the two plugins are opensource. you can modify nvmsgconv plugin by referring to the calling in nvinfer plugin. especially please rebuld and replace the library after modifying the code.
  3. nvmsgbroker is the last element in the pipeline, you can add log in gst_nvmsgbroker_render to measure the latency.
  1. 15 fps x 9 streams so I expect 15 x 9 events per second.
  2. And 3. Could you detail a bit more how to achieve this please?

Thank you!

1.nvmsgconv plugiin is opensource. you can use nvds_set_input_system_timestamp to save the entering timestamp of the Gstbuffer, and use nvds_set_output_system_timestamp to save the leaving timestamp of the Gstbuffer. nvds_measure_buffer_latency will caculate the latency with the two timestamps. nvinfer plugin is opensource. please refer to the funtion calling in nvinfer.
2. 1. nvmsgbroker is the last element in the pipeline, you can add log in gst_nvmsgbroker_render to save the entering and leaving time, then cacalute the latency.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.