WesselKroos / youtube-ambilight

This browser extension adds ambient light to YouTube videos
MIT License
87 stars 8 forks source link

Flickering and stuck frames with WebGL on Firefox 131 #265

Closed Askejm closed 1 month ago

Askejm commented 1 month ago

Bug description

Flickering appears and frames are stuck. When I disable WebGL renderer, this is resolved but then I get bad performance

Steps to reproduce the behavior

  1. Enable WebGL renderer
  2. Go to a video like this one
  3. Observe flickering

Browser

Firefox

Operating system

Windows

Extension version

2.38.10

The bug still happens in these conditions

Additional context and/or screenshots

https://streamable.com/n2dmsb 5800x3d 3090

WesselKroos commented 1 month ago

I'm unable to reproduce this on Firefox.

  1. Are there any relevant errors logged to the javascript console (F12 > Console tab)?
  2. What's your version of Firefox?
  3. Do you have any flags manually enabled/disabled in the Firefox config (url: about:config)
  4. Could you export your extension settings?

It look like graphics artifacts you get after the GPU was lost. It could happen after a driver update, in that case a restart of Firefox might help or a reboot of Windows.

Askejm commented 1 month ago
  1. Im mostly getting errors like this Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://play.google.com/log?format=json&hasfast=true&authuser=0. (Reason: CORS request did not succeed). Status code: (null).
  2. 131.0, now that I look it seems that it updated today
  3. Only stuff for the fade transition, nothing else
  4. ambient-light-for-youtube-settings.json

I'm still on nvidia driver 560.81 (august 2024)

WesselKroos commented 1 month ago
  1. (Firefox version) 131.0, now that I look it seems that it updated today

That's it. I have the same flickering issue in Firefox 131. Thanks for the quick report.

It's interesting. It only happens on vp9 encoded videos, not on other types, so I think it might be a new bug in Firefox. And it seems to draw a random video frame from the first 5~6 frames that were decoded by the browser.

I'll report it to Firefox, but it seems like there isn't much I or you can do in the meantime.

There might be a Firefox flag in the about:config page that could revert the new behavior, or you can roll back to Firefox 130 for now. Or you can always prefer the AV1 encoded video format in the YouTube settings, but not all YouTube videos are encoded in AV1, so some will still fail:

image

WesselKroos commented 1 month ago

Bug reported to Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1922291

WesselKroos commented 1 month ago

Luckily we're not the only ones. Firefox's bugged feature is also used by YouTube's VR videos: https://bugzilla.mozilla.org/show_bug.cgi?id=1922278

Askejm commented 1 month ago

Or you can always prefer the AV1 encoded video format in the YouTube settings, but not all YouTube videos are encoded in AV1, so some will still fail:

Still appears when streaming AV1 image (As you can see, the ambient lights is stuck on an old frame)

WesselKroos commented 1 month ago

Mozilla will release a new Firefox version with the fix on October 15th.

Askejm commented 1 month ago

Updated and confirmed working on 131.0.3