You may encounter that your preinstalled Firefox can’t play videos or certain video thumbnails are missing in your file manager.
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, see here for the fix on traditional Fedora
(Fedora Flatpak Firefox has no fix currently and would need a flatpak extension from a repo like rpmfusion, see this issue for details)
Three options
- A: with layering (modifying your system)
- B: without layering, just for the
ffmpeg
tool - C: using uBlue images that include the Codecs
With “systed sysextensions” there will be a fourth way to install these packages without layering. It is not yet well tested and didnt work in my experiments.
A: With layering
This will add a changeset to your system. On every update, these changes will be applied new, so they are always fresh and dont pile up old issues. It slows down the update process though, and consumes more resources.
Using rpmfusion
packages may also cause temporary update issues, if the packages are not synchronized with Fedora’s. These issues will fix themselves after a few days.
1. Add rpmfusion repo
The repos are managed through an RPM which you need to layer and reboot.
# free and nonfree
rpm-ostree install --reboot 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
2. Install the codecs
A: Minimal: Just freeworld
video codecs
This will make video playback and video thumbnails work, and is likely enough.
rpm-ostree install --reboot libavcodec-freeworld
B: Complete: ffmpeg
+ ffmpegthumbnailer
If you want to use ffmpeg
from the terminal and have all features, you need to remove all those packages to fix the dependency problems.
rpm-ostree override remove libavcodec-free libavfilter-free libavformat-free libavutil-free libpostproc-free libswresample-free libswscale-free libavdevice-free --install ffmpeg --install ffmpegthumbnailer
B: Without layering
There are options to use it without layering. This will keep your updates fast and prevent (temporary) update issues.
Flatpaks with ffmpeg included
Many Flatpak applications include ffmpeg
internally, so you can use that.
NOTE
This will not make video thumbnails in the filemanager (ffmpegthumbnailer
) or video playback in Firefox work, but give you access to the fullffmpeg
binary to do video, audio or image editing.
WARNING
You will need to give these apps access to all directories you use with ffmpeg
, as Portals don’t work in the terminal. This means an app may get more filesystem access than it would need on it’s own.
Applications with home
access can override their own privileges and gain root access. So make sure to trust them.
To display all apps with their App IDs:
flatpak list --app --culumns=application
Use the KDE Settings for that, or Flatseal. You can also use the terminal:
flatpak override --filesystem=home org.app.name
recommended
These apps are well known and trusted. You can restrict internet permission in the settings.
- DigiKam (Photo management tool)
- VideoTrimmer (simple video cutting)
- Haruna (KDE Video Player)
- Celluloid (GTK Video Player)
not recommended
These apps connect to the internet or have other issues. You may not want to remove their sandbox.
- KRDC (Remote Desktop Client)
- OBS Studio (Video recording and broadcasting)
- NewsFlash (RSS Feed Reader)
- FreeTube (Youtube Application)
- VLC (Note that the package is unofficial and doesn’t have Wayland support.)
To use these in bash, enter:
cat >> ~/.bashrc <<EOF
ffmpeg() {
flatpak run --command=ffmpeg org.app.NAME "$@"
}
EOF
Distrobox
You can create a container and install ffmpeg
there. All apps in a Distrobox/Toolbox have full home access.
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
exit
Outside the box:
cat > ~/.local/bin/ffmpeg <<EOF
#!/usr/bin/sh
distrobox-enter Fedora -- ffmpeg
EOF
chmod +x ~/.local/bin/ffmpeg
This will create a script in your $PATH directory.
Alternatively you can use an alias in your shell, example for bash, zsh or fish:
cat >> ~/.bashrc <<EOF
alias ffmpeg="distrobox-enter Fedora -- ffmpeg"
EOF
C: Easy, complete, unofficial: use uBlue images
This is an easy method, requires no additional maintenance and will keep the rpm-ostree
updates just as fast. But it means you need to place trust in a second entity, and you will get your OS updates from Github’s container registry and not Fedora servers anymore.
uBlue takes the Fedora Atomic images and adds all the needed media codecs to it. They do the same for NVIDIA and other hardware enablement tasks.
They don’t advertise their base images anymore, but you find their image list here and the “template command” below.
First, rebase to the unverified image. This is a temporary step.
rpm-ostree rebase --reboot ostree-unverified-registry:ghcr.io/ublue-os/IMAGENAME:latest
After the reboot, rebase to the signed image.
rpm-ostree rebase ostree-image-signed:docker://ghcr.io/ublue-os/IMAGENAME:latest
Use the -main
images if you don’t need NVIDIA or other drivers or custom kernels.
Example: kinoite-main
.
Use the -nvidia
images if you rely on proprietary NVIDIA drivers (which will get more complicated when NVIDIA supports modern cards with opensource but still external drivers).
Example silverblue-nvidia
.
Use the :latest
version to get automatic version upgrades. You never need to touch the Terminal again … probably.
WARNING
the *-nokmods
images are no longer supported and dont receive any updates anymore! Rebase to *-main
.
Note
The first rebase may become redundant when Fedora switches to signed OSTree native containers