<p>I'm trying to tune out ffmpeg to squeeze as much fps as possible from my server machines with lot of cores.</p>

<p>Sometimes expecially when there's also a scale (eg: shrinking down from 4k to full hd or from 1080p to 720p) not all cores are used. The behaviour is the same if I use -s:v 1280x720 or -filter:v "scale=-1:720"</p>

<p>I would like to have my machines use something as near as 90-98 % instead of the actual 20 % (on a 32 core machine using the threads 0 options make use of 22 cores but the usage is still 20%, same reasoning goes for 64 or 128 cores servers)</p>

<p>I also have a nvidia gpu on some machines that could be used for the resizing process maybe making the things more faster.</p>

<p>What kind of optimization can I think of to seriously burn out FPS?</p>

<p>tl;dr:</p>

<ul>
<li>max out the cpu usage</li>
<li>use gpu if it can help and if it is possible (for example for the scale filter pass, it's just bicubic or linear resize cmon..)</li>
<li>the files must be playable inside the well know h264 profiles like <strong>main - 4.1</strong></li>
</ul>

<p>I'm already using ultrafast and fixed bitrate, my aim is pure encoding speed and not the quality as you can see in my command line:</p>

<pre><code>ffmpeg -y -i "input.mov" -c:v libx264 -preset ultrafast -b:v 3000k -profile:v main -level:v 4.1 -s:v 1280x720 -pix_fmt yuv420p -c:a copy -threads 0 "output.mov"
</code></pre>

CC BY-SA 3.0
2018-02-14T10:35:55.360Z
Do what the platforms do - segment, parallel encode, and rejoin
Gyan
CC BY-SA 3.0
2018-02-14T23:12:05.103Z
@Mulvya that could be an idea. Could you write or link me a good syntax / command line examples to do that ? I think is not something that you should do manually with -ss and -t right? Also because the trim command in ffmpeg under libx264 are not very precise and after the join the result could be terrible and stuttered. Thanks!
user3450548
CC BY-SA 4.0
2020-11-10T10:16:08.083Z
@user3450548, https://stackoverflow.com/questions/35133119/ffmpeg-splitting-large-files This might help you
RecklessSergio
<ffmpeg><transcoding><performance>
Encode or Transcode with ffmpeg and libx264 as fast as possible
user3450548
# Encode or Transcode with ffmpeg and libx264 as fast as possible

(Asked by: username_0 on 2018-02-13)

I'm trying to tune out ffmpeg to squeeze as much fps as possible from my server machines with lot of cores.
Sometimes expecially when there's also a scale (eg: shrinking down from 4k to full hd or from 1080p to 720p) not all cores are used. The behaviour is the same if I use -s:v 1280x720 or -filter:v "scale=-1:720"
I would like to have my machines use something as near as 90-98 % instead of the actual 20 % (on a 32 core machine using the threads 0 options make use of 22 cores but the usage is still 20%, same reasoning goes for 64 or 128 cores servers)
I also have a nvidia gpu on some machines that could be used for the resizing process maybe making the things more faster.
What kind of optimization can I think of to seriously burn out FPS?
tl;dr:

max out the cpu usage
use gpu if it can help and if it is possible (for example for the scale filter pass, it's just bicubic or linear resize cmon..)
the files must be playable inside the well know h264 profiles like main - 4.1

I'm already using ultrafast and fixed bitrate, my aim is pure encoding speed and not the quality as you can see in my command line:
ffmpeg -y -i "input.mov" -c:v libx264 -preset ultrafast -b:v 3000k -profile:v main -level:v 4.1 -s:v 1280x720 -pix_fmt yuv420p -c:a copy -threads 0 "output.mov"

**Tags:** ffmpeg, transcoding, performance

> **Comments:**
> **username_1**: Do what the platforms do - segment, parallel encode, and rejoin  
> **username_0**: @Mulvya that could be an idea. Could you write or link me a good syntax / command line examples to do that ? I think is not something that you should do manually with -ss and -t right? Also because the trim command in ffmpeg under libx264 are not very precise and after the join the result could be terrible and stuttered. Thanks!  
> **username_2**: @username_0, https://stackoverflow.com/questions/35133119/ffmpeg-splitting-large-files This might help you  

---

## 0 answers

