Question / Help Presets & FPS Loss

Paperkat

New Member
Hi All

I recently tried a dual PC setup by upgrading my i7 6700 to a i7 7700k in my gaming PC and slammed the 6700 into a streaming PC with a 970 - I ended up having some real issues with an elgato HD 60S where my games at 144hz just wouldnt look good going from the elgato to the streaming PC (im sure you heard that old chestnut many many times, tried everything even projecting on a monitor etc nothing worked quite right compared to a single PC)

Therefore I gave up on the dual PC dream as it was gonna send me down the road of purchasing a Datapath SC2 capture card in order to make it work etc.

Sold the PC and bought the new AMD Threadripper 1950x. along with my 1080TI I figured this would be sweet for a single streaming PC setup.

on the i7 7700k when I was streaming on a single gaming PC as far as I can tell, I never lost FPS while gaming, UNLESS the CPU became overloaded. I was streaming on Faster and playing PUBG / world of warcraft at 720p so it never really got to that point, the CPU would get to 80%-90% and sit there through the whole streaming session.

Now with the threadripper 1950x, it seems like no matter what I do, i lose about 10 to 15 FPS in well optimized games and even more in worstly optimized games (e.g. PUBG which seems to have been terribly optimized for ryzen chips compared to intel's)

I did use the preset "Faster" on my i7 7700k single PC streaming setup so that could be the reason why I never noticed an FPS drop to playing with or without the stream.

Now with the Threadrippers processing power, I can stream demanding CPU games, for example:

Running around the middle of Novigrad (big city) on the Witcher 3: Wild Hunt on my i7 7700k would cost me 70% CPU - on the Threadripper it only costs around 11%. Therefore I am now able to put my preset on medium or even slow (twitch doesnt seem to like slow so much so im sticking to medium @ 864p for now.) now as I walk around novigrad ill go from 75-80-85 FPS down to 60-65-70 FPS. it doesnt sound like a lot but it can be quite noticeable.

The picture quality for a twitch stream is amazing. BUT it seems like i do lose between 10 to 20 FPS depending on the game when I stream.

If I put the preset higher eg, veryfast etc, I do lose some FPS but then its really negligible BUT the picture quality looks absolutely grim compared to medium.

Thanks for reading that far down! My questions are as followed if any one could educate me I would be grateful.

Is there a way to absolutely negate the FPS loss from having a preset like medium?

Is losing FPS just a normal occurrence that comes with the territory when going to a medium preset?

Should I just accept that if I am going to be streaming on a single PC setup at a medium preset, ill tank some FPS?

in case you're looking for a log file - i just played battlefield 1 to check what the FPS drop was like in the game and it seemed to be a loss of 10-15 FPS there too -> https://gist.github.com/db9574407f1d9d1eeadc283cd8faddcd

Cheers guys

Luis
 

Boildown

Active Member
03:20:27.057: [x264 encoder: 'simple_h264_stream'] preset: medium
03:20:27.057: [x264 encoder: 'simple_h264_stream'] settings:
03:20:27.057: rate_control: CBR
03:20:27.057: bitrate: 6000
03:20:27.057: buffer size: 6000
03:20:27.057: crf: 0
03:20:27.057: fps_num: 60
03:20:27.057: fps_den: 1
03:20:27.057: width: 1536
03:20:27.057: height: 864
03:20:27.057: keyint: 120
03:41:14.158: Output 'simple_stream': Total frames output: 74660
03:41:14.158: Output 'simple_stream': Total drawn frames: 74745 (74826 attempted)
03:41:14.158: Output 'simple_stream': Number of lagged frames due to rendering lag/stalls: 81 (0.1%)
03:41:14.159: Video stopped, number of skipped frames due to encoding lag: 8/74737 (0.0%)

So you're getting excellent OBS performance, even on Medium preset at 864p60, which is pretty tough to do. Its your game that's lagging.

03:17:06.676: CPU Name: AMD Ryzen Threadripper 1950X 16-Core Processor
03:17:06.677: CPU Speed: 3400MHz
03:17:06.677: Physical Cores: 16, Logical Cores: 32

One problem that you have with these new CPUs with tons of cores is that x264 can only effectively use 1 thread for every 40 lines of vertical resolution (ballpark figure based on someone's testing long ago).

So if you take 864 and divide it by 40 you get 21.6 But you have 32 logical cores, and x264 opens 1.5 threads per logical core. That means x264 is opening 48 threads but it can only use about 22 of them. This means that OBS is clogging your CPU with threads that are mostly going unused. This could explain why your game performance is lower than you expect.

There's a couple solutions you can try: First, you can disable hyperthreading (or whatever AMD calls it). This will knock you down to 16 logical (and phsyical) cores, which when multiplied by 1.5 gives you 24 threads. Remember that your game needs some CPU time too, but Windows should be able to handle the thread scheduling without a problem.

The second thing you can try is to set OBS' process priority lower than the default in Settings > Advanced > General. This (I think) tells Windows to prefer other programs over OBS, which should help speed up your game but might negatively affect OBS. Considering OBS is doing great, you probably can knock it down a peg or two without much of a noticeable effect on your stream.

The third thing you can do is set a custom x264 command to directly tell x264 to not spawn so many threads. Go to Advanced output mode and under x264 Options put "threads=22". This will tell x264 to spawn 22 threads instead of 48. I doubt 22 is exactly the best number, it could be more or less than this, but you'll need to test to find out.

After you've made a change, run a test stream for 5 minutes of high action gameplay, stop the stream, and look at the log file (you might have to exit OBS to get it to save the log file). Look at the number of lagged and skipped frames for that test. The number needs to be under 1% to have a good looking stream. With your CPU, I'd probably aim for 0.5% or less. Also test whether your game is performing like you like. You will need to iterate, do the tests over and over and improve on them each time, to tell which changes worked, which didn't, and when you've gone too far, or not far enough.

For others that will inevitably Google and find this post, this means that getting the biggest baddest Threadripper isn't necessarily the best thing you can do for your stream. Games need clockspeed, and going past so many threads is pointless with x264. And in the CPU world, the more cores a chip has, the slower the clockspeed of each core is. You can save money and get better x264 and game performance by getting a higher clockspeed CPU with fewer cores, one where x264 will naturally spawn the "right" amount of threads for the resolution you stream at. If I were going down this route and knew I'd be streaming at 720p, I'd probably get the fastest clocked 8 core CPU I could find, and leave hyperthreading on, or the fastest 12 core CPU I could find, and turn hyperthreading off.
 

Paperkat

New Member
Hi Boildown

Many thanks for your detailed response, really appreciate the effort you put in your post there.

I tried to follow with your instruction and was most successful by leaving everything as is but just adding thread=22 to my obs x264 options.

Played Destiny 2 beta and had to stop the stream due to severe FPS lag but after using thread=22 it seemed to stabilize a little bit more. the vod from the test streams are on my secondary account here: https://www.twitch.tv/videos/170895360 in case you're interested in seeing the quality live.

My friends are all using i7's bar one who uses a quad core ryzen 5 who seems to be getting similar performance to myself, perhaps AMD isnt the best in destiny 2 as the i7 boys are apparently all getting between 180 and 200 FPS in the intro sequence i linked in the vod.

I reduced to 16 cores as you mentioned - it didnt really help all that much, affected performance a bit in the game and the game + medium on OBS was putting the CPU on 80% load.

Destiny 2 seems to be very CPU heavy, on a single PC i7 it seems to be very difficult to keep a stream running above 720p at more than a faster preset at best.

The best route seem to be a dual PC setup one with a threadripper + datapath capture card and a gaming PC with a 7700k but unfortunately i cannot really allow myself to spend that sort of money right now so i will have to play the games on the threadripper in the meanwhile although it does offer quite a dip in FPS (even if the game feels smooth to me, quite well made and plays very well even at the FPS provided by the threadripper)

Anyway thanks for the help boildown really appreciate the effort you put in the post, and so far from testing tonight thread=22 seems to reduce the FPS loss via OBS but not completely negate it. It's a FPS sacrifice for viewers to be able to get a high quality stream!
 

Boildown

Active Member
Sure, just test some values other than 22. Try 30 and 16, and then depending on which was best, the ones in-between. Just make sure they're relatively long tests, when I was tweaking my stream I would do an entire play session and then tweak slightly between them. Took me days to weeks but I was sure of the results afterwards. Also play without OBS at all to establish a baseline of how the game performs with OBS doing nothing.
 

Suslik V

Active Member
Keep the rendering fps constant to not to lose anything - this is the rule of the best quality. Just my thoughts on the problem.
 

Paperkat

New Member
Hi All

Just wanted to update you on the situation and how I resolved this issue -

I returned the Threadripper and switched to an Intel i9 7900x - my gaming experience has been way way better since the switch, i guess developers optimize the gaming experience for Intel rather than AMD.
 
Top