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
60.31k stars 7.99k forks source link

[BUG] Game Capture can't decide whether or not to show NVIDIA Game Filters on stream #2922

Closed SamuilDichev closed 4 years ago

SamuilDichev commented 4 years ago

Platform

Operating system and version: Windows 10 Pro 1909 OBS Studio version: 25.0.8

Expected Behavior

When you apply NVIDIA Freestyle game filters from the overlay, they should consistently either be captured by OBS or not at all (either shown or not by OBS).

Current Behavior

Video demo - https://clips.twitch.tv/RepleteUglyDumplingsBloodTrail Seems to occur in CoD Modern Warfare (2019), but not in PUBG from my testing.

When you enable any game filters in Nvidia's overlay while using Game Capture, they apply normally on the game and look normally on screen. But OBS can't seem to decide if it should capture them or not and they flicker ON and OFF in the stream.

This only happens in Game Capture, but the flickering stops when:

  1. The game is alt+tabbed - The game still shows on the stream and renders correctly with all the filters correctly applied and not flickering.
  2. There is mouse movement - the flickering stops while the mouse is in motion and continues as soon as it stops moving, even if you are just lifting it off the mousepad to recenter it. That brief pause in mouse movement allows the flickers to start again for the duration of no motion.

Steps to Reproduce

  1. Launch OBS and Call of Duty: Modern Warfare (2019) (in any order)
  2. Create a game capture with any mode from the dropdown list (any fullscreen app or specific window makes no difference) and default settings. (Note: "Capture 3rd party overlays" option makes no difference).
  3. Get back into the game and open Nvidia's overlay using ALT+Z (default)
  4. Open Game Filters by clicking on it in the overlay or alternatively with ALT+F3 (default)
  5. Choose a slot (1, 2 or 3) and add the filter called "Details" (It is most obvious with it)
  6. Configure the filter with at least 30 Clarity and 100 HDR toning. Bloom and Sharpening are optional, the goal is to make the game look sufficiently different from how it looks without filters so we can easily see when the filters are ON or OFF or flickering between the two states.
  7. Once configured, make sure the correct slot (1, 2 or 3) is selected and close the Nvidia overlay.
  8. Play for a bit and observe the stream / recording / preview. The filters should flicker ON and OFF as if OBS cannot decide whether it should show them or not.

Additional information

It seems like another user that I found here is compaining about the same issue and is saying it also occurs in Red Dead Redemption 2.

From my testing with COD and PUBG, it occurs in COD but not in PUBG.

I understand OBS has problems with overlays, but given that there are 2 situations in which the flickering stops (as mentioned above) as well as some games in which the flickering doesn't occur, I thought there may be a solution to it. And I believe the filters are quite important for many people, especially those playing terrible games with no sharpness setting (to counter AA blur) and terrible lighting.

Fenrirthviti commented 4 years ago

This isn't something we can control, it's the order the hooks are injected, which is why it is inconsistent. If something else is hooking the game earlier in the pipeline, the overlay will show and there's not a whole lot we can do about it. I'll leave this open in case anyone has any knowledge on how to overcome it, but every time this comes up it's been out of our control.

WizardCM commented 4 years ago

You can try using the "Hook Rate" setting in the Game Capture source's properties and setting it to something faster, so that we have more "control" over overlays. Note that if you set it to the fastest setting, there is a possibility of crashing the game.

Ideally, launch OBS before the game, with the source already configured. If you don't have it configured, launch the game, set everything up, then restart the game.

SamuilDichev commented 4 years ago

I tried playing with the Hook Rate and the order of launches but it seems like it happens every time. Or maybe alt-tabbing breaks it. Does alt-tabbing cause a re-hook?

One thing I noticed is that my MSI Afterburner (Rivatuner's) overlay is also flickering in CoD. But in GTA 5, neither the filters nor the MSI afterburner overlay are flickering. In fact, they are not showing AT ALL in the first place when I do not have "Capture third party overlays" ticked. In other words, I have filters on my screen but no filters in OBS. Which is desired behaviour when "Capture third party overlays" is unticked, right?

So is it a bug that OBS is trying to show Nvidia's overlay and MSI Afterburner's overlays in CoD even when "Capture third party overlays" is NOT ticked? I'd be happy to NOT show the filters on stream, but still have them on my screen as long as its consistent, rather than flickering between ON and OFF on stream.

Fenrirthviti commented 4 years ago

It's not a bug, that option is just "best effort" for the aforementioned reasons.

SamuilDichev commented 4 years ago

So the reason the overlay is showing even though "Capture 3rd party overlays" is OFF, is probably because the overlay is hooking before OBS? So the only potential solutions would be to either speed up OBS' hook or slow down the Overlay hook?

WizardCM commented 4 years ago

Correct.

KomiMoe commented 3 years ago

I have the same problem. In any case, obs cannot capture any overlays normally in the game, they are always flickering. This seems to be a compatibility issue between dx11on12 and call of duty. And when the game loses focus, the game will use the same back buffer to call Present twice. My overlay got the same buffer index twice in a row and was drawn twice successfully on the same buffer. Of course, i got a DEV ERROR 6068 after drawing twice. This is why Activision emphasizes closing all overlays when Dev Error 6068 occurs. So we can try to capture ID3D12Resource directly instead of dx11on12 to solve this problem

SamuilDichev commented 3 years ago

So we can try to capture ID3D12Resource directly instead of dx11on12 to solve this problem

So is there a solution or a way to do this? I'm currently sort of streaming with Display capture and it works but no way to use Game capture.

Angelicus07 commented 3 years ago

I have the exact same problem happening while streaming AC: Valhalla. To my knowledge, it is the only game where it does that, even though I use the NVIDIA filters on pretty much all the games I play. I really would like some insight here, because it really is annoying.

Using Display Capture instead of Game Capture seems like a suboptimal solution since Game Capture runs infinitely smoother, for me at least.