Display FPS in title bar or overlay onto the output window image

Please provide complete information as applicable to your setup.

**• Hardware Platform Jetson Orin AGX
**• DeepStream Version 6.2
**• JetPack Version 5.1.1
**• TensorRT Version8.52.2
**• NVIDIA GPU Driver Version (valid for GPU only)
**• Issue Type( questions, new requirements, bugs) question
**• How to reproduce the issue ?
I am newcomer to deepstream, and am an engineer but not a computer science expert. I have installed deepstream, and have become comfortable with the provided deepstream-app sample, and the various examples in the sources and samples folders that come with the deepstream installation. I am comfortable editing the configuration files to set the various options.

I am now trying to go the next step to customize my configurations. Specifically, I would like to be able to measure and overlay the overall frames per second the system is achieving on the title bar of the output window, or as an overlay of the output window. I can see various of the sample apps will print the fps to the terminal window, but I am struggling to see how to get the fps to show on title bar of window, or as an overlay to the output window.

Could you provide a starting point for a strategy of how I would do this type of customization? What files would I need to edit to get this configuration.

Again, I am a new learner, and need guidance.
Paul McWhorter

You can refer to our open source code:osd_sink_pad_buffer_probe in sources\apps\sample_apps\deepstream-test1\deepstream_test1_app.c. You can add anything on the output window with display_meta.

Your reply is helpful, and allows me to see that to do what I want, I will have to edit the underlying app program. Since I dont know c, I will need to move over to the python programs and proceed from there. Thank you for your help.

We have python demo too. You can refer to the link below:

Yes, I have been studying the sample program. I am having trouble understanding what part of the program actually represents the grab frame/show frame loop. Consider FPS as:

. . .some code

FPS=1/(endTime - startTime)

Where in the sample code would I put this measurement sequence to understand what rate the program is grabbing and displaying frames? I am having trouble understanding the program flow in the sample code.
Thank you,
Paul McWhorter

We already have the fps calculations. Please refer to the code below: perf_data

Thank you for your help. I am trying to run deepstream_test_3.py to understand how the perf_data command works. I try and start the program with the command:

sudo python3 deepstream_test_3.py -i file:sample_720p.mp4

where sample_720p.mp4 is in the same directory as the program deepstream_test_3.py

I get the error:

Error: gst-resource-error-quark: Could not open resource for reading. (5): gstgiosrc.c(334): gst_gio_src_get_stream (): /GstPipeline:pipeline0/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstGioSrc:source:
Could not open location file:sample_720p.mp4 for reading: Operation not supported
Exiting app

I have had success running the other python demo programs in the deepstream_python_apps director, but am having trouble running test3

Could you try to use sudo python3 deepstream_test_3.py -i file://sample_720p.mp4?

Thank you for the help. I am in the directory:


to simplify file path names, I copied the sample video sources to the above directory

the contents of the directory are:
sample_ride_bike.mov yoga.jpg
config_triton_grpc_infer_primary_peoplenet.txt fisheye_dist.mp4 sample_720p.h264

in this directory, I execute the command:
sudo python3 deepstream_test_3.py -i file:///sample_720p.mp4

and I get the error:

Decodebin child added: source

Decodebin child added: decodebin0

Error: gst-resource-error-quark: Resource not found. (3): gstfilesrc.c(532): gst_file_src_start (): /GstPipeline:pipeline0/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstFileSrc:source:
No such file “/sample_720p.mp4”
Exiting app

You should add file:// before your video path.

I appreciate your help, and have been able to run the deepstream_test_3.py program. I can see that it periodically prints fps. Thank you for your help

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