I'm using ffmpeg over 3 years now mainly I'm doing live broadcasting on my site , currently I'm preparing to do 5 livebroadcast on the same time using my VPS server CPU E3-1240 v5
OpenVZ
Since I'm only allowed to use 1 vCore CPU usage jumps high very fast . What I ask , I know H264 algorithm based on calculation of previous frame (ref frame) and I frame So I tried -copyinkf and -break_non_keyframes 1 with no effect on the speed BTW here is my main broadcast command :-
ffmpeg -re -i "http://sorce.m3u " -s 720x406 -r 23.976 -vcodec libx264 -profile:v high444 \
-crf 35 -copyinkf - break_non_keyframes 1 -preset slow -acodec libfdk_aac \
-profile:a aac_he_v2 -b:a 8k -map_metadata -1 -f flv rtmp://localhost/hls/live
Current I use -preset slow
to improve image quality little bit CPU usage 60%
even with preset fast
CPU usage were 47%
-preset veryfast CPU-usage 35%
50%
which will kill the tow process , and their is huge quality drop, this setting is the lowest I can get for ~265kbps
broadcast ,,+ I test it without the extra-copyinkf
flags with no different at all , BTW I'm usingcrf
method with value of35
– Salem F Jan 29 '19 at 22:04720x406
with low bitrate , on my laptop cpu its run it fast , but the server VPS limited to 1 vCore so my code above will uses more cpu resources . – Salem F Jan 30 '19 at 18:23-profile:v high444
once I remove it the cpu usage drooped dramatically to less then30%
– Salem F Jan 30 '19 at 20:05