Re: [FFmpeg-user] ffmpeg cpu loading
On Fri, 12 Nov 2021 at 18:01, LianCheng wrote: > 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://: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://: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://: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://:1935/cam-N > > If I run 6 of the above ffmpeg processes, the CPU hits 100%. > > 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? > > Hello there, You could try to reduce threads (set via threads -n, where n is lower than the number of total CPUs on your system). I'd typically recommend a thread setting of no more than 4, especially for hardware-based encoders such as Intel's QSV & VAAPI, and NVIDIA's NVENC. A GPU-based encoder wrapper (depending on the platform you're on and the implementation in use) *can* somewhat overcome that limitation, with caveats: 1. NVIDIA's NVENC consumer GPUs are limited to 2 encode sessions per GPU. This can be somewhat overcome with Keylase's patcher, see https://github.com/keylase/nvidia-patch 2. Only very specific codecs (and codec features) may be supported by the hardware-accelerated encoder wrapper in use, and as such, outpuit may not always be directly comparable to a software-based implementation. Please see FFmpeg's HWAccel wiki on the same: https://trac.ffmpeg.org/wiki/HWAccelIntro Warm regards, Dennis. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] ffmpeg cpu loading
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://: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://: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://: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://: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 ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] ffmpeg cpu loading
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://: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://: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://: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://:1935/cam-N If I run 6 of the above ffmpeg processes, the CPU hits 100%. 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? ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".