Ubuntu

How to Play Mp4 on Firefox in Ubuntu 22.04

If you are a beginner Ubuntu user or recently upgraded to Ubuntu 22.04, you may wonder how you can play mp4 files. By default, Ubuntu lacks the needed multimedia codecs to support mp4 files, especially if you want to play a locally stored video. It gets worse when you try opening your favorite platform like YouTube or Facebook or when you try to load the live videos and you get the annoying error that your browser can’t play the given video file.

We’ll discuss how to play mp4 files in Ubuntu 22.04 and check out how to fix it when you get errors when attempting to play videos on Firefox. So, stick around, and let’s get started.

How to Play Mp4 in Ubuntu 22.04

A recently installed Ubuntu 22.04 can get problematic when you try opening a locally saved mp4 video. Ubuntu doesn’t install the needed software that supports playing mp4 videos by default, and common examples include VLC and MPV media players. Without this open-source software, you won’t be able to play mp4 in Ubuntu 22.04.

Instead, you will get an error message saying that Ubuntu lacks the needed decoders or codecs to support playing the mp4 files, like in the following image:


The good news is that you can get rid of this frustration by installing various open source software like VLC. While that helps you bypass the error, you can still use the Firefox browser to play mp4 files in Ubuntu 22.04.

The best part about using Firefox is that it saves you the hassle of installing the third-party apps. While at it, you can play videos from other platforms like YouTube.

How to Play Mp4 in Ubuntu 22.04 Using Firefox

Firefox is the default browser with any Linux system, so you won’t need to install it. If you want to play an mp4 video stored locally on your system, that’s possible.

First, use your file manager and navigate to the directory containing the mp4 file.

Next, right-click on the mp4. At the bottom, click the button for View All Applications. Choose Firefox from the options.


Firefox opens a new tab and play your mp4.

That’s the simplest way of playing locally stored mp4 files on Firefox.

Similarly, you can play online mp4 videos using Firefox in Ubuntu 22.04. For this case, we will use YouTube.

Open Firefox and look for the video that you wish to play. To start playing, click on the video and Firefox will start playing it.


Also, look for a live video and click on it to play. Here, you may get an error message like the one in the following illustration:


It’s the same error you can get when you try to play Facebook live videos. Luckily, there is a fix for it. The error implies that your Ubuntu 22.04 lacks the needed media codecs to support playing the mp4 videos via Firefox.

To fix this, start by updating your system.

$ sudo apt update

 

Next, run the following command to install ubuntu-restricted-extras which contains the packages for multimedia codecs for Ubuntu 22.04.

$ sudo apt install ubuntu-restricted-extras

 

You will need to confirm various prompts and accept the license for Ubuntu to finish installing the required codecs.

Once done, restart Firefox and try to play the mp4 YouTube Live video that was problematic before. It should now successfully play on Firefox with no errors.


As noted, if you are using other platforms like Facebook and tries to play mp4 files and encounter an error, use the previous command to install the multimedia codecs. That way, Firefox will play all video formats including mp4.

Conclusion

If you encounter some issues trying to play mp4 files in Ubuntu 22.04, it is likely missing the needed multimedia codecs to support mp4. You can opt to install a third-party software like VLC to play the mp4 files or use Firefox. We’ve seen how to play mp4 on Firefox in Ubuntu 22.04 and also covered how you address the errors that arise when trying to play the live videos on various online platforms.

About the author

Denis Kariuki

Denis is a Computer Scientist with a passion for Networking and Cyber Security. I love the terminal, and using Linux is a hobby. I am passionate about sharing tips and ideas about Linux and computing.