<p>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 <code>CPU E3-1240 v5</code> <code>OpenVZ</code> 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 :-</p>

<pre><code>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 
</code></pre>

<p>Current I use <code>-preset slow</code> to improve image quality little bit CPU usage <code>60%</code> even with <code>preset fast</code> CPU usage were <code>47%</code> -preset veryfast CPU-usage <code>35%</code></p>

CC BY-SA 4.0
2019-01-29T19:15:51.577Z
What's wrong with the faster presets?
Gyan
CC BY-SA 4.0
2019-01-29T22:04:43.443Z
it's peak the CPU usage sometime goes up `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 using `crf` method with value of  `35`
Salem F
CC BY-SA 4.0
2019-01-30T17:06:34.933Z
There is no way to use less CPU without reducing quality. If there was, that setting would be turned on by default.
SlimSCSI
CC BY-SA 4.0
2019-01-30T18:23:30.403Z
I'm using low pic size `720x406` 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
CC BY-SA 4.0
2019-01-30T20:05:09.180Z
Alright I found out what's was peak CPU usage `-profile:v high444` once I remove it the cpu usage drooped dramatically to less  then `30%`
Salem F
<ffmpeg><h.264><rtmp>
Reduce CPU usage when downscaling HD>SD>Low on the same codec (H264)
Salem F
# Reduce CPU usage when downscaling HD>SD>Low on the same codec (H264)

(Asked by: username_0 on 2019-01-29)

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%

**Tags:** ffmpeg, h.264, rtmp

> **Comments:**
> **username_1**: What's wrong with the faster presets?  
> **username_0**: it's peak the CPU usage sometime goes up `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 using `crf` method with value of  `35`  
> **username_2**: There is no way to use less CPU without reducing quality. If there was, that setting would be turned on by default.  
> **username_0**: I'm using low pic size `720x406` 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 .  
> **username_0**: Alright I found out what's was peak CPU usage `-profile:v high444` once I remove it the cpu usage drooped dramatically to less  then `30%`  

---

## 0 answers

