Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th May 2011, 17:18   #1  |  Link
pwnsweet
Registered User
 
Join Date: Nov 2008
Posts: 97
Low CPU usage of 1st pass x264 encoding

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.
pwnsweet is offline   Reply With Quote
Old 11th May 2011, 17:35   #2  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
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).
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Old 11th May 2011, 18:21   #3  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
Code:
x264 --preset slowest --pass 1 --slow-firstpass --stats "stats.stats"
There. Full CPU usage during 1st-pass.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 11th May 2011, 19:14   #4  |  Link
Snowknight26
Registered User
 
Join Date: Aug 2007
Posts: 1,426
..but it'll obviously take longer.
Snowknight26 is offline   Reply With Quote
Old 12th May 2011, 01:31   #5  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,395
Quote:
Originally Posted by J_Darnley View Post
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%.
Stereodude is offline   Reply With Quote
Old 12th May 2011, 01:36   #6  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Yes, some parts of x264 (--b-adapt 2) are not scaling very good with more cores or are not multi-threaded at all.
sneaker_ger is offline   Reply With Quote
Old 12th May 2011, 01:38   #7  |  Link
pwnsweet
Registered User
 
Join Date: Nov 2008
Posts: 97
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).
pwnsweet is offline   Reply With Quote
Old 12th May 2011, 01:49   #8  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,395
Quote:
Originally Posted by pwnsweet View Post
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.
Stereodude is offline   Reply With Quote
Old 12th May 2011, 01:58   #9  |  Link
pwnsweet
Registered User
 
Join Date: Nov 2008
Posts: 97
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.
pwnsweet is offline   Reply With Quote
Old 12th May 2011, 08:58   #10  |  Link
J_Darnley
Registered User
 
J_Darnley's Avatar
 
Join Date: May 2006
Posts: 957
Quote:
Originally Posted by Stereodude View Post
That's not entirely true.
No, that is entirely true. Your PC is limited by my second sentence.
__________________
x264 log explained || x264 deblocking how-to
preset -> tune -> user set options -> fast first pass -> profile -> level
Doom10 - Of course it's better, it's one more.
J_Darnley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.