Open Bug 1674775 Opened 4 years ago Updated 3 years ago

[Ubuntu] Low FPS in PIP (Picture in picture)

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: danields761, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file)

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

  1. Open any web page with video (YouTube, Twitch, etc)
  2. 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

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

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.

[1] https://profiler.firefox.com/

Flags: needinfo?(danields761)

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.

Flags: needinfo?(danields761)

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

Flags: needinfo?(danields761)

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!

Flags: needinfo?(danields761)

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.

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.

Flags: needinfo?(danields761)
Attached file about:support (deleted) —

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)

Flags: needinfo?(danields761)

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.

Flags: needinfo?(jmuizelaar)

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!

Thank you for that information! Per comment10, it seems to me a graphic issue, so move this bug to graphic component.

Component: Audio/Video: Playback → Graphics
Severity: -- → S4
Flags: needinfo?(jmuizelaar) → needinfo?(aosmond)

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.

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.

Blocks: videopip
Depends on: 1682206

From Bug 1682206, it seems better to disable forwarding video frames to Main window around Video sink. Changes component to Audio/Video: Playback.

Component: Graphics → Audio/Video: Playback

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.)

Flags: needinfo?(aosmond) → needinfo?(danields761)

@(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 with gfx.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

Flags: needinfo?(danields761)

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.

Component: Audio/Video: Playback → Picture-in-Picture
Product: Core → Toolkit
Version: Firefox 82 → Trunk

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.

Component: Picture-in-Picture → Graphics: WebRender
Product: Toolkit → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: