User Tools

Site Tools


using:multithreading

Multithreading

Simply put, multithreading is splitting a computer process over multiple threads. If you happen to have several CPUs, the threads can then run in parallel, cutting down the processing time needed.

In the case of many modern computer chips, they can have multiple internal cores, meaning they are in fact many CPUs in one chip. Avidemux supports various degrees of multithreading.

Multithreading availability

While Avidemux has some multithreading capabilities, Avidemux itself, the GUI, the scripting engine, and various packing & unpacking, muxing & demuxing utilities are not multithreaded. However, this is not a real issue. The work that Avidemux itself does it quite minor, and the real work is done by the various codecs that are used, such as as the libavcodec codecs, Xvid, and x264. The encoder part in most cases is at least 60(nbsp)% of total the processing time.

Certain codecs have multithreading capabilities. The following are multithreaded codecs within Avidemux:

Encoding

  • x264
  • libavcodec MPEG-1/MPEG-2
  • libavcodec MPEG-4
  • Xvid

Decoding

  • libavcodec MPEG-1/MPEG-2
  • libavcodec MPEG-4

Enabling multithreading

Multithreading can be enabled only in the latest version of Avidemux (>=2.2 or SVN). You can get that using the Compiling Avidemux guide. After you have the appropriate version, start Avidemux. Then going to the menu “Edit→Preferences” and under the tab called “MultiThread” you can select the number of cores/CPUs to thread your program over.

Available values:

  • 0: Disable multithreading - simply allow the operating system to handle the juggling of the CPU power and time.
  • 1: This is the same as disabled. It will reset itself to 0.
  • 2: Useful for two CPUs or with “Dual-Core” chips.
  • 3: Useful for three CPUs or double “Dual-Core” chips.
  • 4: Useful for four CPUs or with two “Dual-Core” chips or with “Quad-Cores” chips.

By default, multithreading is disabled (set to 0). Users do not have to use multithreading, and it can be turned on or off at any time.

A word on performance

Avidemux is not overly aggressive with CPU usage, so you should not notice severe system lag. Certain codecs are multithreaded better than others. Regardless, you may notice good or poor multithread performance with some codecs as opposed to others. This has to do with just how those codecs themselves are multithreaded. Users should keep in mind much of the performance they see has do with the codec itself, not with Avidemux.

Most notably, users have described mixed results with Xvid multithreading. Specifically on two chips or cores, people have reported Xvid performance while being properly multithreaded over the two CPUs, producing equal speeds to being on a single CPU.

On the other hand, users have reported better performance with x264 multithreading performance. This just shows that the multithreading performance it based entirely on the codecs themselves.

Why are only certain codecs multithreaded?

The Avidemux programmer(s) did not write any of the codecs that Avidemux can use. They are not responsible for the development of any codecs, nor would they try to alter them.

Multithreading of codecs is the responsilibity of codec developers. Most of the codecs that have option to be used in multithread mode have been enabled for multithreading within Avidemux.

If you want a certain codec of choice to be multithreaded, please feel free to contact the respective creators and maintainers of that codec to make requests to them. If you notice that a codec has been made multithreaded that has not been made multithreaded within Avidemux, please inform the Avidemux people about it. You can contact them at the Avidemux forums.

using/multithreading.txt · Last modified: 2012/11/11 08:51 (external edit)