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
59.83k stars 7.93k forks source link

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

Open Lordmau5 opened 8 months ago

Lordmau5 commented 8 months ago

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.

lourencop01 commented 7 months ago

@Lordmau5 I'm trying to reproduce this issue but I can't seem to find the background opacity slider you're talking about. Could you break down that step a bit further please? Thanks!

Lordmau5 commented 7 months ago

@Lordmau5 I'm trying to reproduce this issue but I can't seem to find the background opacity slider you're talking about. Could you break down that step a bit further please? Thanks!

It's a few options from the bottom ones image

lourencop01 commented 7 months ago

I'm running the current OBS Build and my text source properties look different than yours.

Maybe they've changed this already?

The only Text Source I have is "Text (FreeType 2)"

Screenshot 2024-03-04 at 18 36 53
Lordmau5 commented 7 months ago

@lourencop01 that would be it then - Are you on OSX or Linux? I'm experiencing this on Windows and I only have "Text (GDI+)" available, so I assume the FreeType one doesn't have a background (and it's opacity)

lourencop01 commented 7 months ago

I'm on macOS Sonoma 14.3.1.

Yeah, that might be it!

RytoEX commented 7 months ago

@lourencop01 that would be it then - Are you on OSX or Linux? I'm experiencing this on Windows and I only have "Text (GDI+)" available, so I assume the FreeType one doesn't have a background (and it's opacity)

Windows has both GDI+ and FreeType text sources. The latter is under the "Deprecated" submenu when adding a source.

Non-Windows systems only have FreeType. GDI+ and FreeType are not 1:1 on features.