Ffmpeg eats all the memory and crash within a minute - recording or streaming

I recommend people here to read my comment on github:

TL;DR, it seems like your ffmpeg is not capable to stream at 1x, and then keep the delay in memory until crashing.

That’s not the solution though. This is a hardware issue. If your CPU (also depends on the type) can’t handle the load, ffmpeg starts eating into your memory till it crashes.

I think that I’m saying the same, but well…
I just said that either your cpu can manage to encode at a 1x speed, and then you don’t have problems, or it is not able to follow the real time, your encoding speed is less than 1, and delay accumulate in your memory until there is no more memory and it crashes.

Thanks for the advice. Updating ffmpeg did help significantly more than any other suggestions I found here, however it seems to delay the crash for my case.
How many cores did you use @4L3XK ?

True! using real hardware 4 Core 6 Thread CPU doesn’t eat memory and cpu. Was using DO droplet 8vCPU 16/32GB RAM it still used to crash in 15-20 Minutes of initiating.

Using real hardware is a workaround, not the solution to the original issue. Any capable VM should be able to manage the encoding at 1X. On my side I tried a static build of 4.4 from https://johnvansickle.com/ffmpeg/; replacing the binary in the running container (because I leverage https://github.com/jitsi/docker-jitsi-meet), and it didn’t improved the situation.

How is it a workaround when it’s something ffmpeg depends on? The fact is vCPU doesn’t have the same muscle as real CPU and when you have a CPU-intensive entity like FFmpeg, that distinction is key. There are indeed some VMs that are more capable than others, but saying the hardware type is not the solution is erroneous.