View Full Version : Low CPU usage of 1st pass x264 encoding
pwnsweet
11th May 2011, 17:18
Hi,
I noticed the 1st pass of a 2 pass encode in x264 uses only about 25% of my CPU. Is this normal? I have an i7 920 and would like to know if there is anything I can do to utilize the whole CPU (like in the 2nd pass) so that the 1st pass doesn't take as long.
J_Darnley
11th May 2011, 17:35
If you want more CPU usage, use slower settings.
The encoder can only run as fast as it can get frames. And the encoder can only run as fast as its slowest part (which is often the frame-type decision).
Didée
11th May 2011, 18:21
x264 --preset slowest --pass 1 --slow-firstpass --stats "stats.stats"
There. Full CPU usage during 1st-pass.
Snowknight26
11th May 2011, 19:14
..but it'll obviously take longer.
Stereodude
12th May 2011, 01:31
The encoder can only run as fast as it can get frames.That's not entirely true. My PC can feed frames to x264 much faster than the first pass of x264 consumes them. My i7-2600k doesn't even use close to use 100% CPU (more like 30%). I'm using --very slow and --b-adapt 2.
I realize the first pass runs faster and has less math to do because it's simplifying things so there aren't tasks to keep 4 cores w/ HT busy. This is in no way a complaint, but simply an observation that the speed at which frames can be fed to x264 is not the sole determiner of the speed of x264 when CPU usage is less than 100%.
sneaker_ger
12th May 2011, 01:36
Yes, some parts of x264 (--b-adapt 2) are not scaling very good with more cores or are not multi-threaded at all.
pwnsweet
12th May 2011, 01:38
Well that's exactly what I'm experiencing. Because the 1st pass isn't using 100% of the CPU, I usually stack up to three 1st passes in separate workers (MeGUI).
Stereodude
12th May 2011, 01:49
Well that's exactly what I'm experiencing. Because the 1st pass isn't using 100% of the CPU, I usually stack up to three 1st passes in separate workers (MeGUI).This is a good idea. I can do two first passes at the same time with no appreciable slowdown vs. doing one and have done it a few times. I've never tried three, but that would work too.
pwnsweet
12th May 2011, 01:58
Still, I'd prefer to do just one 1st pass at a time but get it done 3-4 times faster but it appears that the bottleneck lies in the 1st passes lack of multithreading which there isn't anything we can really do about from the looks of it.
J_Darnley
12th May 2011, 08:58
That's not entirely true.
No, that is entirely true. Your PC is limited by my second sentence.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.