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. |
29th August 2009, 17:56 | #1 | Link |
Moderator
Join Date: Oct 2001
Posts: 20,973
|
X264 Pass Differences
I've been doing a lot of testing of Blu-ray reencodes using the X264 "--preset veryfast" setting and I noticed that in all my encodes the second pass is considerably faster than the first pass (~25fps compared to ~15fps). That seems to be the opposite of what I see in other presets. I'm sure there is a good reason, but I'm just not seeing it and its driving me nuts... I was just wondering if someone could explain it?
Here are my command lines -- almost identical except the first pass outputs to NUL. Code:
"E:\BD_Rebuilder\tools\x264.exe" "E:\WORKING4\WORKFILES\VID_00102.AVS" --preset veryfast --bitrate 7114 --level 4.1 --sar 1:1 --fps 24000/1001 --aud --vbv-bufsize 25000 --keyint 24 --min-keyint 1 --ipratio 1.1 --pbratio 1.1 --vbv-maxrate 35000 --threads auto --thread-input --stats "E:\WORKING4\WORKFILES\VID_00102.AVS.MKV.stats" --pass 1 --output NUL "E:\BD_Rebuilder\tools\x264.exe" "E:\WORKING4\WORKFILES\VID_00102.AVS" --preset veryfast --bitrate 7114 --level 4.1 --sar 1:1 --fps 24000/1001 --aud --vbv-bufsize 25000 --keyint 24 --min-keyint 1 --ipratio 1.1 --pbratio 1.1 --vbv-maxrate 35000 --threads auto --thread-input --stats "E:\WORKING4\WORKFILES\VID_00102.AVS.MKV.stats" --pass 2 --output "E:\WORKING4\WORKFILES\VID_00102.AVS.MKV" Last edited by jdobbs; 29th August 2009 at 18:14. |
29th August 2009, 18:14 | #2 | Link |
BluRay Maniac
Join Date: Dec 2005
Posts: 2,419
|
@jdobbs, sorry for ot but why use settings that are incompatible with Blu-ray standard like Level 4.1 require 4 or more slices. I know that maybe no one has ever had a problem with SAP, but why not follow the standard, btw you use vbv buffer 25000 which limits peak bitrate over 25mbps so vbv maxrate of Level 4.0 will not limit the quality anyway.
|
29th August 2009, 18:19 | #3 | Link | |
Moderator
Join Date: Oct 2001
Posts: 20,973
|
Quote:
Last edited by jdobbs; 29th August 2009 at 18:26. |
|
29th August 2009, 18:25 | #4 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Well, the frame-type decision is made in the first pass and as far as I know the "lookahead" part is still not multi-threaded. So it may be that serial part that makes your first pass slow.
So with "slower" presets this just doesn't show up, simply because all the rest is much slower. But when everything is speeded-up (as with "veryfast" preset), the lookahead can become the bottleneck easily...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 29th August 2009 at 18:29. |
29th August 2009, 18:55 | #7 | Link |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
the speed cost seen there is likely vbv-lookahead in combination with b-adapt 1.
according to Code:
h->param.rc.i_lookahead = x264_clip3( h->param.rc.i_lookahead, 0, X264_LOOKAHEAD_MAX ); { int maxrate = X264_MAX( h->param.rc.i_vbv_max_bitrate, h->param.rc.i_bitrate ); float bufsize = maxrate ? (float)h->param.rc.i_vbv_buffer_size / maxrate : 0; float fps = h->param.i_fps_num > 0 && h->param.i_fps_den > 0 ? (float) h->param.i_fps_num / h->param.i_fps_den : 25.0; h->param.rc.i_lookahead = X264_MIN( h->param.rc.i_lookahead, X264_MAX( h->param.i_keyint_max, bufsize*fps ) ); } MIN( 40, MAX( 24, 35000/25000 * ~24 ) ) , so 33. b-adapt 1 takes some time to perform and this should be noticeable compared to the rest of veryfast's settings when compounded with vbv-lookahead on a multicore processor. |
29th August 2009, 19:23 | #9 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
But it still does VBV lookahead.
Remember, presets like "veryfast" are so fast that they're about the same speed as x264's "fast first pass" system, so the first pass will surely be slower--it simply does more work! (since the first pass does frametype does frametype decision) At this point, it would be better to use ABR mode if trying to maximize performance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|