# High CPU usage when extracting I-frames from an RTSP stream

**URL:** <https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034>\
**Category:** General\
**Created:** [16 June 2022 21:33 UTC](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034 "2022-06-16T21:33:32Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [27 June 2022 15:21 UTC](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034/21 "2022-06-27T15:21:12Z")

</div>

> [@krambriw](#):
>
> One additional observation when using "-vsync", "0" or "-r", "1" is that the latter one gives many more messages at the output of the ffmpeg-spawn node

Yes indeed that was something that I also didn't understand in the beginning. But in one of the above posts I have tried to [explain](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034/8) why that happens.

> [@krambriw](#):
>
> Maybe fps\_mode is as good as vsync?

If I understood correctly fps\_mode is the successor of vsync. The vsync is obsolete and will be removed in the future. In the ffmpeg [docs](https://ffmpeg.org/ffmpeg.html) you can see that you can even pass the old vsync _ **numeric values** _ to the new fps\_mode parameter if you like:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/e/de37a339c2e9a4504e394d8402123a39350986e9.png)

But you can also pass the new _ **string values** _ ('passthrough', 'cf', 'vfr', ...) to the new fps\_mode parameter... They should offer the same behaviour.

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [27 June 2022 15:23 UTC](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034/22 "2022-06-27T15:23:38Z")

</div>

> [@BartButenaers](#):
>
> They should offer the same behaviour

Yes, but since you have it working, maybe you can check when you find time(slot)?  
😉

And BTW, it seems the same image is sent multiple times when using r option

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [27 June 2022 15:27 UTC](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034/23 "2022-06-27T15:27:02Z")

</div>

> [@BartButenaers](#):
>
> I have tried to [explain](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034/8) why that happens

Oh yes, I see now, it is copying the same by design. So means if you just want one sngle copy, use vsync (or maybe fps\_mode)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 August 2022 15:27 UTC](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034/24 "2022-08-26T15:27:27Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/high-cpu-usage-when-extracting-i-frames-from-an-rtsp-stream/64034.md?page=1)
