Play Videos | Movies On Ubuntu 20.04 | 18.04

This brief tutorial shows students and new users how to play videos and other media formats with Ubuntu 20.04 | 18.04 LTS

Out of the box, Ubuntu may not play most videos files and some popular media formats. Unless you install restricted decoders and codecs that are purposely left out, you won’t be able to watch movies, or videos you downloaded from YouTube and other sources.

These restrictions are in place for legal and technical reasons. Ubuntu excluded these codecs because these media formats proprietary and are copy-right protected.

As you know, Ubuntu is opensource and free As the result, they can’t just add these proprietary and protected licenses to their operating systems and programs without agreeing to their licensing terms and conditions.

In order to watch these videos, you need to have these codecs installed. A codec is a piece of software that allows applications to read a video or audio format.

If you get an error that Ubuntu is unable to play the file, that may be the reason.

To get started with enabling your Ubuntu desktop to play proprietary video and audio formats, follow the steps below:

When you attempt to watch a video file formatted in MPEG-4 you’ll get the error message as shown below:

XXX-X AAC decoder, H.264 (Main Profile) decoder are required to play the file, but are not installed.

play videos in ubuntu

The reason you get the error is because your Ubuntu desktop is missing the required codecs or decoders. The video you’re trying to watch is using a copy-right protected technology and Ubuntu is not designed to play them.

You must install these packages below in order to play those videos.

Run the commands below to install the missing codecs and decoders from Ubuntu Desktops.

sudo apt update
sudo apt install libdvdnav4 libdvd-pkg gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg
sudo apt install ubuntu-restricted-extras

After running the commands above, you’ll be prompted with the message below:

┌────────────────────────┤ Configuring libdvd-pkg ├─────────────────────────┐
│ This package automates the process of launching downloads of the source │
│ files for libdvdcss2 from videolan.org, compiling them, and installing │
│ the binary packages (libdvdcss2 libdvdcss-dev). │
│ │
│ Please run "sudo dpkg-reconfigure libdvd-pkg" to launch this process for │
│ the first time. 
└───────────────────────────────────────────────────────────────────────────┘

Run the commands below after after installing above.

sudo dpkg-reconfigure libdvd-pkg

You’ll be prompted to download, build and install the highlighted package below:

┌────────────┤ Download, build and install libdvdcss2/1.4.2-1 ├─────────────┐
│ │
│ This package automates the process of launching downloads of the source │
│ files for libdvdcss2 from videolan.org, compiling them, and installing │
│ the binary packages (libdvdcss2 libdvdcss-dev). │
│ │
│ Please confirm whether you wish this to happen. │
│ │
│ Download, build, and install libdvdcss2/1.4.2-1? │
└───────────────────────────────────────────────────────────────────────────┘

When prompted choose yes to enable automatic upgrade for libdvdcss2.

┌───────────────────────┤ Configuring libdvd-pkg ├────────────────────────┐
│ If activated, the APT post-invoke hook takes care of future automatic │
│ upgrades of libdvdcss2 (which may be triggered by new versions of │
│ libdvd-pkg). When updates are available, the hook will launch the │
│ process of downloading the source, recompiling it, and (if "apt-get │
│ check" reports no errors) using "dpkg -i" to install the new versions. │
│ │
│ Alternatively, the process can be launched manually by running "sudo │
│ dpkg-reconfigure libdvd-pkg". │
│ │
│ Enable automatic upgrades for libdvdcss2? │ Yes
└─────────────────────────────────────────────────────────────────────────┘

The commands above will install missing codecs and make it possible for Ubuntu to play and read some popular media formats that are able available previously.

If for some reasons the videos are still not playing, you may want to restart your computer and try again.

Hope this helps!

~Enjoy!

Conclusion:

This post showed you how to install missing media codes for your desktop. If you find any error above, please use the comment form below to report.

Thanks,

You may also like the post below:

One thought on “Play Videos | Movies On Ubuntu 20.04 | 18.04

  1. It’s work for me, but you must move this:

    sudo apt install ubuntu-restricted-extras

    After the Configuring libdvd-pkg or it will not work.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.