Question / Help X264 and Threads (Help)

PersonSuit

New Member
I am using a Threadripper 1950x trying to get the absolute best quality I can. When I first started OBS it was only using 16 threads and the most I could push was the "Slow" encode preset. After some tinkering in settings I found If I set it to threads=32 let it use 24 threads and If I did threads=64 it would use 100% of all 32 threads. I'm not sure why that worked that way but it did.

having said that, I am now reading that more threads even though it will utilize more of the CPU, will produce an image that may not be the best. What I'm wondering is, is the quality actually worse with 720p@60FPS on Very Slow 32or64 threads than it would be on 720p@60FPS Slow on 16 threads? And if it is, in what way exactly?
 

Boildown

Active Member
The rule of thumb from years ago (on the Handbrake forums) was 1 thread was useful per 40 lines of vertical resolution. More than that was wasted or even detrimental. That was probably from the 4:3 aspect ratio days so it might be lower now (which is a good thing). In any event, if you do that math on a 720p video (at 1 thread per 40 lines), you get 18 threads.

I don't think you want to force x264 to use 32 or 64 threads. I'd aim at somewhere in the 16-24 range. Do five minute or longer tests until you find the one that gives you the least lagged/missed/skipped/whatevered frames in the log file. You probably will need to crank up the preset to Slow or Slower to have noticeably different results while testing. Once you're done testing and identified the best number of threads, back off your preset to one where you can reliably have around 0.5% or less of lagged/missed/skipped/whatevered frames, or else the output video will look jerky.

For your CPU, its probably unrealistic to expect it to ever hit 100% CPU utilization for 720p video. x264 just isn't parallel enough to take advantage of it.
 
Top