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. |
![]() |
#1 | Link |
Registered User
Join Date: Oct 2007
Posts: 1,060
|
Threaded lookahead issue
First of all, I would like to say my thanks to the x264 developers for this feature. It really made encoding quite a bit faster in CRF mode.
I'm encountering some issues. 1) With this patch, wouldn't the CPU usage of my quad core be 100%? It is not always 100%. Half the time it is around 75% 2) In the changelog, it said threaded lookahead is a separate thread with a higher priority. Well, I think the priority is too high. My computer lags considerably when the CPU is at 100%, to the point my mouse movement is not smooth, and the words I'm typing right now does not appear instantly as I press the key. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Dec 2006
Posts: 6
|
I've seen something similar to issue Nr. 2:
Running Windows 7 X64 RTM @ Intel core2quad Q9550@3,4ghz When using r1246 x86 the complete windows gui freezes for ~3 seconds every ~25 seconds during the first encoding pass @~65% cpu usage, the second pass runs fine @~100% cpu usage... (this doesn't happen with r1243 x86) And on the good side: The first pass is ~5fps faster and the second pass is ~2fps faster with r1246 commandline used: --profile high --level 4.1 --pass x --bitrate 7000 --stats ".stats" --thread-input --deblock -1:-1 --b-adapt 2 --direct auto --ref 2 --vbv-bufsize 50000 --vbv-maxrate 50000 --rc-lookahead 30 --me umh --trellis 2 --output "output" "input" Last edited by the6thday; 2nd September 2009 at 13:41. |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,162
|
While at just to be sure: sync-lookahead is like rc-lookahead limited to keyint as max, right?
about the freezes: got no windows freezes here during 1st pass (Running Windows 7 X64 RTM @ Intel core2quad Q9250@2,6ghz) Cu Selur |
![]() |
![]() |
![]() |
#6 | Link | |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
Quote:
due to some possible deadlock problems at very low values of sync-lookahead, it's clipped to the range of [bframes+threads,250] to prevent that possibility generally you should never need to to change the value of the buffer. the thread is also disabled during the 2nd pass since it's useless there. the thread it creates is created with the maximum possible thread priority: on windows for 'normal' class priority for the process, the main program has a priority of '8' or '9', while the lookahead thread has a priority of '15' or so. This was intended as the processing time needed by the lookahead thread is significant in a number of situations and all the encoder threads will block for it to complete some frames. if you don't want x264 using all of your processor power with the change, decrease the number of encoding threads by 1 or 2. |
|
![]() |
![]() |
![]() |
#7 | Link | |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,162
|
to my defense: the independence of sync-lookahead and rc-lookahead doesn't mean it couldn't have been limited by keyint as maximum.
![]() Quote:
Last edited by Selur; 2nd September 2009 at 16:19. |
|
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Aug 2009
Posts: 463
|
I did some small test. I used 3000 frames clip, Diablo 3 trailer, 1280x544 resized to 720x304 using spline36. Command line is --preset medium --crf 22 --me umh --b-adapt 2 --tune ssim.
It seams that v1246 is 7,5% faster then v1243 on Athlon X2 4000+. With --bframes 16 it is 20-25% faster. But, this is only one test clip. Final bitrate is the same. |
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Feb 2005
Posts: 149
|
Looks like you guys don't have your windows tunned up, and your cpu / overclocks.
There is A LOT you need to do on windows reg and configuration to make it perfect. Anyway, I might spend some time to do a guide for you guys. This is what I get even on 1st pass, using avisynth script too. Nothing is laggy, I can even play games while encoding... default windows settings IS BAD. ![]() |
![]() |
![]() |
![]() |
#10 | Link |
ангел смерти
![]() Join Date: Nov 2004
Location: Lost
Posts: 9,555
|
simps, that isn't a problem caused by overclocking, tuning, or anything else, it really is exactly what the first post described: When a thread priority is higher than the windows desktop and every other application running, the system will freeze up. The slower your first-pass settings, the less likely you are to see it. Try fast-first-pass instead and watch the system crawl.
|
![]() |
![]() |
![]() |
#15 | Link | |
Software Developer
![]() Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,246
|
Quote:
![]()
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
|
![]() |
![]() |
![]() |
#18 | Link | |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
Quote:
and you plainly said 'lookahead' which can now refer to either sync-lookahead or rc-lookahead. either way, 250 was used for sync-lookahead because that's the cap that was already in place for rc-lookahead. Last edited by kemuri-_9; 3rd September 2009 at 14:34. |
|
![]() |
![]() |
![]() |
#19 | Link | ||
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,162
|
Quote:
![]() Quote:
|
||
![]() |
![]() |
![]() |
#20 | Link | |
Compiling Encoder
Join Date: Jan 2007
Posts: 1,348
|
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 ) ); } ... #ifdef HAVE_PTHREAD if( h->param.i_sync_lookahead ) h->param.i_sync_lookahead = x264_clip3( h->param.i_sync_lookahead, h->param.i_threads + h->param.i_bframe, X264_LOOKAHEAD_MAX ); if( h->param.rc.b_stat_read || h->param.i_threads == 1 ) h->param.i_sync_lookahead = 0; #else h->param.i_sync_lookahead = 0; #endif Quote:
- rc-lookahead is used with both mb-tree and vbv-lookahead B. sync-lookahead is a different buffer that has absolutely nothing to do with keyint. - I said it clips to [bframes+threads,250] because that's what it does! Last edited by kemuri-_9; 3rd September 2009 at 18:18. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|