Open Bug 1764862 Opened 2 years ago Updated 1 year ago

YouTube avc1 video is not GPU decoded

Categories

(Core :: Audio/Video: Playback, defect)

Firefox 100
defect

Tracking

()

UNCONFIRMED

People

(Reporter: flat, Unassigned)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0

Steps to reproduce:

View a YouTube live stream such as https://www.youtube.com/watch?v=A1gfjXeDvDk
(Media foundation AVC1 codec is installed)
Media Profiler: https://share.firefox.dev/3OdsRyc

Actual results:

The video that is avc1.4d402 (299) encoded is decoded via CPU (Noticeable CPU usage) making Firefox and Windows randomly lag heavily

Expected results:

The video should be hardware decoded by the GPU and use little CPU

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

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

Could you help me check the latest Nightly to see if it helps? We've landed some fix recently, and they should be uplifted to Fx100 soon.
If the issue still exists, could you post your about:support information?
Thank you.

Flags: needinfo?(flat)
Attached file about-support
Still using 0% GPU on Nightly

Here is the `about:support` from Nightly

```
Flags: needinfo?(flat)
Depends on: 1754239

AMD Radeon RX 6900 XT should have H.264 decoding support up to 4K.

Flags: needinfo?(jolin)

Could post your Nightly about support again? We've added hardware decoding support information to it.

Flags: needinfo?(jolin) → needinfo?(flat)
Attached file about_support
Flags: needinfo?(flat)

Yeah this reports hardware and software decoding for h264.

I wonder if we're opting out of hardware decoding for livestream (because of latency), and we should reevaluate this policy?

Alastor, do you know?

Flags: needinfo?(alwu)

No, I don't remember we have such mechanism to not using hardware decoding.

Would you mind to use Firefox profiler to capture a result for us?

  1. Enable the Firefox Profiler button by going to https://profiler.firefox.com
  2. Go to about:networking, select the tab Logging on the left
  3. In the box Current Log Modules, enter timestamp,MediaDecoder:5,PlatformDecoderModule:5,MediaFormatReader:5
  4. Click profiler add-on icon, and chose Media preset
  5. Start profiling
  6. Go to the video where you can reproduce the issue
  7. When issue happens, stop profiling
  8. Upload the profile, keeping all hidden threads

Thank you so much.

Flags: needinfo?(alwu) → needinfo?(flat)

Is there a specific version you would like this captured on?

It would be great if you can do it on the latest Nightly, thanks!

Here is the profile. Let me know if you're missing any needed info. I'm not super familiar on how to read these but I see the remote decoder calls, so if it is using GPU acceleration, something is off, as my GPU utilization doesn't increase, which I assume it would especially on an 8K AV1 video.

https://share.firefox.dev/3DXjOOS

Flags: needinfo?(flat)

We have blocking for this I believe. Looking at the gfx info, I see -

HW_DECODED_VIDEO_NO_COPY:
blocked by default: Blocklisted by gfxInfo

Andrew, any idea what that means?

Flags: needinfo?(aosmond)

(Possibly that was Sotaro's work, and has no relationship to this. Not sure.)

FEATURE_HW_DECODED_VIDEO_ZERO_COPY is using the allowlist, which means only Intel devices can get the feature right now:
https://searchfox.org/mozilla-central/rev/abf6758ed833c203f84703aa2e3e3d317571b1e9/widget/windows/GfxInfo.cpp#1786

We should probably distinguish between explicitly blocked and just not on the allowlist here:
https://searchfox.org/mozilla-central/rev/abf6758ed833c203f84703aa2e3e3d317571b1e9/gfx/thebes/gfxPlatform.cpp#2753

The attached about:support indicates it is an AMD device so it would have been enabled otherwise.

Flags: needinfo?(aosmond)
Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: