obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
58.7k stars 7.82k forks source link

Preview Stutter that appears in Streams/Recordings #4191

Open Zakkaruu opened 3 years ago

Zakkaruu commented 3 years ago

Platform

Operating system and version: Windows 10 20H2 OBS Studio version: 26.1.1

Expected Behavior

Display a non-stuttering image if the source is not stuttering and resources are not constrained.

Current Behavior

After an indeterminate amount of time, the preview window will begin stuttering, irrespective of capture method (Window, Display, Game). This stuttering will make its way into the stream and/or recording.

Steps to Reproduce

  1. Open OBS
  2. Create Game/Window/Display capture, depending on source
  3. Watch the preview for stutter (usually about 5-10 minutes before it shows up in my case)
  4. Stutter appears

Recording of Behavior This recording was made with a second instance of OBS. I thought there was some correlation by running two instances that the stutter went away, but this instance also experienced stutter, albeit, far later on.\ Log from Stuttering OBS Instance shown Timestamps: At the beginning and again at 2:20.

Recording of Stutter Behavior Log from Recording

Another Recording from a completely different machine at another location. 2021-02-04 19-56-16.txt

Laptop Recording with the same exact issue. 2021-02-04 21-13-15.txt

Additional information

In my video, I am using the following link: TestUFO. I have also made an imitation of this pattern as an MP4 for use in a video player supporting D3D11 (Potplayer).

The stuttering will eventually cease and reappear after different periods of time. However, if you change the profile in-use during the stuttering, it goes away...and eventually reappears. The behavior shows up significantly faster when using I444 color format; NV12 still does it, but it takes MUCH longer to appear..I waited probably about 15-20 minutes on NV12 vs about 5-10 with I444. This happens in games and really anything being captured, I chose the test pattern because it makes it easy to see.

I have used nSight Graphics/Systems and GPUView, but there does not seem to be a correlation with anything else going on. This has been tested on two different systems thoroughly. On one of the test systems, I did a fresh install of Windows, installed only necessary drivers/chipset drivers, OBS, Steam, and one game.

I believe this issue is related to the following forum topics: https://obsproject.com/forum/threads/persistent-stutter-issue-tried-everything.137045/ https://obsproject.com/forum/threads/stutter-in-stream-preview-no-rendering-encoding-lag.114986/ https://obsproject.com/forum/threads/random-stuttering-in-preview-which-goes-into-recorded-videos.77744/ https://obsproject.com/forum/threads/obs-preview-stutters-while-not-recording.106424/

I am willing to be a test dummy for this, just let me know what you need from me.

Additional Examples

Vermintide II Gameplay Example

160CH commented 2 years ago

Hi all, have not had time to look through the entire thread but in short I'm experiencing something similar to what's been posted: capable specs, everything is smooth as I'm gaming but recordings have stutters that are also visible in the preview. So far I've even found that playing at 120 Hz (and recording at 60 fps) can result in a smoother recording than trying to lock my monitor and OBS down to 60, but this doesn't work all the time and becomes less feasible the more demanding a game is.

UFO test (OBS recording @ 60 FPS, monitor set to 60 Hz): Log: https://obsproject.com/logs/fKfHb74WS4_oHyw9 Video: https://streamable.com/rkfv6q Stutters examples: 0:01, 1:20, 1:37

Happy to clarify further if needed.

Fenrirthviti commented 2 years ago

I've noticed in a few of these videos that third-party overclocking/tweak tools such as MSI afterburner and EVGA Precision X are being used. Those that are experiencing issues, are you using these or similar tools to make tweaks to your system? Or any other kind of third-party modifications or process priority changes?

Gamer60446 commented 2 years ago

I'm not using any of these applications. I never tried to overclock anything from the BIOS either. As we already mentioned, it also happens on a clean windows 10 without installing any divers or additional software. I even went offline to prevent automatic drivers or software installation.

160CH commented 2 years ago

I have EVGA Precision X1 to check my resizable BAR status but have otherwise not done any OCing and/or other adjustments.

jpark37 commented 2 years ago

