tamius-han / ultrawidify

Firefox extension that allows you to work around some people's inability to properly encode 21:9 videos.
171 stars 9 forks source link

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

Open Sabrehawk opened 1 year ago

Sabrehawk commented 1 year ago

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 commented 1 year ago

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:

There are two things that could help:

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.

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