# How can I improve instability of FPS when I use RTSP stream

**URL:** <https://forums.developer.nvidia.com/t/how-can-i-improve-instability-of-fps-when-i-use-rtsp-stream/289521>\
**Category:** DeepStream SDK\
**Created:** [April 13, 2024, 2:37pm UTC](https://forums.developer.nvidia.com/t/how-can-i-improve-instability-of-fps-when-i-use-rtsp-stream/289521 "2024-04-13T14:37:59Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![masaki\_yamagishi](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/masaki_yamagishi/32/234652_2.png) [@masaki\_yamagishi](https://forums.developer.nvidia.com/u/masaki_yamagishi)\
**Post date:** [May 10, 2024, 10:02pm UTC](https://forums.developer.nvidia.com/t/how-can-i-improve-instability-of-fps-when-i-use-rtsp-stream/289521/12 "2024-05-10T22:02:08Z")

</div>

Hi, @fanzh

Thank you for your kindly suggestion.

#1

> please test this simplest configuration file with deepstream-app? it only includes streammux and fakesink.

I tried it and attached output of this.  
[ds\_stuttered.txt](https://forums.developer.nvidia.com/uploads/short-url/hzsFGjCagYPr5eHMm7hpkOvNt2T.txt) (696 Bytes)  
It seems stable.

#2

> 1. if still stutter, please use this [faq](https://forums.developer.nvidia.com/t/deepstream-sdk-faq/80236/12)  
> to check which element will consume too much time.

I set env as below, and measured latencies of frames and each elements.

> export NVDS\_ENABLE\_COMPONENT\_LATENCY\_MEASUREMENT=1  
> export NVDS\_ENABLE\_LATENCY\_MEASUREMENT=1

I used below config file, which was customized from “source1\_usb\_dec\_infer\_resnet\_int8.txt”, and was changed only source0.  
[rtsp\_test.txt](https://forums.developer.nvidia.com/uploads/short-url/2EpguZkAnrsdvpp66tQm5QN3yoN.txt) (3.9 KB)  
The output is below.  
[latency\_log.txt](https://forums.developer.nvidia.com/uploads/short-url/sIlYNrQ9tYNvtauDjiuenBpRWbx.txt) (303.2 KB)  
Then, I organized that output, and made statistics.

 ![latency_diagram](https://global.discourse-cdn.com/nvidia/original/4X/f/4/8/f4896de71555dbf0988d35fa32ed559d9a6b9bbf.png)  
This shows growing of latencies were occurred periodically.

And statistic values of each latencies are below.

- Frame Latency (ms)  
Max: 230.290039  
Min: 7.488037  
Avg: 69.22920974  
Std Dev: 65.64684938
- nvv4l2decoder0  
Max: 0.562012  
Min: 0.177979  
Avg: 0.357970157  
Std Dev: 0.07368124
- nvstreammux-src\_bin\_muxer  
Max: 113.719971  
Min: 0.655029  
Avg: 7.973373157  
Std Dev: 10.99303953
- primary\_gie  
Max: 18.61792  
Min: 2.196045  
Avg: 6.51779423  
Std Dev: 3.571083002
- tiled\_display\_tiler  
Max: 14.291992  
Min: 1.331055  
Avg: 6.101954581  
Std Dev: 2.907566536
- osd\_conv  
Max: 11.875977  
Min: 0.543945  
Avg: 2.78440003  
Std Dev: 1.991351875
- nvosd0  
Max: 18.539062  
Min: 0.00293  
Avg: 0.529278233  
Std Dev: 1.21280866

I wonder if nvstreammux was bottleneck relatively from Std Dev value, but it cannot be sure.  
Do you have any opinion about that?

Best regards,

---

_[View the full topic](https://forums.developer.nvidia.com/t/how-can-i-improve-instability-of-fps-when-i-use-rtsp-stream/289521)._
