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

Enable/Disable Your Network Interface

Today we'll cover one way to enable or disable your network interface in the Linux…

6 months ago

Check Your NIC Speed In The Terminal

Today's exercise is a nice and simple exercise where we check your NIC speed in…

6 months ago

Easily Monitor Your Wireless Connection

Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…

6 months ago

Count The Files In A Directory

I think I've covered this before with the ls command but this time we'll count…

6 months ago

Get System Information With The ‘uname’ Command In Linux

Today we'll be learning about a basic Linux command that's known as 'uname' and it…

6 months ago

hardinfo Has Been Rebooted As hardinfo2

If you've used hardinfo in the past, it may interest you to know that hardinfo…

6 months ago