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"