Adding H.264 support to Firefox

It’s very easy, but I couldn’t find these steps anywhere else, so I’d like to share it here:

  1. Add the RPM Fusion free repo: rpm-ostree install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
  2. Reboot the system
  3. Install the compat-ffmpeg28 package (yes, even on Silverblue 29): rpm-ostree install compat-ffmpeg28
  4. Reboot again

That’s for the SB 29 pre-installed Firefox. Firefox Nightly flatpak includes H.264 support out of the box.

2 Likes

Likely just very similar steps as for “usual” Fedora Workstation that has been answered on AskFedora before. So it’s kinda answered there, except of the obvious changes for Silverblue and the fact that apparently the package name changed(?).

Thank you for posting here :slight_smile:

you can also just use Firefox Nightly from flatpak
https://firefox-flatpak.mojefedora.cz/

1 Like

For what it’s worth I’ve tried following the official instructions (only adapted them to Silverblue) for installing OpenH264 from Cisco, i.e.

  1. enable that “fedora-cisco-openh264” dnf repo. (actually, you can do that from inside GNOME Software -> software sources) and it seems to work fine. (i.e. rom-ostree shows me it uses this repo when downloading updates)
  2. rpm-ostree gstreamer1-plugin-openh264 mozilla-openh264

This way, you need no (inofficial) rpmfusion repo (the Cisco repo is quite official and maintained by Fedora AFAIK, it only has legal reasons as you can read on the wiki).

In the end I also saw the H264 plugin in the rpm-ostree-Firefox and even in the Fedora flatpaks one (from registry.fedoraproject.org), but in both cases youtube.com/html5 claimed H.264 was not available. :thinking:

1 Like

It’s probably just not available to the flatpack environments. I’d try on a
normal system and see if that works. If so, you know it’s flatpack which is
broken.

As I’ve mentioned I’ve tried it (even) with the rpm-ostree (i.e. build-in version) of Firefox in Silverblue. I would not even have expected it to appear in the flatpak version. But both don’t work.

You would have to install both with dnf or the Silverblue equivalent. You
can’t mix and match with this, as it’s a shared object.

Rpmfusion is developed in tandem with Fedora and afaik is the closest to official a proprietary repo can get. It’s highly recommended overall.

I believe the Cisco h264 repos only cover WebRTC h264 for legal reasons. You need rpmfusion and the compat-ffmpeg28 package to be able to use them on Firefox for standard video.

Ah okay, then this would also apply to Firefox on Fedora Workstation. :thinking: Maybe I just forgot that it works like this.

The easiest way for me was to install Google Chrome which includes H.264.
The problem with Chrome in Silverblue is that you cannot update it from the Software Center. You click download and install, reboot and the update is still available. The workaround is to uninstall it, reboot and then install the new version.
The GOOD news is that Fedora 31 will include OpenH264 2.0 by default and it will support the Main and High profiles. It is mentioned at the end of the blog post.
I hope that it will be back-ported to Fedora 30 so we won’t need to install Chrome only for HBO Go or Netflix.

1 Like

It’s not updating because the RPM containing the older version is being installed again after rpm-ostree has pulled the updated package.

Easy fix is to just not use the RPM to install Chrome.

/etc/yum.repos.d/google-chrome.repo

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub

rpm-ostree install google-chrome-stable

1 Like

Okay, great, I’ve tested it and installing compat-ffmpeg28 really fixes it (for the rpm-ostree Firefox! Flatpak(ed) Firefox (obviously) has not access to it.

What I wanted to add: GNOME Software works perfectly with rpm-ostree and thus you do not have to use the terminal to add the RPM Fusion free repo, but can now (in Silverblue 30) just download the file and open it with GNOME Software.

If that is the case that would be pretty good news! However, where exactly do you read it will be included (or even shipped by default)? I just read:

So the OpenH264 2.0 release […] is out […] and Kalev Lember has been working to get the Fedora packages updated.

Only updated, i.e. that might just include that OpenH264 package on Cisco’s servers? Anything else would be a bigger change, would not it.


Also BTW, as you can see in this thread, with rpm-fusion Firefox works fine for playing videos like with H264.

If that is the case that would be pretty good news! However, where exactly do you read it will be included (or even shipped by default)

That is what I understood after first reading an earlier post and then the title of the second post: “On the Road to Fedora Workstation 31”. It seems that everything will work out of the box. :grinning: