How many threads does ffmpeg use by default?
Solution 1:
it depends on codec used, ffmpeg version and your CPU core count. Sometimes it's simply one thread per core. Sometimes it's more complex like:
With libx264 it is cores x 1.5 for frame threads and cores x 1 for slice threads.
Solution 2:
As of 2014, it uses an optimal number.
You can verify this on a multi-core computer by examining CPU load (Linux: top
, Windows: task manager) with different options to ffmpeg:
-threads 0
(optimal);-threads 1
(single-threaded);-threads 2
(2 threads for e.g. an Intel Core 2 Duo);none (the default, also optimal).
2015 edit: on a 12-core CPU, some ffmpeg commands have Linux top
showing at most 200% cpu (only 2 cores), no matter what number is given to -threads
. So the default may still be optimal in the sense of "as good as this ffmpeg binary can get", but not optimal in the sense of "fully exploiting my leet CPU."