Interval stutter / jitter / duplicated frames bug - workarounds

rockbottom

Active Member
While you're working on it & troubleshooting, it might be a good idea to create a new Scene Collection so you're testing OBS with a clean slate. Add just (1) Source. You can switch back later.
 

Image Diller

New Member
While you're working on it & troubleshooting, it might be a good idea to create a new Scene Collection so you're testing OBS with a clean slate. Add just (1) Source. You can switch back later.
Indeed, if the problem is audio lag, then recording in an empty scene collection should help.
I'll try recording some gameplay and report back with the results.
Thank you for taking the time to help me.
 

Image Diller

New Member
While you're working on it & troubleshooting, it might be a good idea to create a new Scene Collection so you're testing OBS with a clean slate. Add just (1) Source. You can switch back later.
I tried a recording test with an empty OBS. I used a new scene collection and added only a game capture with default settings. This time, I was recording, not streaming. Stuttering still occurs. It can be noticed starting at 13 seconds.


If you look at the camera movements or how the stonework of the road goes behind the camera, it seems like the FPS has dropped.
When recording, the error report turned out different, although the OBS only has 1 scene and only 1 capture source

 

rockbottom

Active Member
There's no rendering lag now & your audio thread looks much better too. So some progress.

I see that you switched Scene Collections in the log but there doesn't appear to be a new collection created.

Also, how about that F drive, is it getting full? Can you record to another drive?
 

rockbottom

Active Member
The audio did lag when you were using this collection. Could be a sign of system overload.
21:47:03.137: Switched to scene collection 'Безымянный' (Безымянный.json)

22:38:23.686: Max audio buffering reached!
22:38:23.686: adding 917 milliseconds of audio buffering, total audio buffering is now 960 milliseconds (source: Звук раб. стола)
22:38:23.686:
22:38:23.706: Source Звук раб. стола audio is lagging (over by 84387.45 ms) at max audio buffering. Restarting source audio.
 

Image Diller

New Member
There's no rendering lag now & your audio thread looks much better too. So some progress.

I see that you switched Scene Collections in the log but there doesn't appear to be a new collection created.

Also, how about that F drive, is it getting full? Can you record to another drive?
Yes, indeed, I noticed that I had an empty scene collection. I thought I could use it since it was empty. It was created when I reinstalled OBS, and my usual streaming collection was restored from a backup.

I recorded to an SSD drive, it still has 75 GB left.

Yes, I also noticed this in the report. It's very strange. Maybe I have some kind of problem with the sound card or its drivers. Maybe it also affects the video rendering...
I think I'll try to check it out.
 

rockbottom

Active Member
That's why I like to create the new collection with just 1 source when troubleshooting. Collections can get bugged & cause trouble. Maybe audio routing is the issue or something else going on with it.

No idea how big that drive is but I like to make sure there's a minimum of 20% free space at all times. 15% when used for archiving purposes.

I decided not to put a soundcard in this rig when I built it for a reason. Had audio issues with my old rig until I switched over to the on-board & have never looked back.
 

Image Diller

New Member
That's why I like to create the new collection with just 1 source when troubleshooting. Collections can get bugged & cause trouble. Maybe audio routing is the issue or something else going on with it.

No idea how big that drive is but I like to make sure there's a minimum of 20% free space at all times. 15% when used for archiving purposes.

I decided not to put a soundcard in this rig when I built it for a reason. Had audio issues with my old rig until I switched over to the on-board & have never looked back.
Yes, it turns out that's the only clue we have right now. Apparently, there's some kind of audio delay, causing the video to lose frames in order to sync with the sound. And it's not even the microphone and its processing that's causing the issue, but the sound system itself. I think so, because the stuttering is also present in the scene without a microphone.

The only thing left to figure out is how to get the sound working in the system. The audio sampling rate is the same, namely 48 Hz, in both the system and the OBS. However, in the system it's 32 bit, so I'm not sure if this makes a difference. Perhaps I can reduce the sound card buffer to reduce the audio latency?

Yes, this is approximately 25% of the total disk capacity.
 

rockbottom

Active Member
It's the only part that is lagging.