Has anyone with a display capture repro checked to see if #5029 fixes their issue? I can make similar fixes to game and window capture, but it would be nice to make sure the approach works first.

jpark37 commented 2 years ago

You can pick up a test build here: https://github.com/obsproject/obs-studio/actions/runs/1244236413

Gamer60446 commented 2 years ago

I just tried this build and unfortunately the stuttering issue is still present in both the preview screen and recording. My test was done with Display Capture and the UFO Test website.

jpark37 commented 2 years ago

Sorry, I should have been more specific. Did you set the display capture to DXGI? If it's on Automatic, force it to DXGI.

Gamer60446 commented 2 years ago

I tried both and they give the same result.

Adega-Studio commented 2 years ago

You can pick up a test build here: https://github.com/obsproject/obs-studio/actions/runs/1244236413

Hi. Can I use instructions on how to use this for the test?

Adega-Studio commented 2 years ago

My experiment: By default, the 60Hz monitor and desktop causes regular stutters for 20 seconds every 10 minutes. Changing the refresh rate through the nvidia panel to 59.996 reduces the stuttering time to 10 seconds, but occurs every 5 minutes. Now I use 59.996 so less stuttering time and more often. I hope this data will be useful.

jpark37 commented 2 years ago
Adega-Studio commented 2 years ago
  • Download the win64 zip from the link.
  • Unzip the zip file to get another zip file.
  • Unzip that zip file to any directory you want.
  • Go to bin, then 64bit, then double-click on obs64.exe.
  • Add a Display Capture. Pick a monitor, and set the Capture Method to DXGI.
  • Record a video, and check the video for stutters.

2 more questions: 1. What is the DXGI capture method and where to expose it?

  1. Do you need to change anything in C: \ Users \ Alex \ AppData \ Roaming \ obs-studio?
jpark37 commented 2 years ago

Select DXGI here. image

You shouldn't need to touch that folder directly? Why do you think you would need to?

Gamer60446 commented 2 years ago

This is the logs from my test earlier in case you need it.

https://obsproject.com/logs/mZPZldN7bonH3Esl

Adega-Studio commented 2 years ago

Select DXGI here. image

You shouldn't need to touch that folder directly? Why do you think you would need to?

