New shared textures hang on frame 404 for 250ms, repeating #468
Labels
No labels
area/accessibility
area/dependency
Confirmed
Crash Report
Delayed
Design Issue
Duplicate
Feedback required
Good first issue
kind/bug
kind/cleanup
kind/enhancement
platform/linux
platform/macos
platform/windows
priority/high
Question
Request for Comments
Seeking Other Contributors
Seeking Testers
Won't Fix / By Design
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-obsproject/obs-browser#468
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
31.0.0
OBS Studio Version (Other)
No response
OBS Studio Log URL
https://obsproject.com/logs/CO0OuTCbJml5RuSh
OBS Studio Crash Log URL
No response
Expected Behavior
Browser sources are working fine without any lag (as can be seen with animated emotes for example)
Current Behavior
Browser sources are lagging sometimes very frequently, other times not as much, with OBS 31 vs. 30.2.3
Steps to Reproduce
Anything else we should know?
This was not happening on 30.2.3 (but I'd rather stick to the newer version because of both TEB and also better encoder and feature support)
It seems I'm so far one of the few people that can reproduce this (on 3 machines no less) and I wouldn't even know where to begin debugging this.
My hunch would be on either the new shared texture implementation in OBS 31 or perhaps something that changed in CEF internally going from the previous version (5060?) to the one found in 31.
As a side-note, this is happening with both HW Acceleration on and off.
The log in question is from my main OBS instance that I use for streaming - However in the first example below I was able to reproduce it on a fresh portable instance with pretty much nothing besides the browser sources (Didn't record OBS itself, just what was in the canvas)
Examples:


https://github.com/user-attachments/assets/8a70613a-6b8d-41d0-8965-11677d1bf2aa
To add more info onto this: Penwyvern on the Discord managed to build me a version of v31 with CEF 5060 so I could check if the issue might've been in core OBS (or maybe some regression in a plugin etc. etc.) and so far I can't spot any lags happening.
We also talked a bit about it happening when the GPU load is high and / or when e.g. Firefox is open with some tabs.
However, I doubt that is the case seeing as I was able to, as said, reproduce it on 3 different machines with varying GPUs (RTX 3090, RTX 3070 and RTX 4060) and on all of them I used a normal v31 portable build without any plugins and was still able to run into lags...
Using a HTML test page that increments a number on every animation frame brings some extra results as well.
On a fresh 31 portable install with nothing extra installed I have both a 7TV Animated Emote open (in WEBP format) and the test page.
It seems to freeze the counter at some of the intervals for a bit.
As for the emote, it also sometimes freezes / hitches, but not at the same time as the counter.
This is with 30 FPS because I forgot to change it to 60
https://github.com/user-attachments/assets/e972a727-57dc-43fe-9304-b8988f1f6619
This one with 60
https://github.com/user-attachments/assets/a8aadc86-357d-47ff-a036-6d0829e28672
The emote in question I used:
https://cdn.7tv.app/emote/01GXKYSGBG000A4FN34W5CETQ7/4x.webp
And finally, the HTML test page that was provided by SquidCharger on the OBS Discord (slightly altered for visibility):
So, extensive testing by a few people has determined this is a bug on Chromium's end and not directly tied to our changes to add support for the new shared textures. We will keep this ticket open for tracking for now, but the next step is to raise a ticket with Chromium so they can either put together a fix upstream, or give us an alternate solution we could implement.
Code in question: https://github.com/chromium/chromium/blob/main/media/capture/content/video_capture_oracle.cc#L190
Once we have more insight from Chromium, we can either fix the issue on our side or close this ticket in favour of theirs. Unfortunately, this will likely mean a proper fix may not make it until we upgrade CEF again, which may be a while. Depending on the complexity of the fix, we could theoretically patch our own CEF in the meantime, but that is a decision for another day.
A better URL to test this with is the following, found in #470
https://app.singular.live/output/6W76ei5ZNekKkYhe8nw5o8/Output?aspect=16:9
Alternatively, here's an HTML page with an accompanying
timer.webmvideo (inccrementing timer with milliseconds), seeing as this also affects videos on the webpage. Curiously it doesn't affect videos if they're the only thing on the page.Additionally, the more the
positionvalue at line 91 changes each animation frame, the more often the stutters will occur.https://github.com/user-attachments/assets/e0969b75-8fc8-47f3-bc50-b79907ab766b
We've reported it on the Chromium bug tracker now
https://issues.chromium.org/issues/391118566
Latest on this issue: the fix has been merged upstream in Chromium, and we have backported it on all platforms. It'll be included as part of https://github.com/obsproject/obs-studio/pull/11910
Noting this for posterity: Chromium has reverted the fix because it apparently results in more frames than the WebRTC team likes. It apparently results in 32fps when targeting 30fps. The hope is to find an alternate fix before our next big CEF/Chromium update, as we don't want to maintain a custom patch forever.
Update: A new patch has been merged in Chromium 137 and will branch at 4/28, then it will be later merged in CEF, but it could take a while before OBS use the new patch, as the OBS team needs time to sort out the new chrome runtime before update CEF to latest.
Anyway, the whole process of transition to new patch should makes no difference to users.
Don't forget to remove the previous manually maintained patch when bumping to the latest CEF.😉
Looks like this just made it into CEF 142.0.14+gceaf578+chromium-142.0.7444.163 (my understanding is it's this commit).
@WizardCM can you confirm that this is all good with upstream CEF now? Also would be nice to be tagged in anything requiring custom patches (or backports ahead of upstream) going forward, so I can throw them into the Fedora CEF package ^^