obsproject / obsproject/obs-studio
[Text source] Dragging the slider for "Background opacity" causes massive render lag
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
Steps to Reproduce
- Add a text source
- Open the stats dock
- Drag the
Background Opacityslider from 0 to 100 - Depending on how fast it was dragged it will increase the
Average time to render frameby 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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