Question / Help High percentage of lagged frames.

SiiBlade

New Member
I've been trying to tweak my OBS settings for over a week now, trying various permutations of settings in order to get a good quality recording, but it seems that regardless of settings or output scaling I use, recording always end up with a large amount of "lagged frames due to render lag/stalls". My lagged frames seem usually around 5% or more, regardless of how low I put the settings (I'll test some really low scaling like <720p soon).

I suppose lets start with specs and physical setup
CPU: i7-5820k @ 4.5GHz
GPU: Palit GTX 1080 GameRock
Mobo: ASUS X99-DELUXE II
RAM: 2x8GB Corsair Vengeance LPX @ 2400MHz
PSU: Corsair H1000i
CPU Cooling: Corsair H110i GTX
Storage;
Samsung 512GB M.2 SSD // OS Drive, also recording temporarily here for testing purposes
WD Black 3TB 7200RPM // Game Drive
Seagate 5TB 5400RPM // Backup/Archive Drive
WD Blue 1TB 7200RPM // To be recording drive

Monitors:
Acer XG270HU omidpx 27" 144Hz 2560x1440
DELL E197FP 19" 60Hz 1280x1024
DELL E176FP 17" 60Hz 1280x1024

I don't want to stream, I'm just trying to record, but my recordings at 1440p60 and 1080p60 are choppy and unpleasant to watch. For a few seconds it would be 60fps and then suddenly stutter for a split second and then 60fps again, with varying levels of stuttering both in high motion and low motion scenes. I've been trying these settings with MGS5:PP and COD:WaW just as random test subjects. I've tried using veryfast, superfast and ultrafast presets with high and low CRF (15<x<25) at both resolutions with both NVENC and x264 encoders, trying to keep CPU usage at max 90%.

I've been scouring the forums as best I can, and I noticed a lot of people with higher core counts seem to have trouble with OBS, as well as some people with mismatched monitor refresh rates. I also noticed my log files report an incorrect CPU clock, my CPU is clocked at 4.5GHz but OBS reports 4.125GHz. Finally a lot of "failed to load modules" seem to be appearing, but this I see with many peoples logs (Hmm, maybe I can get a GitHub contribution here? :D).

Anyway, I've linked my most recent log, it's all 1440p attempts but I assure you 1080p attempts all have the same issues.

https://gist.github.com/20c59315c59e23a4e328e7a21ac77f98

If anyone can shed some light on this situation it would be most appreciated, and I would be willing to work with someone to potentially fix the issue should it be code related.
 
Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 1448 (5.1%)

You are maxing out your GPU. You will have to give OBS more GPU resources by reducing in-game settings or capping your frame rate. Use NVENC and give OBS more GPU headroom and your problem should be fixed.
 

SiiBlade

New Member
Just tried using another few recordings of MGS5 with NVENC, CQP 18, Preset: High Quality, Profile: high, Level: auto, 2 pass encoding and 2 B-frames at 1440p.
Did two recordings with maxed graphics, one recording at medium settings and one recording with minimum graphics. I also monitored gpu usage with HWMonitor and GPU-Z.

At max, GPU usage was under 80% majority of the time with a spike here and there up to 90%. Logs show 1% lagged frames.
At med, GPU usage was around 60% at all times. Logs show 0.1% lagged frames
At min, GPU usage was around 55% at all times. Logs show 0.2% lagged frames.

However when playing these back in video players the stuttering is roughly the same at any graphics setting. I've tried PotPlayer, MPC-HC, VLC and even Premiere Pro's preview window.
To test, I jogged down the same stretch of road on each recording, no stuttering in game and a constant locked fps of 60 on steams fps counter.

Also, when viewing other 60fps videos though these mediums, there is no stutter whatsoever.
 

SiiBlade

New Member
So I did a ton more testing, changing FPS recorded at, output resolution, scaled resolution, trying both NVENC and x264 on 1440p, 1080p, 720p and nothing seems to get rid of this annoying stutter on recordings.

