Is there any way to display FPS data via OSD?

I use python app. There is a function :“def osd_sink_pad_buffer_probe(pad,info,u_data)” used to display object detection results. How could I modify this function to add FPS to the display?

• Hardware Platform (Jetson / GPU) Titan V
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only)
• TensorRT Version 7.0.11
• NVIDIA GPU Driver Version (valid for GPU only) 410.33

Hi,
You want to overlay FPS value onto screen, correct?

@amycao Thanks for the reply. And, yes, I want to overlay the fps value onto the video via OSD. Like, adding an extra FPS in the code below:

        py_nvosd_text_params.display_text = "Frame Number={} Number of Objects={} Vehicle_count={} Person_count={}". \
    format(frame_number, num_rects, obj_counter[PGIE_CLASS_ID_VEHICLE], obj_counter[PGIE_CLASS_ID_PERSON])

But I do not know if there is any function or package to fulfill this purpose. Thanks.

You may refer to deepstream-imagedata-multistream python sample, for how to get fps, get fps function defined in common module, python/apps/common/
then insert the value got into the code
py_nvosd_text_params.display_text = “Frame Number={} Number of Objects={} Vehicle_count={} Person_count={}”.
format(frame_number, num_rects, obj_counter[PGIE_CLASS_ID_VEHICLE], obj_counter[PGIE_CLASS_ID_PERSON])

@amycao. I have explored the multimedia app you suggested. The code is like this:

   # Get frame rate through this probe
   fps_streams["stream{0}".format(frame_meta.pad_index)].get_fps()

So, I need to modify and insert it as:

fps_stream=GETFPS(0)    
FPS = fps_stream.get_fps() #I have only one source stream, indexed as 0.
py_nvosd_text_params.display_text = “Frame Number={} Number of Objects={} Vehicle_count={} Person_count={} FPS={}”.
    format(frame_number, num_rects, obj_counter[PGIE_CLASS_ID_VEHICLE], obj_counter[PGIE_CLASS_ID_PERSON], FPS)

Is it correct?

Seems correct.