How to know if x264 uses multiple processors Windows

583 views Asked by At

I have Linphone open source application that uses x264 encoder. By default it runs on one thread:

x264_param_t *params= ..... 
params->i_threads=1;

I added ability to use all processors:

long num_cpu=1;
SYSTEM_INFO sysinfo;
GetSystemInfo( &sysinfo );
num_cpu = sysinfo.dwNumberOfProcessors;
params->i_threads=num_cpu;  

The question is how do I know that during video streaming x264 runs on (in my case) 4 processors?

Because from Task Manager -> Performance -> CPU usage history doesn't clear.

I use windows 7

Thanks,

2

There are 2 answers

0
Roman Ryltsov On BEST ANSWER

There are three easy to see indications that encoding leverages multiple cores:

  1. Encoding runs faster
  2. Per core CPU load indicates simultaneous load on several cores/processors
  3. Per thread CPU load of your application shows relevant load on multiple threads

Also, you can use processor affinity mask (programmatically, and via Task Manager) to limit the application to single CPU. If x264 is using multiple processors, setting the mask will seriously affect application performance.

0
woolstar On

In windows task manager, be sure to select View -> CPU History -> One Graph Per CPU. If it still does not look like all processor cores are running at full speed, then possibly some resource is starving the encoding threads, and there's a bottleneck feeding data into the encoder.