obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

Adaptive Replay Buffer Memory Limit

Open derrod opened this issue 2 years ago • 6 comments

Description

Adds libobs utility function to get total available memory and changes UI code to adjust the maximum replay buffer accordingly. Also adds a warning for CBR/VBR modes when estimated usage exceeds suggested maximum.

Motivation and Context

8 GiB is a little small considering most users have 16, and 32 is getting increasingly popular.

How Has This Been Tested?

Tested on Windows 10 with advanced output replay buffer.

ToDo

  • Test on macOS
  • Test on Linux
  • Make sure FreeBSD and OpenBSD don't break (they shouldn't)

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch (ignore the typo).
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

derrod avatar May 02 '22 14:05 derrod

I tested this and this works.

Wouldn't a hard cap for CBR be more consistent with VBR and CQP rather than a warning? (I don't know how hard it is to implement that)

TheSwerik avatar May 02 '22 16:05 TheSwerik

I have tested this on macOS and Windows at least. I don't have a Linux machine handy, so if somebody could cross-check that that would be great.

derrod avatar Jul 27 '22 15:07 derrod

Rebased to fix merge conflicts due to f9e7d237ad3d821707e3b5508ff316cd80755347 and ff555dd2b0b8f79070ec627309877ef4bbe05993

derrod avatar Jul 30 '22 16:07 derrod

The warning gets truncated instead of wrapped if the Settings window is too narrow. image

Other than that, the new UI limit seems to work. Haven't yet tested the limits of the buffer itself, but if you've already tested that on Windows and macOS, it's probably fine.

RytoEX avatar Jul 30 '22 16:07 RytoEX

The warning is using the existing QLabel so that's not an issue introduced by this PR. I guess it would need some sort of line wrap to be enabled?

derrod avatar Jul 30 '22 18:07 derrod

The warning is using the existing QLabel so that's not an issue introduced by this PR. I guess it would need some sort of line wrap to be enabled?

If it's a pre-existing issue, feel free to leave that for a later fix.

RytoEX avatar Jul 30 '22 18:07 RytoEX

Appears to work on Linux (tested Flatpak in VM).

derrod avatar Nov 04 '22 18:11 derrod

Seems to work on my 32GB machine on Windows.

image

image

Wondering if this'd be better in GiB, or to add a separator for thousands.

WizardCM avatar Nov 08 '22 03:11 WizardCM