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.
Thanks,
Paul McWhorter
toptechboy.com

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.
Paul

We have python demo too. You can refer to the link below:
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/blob/master/apps/deepstream-test1/deepstream_test_1.py#L37

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:

startTime=time.time()
. . .some code
endTime=time.time()

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
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/blob/master/apps/deepstream-test3/deepstream_test_3.py#L203

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:

/opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/deepstream-test3

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

the contents of the directory are:
config_infer_primary_peoplenet.txt
deepstream_test_3.py
sample_1080p_h264.mp4
sample_720p_mjpeg.mp4
sample_industrial.jpg
sample_qHD.mp4
sonyc_mixed_audio.wav
config.pbtxt
dstest3_pgie_config.txt
sample_1080p_h265.mp4
sample_720p.mp4
sample_office.mp4
sample_ride_bike.mov yoga.jpg
config_triton_grpc_infer_primary_peoplenet.txt fisheye_dist.mp4 sample_720p.h264
sample_cam6.mp4
sample_push.mov
sample_run.mov
yoga.mp4
config_triton_infer_primary_peoplenet.txt
README
sample_720p.jpg
sample_cans_jpg.tbz2
sample_qHD.h264
sample_walk.mov

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.