# How to run control fps of different streams processed when running deepstream-app?

**URL:** <https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468>\
**Category:** DeepStream SDK\
**Created:** [January 15, 2020, 8:15am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468 "2020-01-15T08:15:36Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [January 15, 2020, 8:15am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/1 "2020-01-15T08:15:36Z")

</div>

I am currently using deepstream-test2 app with multiple input sources. We are currently dealing with a situation where we require only one of the stream and the other streams at a low fps since the objects in the stream don’t move that often. Ideally we want to a lot of frames on the other sources and we need it to run real-time on only one of the source. Is there a possiblity of dropping frames on the other sources so that we could add another stream to process with the app?  
When running on longer duration we observed that there was a lag getting generated on all the sources. Hence wanted to drop frames from other sources without losing on detections. Any idea as to how to achieve this?

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [January 15, 2020, 8:48am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/2 "2020-01-15T08:48:21Z")

</div>

1. Drop frame in nvinfer according to source id.

Refer to nvinfer-\>interval, which skip batch, you can change it to skip according to source id.  
gst\_nvinfer\_process\_full\_frame()

```auto
/* Process batch only when interval_counter is 0. */
  skip_batch = (nvinfer->interval_counter++ % (nvinfer->interval + 1) > 0);

  if (skip_batch) {
    return GST_FLOW_OK;
  }

```

nvinfer source id is got in gst\_nvinfer\_sink\_event()

1. Drop frames in decoder.  
[https://devtalk.nvidia.com/default/topic/1061492/deepstream-sdk/deepstream-sdk-faq/](https://devtalk.nvidia.com/default/topic/1061492/deepstream-sdk/deepstream-sdk-faq/) → 9. How can we set “drop-frame-interval” more than 30 ?

---

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [January 15, 2020, 10:50am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/3 "2020-01-15T10:50:56Z")

</div>

@ChrisDing there’s another question unrelated to this. But on the nano when we run 4 streams we see the delay and frames are getting skipped. But on a video on youtube it’s running smooth for all 8 streams. I am not entirely sure as to why this is happening. We were running deepstream-test3-app to test with multiple sources.

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [January 16, 2020, 4:05am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/4 "2020-01-16T04:05:16Z")

</div>

What do you change for test3 ?  
Did you try  
$ deepstream-app -c source8\_1080p\_dec\_infer-resnet\_tracker\_tiled\_display\_fp16\_nano.txt

---

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [January 16, 2020, 7:01am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/5 "2020-01-16T07:01:39Z")

</div>

@ChrisDing yes I tried both ways of running the test-3 app one is directly passing all the input sources as parameters to deepstream-test-3 app. And the other way was to run the deepstream-app using the config file. Both resulted in the same issue. Where we saw a huge lag in all the streams

---

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [January 17, 2020, 5:40am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/6 "2020-01-17T05:40:31Z")

</div>

Oh ok. So the config file has only object detection on 8 streams running concurrently. But the problem occurs when we run the deepstream-test3-app on the nano, since it has an object detector and 3 classifiers. So I guess this was causing the issue of the lag. I’m guessing the nano was unable to handle these many models simultaneously.

---

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [January 17, 2020, 7:04am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/7 "2020-01-17T07:04:06Z")

</div>

@ChrisDing could you explain as to where to make the change for the 1st solution which you shared. And the second solution is dropping frames at the decoder using drop-frame-interval. How can I do the change per source? Could you please brief a bit more on it

---

<div class="post-metadata">

**Author:** ![ChrisDing](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/chrisding/32/14043_2.png) [@ChrisDing](https://forums.developer.nvidia.com/u/ChrisDing)\
**Post date:** [January 19, 2020, 2:17am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/8 "2020-01-19T02:17:08Z")

</div>

1st solution may have other issues. You can try 2nd solution.

---

<div class="post-metadata">

**Author:** ![beefshepherd](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@beefshepherd](https://forums.developer.nvidia.com/u/beefshepherd)\
**Post date:** [January 20, 2020, 5:53am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/9 "2020-01-20T05:53:51Z")

</div>

@ChrisDing, I did give the second solution a try and it worked out fine for two streams. But the moment I have more than two streams, it never works. I get the following warning,

```auto
WARNING from element nvvideo-renderer: A lot of buffers are being dropped.
Warning: A lot of buffers are being dropped.
WARNING from element nvvideo-renderer: A lot of buffers are being dropped.
Warning: A lot of buffers are being dropped.

```

I ran it with 3 streams when I got that warning and see the display getting stuck.  
The same when I run on the rtsp stream I see the display getting stuck for two streams itself.  
I’m guessing it’s on the sink. Any idea as to how to fix it?

Thanks.

---

<div class="post-metadata">

**Author:** ![kayccc](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kayccc/32/14043_2.png) [@kayccc](https://forums.developer.nvidia.com/u/kayccc)\
**Post date:** [February 4, 2020, 3:07am UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/10 "2020-02-04T03:07:00Z")

</div>

> [@](#):
>
> @ChrisDing, I did give the second solution a try and it worked out fine for two streams. But the moment I have more than two streams, it never works. I get the following warning,
> 
> ```auto
> WARNING from element nvvideo-renderer: A lot of buffers are being dropped.
> Warning: A lot of buffers are being dropped.
> WARNING from element nvvideo-renderer: A lot of buffers are being dropped.
> Warning: A lot of buffers are being dropped.
> 
> ```
> 
> I ran it with 3 streams when I got that warning and see the display getting stuck.  
> The same when I run on the rtsp stream I see the display getting stuck for two streams itself.  
> I’m guessing it’s on the sink. Any idea as to how to fix it?
> 
> Thanks.

Following up at [https://devtalk.nvidia.com/default/topic/1070027/drop-frame-interval-on-rtsp-stream-causes-the-stream-to-get-stuck-/](https://devtalk.nvidia.com/default/topic/1070027/drop-frame-interval-on-rtsp-stream-causes-the-stream-to-get-stuck-/)

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:18pm UTC](https://forums.developer.nvidia.com/t/how-to-run-control-fps-of-different-streams-processed-when-running-deepstream-app/110468/11 "2021-10-12T16:18:32Z")

</div>


