[SOLVED] defining number of threads for "cli"

Started by tnt, May 11, 2020, 07:51:20 PM

Previous topic - Next topic

tnt

Hello.

I know that in GUI threads number of threads can be defined (limited) in Edit > Preferences > Threading > Multi-threading,

but is there a command line option to define / limit number of threads while starting "avidemux3_cli" ?

Thx.

eumagga0x2a

Quote from: tnt on May 11, 2020, 07:51:20 PM
I know that in GUI threads number of threads can be defined (limited) in Edit > Preferences > Threading > Multi-threading

No, it can't. This setting is a complete fake at the moment. Multithreaded decoding for libavcodec is always disabled. Multithreading for other libraries is the business of those libraries (partially configurable, especially for some video encoders), there is no central kill swtich.

tnt

so even x264 encoding cannot be limited to 3 of 4 available cores?

eumagga0x2a

No, it can't. I didn't look into details why controls are disabled, however.

tnt

well, I have solved this on the system level:

taskset --cpu-list 0-2

worked for me @linux

thx.

eumagga0x2a

If I am not mistaken, multithreading and CPU affinity are different things.

tnt

Well, in this case multithreading should define the number of encoding threads will be used and spread across CPUs during encoding.
With this specific CPU affinity I provide just 3 cores to avidemux_cli/x264 encoder, so it spawns less threads and at the same time occupies not all cores.