Audio/Video

Play H.264 Encoded Video On Ubuntu

If you want to play H.264 (also known as MPEG-4 AVC) video on Ubuntu you will need to go through a few steps. It’s possible, and I’ll show you how. It’s a little complex, but I’m sure you can handle it. In just a few terminal commands, you’ll be able to play H.264 encoded media.

If you don’t know, the H.264 encoding is a codec. Codecs enable playback and creation of media types. The H.264 codec is still pretty new and, more importantly, isn’t ‘free’. It isn’t truly open source, and it is patent encumbered software. As Linux doesn’t do the whole closed source thing, it can actually take some work to make H.264 encoded videos play in Ubuntu.

The phrase H.264 covers a fairly broad video encoding and transportation of compressed video. In the uncompressed format, it’s not of much use to the viewer. To be able to use/view the media you’ll need the codecs and some additional software.

This article is going to tell you how to install everything you need in order to play high-def, H-264 encoded video. It’s not all that complicated and you can mostly just follow the directions one-by-one and call it good.

Play H.264 Encoded Video:

First, open up a terminal by pressing CTRL + ALT + T and enter the following command:

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

Now, with that entered, you should get some interactive screens. Agree to everything on offer by using the arrow button to navigate between choices and pressing the ENTER to confirm your selections.

Next, you’ll reconfigure some options by entering the following:

sudo dpkg-reconfigure libdvd-pkgwill

Again, make sure to agree in the same way you did with the above command.

Following that, you’ll need to enable a repository. It’s the multiverse repository, and you could do it with a GUI, or you can just enter the following:

sudo add-apt-repository multiverse

Which would be followed with this:

sudo apt install ubuntu-restricted-extras

That will, of course, require some interaction (like accepting the EULA). That interaction is the same as the above – navigate with arrow keys and confirm your selection with the ENTER button.

And that’s it. You may want to reboot to ensure everything has restarted and working. You can do that with:

sudo reboot

Like I said, it’s not all that difficult. You can basically follow the commands and not know exactly what they’re doing. Like always, it’s best to know what the commands will do – but the ones in this article are pretty self-explanatory.

Closure:

Yup… Another article, and this one wasn’t too terribly complicated. It’s something you should know – if you want to play patent encumbered videos on your devices. Sadly, as it stands today, we have to jump through these hoops to get compatibility. As long as this sort of stuff is proprietary, it’s going to be a problem (for many distros) for the foreseeable future.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

9 hours ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

2 days ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

4 days ago

Extract Text From Multiple File Types

Today we will have a fairly simple exercise as we're going to just use a…

6 days ago

Meta: I’ve Been At This For Three Years!

I have not done a meta article lately. I don't find them interesting to write…

1 week ago

How To: Disable CPU Cores

This is not something everyone is interested in doing but you might as well learn…

1 week ago