obsproject / obsproject/obs-studio

[Text source] Dragging the slider for "Background opacity" causes massive render lag

Open
#10,227 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

30.0.2

OBS Studio Version (Other)

30.1.0-beta1

OBS Studio Log URL

https://obsproject.com/logs/uhXYr7f78oILA7ey

OBS Studio Crash Log URL

No response

Expected Behavior

When dragging the slider for the Background Opacity it massively increases the Average time to render frame and introduces render lag.

Current Behavior

It shouldn't cause this much render lag / average time to render frame.
I've observed upwards of 100ms
image

Steps to Reproduce
  1. Add a text source
  2. Open the stats dock
  3. Drag the Background Opacity slider from 0 to 100
  4. Depending on how fast it was dragged it will increase the Average time to render frame by a huge amount and even cause render lag (as in, missed frames)
    4.1. Dragging it around violently will most definitely cause this issue
Anything else we should know?

It does seem to be within spec that the background opacity updates for every % it reaches, which is why typing it in will only update it once and not cause this much of a lag.

After some discussion with Matt there's an idea to potentially add a smart delay to updating the background opacity (say once every 50-200ms) while it's being dragged, so it can still update just fine, but doesn't cause this issue, or perhaps even wait until the user releases the slider for it to update.

Another idea I had in mind (and tested) was to basically have a "Nested Source".
A mix of a Text source and a black Color Source source.
The Color Source would have a Color Correction filter for the opacity.
Then, inside the modified Text source's settings, the Background Opacity slider would control the Color Correction opacity.
In my tests this did not cause the Average time to render frame to increase by even 0.1ms.
However, I am unsure if this would be possible to do in OBS.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on Windows 11 with the Text source, Stats dock, and Background Opacity slider using the reported OBS versions. Review how each slider update affects rendering, then determine a bounded update behavior that preserves usable opacity changes. Done means dragging the slider no longer causes extreme render-time increases or missed frames.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.