Why is MP4 Not Playing in Ubuntu?

If you tried running an MP4 video file on Ubuntu OS and received the error “Unable to Play MP4,” this guide has you covered.

If you use Ubuntu as your main operating system, you will do everything on Ubuntu, including watching videos (mp4 and mkv). However, you might find yourself in an awkward spot when you get an error message “Unable to play MP4” when trying to play the videos. It can be a little infuriating, as no real reason why you can’t play MP4 videos is described.

In Ubuntu 22.04, when you try to run an MP4 file, you don’t even get an error prompt. The video player simply opens up with a broken icon. If you are stuck in the same problem, this guide will explain the reason for this error and provide different solutions for you.

Let’s get started.

Why is MP4 Not Playing in Ubuntu?

A new installation of Ubuntu doesn’t come with the necessary multimedia codecs required to play an MP4 video file. This issue is common in a fresh installation of Ubuntu, but it can also occur if you try to update your Ubuntu from an older version to the latest.

This error is especially true for locally stored files, but it can also occur when you try to watch videos online. Sometimes, it is not a matter of multimedia codecs but the video player itself.

Let’s discuss the different methods to solve this issue.

Run the Video File in Firefox Browser

The easiest and quickest way to view a video file in the format MP4 or MKV in Ubuntu is to play it using the Firefox browser. The reason is that the browsers come with various multimedia plugins by default.

To do this, go to the video file’s directory, right-click on it, and choose “Open With Other Application.”

Why is MP4 Not Playing in Ubuntu?

After that, in the new dialogue box, click on the button that says “View All Applications.” (Do this step if you don’t see Firefox in the “Recommended Application’s List”).

Why is MP4 Not Playing in Ubuntu?

After that, select “Firefox Web Browser” from the new extended version of the application’s list.

Why is MP4 Not Playing in Ubuntu?

After that, click on the “Select” Button at the top right. This will open your Browser, and in a new tab, you will see that your locally stored video is now being played.

Why is MP4 Not Playing in Ubuntu?

However, this method is best for temporarily running the video file. This is not recommended as a permanent solution.

Install Required Plugins on Ubuntu 20.04

If you want a more permanent solution on Ubuntu 20.04 than the previous one, you can install multiple plugins to ensure that the MP4 videos will always run on your Ubuntu Machine.

To do this, open up a new terminal session and update your Ubuntu’s apt packages list by running the following command inside the terminal.

sudo apt update

Executing this command will result in a prompt asking you about your sudo/root password. Therefore, type the password in the terminal and press the ‘Enter” key.

Why is MP4 Not Playing in Ubuntu?

After that, wait for the updation process to complete. Once that is done, install the “libdvd”, “gstreamer” and “ugly” plugins by running the following command in the terminal.

sudo apt-get install libdvdnav4 libdvdread7 gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg

Once that is done, you can install “the extras” by Ubuntu by running the following command.

sudo apt-get install ubuntu-restricted-extras

Once the installation is done, you can play MP4 video files without errors on Ubuntu 20.04

Install VLC Media Player

If you have tried installing the Plugins or the media codec files required to play MP4 video files, you can still meet the same error when playing “H.264” encoded video files. The fact that you have to install everything manually can be overwhelming to many new Ubuntu users.

While it is true that you need to install media codecs manually, you can choose a smarter way and install a media player that takes care of the multimedia codecs and plugins such as VLC.

To install VLC Media Player in your Ubuntu Machine, open up a new terminal session and execute the following command.

sudo apt install vlc -y

Once the installation is done, head over to the directory containing the video file, right-click on it, and choose the option “Open With Other Applications.” After that, choose “VLC media player” from the list.

Click the “Select” button at the top right, and your video will play inside the VLC Media Player.

Install MPV Media Player

An Alternative to the VLC Media Player is the MPV Media Player in Ubuntu. Installing MPV will also remove the missing media codecs error and allow you to play MP4 videos easily.

To install the MPV Media Player, open up a terminal session (CTRL + ALT + T) and execute the following command.

sudo apt install mpv -y

After that, wait for the installation process to complete fully. Once done, right-click on the video file, choose “Run with Other Application,” and select “ mpv Media Player.”

When you click the “Select” button, it will play the video file in the MPV Media Player.

Why is MP4 Not Playing in Ubuntu?

Remove the Gstreamer Plugin in Ubuntu 22.04

In Ubuntu 22.04, the “GStreamer” plugin can sometimes cause various errors or playback difficulties when playing MP4 or MKV video files.

To fix this issue in Ubuntu 22, open up a terminal session and execute the following command to remove the mismatched GStreamer plugin.

sudo apt remove gstreamer1.0-vaapi

Restart your Ubuntu machine and play the MP4 Video File again with the plugin successfully removed.

Affordable VPS Hosting With Dracula Servers

Looking for reliable and budget-friendly Virtual Private Server (VPS) hosting? Look no further than Dracula Servers. Dracula Servers offers a range of VPS hosting plans tailored to meet diverse needs. With competitive pricing, robust performance, and a user-friendly interface, it’s an excellent choice for individuals and businesses alike.

Explore the Dracula Servers website to discover hosting solutions that align with your requirements and take your online presence to new heights with their affordable and efficient VPS hosting services.

Visit Dracula Servers and experience reliable VPS hosting without breaking the bank.

Conclusion

Ubuntu doesn’t have the essential multimedia codecs required to play the MP4, MKV, or the H.264 video files. Therefore, you must manually install the required media codecs by installing plugins or media players.

However, if you don’t plan to watch videos on your Ubuntu machine often and would like to avoid installing new files, then you can simply choose to view the video files in the Firefox Web Browser.

If you want a more permanent solution, install the plugins mentioned above. Alternatively, you can choose to install media players with various media codecs so that you don’t have to install them manually.

Such media players include the VLC Media Player and the MPV Media Player, which can be installed on Ubuntu Machines.

Check out More Linux Tutorials Here!

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
× Dracula Servers

Subscribe to DraculaHosting and get exclusive content and discounts on VPS services.