Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YT 4k 60 fps frame drops with extension enabled , no frame drops without extension #237

Open
Sabrehawk opened this issue Oct 14, 2023 · 1 comment

Comments

@Sabrehawk
Copy link

Sabrehawk commented Oct 14, 2023

The 4k 60 fps mode noteably drops frames when i turn the extension on , when it is off no frames are dropped
screen 32:9 , 5120x1440 resolution , mode is automatic detection (extension caps youtube to 21:9 (up from 16:9 ) aspect ratio in order to not cut off top and bottom content and not overstretch and distort the image which is ok) The black bars at the side are acceptable, its a huge screen and i dont expect YT videos to run properly in 32:9 unless they are specifically encoded for ultrawide.

My assumption is that the browser passes the demand to the video driver to deliver enough perforrmance to playback without frame drops, but due to the extension increasing the viewport and thus the amount of pixels , the requested gpu performance is inadequate and the browser extensions extra performance demand is not accounted for/passed on to the driver. Proof of concept is that when i use Precision X to BOOST LOCK the 3070 ti at max boost speed the frame drops significantly diminish.

cpu ; 8700k @ 5.0 GHZ
gpu:NVIDIA 3070 TI
browsers FIREFOX, EDGE windows 11

could be something entirely different but what do i know :))

@tamius-han
Copy link
Owner

It's more or less that.

The culprit is autodetection (which should get disabled when you set aspect ratio manually, btw).

The story goes a little bit like this:

  • autodetection asks browser for a video frame, resized to 360p.
  • as resolution starts to increase, this gets increasingly expensive, so browser/GPU starts working overtime, leading to frame drops

There are two things that could help:

  • autodetection should ask for a video frame that's NOT resized

That speeds up the act of capturing the video frame significantly. However, doing so means the script for automatic aspect ratio detection will run significantly slower, to the extent running auto-detection on 4K frame loses more time than I gain by doing things this way. This is true even for parts of autodetection code that seems resolution-invariant — the part of extension that checks 144 random pixels to see if image is bright enough that autodetection can run up to 10 times slower.

  • maybe WASM and webgl?

The problem is that I'm not very proficient in either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants