[Ubuntu] Low FPS in PIP (Picture in picture)
Categories
(Core :: Graphics: WebRender, defect)
Tracking
()
People
(Reporter: danields761, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/plain
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0
Steps to reproduce:
OS: Ubuntu 20.04.1 LTS (kernel 5.4.0-52-generic)
Kernel driver in use: nvidia
- Open any web page with video (YouTube, Twitch, etc)
- Activate PIP
Actual results:
Separate PIP window is opened, but FPS is low, 30 frames per second approximatelly
Expected results:
FPS in PIP must be same as on video
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Hi,
You said FPS is low, does it mean the video become stuttering? or it can't be played smoothly enough?
Does that happen immediately after you change video to PIP mode?
Would you mind to use [1] to profile the process when issue happens? And it would be perfect if you could have a screen recording as well.
Last, would this issue happen on a new profile, or on a private browing window?
Thank you.
Reporter | ||
Comment 2•4 years ago
|
||
Hello,
You said FPS is low, does it mean the video become stuttering? or it can't be played smoothly enough? Does that happen immediately after you change video to PIP mode?
No, video running smoothly, it's look like lowered FPS is intentional.
Would you mind to use [1] to profile the process when issue happens? And it would be perfect if you could have a screen recording as well.
Yes, sure, here the link: https://drive.google.com/drive/folders/1el86GCfPkpqgTkmEFdXfQ1view-YXBnQ?usp=sharing
Last, would this issue happen on a new profile, or on a private browing window?
This happens with new profile with safe-mode enabled as well.
Thank in advance.
Comment 3•4 years ago
|
||
Sorry, I've checked your video, but I wasn't aware of the notible FPS drop, how did you notice the FPS drop? Is there any statistic showing that? or just your feeling?
Would the issue happen on this kind of video [1] ?
One possibility I assume is that, when making video into PIP mode, the website would receive the visibilitychange
event if you put the tab to backgroud. Then, they might adjust the video FPS because they think video is already invisible. Currently the visibility HTML spec didn't consider the PIP implementation, so if that is the rootcause, then we have nothing to do here.
In addtion, I tested some 60fps Youtube video on my Mac, they seems the same when video is being used in PIP mode, I didn't feel any FPS drop on PIP video.
Thank you.
[1] https://alastor0325.github.io/htmltests/autoplay_tests/autoplay_test1.html
Reporter | ||
Comment 4•4 years ago
|
||
Sorry, I've checked your video, but I wasn't aware of the notible FPS drop
Yes, the video doesn't provide same view how my eyes sees the monitor. Main reason is that my desktop is on 144hz, while captured video is on 60hz. There is obvious frame aliasing problem, but i still can see the difference on the video, but not so easily.
how did you notice the FPS drop? Is there any statistic showing that? or just your feeling?
I playing dynamic games and my eyes are trained well to see the difference. Hope you trust me enough, because i can't find any tool which able to measure real FPS of some particular window.
Also i created new sample, which is recorded on 120HZ and bitrate of 25000kbit/sec, where the difference should looks more obvious. But i'm afraid, that without high-HZ (more then 60Hz) monitor you'll face same frame aliasing problem :(
Maybe the difference will be a bit clearer comparing to recording of Chrome PIP behaviour.
One possibility I assume is that, when making video into PIP mode, the website would receive the visibilitychange event if you put ...
Is there a way to execute some console command or perform another action, which will change that? Or this is hard-coded browser behaviour?
In addtion, I tested some 60fps Youtube video on my Mac, they seems the same when video is being used in PIP mode, I didn't feel any FPS drop on PIP video.
This video is clearly less-then-60fps video, thats why maybe?
Thank you in advance!
Reporter | ||
Comment 5•4 years ago
|
||
There was mistake in my previous message, i miss quoted when wrote last section. There is fix.
Would the issue happen on this kind of video [1] ?
No, the video seems to be 30fps video, and therefore this issue doesn't affect this kind of video.
Comment 6•4 years ago
|
||
It makes me wonder if this is a graphic issue, could you try to disable webrender (gfx.webrender.compositor
) and restart Firefox to see if it works?
In addition, could you paste the information from about:support
to here?
Thank you.
Reporter | ||
Comment 7•4 years ago
|
||
Reporter | ||
Comment 8•4 years ago
|
||
It makes me wonder if this is a graphic issue, could you try to disable webrender (gfx.webrender.compositor) and restart Firefox to see if it works?
I checked this property and it had been disabled (browser default i assume)
Comment 9•4 years ago
|
||
Jeff, do you have any thought about this issue? Is there any possible situation for graphic that would make PIP video rendering in low FPS?
Thank you.
Reporter | ||
Comment 10•4 years ago
|
||
Enabling OpenGL (which is turned off by default for some reason) via layers.acceleration.force-enabled
fixes the issue. Now i can definitely see more then 2 times higher FPS inside PiP.
Hope that helps for future readers!
Comment 11•4 years ago
|
||
Thank you for that information! Per comment10, it seems to me a graphic issue, so move this bug to graphic component.
Updated•4 years ago
|
Comment 12•4 years ago
|
||
When PIP is enabled, VideoSink sends video frame to 2 VideoFrameContainers(ImageContainers).
Then, 2 ImageHosts reveice the video frames. One is for MainWindow and another is for PIP window.
ImageHost on MainWindow is not rendered because pictureInPictureOverlay covers the video.
- https://searchfox.org/mozilla-central/rev/97dd1934d16cada69dbf68e9cda9e9a017459e9e/toolkit/content/widgets/videocontrols.js#1023
- https://searchfox.org/mozilla-central/rev/97dd1934d16cada69dbf68e9cda9e9a017459e9e/toolkit/content/widgets/videocontrols.js#3011
But the ImageHost rendering triggers composite. It adds extra tasks, even when the video frame was not composited. Same extra task is added during WebRender enabled.
Comment 13•4 years ago
|
||
From Bug 1682206, it seems better to disable forwarding video frames to Main window around Video sink. Changes component to Audio/Video: Playback.
Comment 14•4 years ago
|
||
OpenGL compositing via layers.acceleration.force-enabled
is deprecated. WebRender will eventually be supported on the NVIDIA binary driver but we're still working through some issues for it around suspend/resume.
On the latest nightly, could you try with gfx.webrender.all
flipped to true and confirm that also works? And after that, try with gfx.webrender.software
flipped to true and let us know if you see the issue? (That enables our replacement for Basic compositing.)
Reporter | ||
Comment 15•4 years ago
|
||
@(In reply to Andrew Osmond [:aosmond] from comment #14)
Hi,
OpenGL compositing via
layers.acceleration.force-enabled
is deprecated. WebRender will eventually be supported on the NVIDIA binary driver but we're still working through some issues for it around suspend/resume.
Yes, layers.acceleration.force-enabled
causes wired visual bugs and only Firefox restart helps.
On the latest nightly, could you try with
gfx.webrender.all
flipped to true and confirm that also works? And after that, try withgfx.webrender.software
flipped to true and let us know if you see the issue? (That enables our replacement for Basic compositing.)
Enabling both gfx.webrender.all
and gfx.webrender.software
fixes issue even with layers.acceleration.force-enabled
turned off! Tha
Comment 16•4 years ago
|
||
When I tried 720p60 video with WebRender on my Linux PC, PIP decreased FPS from 40fps to 20 fps. But When I applied attachment 9192967 [details] [diff] [review] of Bug 1682206, FPS was increased to 50 fps.
Updated•3 years ago
|
Comment 17•3 years ago
|
||
Given the above, I'm inclined to think this bug now has more to do with the Graphics pipeline for the cloned video frames than PiP directly. Going to move to Core :: Graphics : Webrender for now.
Description
•