Question / Help Random stuttering in preview which goes into recorded videos.

Lapppy

Member
So from what I can tell,
30 fps is fine. (?)
60 fps drops frames every 15 or so minutes. (but doesn't show up in a log file)
120 fps is fine.

And I don't think it is just limited to OBS, I'm thinking it might be a problem with NVIDIA on either the hardware or driver level. Unless there is someone that has this issue with an AMD graphics card.
 

Kapu

New Member
Yes I can confirm that 120 fps is fine. Too bad it's not possible with streaming.

Yesterday I tried to record on a less capable computer (I5 2500k, GTX 780) and I had zero stuttering. And when I switched my GTX 1070 with a GTX 570 in my own rig, I still got the stuterrings. So I'm not sure it's related to the Nvidia cards...
 

Lapppy

Member
Interesting... What are the full specs of the PC with the GTX 780? And also what driver version is it running, etc.

Maybe if you could somehow get the stuttering to happen on this PC and remember what was changed to get it to happen, we could determine the cause.
 

Kapu

New Member
I don't remember all the specs but even if I did, that wouldn' help a lot. There are so many things that could be causing the stutterings...

Concerning the GPU driver, I think it was 388.X. So quite recent but not the latest one. Windows 10 Pro 1709 was installed. Nothing fancy.

Anyway, I'll try to do more testing on both computers these next few days and see if I can find the culprit.

I don't know, I have the feeling something's up with the motherboard (it may only be BIOS related). :/
 
The 120fps limit fix is purely placebo as you guys aren't seeing the deficit of less than 16.667ms frame time, which is where you are noticing it stutter due to the slower draw rate of the frame/s when you are recording/streaming at 60fps.
Have you guys tried a less common integer, such as 45-48fps, or 59.94fps?

Also it seems everybody is on nVidia graphics cards (Something else I have noticed on the forums a lot recently in terms of troubleshooting - Particularly for the GTX 1000 series)
Have you tried rolling back drivers to oldest compatible version then updating to following version (A lot of effort and time if for nothing other than to rule out drivers) to see if there is a difference?

I run a Sapphire Tri-X R9 290x 4GB OC and have not noticed any issues with using either h264 or x264, other than the lack of capability inherit from GPU architecture in regards to performance when using h264, CPU thread limitation when using x264. CPU is a R5 1600 OC @3.825Ghz.

Are you guys using V-Sync to limit fps or using a hard limiter such as config file or MSI AfterBurner/EVGA Precision? V-Sync can have the effect of rapidly switching clocks due to the design of sending a stop and wait command to the GPU, perhaps lowering/raising reference frames in GPU software settings may assist?

Some thoughts on possible causes:
Possible Windows 10 latest (Assuming everybody is keeping their OS up to date) DirectX call functions conflicting with the installed game DirectX files. Solution may be found in re-installing the DirectX files found in game ReDist. folder.
Perhaps thread prioritization issue within Windows 10, perhaps changing OBS to High Process Priority and games to Above Normal will alleviate.
Perhaps background service such as Windows Defender, Telemetry, Search Indexer, Windows Update/Software Update checker is conflicting? Would need to log using performance/resource monitor in Windows.
Multiple software sensors reading hardware conflicting when they read the same sensor at the same time?
If nVidia GPU affected only, then perhaps driver optimization techniques (VRAM buffer flushing, object culling, tessellation, etc) in conflict with DirectX call functions when running Windows 10?

I would say the issue is more likely software than hardware, unless it is inherit to nVidia only and is now being seen with Windows 10 and later driver revisions?

If it can be defined as a repeated interval in time, then you have a base to start in finding the culprit.

Can you guys find a game which you all have to reproduce the issue?
 

Lapppy

Member
The 120fps limit fix is purely placebo as you guys aren't seeing the deficit of less than 16.667ms frame time, which is where you are noticing it stutter due to the slower draw rate of the frame/s when you are recording/streaming at 60fps.

I can confirm that the problem is still happening even when recording at 120fps. If I take a video recorded at 120fps and then re-encode it to 60fps, the stutters appear to return.

Have you guys tried a less common integer, such as 45-48fps, or 59.94fps?

Yes, In my case, recording at anything that is not a multiple of the monitors refresh rate will introduce frame skips. Down to the 0.001Hz. Recording at 59.94 causes frame skipping to happen considerably more frequently, which is the complete opposite of what we are looking for. I have tested this on multiple PC's and monitors.

Also it seems everybody is on nVidia graphics cards (Something else I have noticed on the forums a lot recently in terms of troubleshooting - Particularly for the GTX 1000 series)
Have you tried rolling back drivers to oldest compatible version then updating to following version (A lot of effort and time if for nothing other than to rule out drivers) to see if there is a difference?

A driver where the problem doesn't happen? Hmmm. For me that would be a driver from as early as late 2014/early 2015.
And there's not a chance that my GTX 1070 or Windows 10 would support it, lol.

Anyways, the oldest compatible driver that NVIDIA offers for my card is 378.92 from March 2017. Keep in mind that I've been having this problem for over three years across multiple PC's. I could try downgrade to that driver, but I feel I already know what the results will be.

Are you guys using V-Sync to limit fps or using a hard limiter such as config file or MSI AfterBurner/EVGA Precision? V-Sync can have the effect of rapidly switching clocks due to the design of sending a stop and wait command to the GPU, perhaps lowering/raising reference frames in GPU software settings may assist?

Recording without VSYNC or some sort of frametime lock is worthless for the same reasons as above. Without it, the output file is a complete mess full of duplicated or skipped frames that aren't logged in a log file. I'm not talking about dropped frames due to maxing out the GPU usage / uncapping the framerate, which is a common problem seen on the forums here.
Adjusting "maximum pre-rendered frames" has no effect on this issue, assuming that is what you meant by that.

Some thoughts on possible causes:
Possible Windows 10 latest (Assuming everybody is keeping their OS up to date) DirectX call functions conflicting with the installed game DirectX files. Solution may be found in re-installing the DirectX files found in game ReDist. folder.
Perhaps thread prioritization issue within Windows 10, perhaps changing OBS to High Process Priority and games to Above Normal will alleviate.
Perhaps background service such as Windows Defender, Telemetry, Search Indexer, Windows Update/Software Update checker is conflicting? Would need to log using performance/resource monitor in Windows.
Multiple software sensors reading hardware conflicting when they read the same sensor at the same time?
If nVidia GPU affected only, then perhaps driver optimization techniques (VRAM buffer flushing, object culling, tessellation, etc) in conflict with DirectX call functions when running Windows 10?

I already have OBS set to high priority, but I haven't bothered touching priority of games or other software yet.
In my case, the problem doesn't happen every 15 minutes from the start of Windows, The problem happens from the start of recording. Stopping and starting the recording again resets the "timer". If I had to, I could record my stuff in a bunch of small 5-10 minute segments and I could bypass this issue.
So maybe there's another process that is somehow using resources on a set interval from the start of recording. I have my recording directory set as an exclusion in Windows Defender, so I don't think it's that. Search Indexer is disabled entirely.

Can you guys find a game which you all have to reproduce the issue?

It can happen on the desktop or a web browser. There is no need for a game to reproduce the issue.
For some tests a while back I Just visited www.vsynctester.com, recorded it with desktop capture and made myself a sandwich while it recorded.
In my case, I am primarily using Overwatch as my test game. But I have seen it in virtually every game I have tried.
 
Last edited:
Lapppy said:
Yes, In my case, recording at anything that is not a multiple of the monitors refresh rate will introduce frame skips. Down to the 0.001Hz. Recording at 59.94 causes frame skipping to happen considerably more frequently, which is the complete opposite of what we are looking for. I have tested this on multiple PC's and monitors.
In regards to the multiple PC's, can you provide specs for them please.
Lapppy said:
A driver where the problem doesn't happen? Hmmm. For me that would be a driver from as early as late 2014/early 2015.
And there's not a chance that my GTX 1070 or Windows 10 would support it, lol.
Anyways, the oldest compatible driver that NVIDIA offers for my card is 378.92 from March 2017. Keep in mind that I've been having this problem for over three years across multiple PC's. I could try downgrade to that driver, but I feel I already know what the results will be.
That is a very long time to have an issue unresolved. I don't think I'd even attempt a roll-back to that date, so much has changed since then that it would most likely be a compatibility nightmare just with the OS.
In regards to the multiple PC's over the years, can you provide specs for them please.
Lapppy said:
Recording without VSYNC or some sort of frametime lock is worthless for the same reasons as above. Without it, the output file is a complete mess full of duplicated or skipped frames that aren't logged in a log file. I'm not talking about dropped frames due to maxing out the GPU usage / uncapping the framerate, which is a common problem seen on the forums here.
Adjusting "maximum pre-rendered frames" has no effect on this issue, assuming that is what you meant by that.
Limiting frame rates when streaming/recording is definitely the way to go, it is just about entirely pointless to exceed the monitor refresh rate in any game, bar a handful of game engines that have negative impact on hardware input at lower framerates (Source Engine games, most notably)
Pre-Rendered Frame limit allocation was being referred to.
Lapppy said:
I already have OBS set to high priority, but I haven't bothered touching priority of games or other software yet.
In my case, the problem doesn't happen every 15 minutes from the start of Windows, The problem happens from the start of recording. Stopping and starting the recording again resets the "timer". If I had to, I could record my stuff in a bunch of small 5-10 minute segments and I could bypass this issue.
So maybe there's another process that is somehow using resources on a set interval from the start of recording. I have my recording directory set as an exclusion in Windows Defender, so I don't think it's that. Search Indexer is disabled entirely.
Have you got OBS directory excluded as well as game directory? It does sound like interference from a background app, especially an AV service that runs on demand interaction checks on file use. Not sure as to why it would 'pulse' on a timer though as after the initial file scan it should be happy to let it go (Other than file being written to the recording directory)
Lapppy said:
It can happen on the desktop or a web browser. There is no need for a game to reproduce the issue.
For some tests a while back I Just visited www.vsynctester.com, recorded it with desktop capture and made myself a sandwich while it recorded.
In my case, I am primarily using Overwatch as my test game. But I have seen it in virtually every game I have tried.
If it also happens outside of games, then perhaps there is an issue with OBS that a dev needs to take a look at.

Have any of you guys noted any clock/utilization/VRAM usage changes on your graphics card when the issue occurs? Wish I had the issue in a sense as I could also actively test for a solution, whether it be a fix or workaround. Unfortunately I am limited to throwing out ideas/suggestions as a 3rd party...
 

Lapppy

Member
In regards to the multiple PC's, can you provide specs for them please.

I've provided specs for my two main PCs in this post.
I've also have seen this issue on one other PC that I no longer use, here are the current specs:

HP ENVY 700-349 (prebuilt)
Intel i7-4790 3.6GHz
EVGA NVIDIA GTX 960 (upgraded from NVIDIA GTX 645)
12GB RAM
1TB 7200rpm
2x Samsung S22D390 monitor 60hz (One monitor is connected via HDMI, the other is connected via DVI)

Have you got OBS directory excluded as well as game directory? It does sound like interference from a background app, especially an AV service that runs on demand interaction checks on file use. Not sure as to why it would 'pulse' on a timer though as after the initial file scan it should be happy to let it go (Other than file being written to the recording directory)

No, I'll add the OBS directory as an exclusion and post back with findings later.

Have any of you guys noted any clock/utilization/VRAM usage changes on your graphics card when the issue occurs? Wish I had the issue in a sense as I could also actively test for a solution, whether it be a fix or workaround. Unfortunately I am limited to throwing out ideas/suggestions as a 3rd party...

The only thing I have noticed is that video memory clocks go to a lower power state when using CUDA/NVENC by default. This is easily fixed by changing a setting in NVIDIA inspector.
In the past I have monitored graphs while playing games and recording and I don't recall seeing anything out of the ordinary when the frames started dropping.
 
Last edited:

Kapu

New Member
I've done more testing, more tweaking, and that's just impossible to get a flawless recording on my rig. I noticed that even if we do not consider the big recurrent stutterings, you can feel some micro stuttering occuring from time to time. I invite you to check my own thread and my YT videos on the issue : https://obsproject.com/forum/threads/regular-stutterings-on-preview-recorded-videos.80031.

On W7 it was way smoother, too bad it's still impacted by the big stutterings...

Oh and I tried Shadowplay : still choppy.

Now I'm really curious to know if someone tried to use a decent Radeon instead of a GTX, just to see if we get the same results or not.
 
Can you guys all please do a single fresh local recording (Hopefully without any encoding/rendering lagged frames reported) then exit OBS, then open OBS and upload the last logfile so it includes the Profiler Statistics in the logfile:

16:20:07.025: obs_graphics_thread(16.6667 ms): min=0.159 ms, median=0.956 ms, max=533.688 ms, 99th percentile=3.719 ms, 99.9002% below 16.667 ms
16:20:07.025: ┣tick_sources: min=0.001 ms, median=0.01 ms, max=532.897 ms, 99th percentile=0.08 ms
16:20:07.025: ┣output_frame: min=0.156 ms, median=0.657 ms, max=3.03 ms, 99th percentile=1.039 ms
16:20:07.025: ┃ ┣gs_context(video->graphics): min=0.099 ms, median=0.171 ms, max=2.741 ms, 99th percentile=0.295 ms
16:20:07.025: ┃ ┃ ┣render_video: min=0.023 ms, median=0.05 ms, max=0.941 ms, 99th percentile=0.112 ms
16:20:07.025: ┃ ┃ ┃ ┣render_main_texture: min=0.004 ms, median=0.017 ms, max=0.068 ms, 99th percentile=0.038 ms
16:20:07.025: ┃ ┃ ┃ ┣render_output_texture: min=0.003 ms, median=0.012 ms, max=0.923 ms, 99th percentile=0.035 ms
16:20:07.025: ┃ ┃ ┃ ┣render_convert_texture: min=0.001 ms, median=0.011 ms, max=0.041 ms, 99th percentile=0.023 ms
16:20:07.025: ┃ ┃ ┃ ┗stage_output_texture: min=0 ms, median=0.006 ms, max=0.148 ms, 99th percentile=0.015 ms
16:20:07.025: ┃ ┃ ┣download_frame: min=0 ms, median=0.004 ms, max=0.031 ms, 99th percentile=0.01 ms
16:20:07.025: ┃ ┃ ┗gs_flush: min=0.057 ms, median=0.113 ms, max=1.797 ms, 99th percentile=0.182 ms
16:20:07.025: ┃ ┗output_video_data: min=0.304 ms, median=0.486 ms, max=2.211 ms, 99th percentile=0.716 ms
16:20:07.025: ┗render_displays: min=0 ms, median=0.284 ms, max=3.447 ms, 99th percentile=0.507 ms
16:20:07.025: video_thread(video): min=0.001 ms, median=0.002 ms, max=0.007 ms, 99th percentile=0.005 ms

Hopefully someone with an AMD card can chime in with the same/similar issue as I do not with my R9 290X. To date it appears to be nVidia alone, if it occurs with other recording software I would say it also rules out OBS itself. That said we can use OBS to a certain degree to try and leverage more of an understanding as to what is going on when the issue occurs, using the profiler statistics portion of the logfile.

I would hazard a guess it lies with an issue in the rendering pipeline of nVidia cards, when the frame is being rendered concurrently whilst the video card is under load? Doesn't make a lot of sense if the issue also occurs outside of gaming though... I don't know anywhere near enough about the architecture in regards to the inner workings of how prioritization is done with multiple concurrent rendering streams in the pipeline on GPU's, will have to look into that to see if I can find some info. Got work so will have to be later today.
 

Lapppy

Member
Here is a log without any dropped frames.

Also the recording from this log: https://youtu.be/oNul5ziw73k?t=470. I recorded vsynctester.com and the OBS stats window.
The stutters start at around 7:50, slowly building up to its peak at around 8:05. It lasts until around 8:50.

Normally the stutters have been happening every 15 minutes for me, but in this recording it happened once at 8 minutes and then it didn't happen again during this recording.

EDIT: I should also mention I am currently using a build of OBS that is not a stable release. The build I am using is based on this commit.
Keep in mind that the issue happens on the stable release as well, from the start of recording.
 

Attachments

  • 2018-02-08 15-19-51.txt
    12.8 KB · Views: 33
Last edited:

Kapu

New Member
Sure, I posted a few logs of local recordings on my thread.

First one on PES 2018, classic x264 CBR 3500 :
https://obsproject.com/forum/attachments/2018-01-22-14-43-31-txt.33536.

And this one on Rocket League, x264 CBR 7000 :
https://obsproject.com/forum/attachments/2018-02-06-20-56-27-txt.34054.

Oh and I tried Lapppy's www.vsynctester.com method, I get the very same stutterings every ~13 minutes, even though I'm not ingame : https://youtu.be/g2mozV0Cx3M @11:15-11:47 / 24:21-24:59 / 37:41-38-13, 50:49-51:25, etc. I'm uploading the log as well.
 

Attachments

  • 2018-02-08 03-22-01.txt
    12.3 KB · Views: 27

Lapppy

Member
When you look at the stats window in the video I uploaded, the bitrate drops to around 4000-5000kb/s during the stutter issue, when normally it would hit up to 10000kb/s.

Using a bitrate graph viewer, you can easily identify if a stutter issue occurs in a vsynctester video without having to seek through a recording to find it. (if recording using a variable bit rate / cfr)

bitrate.png


In this example, I did a recording that was 1 hour 20 minutes long with no audio sources. The stutter event happened twice, once at 25 minutes and again at 56 minutes.
I'm not exactly sure why the timing is different now that I've removed my audio sources, let alone using vsynctester as my test subject.
 
Last edited:
Lapppy, with that unstable version you are running you are encountering a heap of memory leaks, though they don't seem to be contributing in any form whatsoever in regards to the hitching in your video link, or going by the profiler statistics of the recording.
I'm also not entirely sure the drop in bitrate is more than a coincidence, I also see that occurring during my local recordings of game play footage in pretty much every single game, whether it be using x264 or h264.
I think it is down to a case of the encoder just not needing anywhere near the amount of bitrate for those frames (Whether they are single or multiple) I've even seen drops down to a few hundred kb in Battlefield 4 recordings with no apparent quality loss/stutter, etc.

I think there is something entirely different going on for you guys, below is an example of a recording using desktop capture, 1080p60fps, h264 (AMD AMF) OBS built-in High Quality preset:
Balanced quality preset
i & p-frame QP 18
keyframe of 2.00
https://youtu.be/FuHUHJjo5tQ
It is pretty much exactly the same regardless of recording length, same for using x264. The only way I can get similar hitching is by deliberately overloading the encoder, which doesn't seem to be the case for you guys according to the output of OBS Profiler Statistics for both of you guys.

Also take note that I have a Sapphire R9 290X 4GB Tri-X OC, which is a silicon lottery fail purchase for me in regards to overclocking, can only achieve 1080 core (Default 1040) 1450 memory (Default 1300) stable on air with latest drivers, using MSI Afterburner to overclock (Wattman - AMD's GPU overclocking utility is utter crap) so it is older gen. tech as well, reported recording capability is below link:
https://github.com/Xaymar/obs-studio_amf-encoder-plugin/wiki/Hardware-VCE2.0
https://github.com/Xaymar/obs-studio_amf-encoder-plugin/wiki/Hardware-VCE2.0#r9-290x

From my very basic understanding of OBS profiler statistics output, there is nothing at all to indicate the issue is with OBS either.
 

DEDRICK

Member
I see you saw my crazy remove audio device post before I deleted it lol

I have replicated this issue in both OBS and SLOBS with my 1080ti, you don't even have to be recording.

It is not GPU Core or memory clock related, nor is it device timestamp, sample rate or anything that would cause synchronization. Occurs with both Integer and fractional FPS. My monitors report as 59.94, the issue is still present when recording at 59.94 though occurs less often.

The audio idea was based around DPC latency, which there is a tool for checking, I'm at work so I can't test it. I'm not even sure it works in Windows 10. If you have temporary DPC latency spikes I can cause real-time audio and video dropouts. NVIDIA drivers in the past have been known to increase it as well

http://www.thesycon.de/eng/latency_check.shtml

https://www.reddit.com/r/nvidia/comments/4wev6w/about_my_gtx_1070s_dpc_that_didnt_go_down_with/

Something called dynamictick in Windows 8 and 10 could also cause increased DPC latency, I'm just pulling data as I find it.

https://superuser.com/questions/1293337/what-is-the-purpose-of-dynamic-tick-in-windows/1293350

The article goes on to explain why you might want to disable this feature:

This [feature] is nice for portable and battery systems but can be a problem for desktops, especially since the tickless mode has been known to cause strange issues on some systems; especially when gaming or engaged in other media related tasks.

There's also the High Precision Event Timer which apparently causes stuttering in games.

https://www.reddit.com/r/PUBATTLEGR...ing_stuttering_or_lower_fps_than_others_with/
 
Last edited:

DEDRICK

Member
Perfect thanks, yeah DPC Checker just reports 4000micro seconds lol

Hey look at that...NVIDIA..it actually jumped to 441us. My DPC goes up if I disable my NVIDIA drivers though so that might be the wrong avenue.

hdSkHYE.png


When I reinstalled windows 10 it didn't install my motherboard drivers, so my PCIe COntroller driver was from 2006...I did something unheard of and updated EVERY driver (Snappy Driver Installer, quite handy lol)

NVIDIA is still high but I got my DPC down, lets see if anything changes, I already did the Dynamictick and HPET stuff and it did nothing so I've turned them back on.

No change
 
Last edited:

Lapppy

Member
I'm also not entirely sure the drop in bitrate is more than a coincidence, I also see that occurring during my local recordings of game play footage in pretty much every single game, whether it be using x264 or h264.

I never meant to imply that it's a cause of the issue, rather that it's an easy way to help determine if the issue happens in a test video.
 

Kapu

New Member
First of all, I'd like to thank Lapppy, BornDownUnder and DEDRICK, for all the help you're providing. Sure we still have to solve the puzzle, but I can't help feeling we're somehow making some progress. So yeah, thank you guys !

Now I've got some interesting news for you :

- On my 6700k rig, I've tried DPC Latency Checker and even though it seems I have very rare random spikes if I let it open and do other things on my computer, these spikes do not occur when there are stutterings on OBS. So I'm not sure it's related.

- This is what I get on LatencyMon after 1h30 : https://tof.cx/image/BqYx9.

- And I disabled HPET but it didn't change anything.

-On my 2500k / GTX 780 / Asus P8P67 Pro / G.Skill Ripjaws X ddr3 1600 rig, I've made a long recording of www.vsynctester.com and... the stutterings are also occuring there ! You can check the recording here (and the log I'm uploading) : https://youtu.be/HHqyBJnx1jk. By the way, I don't know how you're getting such a stable frequency on your monitor, mine seem so hectic compared to yours.

At this point, I don't think it's a motherboard issue anymore. That's only a guess, but (like Lapppy) I'd say it's more likely related to the Nvidia hardware/drivers.

I have a good old Radeon HD 4770 waiting on my table, so I'm going to try that and see if I get different results...
 

Attachments

  • 2018-02-10 17-10-53.txt
    11.9 KB · Views: 22
Top