Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: tnt on May 11, 2020, 07:51:20 PM

Title: [SOLVED] defining number of threads for "cli"
Post by: tnt on May 11, 2020, 07:51:20 PM
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.
Title: Re: defining number of threads for "cli"
Post by: eumagga0x2a on May 11, 2020, 08:32:03 PM
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.
Title: Re: defining number of threads for "cli"
Post by: tnt on May 11, 2020, 09:01:32 PM
so even x264 encoding cannot be limited to 3 of 4 available cores?
Title: Re: defining number of threads for "cli"
Post by: eumagga0x2a on May 11, 2020, 09:20:08 PM
No, it can't. I didn't look into details why controls are disabled, however.
Title: Re: defining number of threads for "cli"
Post by: tnt on May 11, 2020, 09:27:53 PM
well, I have solved this on the system level:

taskset --cpu-list 0-2

worked for me @linux

thx.
Title: Re: [SOLVED] defining number of threads for "cli"
Post by: eumagga0x2a on May 11, 2020, 09:36:20 PM
If I am not mistaken, multithreading and CPU affinity are different things.
Title: Re: [SOLVED] defining number of threads for "cli"
Post by: tnt on May 11, 2020, 09:40:44 PM
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.