This is the suspect device & OBS is using it's laggy timing...
Source Звук раб. стола audio is lagging (over by 84387.45 ms) at max audio buffering. Restarting source audio
21:43:38.429: [win-wasapi: 'Звук раб. стола'] update settings:
21:43:38.429: device id: default
21:43:38.429: use device timing: 1

32-bit should be OK but you may want to test 16 & 24.

Perfect!
 

rockbottom

Active Member
I already gave you the specs for the El Gato, you're clearly not following them.....

video device: Elgato 4K X
04:45:12.391: video path: \\?\usb#vid_0fd9&pid_009b&mi_00#8&26b0a24&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
04:45:12.391: resolution: 2560x1440
04:45:12.391: flip: 0
04:45:12.391: fps: 120.00 (interval: 83333)
 

rockbottom

Active Member
Another issue that may be rearing it's ugly head is your CPU bottleneck. 12900H is not a good match for a 4090. Proof, my 12900k is a bottleneck to my 3090. I think it would be a good idea to try backing off the hi-refresh/framerates & go with 60HZ/60FPS & see if you can get traction.


A slower CPU can also result in more stutters and framerate inconsistencies. We run each test multiple times and use the best result (after discarding the first run), which represents something of a best-case scenario. Diablo IV, to cite that example again, has a ton of stuttering as you enter new areas on the 8700K, to the point that it can at times become unplayable — you definitely don't want to try hardcore mode with a slower CPU and DXR enabled.
 
Last edited:

BenReddic

New Member
I have managed to get a few good recordings with my setup that includes a low-lag vsync setup with a FPS cap just below my exact refresh rate of my fixed refresh monitor (exact refresh 59.946). My 2080Ti seems to struggle (not so surprising when I already am using the most of it's resources for use in MSFS 2020, but goal has been acceptable quality with the same smoothness I am seeing on my monitor). This recording is with a RTSS cap of 59.93 and OBS capture FPS of 59.94 and a 2560x1440 resolution outputted at 1920x1080@60fps (couldn't get 2k recording stable without stutters).
19:01:45.450: obs_hotkey_thread(25 ms): min=0.002 ms, median=0.004 ms, max=0.694 ms, 99th percentile=0.033 ms, 100% below 25 ms
19:01:45.450: audio_thread(Audio): min=0.005 ms, median=0.107 ms, max=5.121 ms, 99th percentile=0.544 ms
19:01:45.450: ┗receive_audio: min=0.004 ms, median=0.09 ms, max=5.09 ms, 99th percentile=0.533 ms, 0.832601 calls per parent call
19:01:45.450: ┣buffer_audio: min=0 ms, median=0 ms, max=0.066 ms, 99th percentile=0.001 ms
19:01:45.450: ┗do_encode: min=0.059 ms, median=0.088 ms, max=5.088 ms, 99th percentile=0.531 ms
19:01:45.450: ┣encode(Track1): min=0.054 ms, median=0.07 ms, max=0.789 ms, 99th percentile=0.099 ms
19:01:45.450: ┗send_packet: min=0.001 ms, median=0.018 ms, max=5.013 ms, 99th percentile=0.457 ms
19:01:45.450: obs_graphics_thread(16.6833 ms): min=0.035 ms, median=0.158 ms, max=3.763 ms, 99th percentile=1.174 ms, 100% below 16.683 ms
19:01:45.450: ┣tick_sources: min=0.001 ms, median=0.005 ms, max=2.696 ms, 99th percentile=0.009 ms
19:01:45.450: ┣output_frame: min=0.03 ms, median=0.149 ms, max=3.755 ms, 99th percentile=1.15 ms
19:01:45.450: ┃ ┗gs_context(video->graphics): min=0.03 ms, median=0.149 ms, max=3.613 ms, 99th percentile=1.059 ms
19:01:45.450: ┃ ┣render_video: min=0.002 ms, median=0.132 ms, max=2.796 ms, 99th percentile=0.906 ms
19:01:45.450: ┃ ┃ ┣render_main_texture: min=0.001 ms, median=0.009 ms, max=1.085 ms, 99th percentile=0.023 ms
19:01:45.450: ┃ ┃ ┣render_output_texture: min=0.002 ms, median=0.003 ms, max=0.958 ms, 99th percentile=0.005 ms, 0.832843 calls per parent call
19:01:45.450: ┃ ┃ ┣render_convert_texture: min=0.004 ms, median=0.008 ms, max=0.972 ms, 99th percentile=0.022 ms, 0.832843 calls per parent call
19:01:45.450: ┃ ┃ ┗output_gpu_encoders: min=0 ms, median=0.026 ms, max=1.326 ms, 99th percentile=0.258 ms, 0.832843 calls per parent call
19:01:45.450: ┃ ┗gs_flush: min=0.003 ms, median=0.023 ms, max=2.158 ms, 99th percentile=0.24 ms
19:01:45.450: ┗render_displays: min=0 ms, median=0 ms, max=0.619 ms, 99th percentile=0.001 ms
19:01:45.450: obs_gpu_encode_thread(16.6833 ms): min=0.104 ms, median=0.198 ms, max=6.688 ms, 99th percentile=0.823 ms, 100% below 16.683 ms
19:01:45.450: ┣gpu_encode_frame: min=0.097 ms, median=0.169 ms, max=6.677 ms, 99th percentile=0.685 ms
19:01:45.450: ┗send_packet: min=0.004 ms, median=0.009 ms, max=4.513 ms, 99th percentile=0.166 ms
19:01:45.450: =================================================
19:01:45.450: == Profiler Time Between Calls ==================
19:01:45.450: obs_hotkey_thread(25 ms): min=24.214 ms, median=25.284 ms, max=35.745 ms, 82.4762% within ±2% of 25 ms (0.0680684% lower, 17.4558% higher)
19:01:45.450: obs_graphics_thread(16.6833 ms): min=13.315 ms, median=16.683 ms, max=20.051 ms, 97.3427% within ±2% of 16.683 ms (1.33613% lower, 1.32117% higher)
19:01:45.450: obs_gpu_encode_thread(16.6833 ms): min=12.495 ms, median=16.683 ms, max=20.865 ms, 90.8639% within ±2% of 16.683 ms (4.59199% lower, 4.54409% higher)
19:01:45.450: =================================================
19:01:45.662: Number of memory leaks: 0


 

