Firefox does not play videos on Ubuntu despite having ffmpeg installed

A few days ago Ubuntu (22.04 LTS) showed me a message saying I can upgrade my OS (or something along those lines). I click on agree (any button that would let me proceed) and the upgrade took place (without restarting). Along with the upgrade Firefox was also updated to its latest version at the time (119.0). Since then, videos on Twitter play but without sound. On some other websites also none of the videos play. On YouTube, Firefox shows me a message saying “To play video, you may need to install the required video codecs” but the videos play fine; I haven’t tried other websites but I assume all would have some issues. Google Chrome however doesn’t have this issue and all videos play without any issues.

Note that I restarted my computer after the upgrade but this didn’t resolve the issue.

I did the followings and restarted Firefox but none have worked so far for Twitter and some other random websites that I come across, but they resolved the issue for YouTube and now YouTube videos play, although I still get that codec message at the top of the tab:

sudo apt-get install ffmpeg sudo apt install ubuntu-restricted-extras sudo apt install libavcodec-extra

SUntil today I didn’t know you can install things on Ubuntu 22 as a snap package and that by default, Firefox is a “snap” package on Ubuntu 22. So I also did the following and installed ffmpeg as a snap package but still have the same issue after restarting Firefox.

sudo snap install ffmpeg

Could you help me figure out what I should do to fix this issue?

Firefox snap already contains ffmpeg, you don’t need to install it
Can you post a link to the video where the message appears?

Also to be sure you’re using snap, output of whereis firefox command should be firefox: /snap/bin/firefox.

Thanks for your comment. For YouTube (and most other websites’) videos the message appears at the top that says the following

To play video, you may need to install required video codecs

Note that initially I could not play any videos from YouTube (and all other websites) but after installing ffmpeg, I can play YouTube videos (despite getting that messages that suggests something’s wrong still). I still cannot play any videos on most websites. For videos on Twitter, I don’t see any messages and the videos play without sound.

The output of whereis firefox is the following: firefox: /usr/bin/firefox /etc/firefox /snap/bin/firefox

Do you have any other insights?

so that shows you have mixed the snap and some other type of a firefox package (tarball, some third party deb package or whatnot) on your system …

installing any package (like ffmpeg) on the host will never change anything inside a strict snap like firefox, so you seem to be actually running the non-snap version there … to be sure you are running the right one you could start firefox from a terminal via “snap run firefox” but in general if i were you i would clean up this mess and remove the non-snapped version and its remains instead

1 Like

I noticed the Firefox I’m running is always the snap version though (as shown in htop). Would removing the other ones help fix the issue for this one still?