Unfortunately, nothing has changed (. I also get stuttering (

flaeri commented 2 years ago

@Adega-Studio Keep in mind, the preview will still likely stutter. It is not the same "pipeline" as the output. Are you certain that when you stuttered in the preview, it also carried over into the output (recording)?

When I was testing this, I got the stutters in the preview, but none in the output.

Adega-Studio commented 2 years ago

@Adega-Studio Keep in mind, the preview will still likely stutter. It is not the same "pipeline" as the output. Are you certain that when you stuttered in the preview, it also carried over into the output (recording)?

When I was testing this, I got the stutters in the preview, but none in the output.

In the interrupt record.

flaeri commented 2 years ago

@Adega-Studio

In the interrupt record.

Would be nice if you could get a log from the same session where you had the recording (or redo it). Im also quite curious to look at the output, so if you would be willing to share the raw recording that would be cool.

Adega-Studio commented 2 years ago

I have updated the survey to 27.1.1 and am even more disappointed (Capturing the window is even bigger and more often causes previews and recordings. https://obsproject.com/logs/RE5Fxagc7VNZyUkT https://youtu.be/TRewMMAegXY

fatmatrow commented 2 years ago

Tried test build with the #5029 dxgi buffer extensively today and can confirm it got rid of my output stutter. The preview will still stutter but the actual output to the streaming service no longer stutters. Big win and potential with this one.

Devicetron commented 2 years ago

I have an elgato 4k capture capture, having the same problem, I tried to download the test build #5029 but its greyed out, can anyone share it to test it?

flaeri commented 2 years ago

I have an elgato 4k capture capture, having the same problem, I tried to download the test build #5029 but its greyed out, can anyone share it to test it?

@Devicetron I think you should come seek support in the Discord. Dshow in my experience can usually be sorted out as is (enable buffering, and sorting out other issues). https://obsproject.com/discord

Adega-Studio commented 2 years ago

@Adega-Studio

In the interrupt record.

Would be nice if you could get a log from the same session where you had the recording (or redo it). Im also quite curious to look at the output, so if you would be willing to share the raw recording that would be cool.

Hi. I could not check it before (I bought a new monitor), but today I checked it and I will say that the screen capture is less likely to twitch. Can you do this to capture a game or capture a window?

Adega-Studio commented 2 years ago

Has anyone with a display capture repro checked to see if #5029 fixes their issue? I can make similar fixes to game and window capture, but it would be nice to make sure the approach works first.

Hi. Bought a new monitor and this option really reduces stuttering. I'd like to add this method to game capture and window capture.

Gamer60446 commented 2 years ago

I started to think that the monitor could be an issue even if it doesn't really make sense at first. I've noticed that a lot of people are using a Dell monitor here. @Adega-Studio Can you tell me which one you bought? Can you also tell me if you see stuttering in the preview? I would really appreciate it.

I also want to confirm that Windows 11 doesn't fix the stuttering issue for those that are interested, at least for me.

Adega-Studio commented 2 years ago

I started to think that the monitor could be an issue even if it doesn't really make sense at first. I've noticed that a lot of people are using a Dell monitor here. @Adega-Studio Can you tell me which one you bought? Can you also tell me if you see stuttering in the preview? I would really appreciate it.

I also want to confirm that Windows 11 doesn't fix the stuttering issue for those that are interested, at least for me.

lg-24gn650-b

flaeri commented 2 years ago

@Adega-Studio hmm, I dont think the monitor should matter too too much. I've tried on a variety of 5+, and I seem to have the same issue. Much like other people tho, the test build has perfect output for me on DXGI display capture (despite preview stuttering). I think you should make certain you test that exact build, and you should completely ignore the stuttering in the preview, and only look at the output (stream/recording).

If the devs get proper confirmation of this type of fix working, then they could implement it in other captures (window capture etc). It might be a lot of additional work tho to adapt it to other sources, but still, hopefully yes.

Game capture should not need this fix, I've not been able to produce this issue on any of my systems where I can reproduce the display/window capture stutter. It already oversamples (unless you click the "limit fps", and should be fairly stutter free imo). Keep in mind that a lot of the old stuttering issues on game capture came from DX12 capture, which has since been solved.

Window capture: Hopefully yes, but will certainly take time, and hopefully we can get more testing and verification on the validity of the DXGI display capture build first.

flaeri commented 2 years ago

@Gamer60446 Are you certain that the test build does not work for you? Please keep in mind that the preview is very likely to still be stuttering. You can completely ignore the preview stutter, it will not impact the output. Make tripple sure that you're running the right test build, and that you're clear in terms of other potential stutter issues (refresh rate mismatch, framerate mismatch, encoding/render lag).

The output is where the fix is, make sure you've 100% confirmed the stuttering issue using said build, with said DXGI display capture, and you check the output (stream/recording). Dont trust the preview, thats not the output.

If you would like me to look at your case, then please dont hesitate to ping me (@flaeri) in the discord server. https://obsproject.com/discord

Adega-Studio commented 2 years ago

@Adega-Studio hmm, I dont think the monitor should matter too too much. I've tried on a variety of 5+, and I seem to have the same issue. Much like other people tho, the test build has perfect output for me on DXGI display capture (despite preview stuttering). I think you should make certain you test that exact build, and you should completely ignore the stuttering in the preview, and only look at the output (stream/recording).

If the devs get proper confirmation of this type of fix working, then they could implement it in other captures (window capture etc). It might be a lot of additional work tho to adapt it to other sources, but still, hopefully yes.

Game capture should not need this fix, I've not been able to produce this issue on any of my systems where I can reproduce the display/window capture stutter. It already oversamples (unless you click the "limit fps", and should be fairly stutter free imo). Keep in mind that a lot of the old stuttering issues on game capture came from DX12 capture, which has since been solved.

Window capture: Hopefully yes, but will certainly take time, and hopefully we can get more testing and verification on the validity of the DXGI display capture build first.

If there were no problems, I and the others would not have written here. Many people have a problem with capturing the game and capturing the window, they just silently endure the inconvenience or do not care. I personally tried everything, and it turned out to be a new computer and a new monitor in 2021, but the problem became less noticeable with the purchase of a new monitor. But the problem with jerks personally follows me after 10 minutes of recording and lasts 1 minute, repeats again after 10 minutes. An enormous amount of time and money was spent (. If everything is fine with you, then you can watch the video and settings of the video card driver and obs?

flaeri commented 2 years ago

@Adega-Studio I think you're misunderstanding, or I am doing a poor job at explaining. I suffer from the same issue as a lot of the people in this thread. Window and Display capture will stutter in both preview and output.

The build: https://github.com/obsproject/obs-studio/actions/runs/1244236413 To get a valid case for the test build, we would want:

I've tried several times to ask you to properly test out the build that one of the developers made, and include a log and footage. That build solves the issue for me and others with DXGI display capture, in the output (not the preview, that's separate).

I try to keep this thread clean from potentially unrelated or unconfirmed issues because it makes things so much easier for the developers to keep track of this issue. I've helped several people in this thread get rid of their stutters in dshow and other captures. I would like it if we could keep this issue focused in on the confirmed captures.

I would welcome anyone that has issues with game capture or dshow (video capture device) to join the discord, and I believe we can get you sorted there. https://obsproject.com/discord

Gamer60446 commented 2 years ago

@flaeri This is getting weirder. I recorded another video with this build and it was stuttering. I sent the video file to one of my friends and he said that he doesn't see any stuttering. Turns out the Windows 10 video app or VLC will also randomly stutter for me when in fact the recorded video is fine. @Adega-Studio posted a YouTube video trying to show the stuttering and I didn't notice anything wrong with it. I could be wrong, but videos uploaded on YouTube doesn't seem to be affected. I also think that this build has potential after all. I would really like to determine what's causing the stuttering in the preview, though.

Adega-Studio commented 2 years ago

Test The build: https://github.com/obsproject/obs-studio/actions/runs/1244236413 All is well with DXGI screen capture. PC settings: 144 Hz monitor is fixed in Windows 60 Hz, vertical sync is enabled in the game, there is no third-party FPS control software. Everything else is in the log https://obsproject.com/logs/z3lQYgT8u6wt0bz8 Here is a video of 20 minutes without stuttering https://youtu.be/4R0FerGkB2w

Adega-Studio commented 2 years ago

Test 2 The build: https://github.com/obsproject/obs-studio/actions/runs/1244236413 But capturing the game is a problem. PC settings as I wrote above. Discuss the capture of the game with the selected window. Everything else is in the log https://obsproject.com/logs/bCLk6HksF-fGJf8K Here is a video of 21.30 minutes where stutters 7.45 to 8.53 and 21.14 minutes (sorry to stop recording early). I think the problem is visible. https://youtu.be/TrwLg9EPn-I

flaeri commented 2 years ago

@Adega-Studio Thank you for posting thorough data. I really appreciate it :) I think perhaps in post number 2, you've pasted the wrong youtube link. Its the same in both posts "4R0FerGkB2w".

Very happy to get confirmation that the test build works well on DXGI capture.

flaeri commented 2 years ago

@Gamer60446 Yes, that is 100% a possiblity. Thats probably my bad for not specifying that one should use a good video player during viewing of footage. The built in player "Movies & TV" is unfortunately not reliable. VLC usually is tho. Not sure how we would go about diagnosing bad playback in multiple players, but it would at least have to be somewhere else (Discord?), and not in this issue post.

Gamer60446 commented 2 years ago

@Adega-Studio I watched your video and it's perfectly smooth to me. No stuttering or frame drops. If you watch it from an application in Windows 10 such as the built-in video app it might randomly stutter which is only visible by you, but on YouTube it's fine.

Adega-Studio commented 2 years ago

@Adega-Studio Thank you for posting thorough data. I really appreciate it :) I think perhaps in post number 2, you've pasted the wrong youtube link. Its the same in both posts "4R0FerGkB2w".

Very happy to get confirmation that the test build works well on DXGI capture.

Wrong with links, corrected. HD quality processing Looking forward to DXGI for game capture and window capture

flaeri commented 2 years ago

@Adega-Studio Thank you very much. I see what you mean in the footage. Its quite subtle, but its there. I'm curious, could you test one thing for me?

If you disable v-sync on the game, and you run the framerate cap 20+ (80fps or more) or more (or maybe just uncapped framerate), does that solve the stutter on game capture?

sleepshot commented 2 years ago

Imma try this test build tonight. If this in fact dose help will that mean a fix on obs will come down the road at some point?

Adega-Studio commented 2 years ago

@Adega-Studio Thank you very much. I see what you mean in the footage. Its quite subtle, but its there. I'm curious, could you test one thing for me?

If you disable v-sync on the game, and you run the framerate cap 20+ (80fps or more) or more (or maybe just uncapped framerate), does that solve the stutter on game capture?

Hi. In the test assembly, game capture does not pick up all games. Regarding the capture of the game without synchronization and above 60fps, 75, 80, 120, 144 leads to a random stutter in time. Without vertical sync, I don't like it at all and it seemed the micro-friezes were visible on the recording. There is a direct dependence on the frequency of the monitor. If you set 60 stutters on the monitor every 10 minutes for 1 minute, and if you set 59.996, then stutters every 5 minutes for 10 seconds. And if 60.004, then the effect is the same as with 59.996. I would like to get DXGI for game capture and window capture as soon as possible.

flaeri commented 2 years ago

@Adega-Studio Yes, the test build is not signed, so some games running anticheat technology, or discriminate software that hooks in may not work on it. The test build is probably not feasible for normal use (mixing display and game capture). Thank you for the report :)

