Silverblue 40 - Firefox - Couldn't open avcodec

I do not believe it’s news that Firefox is sometimes not able to play certain videos:

But none of the above seems to yield a solution for Silverblue.

I’m seens this error messages on Dev Console:

Media resource could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005)
Details: mozilla::MediaResult mozilla::FFmpegDataDecoder<60>::InitDecoder(AVDictionary**): Couldn't open avcodec


This error message will be blank when privacy.resistFingerprinting = true.  If it is really necessary, please add it to the whitelist in MediaError::GetMessage: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005) - mozilla::MediaResult mozilla::FFmpegDataDecoder<60>::InitDecoder(AVDictionary**): Couldn't open

I tried to install with rpm-ostree but:

$ rpm-ostree install libavcodec-free
error: "libavcodec-free" is already provided by: libavcodec-free-6.1.1-12.fc40.x86_64. Use --allow-inactive to explicitly require it.

Which I presume means the avcodec is already installed.

Does anyone know how to fix this? Should I uninstall Firefox and use the flatpak version?

I also use Chrome (flatpak version) and it’s showing any issues.

any tips on how to handle this issue?

You need libavcodec-freeworld from RPM Fusion, or you can use the Firefox flatpak from Mozilla (preferred option).

Just to clarify: Does the Firefox from flatpak already comes packed with libavcodec-freeworld?

The Flathub firefox flatpak uses the ffmpeg-full flatpak extension. It doesn’t install it automatically (for legal reasons), but most users will get it anyway via some other app that does allow it to auto-install. If not, you can install it manually: flatpak install org.freedesktop.Platform.ffmpeg-full//23.08

Got it. Thank you so much for the help :]