[FFmpeg-user] ffmpeg cpu loading

Reindl Harald h.reindl at thelounge.net
Fri Nov 12 17:05:19 EET 2021



Am 12.11.21 um 16:01 schrieb LianCheng:
> Hi,
> 
> I tried to run several ffmpeg processes with different input mp4 files and
> to different outputs within my PC (having Intel Core i7). The mp4 video
> resolution is full HD format.
> 
> ffmpeg -re -stream_loop -1 -i 1.mp4 -c:v libx264 -preset ultrafast -tune
> zerolatency -maxrate 2M -bufsize 2M -r 20 -g 60 -an -c:a copy -f rtsp
> rtsp://<ip_addr>:1935/cam-1
> ffmpeg -re -stream_loop -1 -i 2.mp4 -c:v libx264 -preset ultrafast -tune
> zerolatency -maxrate 2M -bufsize 2M -r 20 -g 60 -an -c:a copy -f rtsp
> rtsp://<ip_addr>:1935/cam-2
> ffmpeg -re -stream_loop -1 -i 3.mp4 -c:v libx264 -preset ultrafast -tune
> zerolatency -maxrate 2M -bufsize 2M -r 20 -g 60 -an -c:a copy -f rtsp
> rtsp://<ip_addr>:1935/cam-3
>    :
>    :
> ffmpeg -re -stream_loop -1 -i N.mp4 -c:v libx264 -preset ultrafast -tune
> zerolatency -maxrate 2M -bufsize 2M -r 20 -g 60 -an -c:a copy -f rtsp
> rtsp://<ip_addr>:1935/cam-N
> 
> If I run 6 of the above ffmpeg processes, the CPU hits 100%.

why?

your CPU is there to work and not to idle, for concurrency set process 
priorities for important ones or niceness for low priority

> Are the parameters used optimized? I need to keep the CPU below 80%.
> 
> Will having GPU (like nvidia)  help to increase the number of ffmpeg
> processes that can be run?

maybe but quality is AFAIK worser


More information about the ffmpeg-user mailing list