Firefox using more CPU while playing videos

hey i recently find a issue that if play a video from youtube in firefox and chromium/brave i find firefox using more cpu then chromium base browser why this is happening can anyone explain btw my firefox was installed from dnf but brave was with flatpak

2 Likes

You probably aren’t getting hardware acceleration in firefox but are in brave.

1 Like

https://fedoraproject.org/wiki/Firefox_Hardware_acceleration

4 Likes

I have tried with flatpak version of the firefox but same as it was in from .rpm

I will loook into

What’s your hardware? Share the output of vainfo -a and lspci -v.

I experienced the same thing on an Intel processor with internal graphics with flatpaked firefox beta. It’s much improved since I installed intel-media-driver and generally just followed the guide linked by @ozeszty. In the flatpaked version you might have to allow firefox to use hardware acceleration through flatseal or commandline

1 Like

I find it is same for both flatpak and .rpm i find even ungoogled chromium have lower cpu usage thn firefox almost half.

2 Likes

Check which codecs and what resolutions are being used (e.g. YT stats for nerds) and what can be hardware accelerated (with vainfo).
Even without HW acceleration difference, cpu usage can differ substantially between h264 (avc1) and e.g. vp9 or av1.

anyway…I’m getting trouble firefox, recently unstable status for me! Take care!!! :face_with_head_bandage:

$ vainfo
bash: vainfo: command not found...

i am on wayland so it should work out of the box.
still i am installing ffmpeg, libva and libva-utils this three packages

installing 3 packages does not solve anything

$ vainfo
libva info: VA-API version 1.15.0
libva info: Trying to open /usr/lib64/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_15
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.15 (libva 2.15.0)
vainfo: Driver version: Mesa Gallium driver 22.2.0 for AMD RS780 (DRM 2.50.0 / 5.19.16-301.fc37.x86_64, LLVM 15.0.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc

This is UVD 2.0 GPU supporting MPEG4 AVC and VC1 decode: RadeonFeature
Those are missing in vainfo output because you’re using F37 in witch some VA-API drivers (including AMD) were dropped because of licensing issues: Mesa in F37- vaapi support disabled for h264/h265/vc1 - devel - Fedora Mailing-Lists

Here’s review request for providing dropped drivers in RPMFusion: 6426 – Review request: mesa-freeworld - Mesa graphics libraries

Flatpak has it’s own mesa with those drivers still included (at least for now), hence flatpacked apps can use all hardware decoding capabilities and the difference in CPU usage. With drivers in RPMFusion the difference will once again disappear.

2 Likes

But then why flatpak one also same as .rpm one is there a reason. As i have checked with brave and ungoogled chromium that both works without a issue. I find it particularly in only firefox though.

They are not the same. Don’t ever claim that.
The version may be the same but the packages are different.

The rpm only installs what fedora allows and provides.
The flatpak installs additional apps, libraries, etc to enable running without the same restrictions as fedora has.

Brave and chromium come from a 3rd party repo so they are not restricted the same as the fedora provided firefox from rpm. Same for the flatpak in that it also is not under the same restrictions as the rpm version.

Fedora does not distribute any license, copyright, or patent encumbered software. 3rd party developers and packaging sites are not under the same limitations.

1 Like