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
57.81k stars 7.74k forks source link

Recording stutters when Nvidia Control Panel fps limiter / Reflex / NULL engaged and OBS fps equals to limiter's cap. #10960

Closed eduardshugar closed 2 weeks ago

eduardshugar commented 2 weeks ago

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/tools/analyzer?log_url=https%3A%2F%2Fobsproject.com%2Flogs%2FaFan8tQANgjrS5pT#logURL

OBS Studio Crash Log URL

No response

Expected Behavior

Smooth recording no matter what fps limiter is used, in-game or NVCP, or rivatuner etc.

Current Behavior

Recording stutters when Nvidia Control Panel fps limiter / Reflex / NULL engaged and OBS fps equals to limiter's cap.

I always play with G-Sync, my monitor is 144Hz, so the games that support Nvidia Reflex, they are capped at 138 fps, i first noticed the issue when i tried to record a video at 138 fps for super smooth footage, but my surprise was that the video had random stutters and was smooth only for a few moments in the video. I then proceeded to run multiple tests and after a few weeks i found that it's something to do with NVCP cap or Reflex itself.

If you record a video with Nvidia Control Panel fps limiter / Reflex / NULL (let's say they cap your fps at 120), and you have no fps limit in-game (it will still be limited because of Reflex or other limiters), and you record at 120 FPS - the video will have random stutters like duplicated frames, but OBS doesn't log that.

If you record a video at 120 FPS with Nvidia Control Panel fps limiter / Reflex / NULL and those limiters are limiting your FPS above 120 (let's say 138 like for 144Hz monitor), but you're also limiting your FPS to 120 using in-game's limiter (e.g. for CS2 it's fps_max command), then the recording will appear smooth as butter.

I tried reinstalling windows, tried different Nvidia drivers, updated bios, disabled AMD EXPO, i tried disabling HAGS, everything is at default values, it's not multi monitor setup (i also tried tried to record with only one monitor connected), tried different codecs and different containers (mp4, mkv, etc), tried everything, but suddenly it has something to do with NVCP limiters.

Steps to Reproduce

  1. If the game supports Reflex, just enable G-Sync, VSync and Reflex in-game

  2. Set OBS fps to whatever Reflex caps your fps at

  3. Record a video

  4. If the game doesn't support Reflex, using Nvidia Control Panel enable: G-Sync, VSync - on, Low Latency Mode - ultra, Max Frame Rate - whatever is below your monitor max refresh rate -3, for example if your monitor is 144Hz, set it to 141 or 138 like reflex do.

  5. Set OBS fps to the value you entered in Max Frame Rate in Nvidia Control Panel

  6. Record a video

Anything else we should know?

Please note that 120 fps and any other values are just for the sake of convenience, you can try it with 60 fps if you want. I understand that 60+fps is not supported and that's my monitor aspect ratio is not officially supported, that HAGS is on and anything else, but that's just not the case, I tried the same on the other PC with Intel CPU and RTX 4070 and 16:9 monitor, it's not the hardware as far as i tested.

I understand that there's no reason to record at 60+ fps, and there's no services that officially support high motion streaming, but as time goes on, it's inevitable that in the future we will have services that DO support high motion streaming officially.

Here are two video samples: the first one is buttery smooth with following settings: NVCP Low Latency Mode - Ultra, Max Frame Rate - 138, VSync - on, G-Sync - on, in-game limiter is set to "fps_max 120", link - https://www.dropbox.com/scl/fi/9s66v95t30cpvve5zbx5l/in-game-cap-no-stutters.mp4?rlkey=9dzyg0fqktixe0a6tjygfhf6r&st=1iip7ix2&dl=0

the second video has stutters, and the settings are following: NVCP Low Latency Mode - Ultra, Max Frame Rate - 120, VSync - on, G-Sync - on, in-game limiter is set to "fps_max 0", link - https://www.dropbox.com/scl/fi/s3x2574mxh52jhsuzc7br/NVCP-capped-to-120-stutters.mp4?rlkey=ja0grfrk3sqnw26kgy40kv4gv&st=52s0zm04&dl=0

matoi974 commented 2 weeks ago

I wish I could contribute more than just "I have the same issue". I, too, use NVCP to cap frame rates, and sometimes my recordings have stutters that weren't originally there, and I can't figure out why. I'll try disabling "max frame rate" for obs64.exe and report back if I observe any significant improvement or find something else worth reporting.

eduardshugar commented 2 weeks ago

I wish I could contribute more than just "I have the same issue". I, too, use NVCP to cap frame rates, and sometimes my recordings have stutters that weren't originally there, and I can't figure out why. I'll try disabling "max frame rate" for obs64.exe and report back if I observe any significant improvement or find something else worth reporting.

I wish I could call it stutters, but to me it looks more like duplicated frames, but there's no log for that and game's FPS is stable as shown on my recordings samples. Also, i tried disabling NVCP settings for OBS only, but that doesn't help

matoi974 commented 2 weeks ago

That's the odd part, RTSS' frame time overlay shows a steady 120 FPS, but my perception is telling me something's not right. This could be an issue with NVIDIA's frame rate limiter, and/or with the individual games - I don't think I've ever had this in CS2, but in TESV it starts happening within minutes or hours, and gets worse over time until the game is restarted, for example. Eventually RTSS will begin to register that there are stutters, but recordings begin to show them much sooner.

eduardshugar commented 2 weeks ago

That's the odd part, RTSS' frame time overlay shows a steady 120 FPS, but my perception is telling me something's not right. This could be an issue with NVIDIA's frame rate limiter, and/or with the individual games - I don't think I've ever had this in CS2, but in TESV it starts happening within minutes or hours, and gets worse over time until the game is restarted, for example. Eventually RTSS will begin to register that there are stutters, but recordings begin to show them much sooner.

I've tried 5 different games including: CS2, DayZ, Doom Eternal, PUBG and Helldivers 2. The issue is happening in every game from my list. I can't even imagine at this point what could be root cause of the issue. I may not understand it how in-game's limiter works vs how NVCP limiter works, maybe OBS doesn't like external limiters like NVCP's one, and on the other hand, when in-game's limiter is engaged, it can tell the driver clearly that it's producing 'n' number of frames that OBS can capture, but NVCP's one doesn't make it clear for OBS.. I don't know, that's just my fantasy now

RytoEX commented 2 weeks ago

Are you just seeing the stutters on playback? I've heard similar issues described with the framerate limiter in NVCP where the only thing that solved it was turning it off.

Kaidesa commented 2 weeks ago

I discovered a similar issue a while back, but in my case it only affected video playback in certain web browsers when using Low Latency Mode and/or a global frame rate cap.

If the issue is on playback only, specifically on the browser side, the only thing that worked for me was to go into the Nvidia Control Panel, go into or add settings for your browser of choice, and remove the default frame rate cap for the affected application.

For example, in my situation, I had to add an entry for my browser of choice (Brave) and remove both Low Latency Mode and the FPS limit. This solved the issue entirely.

I can not say for sure that this is the issue, but the first thing I would try would be to remove these features from your software of choice for video playback. If problems persist, repeat the steps for the game you're trying to capture. Lastly, perhaps try OBS itself. Preferably one at a time, so you know which one was the one that fixed it.

A bit of a lengthy process, but will work to limit and discover the cause. If this doesn't solve the issue, though, I'm not exactly sure what it could be.

eduardshugar commented 2 weeks ago

I discovered a similar issue a while back, but in my case it only affected video playback in certain web browsers when using Low Latency Mode and/or a global frame rate cap.

If the issue is on playback only, specifically on the browser side, the only thing that worked for me was to go into the Nvidia Control Panel, go into or add settings for your browser of choice, and remove the default frame rate cap for the affected application.

For example, in my situation, I had to add an entry for my browser of choice (Brave) and remove both Low Latency Mode and the FPS limit. This solved the issue entirely.

I can not say for sure that this is the issue, but the first thing I would try would be to remove these features from your software of choice for video playback. If problems persist, repeat the steps for the game you're trying to capture. Lastly, perhaps try OBS itself. Preferably one at a time, so you know which one was the one that fixed it.

A bit of a lengthy process, but will work to limit and discover the cause. If this doesn't solve the issue, though, I'm not exactly sure what it could be.

I'm using VLC to playback the footage. Yes i see the issue in playback only, the gameplay is smooth. Yes, without NULL and frame limiters when the game is running uncapped there's no such problem. That's the problem, many people do play and want to play with VRR, and to play with VRR you have to cap your framerate under monitor's max refresh rate, that's the whole point. The stutters are in the footage itself, it's not media player stutters

eduardshugar commented 2 weeks ago

Are you just seeing the stutters on playback? I've heard similar issues described with the framerate limiter in NVCP where the only thing that solved it was turning it off.

That's the whole point, to play with G-Sync you have to limit fps.

RytoEX commented 2 weeks ago

The stutters are in the footage itself, it's not media player stutters

If you disable the settings while recording, do the stutters still occur? If OBS is not reporting skipped/lagged frames, I'm wondering if this is an issue with the game rendering itself and the frames being grabbed by OBS.

eduardshugar commented 2 weeks ago

The stutters are in the footage itself, it's not media player stutters

If you disable the settings while recording, do the stutters still occur? If OBS is not reporting skipped/lagged frames, I'm wondering if this is an issue with the game rendering itself and the frames being grabbed by OBS.

I haven't tried to change settings while recording, i have to test it. Yeah, OBS does not report skipped/lagged frames in this situation.

eduardshugar commented 2 weeks ago

Just to be clear, even if you don't change NVCP settings (max framerate, low latency mode, vsync) but have G-Sync enabled, and using in-game's VSync, and the game supports Reflex and it is enabled in-game, the game will cap your FPS under your monitor refresh rate and if you record at that FPS - the footage will have stutters.

Kaidesa commented 2 weeks ago

Yes, but have you tried removing those settings in the control panel SPECIFICALLY for OBS and tried recording?

This isn't "remove the settings globally and stop using them", it's to see if the issue is related to OBS itself, or if it's an issue with the driver settings, period.

eduardshugar commented 2 weeks ago

Yes, but have you tried removing those settings in the control panel SPECIFICALLY for OBS and tried recording?

This isn't "remove the settings globally and stop using them", it's to see if the issue is related to OBS itself, or if it's an issue with the driver settings, period.

Yes i tried disabling those settings in NVCP for OBS specifically and it doesn't change anything.

eduardshugar commented 2 weeks ago

Yes, but have you tried removing those settings in the control panel SPECIFICALLY for OBS and tried recording? This isn't "remove the settings globally and stop using them", it's to see if the issue is related to OBS itself, or if it's an issue with the driver settings, period.

Yes i tried disabling those settings in NVCP for OBS specifically and it doesn't change anything.

I was wrong. Just ran another test with those settings disabled in NVPC for OBS specifically, restarted PC and the results are surprisingly great. The duplicated frames / stutters are still there, but they're happening much much less frequently. Like 2-3 seconds in 3 minutes. Sorry for previous misleading response, but i was sure i've ruled this out with my tests. Recording at 138 FPS with NVCP max frame rate at 138 and other settings engaged, but not for OBS - great results.

eduardshugar commented 2 weeks ago

Just ran 2 more tests and the stutters are back. I don't know at this point, they just appear at random time in the footage, for 2-5 seconds it's like my in-game fps drops and OBS duplicating frames, but the FPS is stable and never dropped, only the recording is affected. I don't know. If i go frame by frame using VLC in those moments of stutter, i can clearly see that there are duplicated frames..

Kaidesa commented 2 weeks ago

Just ran 2 more tests and the stutters are back. I don't know at this point, they just appear at random time in the footage, for 2-5 seconds it's like my in-game fps drops and OBS duplicating frames, but the FPS is stable and never dropped, only the recording is affected. I don't know. If i go frame by frame using VLC in those moments of stutter, i can clearly see that there are duplicated frames..

So, I did some testing on the side and discovered something. If you're using Nvidia Low Latency on global settings, try turning just that off. As much as it offers to help, it seems that in a lot (but not all) of games I've just tested, setting this to anything but off will double or triple the latency of rendering frames, occasionally causing the frame to be captured by OBS up to three times in a row. Despite the fact that OBS and other metrics gathering software says everything's fine.

Tested similar settings with CS2 and noticed a similar situation under specific high-load situations. I've noticed similar findings in another game as well, including but not limited to Helldivers 2, Doom 2016, Doom Eternal and Alan Wake 2. Removing Low Latency options in its entirety made the problem near non-existent, so if you don't NEED that option on, I'd highly recommend disabling it for the moment. I've yet to try a different driver version to see if it's an issue with the currently released Nvidia drivers. Worth looking into, maybe.

As a test to humor my findings, give it a shot regardless and see if the recordings are any better.

eduardshugar commented 2 weeks ago

Just ran 2 more tests and the stutters are back. I don't know at this point, they just appear at random time in the footage, for 2-5 seconds it's like my in-game fps drops and OBS duplicating frames, but the FPS is stable and never dropped, only the recording is affected. I don't know. If i go frame by frame using VLC in those moments of stutter, i can clearly see that there are duplicated frames..

So, I did some testing on the side and discovered something. If you're using Nvidia Low Latency on global settings, try turning just that off. As much as it offers to help, it seems that in a lot (but not all) of games I've just tested, setting this to anything but off will double or triple the latency of rendering frames, occasionally causing the frame to be captured by OBS up to three times in a row. Despite the fact that OBS and other metrics gathering software says everything's fine.

Tested similar settings with CS2 and noticed a similar situation under specific high-load situations. I've noticed similar findings in another game as well, including but not limited to Helldivers 2, Doom 2016, Doom Eternal and Alan Wake 2. Removing Low Latency options in its entirety made the problem near non-existent, so if you don't NEED that option on, I'd highly recommend disabling it for the moment. I've yet to try a different driver version to see if it's an issue with the currently released Nvidia drivers. Worth looking into, maybe.

As a test to humor my findings, give it a shot regardless and see if the recordings are any better.

Thank you for helping! Just ran a test with Low Latency Mode disabled globally and all settings disabled for OBS and results are absolutely the same, the video is stuttering on 25-35 seconds mark. I'm testing it in CS2 and the game has native Reflex support, so Low Latency Mode is being overridden by it anyway. Playing without Reflex also not an option, it's reducing input latency even better than Low Latency Mode

Fenrirthviti commented 2 weeks ago

The conclusion here seems to be that this is a byproduct of forcing specific modes in the GPU driver, and isn't likely anything that we have any control over, I will close this. For further troubleshooting/testing, please use our support channels through Discord or the Forums. If this is determined to be something we do have control over, we can reopen (or a new issue with further details can be opened).

Fenrirthviti commented 2 weeks ago

As an additional note, we've reported this thread to NVIDIA for investigation.

eduardshugar commented 2 weeks ago

Alright, so if this thread is going to be investigated by NVIDIA, for further notice - even with setup when your FPS is locked by in-game engine's limiter (for example fps_max in CS2) below Reflex cap (138 for 144Hz monitor) let's say to 120, and NVCP frame limiter / Reflex / NULL are engaged, so the driver limiting it to 138, the game limiting to 120, and you record at 120 FPS, there will be stutters / duplicated frames in the recording, but they will appear much much less frequently compared to if you record a video at Reflex's cap (for example OBS fps setted to 138 and Reflex enabled for 144HZ monitor, so your FPS is limited to 138 by the driver).

Also at this point I don't even understand what are the best settings to record a video with G-Sync / Reflex enabled, I think we need some sort of clarification in this regard. If you record a video at Reflex's cap - you have duplicated frames at random times. If you playing at 138 FPS with G-Sync / Reflex, and record at 60/120 FPS - you'll have jumpy / jittery footage compared to if you play at 120 and record at 120, but in the latter case you'll have stutters / duplicated frames, or play uncapped with screen tearing. It's just a circle with no solution right now..

Here are two more clips, both are recorded at 120 FPS, with G-Sync and Reflex engaged, with following NVCP settings: Low Latency Mode - Ultra Max Frame Rate - 138 Vertical Sync - On Reflex in-game - On + Boost

The smooth clip is recorded with in-game limiter also engaged with Reflex, fps_max is setted to 120, so i play at 120FPS/120HZ and record at 120FPS The jittery clip is recorded with no in-game limiter (fps_max 0) and Reflex engaged, so i play at 138FPS/138Hz and record at 120FPS. The smooth video will eventually have stutters at 2-5 minutes mark and it will be back to normal within 10 seconds, and again after 2-5 minutes it will have stutters, but atleast it's smooth most of the time, but why do we have to play at 120 FPS if we can play at 138? There is a difference, it's noticeable..

Please set your monitor's refresh rate to 120Hz to see the difference more clearly. Smooth video - https://www.dropbox.com/scl/fi/5kmppfsbk4ur7nktq1s95/smooth-as-butter.mp4?rlkey=yakcjtx1j5rvb9rgxhe5h0ey5&st=b5fwcf84&dl=0 Jittery video - https://www.dropbox.com/scl/fi/5y30gtbzn38d6e1sedfub/jittery.mp4?rlkey=karukxt2rb57zr6mhwohv93yl&st=r7budoc4&dl=0