Question / Help Advice on memory for x264 encoding

Lazar Markov

New Member
Hey!

I'm setting up a streaming PC with the following relevant config:
CPU: i7 8700k @ 5GHz
Memory: 1x8GB DDR4 2400MHZ
Capture card: Elgato HD60 PRO
OS: Win 10 64bit

I try to encode at 1080p/60fps, however the "fastest" preset I can use is veryfast. Anything lower and the encoder is overloaded. Honestly I was expecting a bit more out of this top-tier CPU, especially since i'm only running OBS on the streaming PC.

However, I did some reading here, and it seems that one of two things might be bottlenecking me:
  • 8GB single-channel memory is insufficient?
  • I don't have a dedicated GPU (or I have but it's the integrated Intel UHD 630)

Could you please shed some light on whether my assumptions hold? Also if it is the case a dedicated GPU is needed, can you elaborate on what for?

I can upload a log file later tonight when I get home, if the information provided is insufficient.

Cheers,
Lazar
 

Lazar Markov

New Member
For posterity, the issue was that I had 1x8GB DDR4 2400MHz installed. I switched it with 2x8GB DDR 2666MHz and I can now go down to the medium preset, which is amazing.

I think the important part here is moving from single channel to dual channel. I suspect that the CPU just couldn't read/write to the memory fast enough, so it became a bottleneck.

The streaming PC still uses 3.5GB of memory while x264 encoding, so I don't think it's the increase in memory size from 8GB -> 16GB. Same goes for the change from 2400Mhz to 2666MHz, I mostly did it because I bought the wrong memory for my i7 Coffee Lake (uses 2666).
 

jerknerkel

New Member
Hi,

Thank you for this information. I have a ryzen 1700 clocked at 3.8ghz and haven't been able to push medium at 1080p 60fps, I can only manage fast.

I realized I bought terrible ram for my setup p, I got one 8gb generic Kingston 2400mhz stick (mAtx with only 2 dimm slots). Later learning that ryzens like high clock speeds too, now learning single channel is clearly not my friend either.

I'm hoping if I manage dual channel I'll be able to comfortably sit at medium 1080p 60fps.

I'm struggling to find any other info on dual channel and x264 online, but your situation seems promising.

Now I just need to decide if I should get 2x4gb kit or fork out the extra for 2x8gb at 3000mhz or 3200mhz.

Cheers.
 

BK-Morpheus

Active Member
@Jernekel: If you are gaming + streaming on the same computer, you won't get smooth 1080p 60fps with x264 medium.
My Ryzen 1700x is clocked at 3.8GHz as well and even with 2x 8GB DualRank Dual Channel at 3066MHz and optimized timings, the CPU is not fast enough for those settings, as long as a fast game is running and using ~4 Cores.
On a dedicated machine, it might work, but on a single PC setup, I suggest to use very fast preset for 1080p 60fps. To be honest, quality wise I barely see any difference, when I tested very fast vs. medium vs. slow
 

jerknerkel

New Member
@Jernekel: If you are gaming + streaming on the same computer, you won't get smooth 1080p 60fps with x264 medium.
My Ryzen 1700x is clocked at 3.8GHz as well and even with 2x 8GB DualRank Dual Channel at 3066MHz and optimized timings, the CPU is not fast enough for those settings, as long as a fast game is running and using ~4 Cores.
On a dedicated machine, it might work.
Thanks for your reply, I should have specified its a dedicated streaming rig.
 

vapeahoy

Member
the "speed" preset is very misleading here in what u cant and cannot do with an 8 core cpu like this. It all depends on what you're going to stream + what other settings u have - which will probably be or i should say *should be related to what you're going to stream. You also need to be thinking about what gamma(brightness) your games are. If horror games is a thing for you or very dark games u have options to help with that, where as the default may not be so good..
But those options may not be so good for other things, and so it's all just about finding a good compromise.
Happy reading!! :
chaneru - X264 Settings
 

jerknerkel

New Member
FYI, I just pulled an 8gb stick out of my gaming PC to test the dual channel. On 1080p 60fps medium x264 preset my CPU dropped from 95%+ down to a comfortable 60ish% and very smooth video playback. The bios set it down to 2133 from the original single sticks 2400mhz too.

Sounds like I really just need some 3200mhz ryzen 2x4gb kit, but they don't really seem to exist they are all 2x8gb kits : (

Interesting though that it made this much difference, now I need to work out what ram to buy. Maybe I'll just get another generic 8gb 2400mhz stick?

Thanks.
 

vapeahoy

