Install video codecs for Firefox etc. in Rocky Linux 9.x

By default many videos don’t work on in the Firefox browser, e.g. Youtube live videos, videos in Twitter or various online newspapers. Some examples:

The workaround is to install and use the Chrome browser which apparently includes the needed codecs within the browser itself, but if you want to make them work (also) in Firefox, the following worked for me.

sudo dnf install epel-release
sudo dnf install --nogpgcheck
sudo dnf install --nogpgcheck
sudo dnf config-manager --enable crb
sudo dnf groupupdate core
sudo dnf groupupdate multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin
sudo dnf groupupdate sound-and-video

These instructions are specifically for Rocky Linux 9.x (I tried it on 9.3). I updated them from these instructions, which are apparently for Rocky Linux 8:

I changed those instructions by replacing “8” with “9” in the rpmfusion links, and replacing “powertools” with “crb”. If I am missing something in these instructions, let me know, but at least e.g. those web pages above now work for me in Firefox.