Enable Firefox OpenH264 video codec?


i find firefiox using more cpu and gpu while playing videos

$ dnf list installed | grep ffmpeg
ffmpeg.x86_64                                        5.1.2-3.fc37                        @rpmfusion-free       
ffmpeg-libs.x86_64                                   5.1.2-3.fc37                        @rpmfusion-free  

I think I read that fedora is removing the h264 and h265 codecs from their repo.
Since that is at least partly related, disabling of the codec may be a result of that decision by fedora.

You did not give us any info about your hardware and it may not be related at all since a codec is either supported or not and is responsible for managing the file formats for audio/video files. The drivers are responsible for managing hardware acceleration on devices, and if hardware acceleration is not enabled then software acceleration is necessary and video playback becomes CPU intensive.

Please post the output of inxi -Fzxx so we can see the hardware and drivers involved.

Another thought.
Since the OpenH264 codec is provided by Cisco and has been installed automatically by fedora for some time, is it actually installed on your machine?
This is what I see on my F36 machine.

# dnf list installed openh264
Installed Packages
openh264.x86_64                                                    2.3.1-1.fc36                                                     @fedora-cisco-openh264
1 Like
$ rpm -qa | grep openh264
openh264-2.3.1-1.fc37.x86_64
mozilla-openh264-2.3.1-1.fc37.x86_64

openh265 not installed

System:
  Kernel: 6.0.7-301.fc37.x86_64 arch: x86_64 bits: 64 compiler: gcc
    v: 2.38-24.fc37 Desktop: GNOME v: 43.0 tk: GTK v: 3.24.34 wm: gnome-shell
    dm: GDM Distro: Fedora release 37 (Thirty Seven)
CPU:
  Info: 6-core model: AMD FX-6300 bits: 64 type: MT MCP arch: Piledriver
    level: v3 rev: 0 cache: L1: 288 KiB L2: 6 MiB L3: 8 MiB
  Speed (MHz): avg: 1401 high: 1406 min/max: 1400/3500 boost: enabled
    cores: 1: 1406 2: 1400 3: 1400 4: 1400 5: 1400 6: 1400 bogomips: 42183
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Graphics:
  Device-1: AMD RS780L [Radeon 3000] vendor: Gigabyte driver: radeon
    v: kernel arch: TeraScale ports: active: VGA-1 empty: DVI-D-1
    bus-ID: 01:05.0 chip-ID: 1002:9616
  Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 22.1.3
    compositor: gnome-shell driver: gpu: radeon display-ID: 0
  Monitor-1: VGA-1 model: LG (GoldStar) 22MP56 res: 1920x1080 dpi: 102
    diag: 547mm (21.5")
  OpenGL: renderer: AMD RS780 (DRM 2.50.0 / 6.0.7-301.fc37.x86_64 LLVM
    15.0.0) v: 3.3 Mesa 22.2.2 compat-v: 3.0 direct render: Yes
Audio:
  Device-1: AMD SBx00 Azalia vendor: Gigabyte driver: snd_hda_intel v: kernel
    bus-ID: 00:14.2 chip-ID: 1002:4383
  Device-2: AMD RS780 HDMI Audio [Radeon 3000/3100 / HD 3200/3300]
    driver: snd_hda_intel v: kernel bus-ID: 01:05.1 chip-ID: 1002:960f
  Sound Server-1: ALSA v: k6.0.7-301.fc37.x86_64 running: yes
  Sound Server-2: PulseAudio v: 16.1 running: no
  Sound Server-3: PipeWire v: 0.3.59 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1
    port: ce00 bus-ID: 03:00.0 chip-ID: 10ec:8168
  IF: enp3s0 state: down mac: <filter>
  Device-2: Ralink MT7601U Wireless Adapter type: USB driver: mt7601u
    bus-ID: 2-1:2 chip-ID: 148f:7601

sudo dnf list installed mesa
If you have mesa-va-drivers, you may want to swap them for mesa-va-drivers-freeworld.
If you don’t have rpmfusion-free-updates-testing enabled you will need to enable it.

sudo dnf --enablerepo rpmfusion-free-updates-testing swap mesa-va-drivers mesa-va-drivers-freeworld

1 Like
mesa-dri-drivers.x86_64                              22.2.2-1.fc37                       @fedora               
mesa-filesystem.x86_64                               22.2.2-1.fc37                       @fedora               
mesa-libEGL.x86_64                                   22.2.2-1.fc37                       @fedora               
mesa-libGL.x86_64                                    22.2.2-1.fc37                       @fedora               
mesa-libgbm.x86_64                                   22.2.2-1.fc37                       @fedora               
mesa-libglapi.x86_64                                 22.2.2-1.fc37                       @fedora               
mesa-libxatracker.x86_64                             22.2.2-1.fc37                       @fedora               
mesa-va-drivers.x86_64                               22.2.2-1.fc37                       @fedora               
mesa-vulkan-drivers.x86_64                           22.2.2-1.fc37                       @fedora   

Regarding the High CPU Usage with firefox:
The Fedora mesa package dropped support for those codecs here

The folks at rpmfusion have built mesa vaapi drver package that supports these codecs :mesa-va-drivers-freeworld it’s available but still in the update-testing repository of rpmfusion. This is also referenced in your original post, Firefox using more CPU while playing videos - #14 by ozeszty

Regarding the OpenH264 addon in your screenshot, you should be able to enable that by selecting the 3 dots on the right and activate always.
https://docs.fedoraproject.org/en-US/quick-docs/openh264/

2 Likes

i really say droping that hardware video accelerated driver for mesa seems strange but it shoud be asked like fedora ask on first boot up that do you want third party codec support then tap this so syaten just enable that and install.

Since this is a licensing issue with mesa and fedora dropped that then it seems not a fedora issue but rather a mesa issue. Maybe addressing it with them would have more and better affect. Without permission fedora cannot directly include that codec in what they distribute.

If Fedora does not have the license to distribute certain codecs, they won’t. If they did, they could be sued for infringement.

As rpmfusion is based outside the US, it is not under the jurisdiction of US courts.