Missing codecs on rocky 10.2

When i open you tube in firefox, some videos play, and some dont..i saw posts related to this, and i didnt find solution that works on rocky 10.2..i also got suggestions to install flatpak firefox, but i dont want that..what codec/s is/are missing, and how to install it? Vlc is flatpak version, so it has its own codecs..only thing is that some of you tube videos wont play..it gives me an error and grey window:D

Install rpmfusion-free repo
dnf install -y site/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm

Where site is https:// and mirrors.rpmfusion.org

Then install x264
dnf install -y x264

This should install the needed codecs.

Ok, thank you so much for help!! ill try that..

it didnt worked..but this worked instead: sudo dnf install ffmpeg ffmpeg-libs gstreamer1-plugins-bad-freeworld gstreamer1-plugins-ugly --allowerasing