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.
# 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-nokmods: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-nokmods: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