Member
You need to get an identical memory stick to make sure it will run stable with the speed implied.
memory speed on ryzen is also chipset dependent, i have both x370 and x470 and its dead easy to get 3600 cl 15 on x470 while nigh impossible on x370 at same latencies. It just struggles to death on x370, sure its doable, but need to push so much voltage, llc, keen tweaking and its just too much work. And i normally love tweaking this stuff but this 1st gen ryzen had serious memory issues.
on x370 i run 3200cl14-14-14-32, and while i did get a stable pass on memtest86 at 3400, it gives errors in hci memtest (in windows). not even 3266 would pass as stable then. and thats with 3200cl14 rated sticks. Meanwhile on x470 same sticks easily go a lot higher, and stable.
The hope right now is that the next scheduled bios updates for july will fix a lot of memory performance on ryzen, and its possible, it has improved since launch. Oh and dont bother with the gskill flare x or other ryzen specific kits. tldr. I'd get a 3600cl15 kit if u can find it or so and it should perform very well. if u are on x370, just regular 3200cl14 but compare prices obviously and then make a decision.

Memory has great impact on x264 encoding, as any other, due to options as rc lookahead and other things which will require x amount of memory.
 

jerknerkel

New Member
Thanks for the info vapeahoy, I'm running an MSI B350M Gaming Pro mobo and AMD R7 1700, as I wanted a micro ATX build in hopes the whole PC would take up less physical space (as it's currently only used for streaming purposes).

The mobo will only take a max of 3200mhz, kinda thinking it might just be simpler to go for the flare 3200mhz kit, there doesn't seem to be a huge amount of option here in Australia.

edit: maybe something like this? https://www.pccasegear.com/products/42618/team-t-force-dark-pro-3200mhz-16gb-2x8gb-ddr4-black-red
 
Last edited:

vapeahoy

Member
still no point to get the flare x kit, it has less value as other kits perform just as well and will clock better on better chipsets, ie say u sell it later on and they want to use it in an intel system or a newer ryzen chipset that can overclock it to 3600 etc. i got my 3200cl14 to run 3333 here at nearly same timings with some tweaking. flare x kit quality isnt on par to be overclocked i think, it simply just has working timings out of the box. But that was only an issue at ryzen launch. also u can prolly google the stilts asus timings to copy paste them anyway.

never heard of t-force, i run the x370 pc now at 3333mhz ddr at 14-14-14-30t1 with trfc 333 i think and rest is defaulted from stilts 3333 1.4v safe preset. Seems to work great for now. cant remember if it was a corsair or g-skill kit but i think the latter.
3200cl16 is quite slow on that t-force kit. Especially on ryzen. I wouldnt go lower then a 3200cl14 kit. Maybe it overclocks well tho, i dont know.
 

Boildown

Active Member
Just want to point out that you should get a dedicated GPU. Anything recent GTX should work, best bets are GTX 750 / 950 / 1050. But even an old GTX 560 will work, if you can get that cheaper or have one collecting dust. The advantage of the three I listed first is they have good NVEnc support, which can be handy. Equivalent AMD cards will work too, but Nvidia's NVEnc is better supported than AMD's hardware encoder from what I see.
 

jerknerkel

New Member
fyi, I had trouble finding any stock where I live for some CL14 stuff so I ended up being lame and buying the Flare 3200mhz kit because I got impatient. It's running awesomely though, used the A-XMP bumped it to 3200mhz straight away and sitting at 1080p 60fps medium preset at a comfortable 50-65% CPU usage and seems stable.

Haven't seem to run into any issues with that 7770 card either, so far so good. Stream looks smooth as with NDI too so all is well, thanks for your help.
 

Maginhart

Member
fyi, I had trouble finding any stock where I live for some CL14 stuff so I ended up being lame and buying the Flare 3200mhz kit because I got impatient. It's running awesomely though, used the A-XMP bumped it to 3200mhz straight away and sitting at 1080p 60fps medium preset at a comfortable 50-65% CPU usage and seems stable.

Haven't seem to run into any issues with that 7770 card either, so far so good. Stream looks smooth as with NDI too so all is well, thanks for your help.

I have dedicated stream pc Ryzen 1700 My ram runs at 2666 mhz 8 gb 2 sticks and I can't set encoder to medium on high motion content :( not even at 6000 bitrate. I was thinking if i will get faster ram will it help? Or am I limited by cpu core count?
 

BK-Morpheus

Active Member
The performance boost, that you will get from switching to faster RAM with lower latency is not big enough in my opinion.
I did some tests myself by switching between DDR 2400 with slow/default subtimings and DDR3066 with optimized timings.
In many games (I only tested the performance difference in a few games, not in video encoding) I needed to reduce resolution details to 720p very low, to even get a measurable outcome. Most of the time, the difference was 3-6%, so really not a big deal.

Always keep in mind, that the visual difference between very fast preset and medium preset is almost not existent. I tried this very often, but I barely could tell which of my test clips was medium preset or very fast preset.
 

Narcogen

Active Member
Not sure what you mean by saying the PC isn't "fully utilized" when you are overloading your CPU. 1080p60 is challenging for many systems. Medium is challenging for the strongest systems.

RAM speed is not your problem, and increasing it will not resolve an overloaded encoder error.
 

BK-Morpheus

Active Member
Could be, that some driver (like the capture card for example) or process is not scaling well with cores an therefore the CPU bottleneck can not be seen by simply checking the percentage of core utilization.
 
Top