Adega-Studio commented 2 years ago

@Adega-Studio Yes, the test build is not signed, so some games running anticheat technology, or discriminate software that hooks in may not work on it. The test build is probably not feasible for normal use (mixing display and game capture). Thank you for the report :)

Does it take a long time to add DXGI to capture game and window? I really want to make smooth content :)

flaeri commented 2 years ago

@Adega-Studio yes, it takes a long time. The code is not even ready yet for DXGI. Once that is ready, and it gets thru testing, and its confirmed that its working well for the majority of people, then one can maybe start thinking about work on other types. This is not official, its just my thoughts on the matter.

Zakkaruu commented 2 years ago

I finally got around to trying the test build with PR #5029 . The preview window displays stuttering, however, the output is silky smooth, which was not the case before. I'll do some more test recordings, but it is looking better in my case. Log attached below.

2021-10-15 16-02-59.txt

gpalm commented 2 years ago

I finally got around to trying the test build with PR #5029 . The preview window displays stuttering, however, the output is silky smooth, which was not the case before. I'll do some more test recordings, but it is looking better in my case. Log attached below.

2021-10-15 16-02-59.txt

It worked for me, I got rid of the stutters using this capture method with the buffer 2021-10-20 05-45-17.txt

1030 commented 2 years ago

Hello, I've been trying to diagnose the same issue for over a year. Replaced almost everything in my computer with no luck. I even bought a 3080 just in case. Here's the log https://obsproject.com/logs/Qza_iaTFlpnjXRhi and here's a video (stutter happens close to the end) please let me know what I can do, I'm very desperate. https://www.dropbox.com/s/s28flb54vo0cms0/2021-11-08%2006-32-49.mkv?dl=0 (this was done with the test build)

Kaibenson commented 2 years ago

I commented this issue half a year too. No luck but i´m looking forward. Regards Kai

Kaibenson commented 2 years ago

Hi I think the best would be to add a "sync to source" feature in the obs capture module like NDI does in the NDI input module. All the received material appears with no stutter at all. Therefore it seems a syncing problem during capturing with the obs capture input module and the source. Regards Kai

Adega-Studio commented 2 years ago

Tired of these stuttering (All desire to stream disappears, viewers write about lags regularly (. And there has been no solution for a very long time. Dipresia comes (((