Question / Help FPS not staying at 60 no encoder overload

Talic1337

New Member
Since my upgrade to windows 10 I have been running into small problems with OBS. Mainly in some games OBS is not outputting a solid 60 fps without overloading the encoder/cpu or dropping frames. In game my fps will be 60fps but OBS may output 15-20-30 frames and it will vary greatly. Tried several things like running window/game capture instead, win 8 compatibility mode. Most likely will try a fresh install next. Wondering if anyone else has an answer. Noticed several modules not loaded, possibly because of win10 upgrade program broke? Some games run fine others have issues.

Most recent log: https://pastebin.com/3XkPSev1

Thanks!
 

Attachments

  • 2017-09-04 18-52-41.txt
    24.5 KB · Views: 54

AlphaSwifty

New Member
I believe all the highlighted areas are required to be under 16.6667 ms for guaranteed fluid 60 FPS but I think there's also a buffer that allows this to fluctuate some without affecting dropped frames to viewers but whatever that time/number is would directly depend on the size of the buffer. However a few of those items are well past a full second which would most likely cause something to drop in the encoding process. Notice that the first line with the max recorded frame is at 5184.95ms which equates to almost 6 whole seconds and the high percentage of frames (~30.9%) not below that 16.667 threshold

The do_encode section shows frames taking up to a max of 113ms which is more than that 16.6667 ms limit but again the buffer probably covers this up and thus why you dont see an overloading of the encoder/cpu.
  1. 02:28:32.231: obs_video_thread(16.6667 ms): min=0.204 ms, median=3.636 ms, max=5184.95 ms, 99th percentile=67.692 ms, 69.0921% below 16.667 ms
  2. 02:28:32.231: ┣tick_sources: min=0.001 ms, median=1.382 ms, max=5184.2 ms, 99th percentile=11.337 ms
  3. 02:28:32.231: ┣render_displays: min=0.001 ms, median=0.325 ms, max=37.46 ms, 99th percentile=1.814 ms
  4. 02:28:32.231: ┗output_frame: min=0.199 ms, median=1.056 ms, max=2788.74 ms, 99th percentile=64.567 ms
  5. 02:28:32.231: ┣gs_context(video->graphics): min=0.124 ms, median=0.692 ms, max=2788.38 ms, 99th percentile=64.177 ms
  6. 02:28:32.231: ┃ ┣render_video: min=0.026 ms, median=0.123 ms, max=266.041 ms, 99th percentile=2.804 ms
  7. 02:28:32.231: ┃ ┃ ┣render_main_texture: min=0.002 ms, median=0.054 ms, max=265.689 ms, 99th percentile=0.506 ms
  8. 02:28:32.231: ┃ ┃ ┣render_output_texture: min=0.004 ms, median=0.009 ms, max=13.217 ms, 99th percentile=0.04 ms
  9. 02:28:32.231: ┃ ┃ ┣render_convert_texture: min=0.001 ms, median=0.011 ms, max=13.227 ms, 99th percentile=0.046 ms
  10. 02:28:32.232: ┃ ┃ ┗stage_output_texture: min=0 ms, median=0.008 ms, max=72.534 ms, 99th percentile=2.263 ms
  11. 02:28:32.232: ┃ ┣download_frame: min=0 ms, median=0.41 ms, max=2787.8 ms, 99th percentile=63.361 ms
  12. 02:28:32.232: ┃ ┗gs_flush: min=0.013 ms, median=0.073 ms, max=53.714 ms, 99th percentile=0.781 ms
  13. 02:28:32.232: ┗output_video_data: min=0.001 ms, median=0.259 ms, max=21.282 ms, 99th percentile=0.711 ms
  14. 02:28:32.232: video_thread(video): min=0 ms, median=0.837 ms, max=440.37 ms, 99th percentile=5.882 ms
  15. 02:28:32.232: ┗receive_video: min=0 ms, median=0.898 ms, max=113.086 ms, 99th percentile=2.406 ms, 1.20516 calls per parent call
  16. 02:28:32.232: ┗do_encode: min=0.467 ms, median=0.897 ms, max=113.086 ms, 99th percentile=2.405 ms
  17. 02:28:32.232: ┗encode(streaming_h264): min=0.459 ms, median=0.876 ms, max=113.073 ms, 99th percentile=2.351 ms
 
gpu is maxed but it shouldnt be to guatantee everything will go smoothly
follow this list step by step and you will fix this and few other potential issues fast

1. 60hz desktop refresh
Replace with 59,94 only for HDMI TV used as monitor.
If you have 144hz monitor its fastest and most reliable to forget about 144hz and follow 1,2,3,4
2. 60 or 30 in OBS (59,94 or 29,97 only for HDMI TV)
3. 60 in game if there is switch for it (like bf3, bf4, overwatch) - 59,94 only for HDMI TV
4. Enable vsync in game
5. Run obs as administrator
6. Enable high performance mode in windows power options
7. On Win10 disable game mode, game bar and game DVR https://i.imgur.com/7CVH7c5.png
8. Make sure your gpu can do stable 60fps in game without being maxed. OBS needs some of gpu resources as well. If you did points 1+4 and its still maxed lower resolution and/or details.
9. Install Afterburner (or pure RTSS+HW Info) to monitor cpu/gpu load and start experimenting with tuning resolution / fps / x264 preset. GPU/CPU load should not exceed 85-90%
 

AlphaSwifty

New Member
Before cutting and pasting generic fixes like you have in this post and others, can I suggest that it might be helpful if you look at the actual log file that the parent posted and take that into account with how they described the problem

Several items in your fix-list are actually answered in there such as :
  • (2) OBS was set to capture at 60fps
  • (3,4) Games used in capture were The Division and PUBG and both have switches for vsync and frame rate though PUBG would appear to only be available via a text configuration file and not UI accessible. What those are set at, however, is a good question
  • (5) OBS is running as Administrator
  • GPU is an Nvidia GTX 770
  • (8) Knowing the gpu and the games from above allows you to do a quick google search to see if they are, in fact, capable of doing 60fps. Parent though has already stated that they are reporting those games as being 60fps stable using their current settings.
  • (8) OBS is doing the encoding via x264 which is a cpu process and not NVENC, thus gpu resources are not impacted
  • (9) Parent stated that the cpu isnt being overloaded
If you also take into account what I wrote and highlighted, there is a clear problem in the OBS_VIDEO_THREAD profiling data. A little more than 30% of the frames are not meeting the 16.667 ms deadline to be output at the requested 60fps rate. This specific area of OBS' code is where the video is composited/rendered and then sent to the encoder to be converted into a h264 elementary mpeg stream and then combined with the audio into a RTMP stream to be broadcast. The encoding does have some frames not meeting the deadline but 99% are well under 16.667ms at 2.4ms. Its the DOWNLOAD_FRAME function that is failing to copy a frame of data in a timely manner from the capture source. I'm not familiar with OBS' codebase other than casually looking at it today, but I would expect that should be no more than a few milliseconds at most as you're essentially copying ~6-8 mb's of data (1920 * 1080 * 3 or 4 bytes aka Width * Height * Color Depth) along with any pthread locking/context switches.
 
What you dont understand is that if you max gpu in game to full load and wont take care of leaving free processing power for obs you will get massive stutters like here with 24% frame loss in rendering.
GTX770 is considerably slow for today standards and needs more effort like lowering game res and / or details than faster cards. Profiler shows this, you point this out and still you miss the core or the problem trying blame others and confusing gpu load and nvenc encoder load in your #8. Do some more testing or reading.
 
Top