Last two logs (They're pretty long)
https://gist.github.com/anonymous/49d576fa684704cfe7437235d8951a49
https://gist.github.com/anonymous/5b19135d1f7f1a5fa846bc3153b727e2

The funny thing is I had a defective gtx 980ti about about a year ago that had absolutely no issues recording on whatever version OBS studio was on last year, the problems only seem to have started on the 1080 or the latest version of OBS (18.0.1), and to me it doesn't make sense that the the more powerful 1080 is the problem, but I might be wrong.

edit: I also tried playing Overwatch, MGS5 and Binding of Isaac, both on high and loweest settings, stutter was still apparent in the recordings at various attempted recording resolutions and quality settings. I noticed that it was less of an issue when using CBR or VBR vs CRF/CQP, but still heavily apparent.
 
Last edited:

vencabot

Member
This could be related to an issue that I'm having. In-game, my framerate is a consistent 60fps. In the OBS logs, after 3 hours of recording, I have 0.0% lagged frames, usually around 30 frames total, and 0 dropped / skipped frames.

However, video recorded by OBS is sprinkled with stutters, and frame-by-framing the video in VLC often shows 2 or 3 identical frames, side-by-side, hence the stutter. I can count many, many more repeated frames than OBS Studio reports in the 'lagged frames' count.

I'm going to continue testing this tomorrow or the following day, using a similar method to SiiBlade: recording a relatively short video in an in-game situation where I can clearly monitor the smoothness of an animation, then compare that to the recorded video and OBS Studio's log (compare actual recorded choppiness to reported lagged / skipped frames).
 

vencabot

Member
I just conducted my test, standing my character in a spot and slowly rotating the camera for a couple of minutes, carefully monitoring to ensure the frames were a smooth 60 fps the entire while. OBS Studio's log reports no skipped frames and 34 "lagged" frames, but the output recording, at 30 fps, shows minor FPS inconsistency throughout, and frame-by-framing the video shows many, many repeat frames; I'm not sure how a 'lagged' frame manifests itself in a recording, but I'd counted more than 50 repeat frames in the first few seconds of the test, let alone over the entire recording. Sometimes, there are even repeats of the repeats (3 or 4 identical frames before the next brand new frame), and this at 30 fps, when I was obsessively monitoring a smoothly-rotating camera at 60fps -- I definitely would've noticed that.

In any case, I don't expect for this issue to be addressable in the near future, so I'm going to see what sorts of results I can get with Xsplit. I have tons of respect for the fact this is an open source project managed mostly (entirely?) by one person, and I wish you luck!
 
Did you try to disable vsync in game? Vsync tends to cause issues grabbing the frames, resulting in frame duplication. Even with best encoder settings you can't get rid of that.
 

vencabot

Member
Did you try to disable vsync in game? Vsync tends to cause issues grabbing the frames, resulting in frame duplication. Even with best encoder settings you can't get rid of that.

Interesting! I just got back from having the exact same problem with Xsplit -- exactly the same, right down to the frequency of duplicated frames. For a few hours, been reading about encoders (since I figured this might be the issue, since it seems odd that Xsplit and OBS would have the exact same problem), which lead me, as always, on a wild goose-chase here and there. I ended up finding this thread, right here on the forums:

https://obsproject.com/forum/threads/stuttering-at-60fps-workaround-found.21525/

This would appear to be the issue that we're dealing with. I'm going to try rendering with OpenGL instead of Direct3D. I'll have a look at 'custom resolutions' and drivers to make sure that I'm really getting 60fps. I'll also try playing with vsync.

Thanks!
 

vencabot

Member
[EDIT: Yeah, for me, switching my game to Windowed Mode and then using OBS Studio's Window Capture (rather than Game Capture) makes a huge difference. For anyone reading this thread, hopefully it works for you, too.]

I'm an audio engineer, so I know how technical tinkering can make a man want to pull his hair out, and it seems that video work is exactly the same. Here are a couple of notes:

* OpenGL SEEMED to make the problem worse.

* The game that I'm capturing has no option to disable vsync, but that got me thinking: the last game, where I didn't notice this issue, played in windowed mode. I went back to Direct3D rendering, set THIS game to windowed and used window capture instead of game capture, and playback of the resulting video file seems much smoother. Success?

* Frame-by-framing in VLC, though, still shows a large number of duplicate frames, but that confounded me because, to my eye, the playback was very, very smooth (unlike before). I did some testing and found that VLC'S #$%^'ING 'FRAME-BY-FRAME' FEATURE IS NOT ACCURATE. I have no idea how it calculates a 'frame', but 'frame-by-framing' through the same section of the video will show DIFFERENT frames repeating each time (and, sometimes, no frames repeating). Perhaps this makes sense, since we're talking about a compressed video format which, perhaps (again, I'm new to video) and to my limited understanding doesn't deal strictly with 'frames,' but, rather, with the difference between frames. So maybe what VLC treats as a 'frame' could differ based on its operating state.

In any case, this virtually invalidates all of my findings thus far, since I've been using VLC's 'frame-by-frame' feature to count duplicate frames. For all I know, these videos aren't even choppy, then, by their own nature, and it's merely a result of VLC's failure to decode them properly. They appeared choppy to my eye, and my computer is easily powerful enough to play any 1080p60 mp4 without choppiness, let alone 720p30, but, just in case, I thought that, by frame-by-framing, I'd eliminate the possibility that this was a decoding issue that may be isolated to a single player. Apparently, I have done no such thing.

So, uh... changing the game from full-screen 1080p to windowed 1080p and capturing with the window source made the video much smoother to my eye. And that's apparently all I can say.
 
Last edited:

vencabot

Member
Based on what I'm reading, when a game is 'fullscreen,' it gets special access to the video card's frame buffer, which is why it isn't as easy to switch between applications when one of them is 'fullscreen.' Perhaps this also makes them more difficult to capture smoothly, since the fullscreen application has some kind of private contract with the video card? Or maybe that's exactly why the 'game capture' is a separate source than the 'window' capture? But even then, maybe the 'window capture' really does just work 'better' or more consistently in this regard?

I'm no expert, but, to anyone else having this problem, I recommend trying to run your games in windowed mode and seeing if that helps. If you still want for the window to be 'maximized' and without a border, I recommend trying the software at http://steamcommunity.com/groups/WindowedBorderlessGaming .
 

SiiBlade

New Member
Right, so today I did a lot of fairly drastic measures to try and sort this out, and I did actually manage to sort this out!

But firstly
@vencabot: Thank you for your invaluable testing. I'm not sure if VLC is great at 60fps video, so on the off chance that's giving you issues try PotPlayer. I've used it back on my 980ti recordings and now as well playing back 1440p video and it's silky smooth. Also nice find on the WindowedBorderlessGaming program, I've been using it for a few weeks now to play certain games, but I didn't test those games with OBS recordings.
@Anubisviech: I enable and disable vsync from game to game, I don't believe I used it to test the recording I just did, but I'll see what happens when playing a game with vsync on vs off.

Anyway, here are the order of events I took to getting my system recording properly, with x264 rather than NVENC might I add.

First off, reinstalled my graphics drivers. Tested with no change.
Used DDU in safe mode to uninstall graphics drivers and installed fresh drivers and opted out of 3D vision and HD audio drivers. Tested with no change.

Now, I did all these next thins without testing in between, so I'm not sure which one actually fixed my issue.
Overclocked my graphics card, gave it a +175 core offset and +575 memory offset, checked for stability, spotted one or two artifacts so I might need to tone it back slightly later.
Downloaded newest BIOS for my motherboard, installed that and reapplied my CPU and RAM OC settings.
Proceeded to debug boot errors because I tried applying all OC settings at once rather than one thing at a time.
Learned I could switch my 60Hz monitors to 75Hz, so I did that, which solved a separate flickering issue on one of them.
Uninstalled other recording software (Dxtory and xsplit).
Removed Samsung magician from startup.
Ran Malwarebytes and Avira scans to check for any viruses.
Ran CCleaner to clean up a lot of temp data.
Ran CCleaner's registry cleaner several times until no more issues were being found.
Restarted computer and then tested, log here: https://gist.github.com/51458f5387c9da89552cc66b0a1f16c9
Played recording with PotPlayer, all seems good.

I'm not sure which of these fixed the issue, or was it a combination of these, but my issue seems to be solved. I'll certainly keep an eye out and report back here.
 
Top