[FFmpeg-user] Memory leakage in ffmpeg

Dennis Mungai dmngaie at gmail.com
Mon Mar 9 14:00:33 EET 2020

On Mon, 9 Mar 2020 at 14:04, karthik <karthikdas81 at gmail.com> wrote:
> hi ,
>     Am planning to play 50 streams with scaling option 1080p,720p,576p,480p.
>     Is below hardware specs is compatible ??
>   Or need I also upgrade or ready to update
>     Are there any benchmarks?
>    CPU
>           product: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
>          RAM -32 gb

Did you mean *encode* 50 streams at once using the template above,
which has the scale filter(s) outputting at these resolutions on that

Sure, you can. However:

(a). Your encoding speed will not be anywhere near real time. The
software-based scale filter *can* be somewhat slow even on fast CPUs.
Concurrent transcodes will make this even worse.
Where possible, use a hardware-based scaling filter, such as these
availed by vaapi (scale_vaapi) or even Vulkan (scale_vulkan) *if* the
onboard GPU on that processor there is enabled.
Then perhaps you can fall back to software-based transcoding or a
mixture of hardware based transcoding with either QuickSync or VAAPI,
both of which are supported on your hardware.

(b). RAM: 32 GB of RAM with ~50+ transcodes won't cut it, especially
with complex filter chains, be it on hardware or on software-based
encoding and filtering.

For a perspective: Using QuickSync and VAAPI to encode VOD according
to the Apple HLS encoding ladder, shown here:
specifically for H.264/AVC will yield at most 8 concurrent streams at
real time, targeting 30 fps per encode variant. For HEVC, at most 6.
And that is with CoffeeLake GT2 Integrated Graphics and above. The
iris lineup on some Xeons and the Intel NUC performs far better.

NVENC, depending on the specific GPUs in use, should be a far superior
option. This right here is the wild west, so due diligence and
research is needed before you settle on a card based on your budget,

>    How I have to reduce the thread count in ffmpeg ??

Before input, and at the input, use -threads 2.

More information about the ffmpeg-user mailing list