Firefox: some ways to fix video playback issues on Fedora Atomic

You may encounter that your preinstalled Firefox, or the Fedora Flatpak one (no fix currently afaik), can’t play videos.

This is due to missing nonfree codecs, that the Fedora Project would need to pay an enormous amount of money for, thus they can’t possibly preinstall it.

There is rpmfusion though, which is not situated in the US and thereby can easily ship these packages without consequences. Also, some Flatpak apps or runtimes ship ffmpeg, which includes the wanted video codecs.

Here are some ways to fix this problem. I will focus on Fedora Atomic versions, but on regular Fedora its similar.

Minimal: Just freeworld video codecs

rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && reboot
#leaving out the nonfree repo: https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

#after reboot
rpm-ostree update --install libavcodec-freeworld

Complete, preinstalled: Ublue images

Ublue) is a project producing custom Fedora images that include things like the wanted video codecs. They focus on minimal and not too opinionated additions, it is a smaller community though.

WARNING: the *-nokmods images are no longer supported and dont receive any updates anymore!

# Silverblue / GNOME
rpm-ostree rebase ostree-unverified-registry:ghcr.io/ublue-os/silverblue-main
# after reboot
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/ublue-os/silverblue-main:latest

# Kinoite / KDE
rpm-ostree rebase ostree-unverified-registry:ghcr.io/ublue-os/kinoite-main
# after reboot
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/ublue-os/kinoite-main:latest

See the other images with Commands under the link above

First you need to rebase to the unverified images, then you can rebase again, to the verified ones and you are done.

Complete, manual, official Fedora: ffmpeg + ffmpegthumbnailer

rpm-ostree install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && reboot
# using free and nonfree repos

# after reboot:
rpm-ostree override remove libavif libavcodec-free libavfilter-free libavformat-free libavutil-free libpostproc-free libswresample-free libswscale-free --install ffmpeg
#You need to remove all those packages to fix the dependency problems

ffmpeg without layering

There are options to use it without layering. You can use a Fedora Distrobox/Toolbox, add rpmfusion there and install it there. You can use it through VLC or the Freedesktop.org Flatpak runtime (don’t know how to do the last one)

VLC:

cat >> ~/.bashrc <<EOF
ffmpeg() {
  flatpak run --command=ffmpeg org.videolan.VLC "$@"
}
EOF

# note: this uses the name "ffmpeg" which may not be wanted

This will not make ffmpegthumbnailer or Firefox work though

Distrobox:

distrobox-create Fedora -i registry.fedoraproject.org/fedora-toolbox:$(rpm -E %fedora)

distrobox-enter Fedora
sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && sudo dnf install -y ffmpeg

distrobox-export --bin /usr/bin/ffmpeg

This will create an executable in your $PATH directory. Another option instead of Distroboxes export command is this:

cat >> ~/.bashrc <<EOF
alias ffmpeg="distrobox-enter Fedora -- ffmpeg"
EOF

This simply adds a shortcut to your Bash config. Other shells work too, fish:

cat >> ~/.config/fish/config.fish <<EOF
alias ffmpeg="distrobox-enter Fedora -- ffmpeg"
EOF
3 Likes

its a while ago that I did this. If there is a mistake, please correct me.

Or just install the flatpak from flathub which includes everything

1 Like

Thanks for collecting these fixes in one place as they will be needed for some time to come.

I’ve got to see about getting involved in these as they promise to be a much better solution. Both were started by the wonderful cgwalters
bootc
sagano

I remeber reading a thread within the last few years where a question was raised about using container rather than ‘git for fs tree’ and Colin seemed to really have the light bulb go off in his responses. Wish I could find that thread again…

I selfishly mention them on your discussion with the hope that others will want the benefit and become part of the way forward as well.

  • No drag&drop
  • slower (did a huge test yesterday, will post here)
  • no native messaging (KeepassXC-browser, KDE connect, KDE Plasma integration, Zotero, UMD, …)

Edit: fixed the override command. ffmpeg conflicts with a hell lot of packages.

With workstation that is not an issue since installing ffmpeg can be done with dnf and using the
--allowerasing option to remove the conflicts. I understand that you are on an immutable system, but that should also be possible with using rpm-ostree. The command is structured differently but still can be done. If I understand your comment it seems you may have been able to do that already.

1 Like

It’s still not quite right. The Fedora ffmpeg packages are libavcodec-free libavfilter-free libavformat-free libavutil-free libpostproc-free libswresample-free libswscale-free

libavif is not part of ffmpeg, and ffmpegthumbnailer is not a Fedora package. Kinoite alone has ffmpegthumbs in the base image, which is apparently KDE-specific and doesn’t appear to conflict with ffmpegthumbnailer from RPM Fusion.

1 Like

Thanks, so on my Fedora Container its easier then

I am pretty sure libavif was a dependency problem