Confused on Steam Play and Proton? Be sure to check out our guide.
Shadow play like recording on Linux with Nvidia
zany130 Jan 1, 2022
I'm trying to find a low performance cost way of recording x amount of last seconds of gameplay. OBS with just nvenc works as long as the game isn't using more than 80% of the GPU performance (measured by Mangohud) otherwise it will have stuttering issues. There is a nVFBC plugin for OBS that is supposed to have no performance overhead if used along by with patched drivers but for some reason that causes screen tearing without the composition pipeline option enabled and stuttering with it enabled. I posted about this on the discord server before and found enabling the kde compositor while the game is playing helps with the stuttering but it still feels weird like it's lagging a lot.

sys info

So found out something interesting about my obs nvfbc issues. It actually not limited to when I use the obs-nvfbc plugin using window capture instead of screen capture also causes issues. The issue was if I don't enable composition pipeline in the nvidia drivers I get tearing and if I do I get stuttering not using obs or using screen capture instead of window or the nvfbc plugin fixes this which nvidia driver version I use doesn't seem to matter here is a obs log but don't think there really is anything there https://obsproject.com/logs/yEdgT4__k--wxylQ

Last edited by zany130 on 2 January 2022 at 3:35 am UTC
kit89 Jan 2, 2022
What is your capture settings?

Frame tearing would suggest that a frame is being captured partially through a refresh.

For example, if you capture at 24fps and the game runs at 60fps, the point in which a frame is captured is potentially out of sync with when it's rendered.

This may also explain why stuttering appears, when the compositor is enabled it forces a stall and throws out the frame pacing.

Note: I have dabbled a little with Nvidia capture and OBS over the years but I am by no means an expert.
Xpander Jan 2, 2022
I dont think i have ever experienced this. Have been using nvfbc for the last year or so. I have forcecomposition enabled. Using nvenc, mkv, CQP 17, Keyframe inverval 2, preset Low latency, Profile High and max B-frames 2. My screen is 170hz though but recording 60 fps 1440pö footage. I used to use KDE few months ago just fine also, but currently on MATE desktop again.
zany130 Jan 2, 2022
Quoting: kit89What is your capture settings?
i have tried all kinds of settings and the issue still happens tried using nvenc and setting CBC settings to max performance also tried the low latency options, rescaling to 720p instead of native 4k, setting fps for the capture at 30.

https://i.imgur.com/i5FBKnv.png

Last edited by zany130 on 2 January 2022 at 8:57 pm UTC
kit89 Jan 2, 2022
Quoting: zany130
Quoting: kit89What is your capture settings?
i have tried all kinds of settings and the issue still happens tried using nvenc and setting CBC settings to max performance also tried the low latency options, rescaling to 720p instead of native 4k, setting fps for the capture at 30.

https://i.imgur.com/i5FBKnv.png

Cheers, what's your settings in the Video Panel?

When you record the game is it Fullscreen or Windowed?

The Video Panel allows you to specify the capture rate, which is a dropdown that says:

  • Common FPS Values

  • Integer FPS Value

  • Fractional FPS Value



For my own setup I have this at Common FPS Values and 60.

I would recommend avoid down-scaling while recording* it adds additional processing.

A 1080 is a pretty competent card though I am not certain how good it is for 4K content.

* There are exceptions
zany130 Jan 2, 2022
Quoting: kit89Cheers, what's your settings in the Video Panel?
https://i.imgur.com/y2vCC1U.png
Quoting: kit89When you record the game is it Fullscreen or Windowed?
I tried both full screen and windowed still get either stuttering or tearing when I use window capture or nvFBC capture.
also I tried different resolutions for the output video and I got the best performance with the options I set above (720p 30 fps) but it still causes slow downs when using screen capture with nvFBC game runs fine regardless of settings but the display stutters with fullcompositionpipeline (game runs at a locked 60fps) or tears without
Xpander Jan 3, 2022
Are you using vsync from either game settings or goverlay/mangohud or from somewhere else?
Maybe those don't match with the 60 fps recording and do some weird tripplebuffering and lowering the video output framerates for some reason. The only thing i can think of as i don't use vsync in my games. just let it run at whatever higher framerates they run but capturing at 60.
Do you have an example video about the stutter somewhere so i could investigate and maybe we can check settings one by one in nvidia-settings and OBS to check what might cause it for you.

Last edited by Xpander on 3 January 2022 at 12:07 pm UTC
zany130 Jan 3, 2022
Quoting: XpanderAre you using vsync from either game settings or goverlay/mangohud or from somewhere else?
Maybe those don't match with the 60 fps recording and do some weird tripplebuffering and lowering the video output framerates for some reason. The only thing i can think of as i don't use vsync in my games. just let it run at whatever higher framerates they run but capturing at 60.
Do you have an example video about the stutter somewhere so i could investigate and maybe we can check settings one by one in nvidia-settings and OBS to check what might cause it for you.

well the recording always comes out fine

https://vimeo.com/662011016

It's on the actual display I have issues with. If I set my game without vsync or an fps cap it does help with the stuttering but it causes the display to feel very laggy

on the OBS discord it was suggested that maybe I am running into this issue although they think it's doubtful as the regression was introduced after 27.11.3-3 which is what I have tried building the fix anyway using these build instructions but got these errors


EDIT: was somehow able to fix the issue by disabling the game vsync and fps limiter, keeping forcecompositionpipline enabled in the nvidia settings, setting mangohud to use mailbox vsync vsync=2,and setting a fps limit of 60 in mango hud. game runs butter smooth now. Sometimes I have to switch between fps limits to get the game running smoothly for some reason so I set multiple fps limits in mangohuds config fps_limit=60,45,30,0(0 is unlimited)

EDIT2: so this issue went from strange to downright impossible. So I didn't notice originally, but my 'fix' requires my game settings to be set to the maximum (lowering the game settings actually causes the game to stutter more which makes no sense, only way I can logicly explain this is that increasing the settings causes my gpu to be used more whereas lower settings limit gpu usage) the problem with this is on demanding scenes this actually causes the fps to drop bellow 60 causing the game to stutter. So basically I either lower graphical settings and get stuttering on the display but the game runs at or above 60 fps or I increase graphical settings and that causes everything to run smoothly until the GPU can't keep the fps above 60 (on demanding scenes) and then the game stutters.

Last edited by zany130 on 3 January 2022 at 8:27 pm UTC
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
Login / Register


Or login with...
Sign in with Steam Sign in with Google
Social logins require cookies to stay logged in.