Image Diller

New Member
It's the only part that is lagging.

This is the suspect device & OBS is using it's laggy timing...
Source Звук раб. стола audio is lagging (over by 84387.45 ms) at max audio buffering. Restarting source audio
21:43:38.429: [win-wasapi: 'Звук раб. стола'] update settings:
21:43:38.429: device id: default
21:43:38.429: use device timing: 1

32-bit should be OK but you may want to test 16 & 24.

Perfect!
Good evening!
I completely disconnected everything from my motherboard, including the microphone and webcam, to rule out any potential microphone latency affecting the video.

I ran tests and discovered that the recording contained duplicate frames.
I realized this after I downloaded the Premiere Pro video and saw the duplicate frames with my own eyes :(

It turns out the search circle has narrowed; all that remains is to understand why frames may be duplicated.
I can say for sure that it's not:
- The video card and drivers (since this happened with the previous video card and with many other drivers, including a clean installation)
- Windows (since I have the latest version of Windows 10 installed and all features that could cause problems are disabled)
- Second monitor (since I recorded this fragment with the second monitor disconnected from the motherboard)
- OBS (since this problem exists on both XPlit and Streamlabs)
- I also tried everything (running as administrator, setting OBS to high priority in both the settings and the task manager, all sorts of old OBS versions, a completely clean OBS with one recording source)

For some reason the footage is duplicated, but why?
 

OmegaMalkior

New Member
I already gave you the specs for the El Gato, you're clearly not following them.....

video device: Elgato 4K X
04:45:12.391: video path: \\?\usb#vid_0fd9&pid_009b&mi_00#8&26b0a24&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
04:45:12.391: resolution: 2560x1440
04:45:12.391: flip: 0
04:45:12.391: fps: 120.00 (interval: 83333)
I mean I already set the console to SDR to match its output. My main goal is 120 FPS without stuttering. Something the app Elgato Studio can already do on PC, which I want OBS to be able to also do. And the Elgato 4K X can do 1440p 120 FPS SDR, so we're within specs here.
Another issue that may be rearing it's ugly head is your CPU bottleneck. 12900H is not a good match for a 4090. Proof, my 12900k is a bottleneck to my 3090. I think it would be a good idea to try backing off the hi-refresh/framerates & go with 60HZ/60FPS & see if you can get traction.
I mean I'm not even encoding anything tho? Again this isn't for recording or streaming, it's just to output it on the Preview/Program Projector and nothing else. I saw the chart that had the stats for when I was doing that recording even, a 2% CPU usage only, with no dropped frames registered anywhere on the chart... I can't really buy this is a CPU problem. Especially when another program essentially proves that isn't the issue. This is an OBS issue unless explicitly presented otherwise. If not I would have said issues in Elgato Studio, which as mentioned previously, I do not. If one program proved my setup was fine, that means the other has potential to be fine as well. It just needs the optimization for it, whatever it may be.
Diablo IV, to cite that example again, has a ton of stuttering as you enter new areas on the 8700K, to the point that it can at times become unplayable — you definitely don't want to try hardcore mode with a slower CPU and DXR enabled.
I am not running any actual games on the PC, so this is entirely unrelated to my case. Nothing remotely heavy is being run on my PC when doing the use case I've provided/explained here.

P.S: The stutters also happen in 60 FPS mode as well btw. So no, lowering the frame rate doesn't fix the problem either. Even more reason to believe it isn't the CPU the problem here.
 
Last edited:

rockbottom

Active Member
Good evening!
I completely disconnected everything from my motherboard, including the microphone and webcam, to rule out any potential microphone latency affecting the video.

I ran tests and discovered that the recording contained duplicate frames.
I realized this after I downloaded the Premiere Pro video and saw the duplicate frames with my own eyes :(

It turns out the search circle has narrowed; all that remains is to understand why frames may be duplicated.
I can say for sure that it's not:
- The video card and drivers (since this happened with the previous video card and with many other drivers, including a clean installation)
- Windows (since I have the latest version of Windows 10 installed and all features that could cause problems are disabled)
- Second monitor (since I recorded this fragment with the second monitor disconnected from the motherboard)
- OBS (since this problem exists on both XPlit and Streamlabs)
- I also tried everything (running as administrator, setting OBS to high priority in both the settings and the task manager, all sorts of old OBS versions, a completely clean OBS with one recording source)

For some reason the footage is duplicated, but why?

Still using the same scene collection that may or may not be flawed & you still have lag. Maybe the source you're using is bad.

You already know it's not OBS.
 

rockbottom

Active Member
I mean I already set the console to SDR to match its output. My main goal is 120 FPS without stuttering. Something the app Elgato Studio can already do on PC, which I want OBS to be able to also do. And the Elgato 4K X can do 1440p 120 FPS SDR, so we're within specs here.

I mean I'm not even encoding anything tho? Again this isn't for recording or streaming, it's just to output it on the Preview/Program Projector and nothing else. I saw the chart that had the stats for when I was doing that recording even, a 2% CPU usage only, with no dropped frames registered anywhere on the chart... I can't really buy this is a CPU problem. Especially when another program essentially proves that isn't the issue. This is an OBS issue unless explicitly presented otherwise. If not I would have said issues in Elgato Studio, which as mentioned previously, I do not. If one program proved my setup was fine, that means the other has potential to be fine as well. It just needs the optimization for it, whatever it may be.

I am not running any actual games on the PC, so this is entirely unrelated to my case. Nothing remotely heavy is being run on my PC when doing the use case I've provided/explained here.

P.S: The stutters also happen in 60 FPS mode as well btw. So no, lowering the frame rate doesn't fix the problem either. Even more reason to believe it isn't the CPU the problem here.

It may or may not be the issue. There's a significant bottleneck, I just made you aware of it.

I've tried but can't duplicate your issue with the Preview/Projector. Running smooth as butter on my rig with no stuttering observed.

Have you tried disabling HAGS? Something I don't use so might be worth the shot.

Post the log.
 

OmegaMalkior

New Member

It may or may not be the issue. There's a significant bottleneck, I just made you aware of it.

I've tried but can't duplicate your issue with the Preview/Projector. Running smooth as butter on my rig with no stuttering observed.

Have you tried disabling HAGS? Something I don't use so might be worth the shot.

Post the log.

It's fine to mention it in general but for my case I'd accept the bottleneck claim if I were actually playing a game or something demanding on the PC, but the fact I get 1-2% CPU/10-13% GPU usage at max while not even recording paints another story. Again if Elgato Studio can utilize a i9-12900H fine, OBS should be more than capable. I see something saying about 17 lost or lagged frames or something, lmao it is absolutely more than that that can be seen, so the logs aren't even capable of properly "grabbing" what's really going on here. Logging needs to be updated for this kind of thing.

I disabled HAGS, same stutter result btw.
 

rockbottom

Active Member
Those 17 lagged frames happened do to GPU overload. The log doesn't lie. Looks to me like your system is struggling. Maybe it's a driver conflict or a bad source. OBS is not causing your pain.
 

OmegaMalkior

New Member
Those 17 lagged frames happened do to GPU overload. The log doesn't lie. Looks to me like your system is struggling. Maybe it's a driver conflict or a bad source. OBS is not causing your pain.
The log “doesn’t lie” but it’s clearly incomplete. I am experiencing a LOT more frames lost than just 17 out of the total really high amount that it was able to register. I even saw in real time when the stuttering occurred, and the OBS stat page didn’t even increase the lost frames number!

I can set the FPS recorded + source to be 30 FPS as well. And guess what, the stuttering still occurs. You’re really going to tell me a 4090 and 14 core CPU can’t really do a preview of a mere 30 FPS smoothly? I’m sorry, but this is straight up ignoring facts here, come now.

OBS has an issue as a program to “interpret” this Program/Preview Projector in a smooth fashion. The logs don’t pick up anything on it and the frames lost don’t add up to anything close than to the apparent reported ones. Just because it’s fine for you doesn’t mean the problem doesn’t exist for me or for others based off on the program OBS.

Whatever black magic, if you want to acuse it of that (since you haven’t acknowledged a single time any mentions it comes from me), for Elgato Studio, to capture and “interpret” smoothly into its preview window, needs to be studied by OBS developers and implemented into it to resolve this. The fact I have not touched a single setting in that program and it works flawlessly for a smooth preview window capture, means way too much towards OBS for needing to improve on this. A program that doesn’t make the user troubleshoot for around a week now is certainly doing something right.

I recently read through some suggestions by users on this stuttering in another thread. 2-3 years ago of actual suggestions regarding of how OBS could handle refresh rate and how it varies, and I can only assume that #1 OBS did not bother with implementing anything in regards to that thread when it brought a lot of good points, and #2 the people behind Elgato Studio actually bothered to do so and incorporate whatever fix they came up with for the program. I strongly encourage the OBS devs to reach out and communicate with them to see what was it they did, since it is clearly working better than OBS’ current implementation here.

I appreciate all your help and time but it doesn’t matter how much I lower the specs of the recording or FPS values, the stutter is just *always* there even if I close every single program I have open on my PC. You might not want to blame OBS for causing stuttering. But at least take it from me, it may or may not be causing direct stutters. But it *certainly* cannot output a smooth image on preview when a different program to it completely can on everyone’s hardware. OBS simply cannot handle interval stutter and these threads with my and your experience prove it. Otherwise it’d be performing like Elgato Studio and we wouldn’t be here troubleshooting now.

I only hope for one day for OBS to have this solved by either addressing interval stuttering internally or at the very least having the logs pick up what’s actually going on with the preview window. Because it is definitely failing at picking up the actual stutter I’m witnessing.

P.S: Oh, and to the “bad source” comment, well, let the program be able to accept “bad sources” like Elgato Studio can then, tbf. Tried already with both my PS5 Pro and Switch 2, same issues.
 
Top