Quantcast

Don't have an account? Register Now! Forgot password?

Maximum IT
Features

Complete Guide to Playing Movies and Music on Linux

comment Commentsprint Printemail EmailDeliciousDiggStumbleUponRedditFacebookSlashdot

One of the caveats that many people have with using Linux is the current state of media support. While media playback on Linux is presently much better than it has ever been before, it still requires a little bit of know-how and tweaking to get everything working properly. This guide will go over each step of optimizing your media capabilities.

Why Doesn't Media Just Work?

The reason why some types of media do not work out of the box on Linux is due to legal and technological reasons. Many of the popular media formats (like DVD, MP3, Adobe Flash, etc.) require a codec, DRM workaround, or other sort of player before content in any of those formats can be viewed. Because of patent and copyright law, Linux distro maintainers are not able to include these extra packages in their distros, so media performance is somewhat crippled as a result. Some distros actually license these codecs (e.g. Mandriva's Codina tool) and have working media support out of the box. However, such features are not free and many people balk at the notion of paying for Linux. If it provides any reassurance, it helps to know that this problem is not specifically limited to Linux. Windows XP and some of the low-end editions of Vista are unable to play DVDs out of the box as well, and no version of Windows offers out of the box Blu-Ray support.

Even if you have the requisite codecs, you may still be hindered if the file you are trying to play is protected by strong DRM. Many people have gotten burned over the years by DRM-encumbered media that has a built-in time limit, requires a special player, or must “phone home” for license confirmation each time you want to play it. The last method is especially bad, since you will no longer be able to view the files you are legally entitled to if the media company suddenly shuts down the authentication server; this has happened several times in the past and customers were left high and dry in all instances. Aside from breaking the copy protection (which requires some skill in most cases in addition to being technically illegal thanks to the infamous Digital Millennium Copyright Act) there is little you can do in such instances except hate the media companies that insist on such strong measures.

On the other hand, Linux is capable of playing unencrypted DVD video (like discs you make yourself) and various open audio formats like OGG Vorbis and FLAC (Free Lossless Audio Codec) out of the box. CD audio and WAV also work without any tweaking. Most distros include a wide assortment of players that can handle almost any kind of media when properly configured.

Preparing your System

Although most distros are not able to ship codecs for every type of media out of the box, these codecs are relatively easy to come by from both official and unofficial sources. To facilitate ease of installation, virtually every codec is stored in a package that can be handled by a distro's package manager.

DVD Playback

The media feature that is essential to most people is DVD playback. Virtually every retail DVD sold off the shelf contains a fairly weak (by today's standards) 40-bit DRM encryption scheme called Content Scramble System, (CSS) meant to prevent unauthorized disc reproduction. CSS relies on decryption through keys located on a non-copyable area of the original disc, (the lead-in area) so any homemade copies made from the original disc will not have the keys necessary for decryption and will therefore be unwatchable. CSS-protected video is almost completely obscured by extensive multicolored blocking and artifacting when viewed without a means to decrypt it. (interestingly enough, the audio tracks are unprotected and may still be listened to)

Every standalone hardware DVD player or the various proprietary DVD player software programs (like PowerDVD) are capable of decrypting CSS so the video may be displayed properly. Doing this legitimately requires licensing various patents and key sets from the DVD Copy Control Association, so free software was mostly left out in the cold in the early years. As a consequence, it used to be impossible to watch (much less copy) DVD video on Linux, and the only reliable way to replicate DVD video back then was through analog capture. Several years ago, John Lech Johansen, working with other people who have never been identified, released a program called DeCSS that used a rather simple algorithm (the functional code of DeCSS can fit on a t-shirt) to break the CSS copy protection through a brute-force attack.

After the inner workings of DeCSS became widely understood, many derivatives of it became available, mainly to survive eradication attempts on the part of the media companies through sheer redundancy. While few systems still use the original DeCSS, the most common DVD decryption module for Linux systems is now libdvdcss2. Whereas the media companies fought aggressively against DeCSS, libdvdcss2 has largely been left alone.

Unlike DeCSS, (which relies exclusively on brute force) libdvdcss2 includes a pool of potential keys that are tested until a working one is found; if none of the keys work then brute force is used instead. Brute-forcing strong encryption is usually pointless, but today's computers can break the weak CSS encryption in anywhere from a few seconds to a few minutes.
Many players (like VLC) rely exclusively on libdvdcss. Once you install it for one player, it should work for all of them since it is a shared library. For Ubuntu, the package you need is called libdvdcss2. You can install libdvdcss through Ubuntu's libdvdread package, which is available in the main Universe repository. This method will acquire libdvdcss from the Medibuntu (the multimedia-focused variant of Ubuntu), make a package out of it for easy management, and then install it. To do this, you need only follow this procedure:

1.    For Ubuntu 9.04 and up, run “sudo apt-get install libdvdread4”. For older versions of Ubuntu, use the libdvdread3 package instead of libdvdread4.

2.    After the libdvdread4 package has been installed, open a terminal and run “sudo /usr/share/doc/libdvdread4/install-css.sh”. For libdvdread3, you should use “sudo /usr/share/doc/libdvdread3/install-css.sh”.

3.    Your computer should now be able to play encrypted DVDs with any player that uses libdvdcss2.

Alternatively, you have the option to install the libdvdcss2 package manually. The actual libdvdcss2 package is not found in the standard Ubuntu repositories, (in the first method, you make the package yourself) but can be found in third party locations like the Videolan repository. To enable this resource in apt-get, do the following:

1.    open /etc/apt/sources.list with your favorite text editor (sudo/root is required to save changes)

2.    add “deb http://download.videolan.org/pub/videolan/debian sid main” as an entry in the sources.list file. Make sure it is all on one line and there are no line breaks. Although the version of libdvdcss in that repository is for Debian's unstable branch, it will work fine in Ubuntu 9.04 and older.

3.    Save the sources.list file.

4.    Run “sudo apt-get update” to refresh the package list and make libdvdcss2 available for download.

5.    Run “sudo apt-get install libdvdcss2”.

6.    The apt-get program will warn you that the package cannot be verified. Unfortunately, there is no GPG signature for that repository listed on the developer website, so you will have to install the package without verification. (In this instance, it is safe to do so)

7.    Your computer should now be able to play encrypted DVDs with any player that uses libdvdcss2.

COMMENTS:14
COMMENTS
avatarAll you need to know (when using Ubuntu)

sudo apt-get -y install vlc

&

sudo apt-get -y install flashplugin-nonfree

:)

Login or register to post comments
avatarso no one has ever heard of

so no one has ever heard of Linux mint or sabayon linux ? damn there
are so many distros
out there stop using one, 99% of them are free and almost all of them
use live CD environment or can be boot from usb drives. dont be afraid
go to these sites , http://distrowatch.com/ and
http://www.pendrivelinux.com/ and have some free fun with other linux
distros other than ubuntu

 

Login or register to post comments
avatarDVD Playback

You could just use the PerfectBuntu script to automatically install media codecs and allow DVD playback.

 

PerfectBuntu found here.

http://www.category5.tv/content/blogcategory/15/77/

 

Just download and go to whereever it is saved and just ./perfectbuntu and it runs just fine.  Works I believe from 8.04 and up.

Login or register to post comments
avatarThanks for the article. I've

Thanks for the article. I've been using Ubuntu for almost a year now and didn't realize that I could actually play windows media files at all. Then again, I never really had an interest... In any case, it is a useful article and I have updated some of my libraries because of it. Thanks!

I want to add that I like Songbird as a music player. It's still rough around the edges but it gets the job done. It works with Last.fm and ShoutCast. And it integrates web content very nicely by pulling up album info, news, photos, lyrics, and purchase opportunites from the web automatically for you. It's a young application that will definitely grow into a great media player someday. 

BTW, it is available for Windows, Linux (32 & 64 bit), and (GASP!!) OS X.

http://getsongbird.com/

For  Debian install package that works on Ubuntu go here:

http://www.getdeb.net/app/Songbird

Login or register to post comments
avatarThis is why I can't take the

This is why I can't take the people who suggest that the entire world switch to Linux seriously. Can you imagine your mom figuring any of this stuff out? Absolutely not. Windows may not be the most efficient thing in the world, but at least it's easy.

Login or register to post comments
avatarEXACTLY. Just to play DVDs

EXACTLY. Just to play DVDs and WMA? 

Now, I'm a pretty savvy user with a lot of technical knowledge, and I only recently was able to use Ubuntu enough to run it as my main OS in my office. ...And that doesn't mean that it doesn't have its quirks - it's just ridiculously faster than Windows XP on my office PC's hardware (and prettier). 

However, there are a few things that this article completely fails to mention, like the ability to [easily] configure your Ubuntu box to play your audio files stored somewhere else on a Windows PC. None of the above audio programs supports configuring it so that your music library is stored on a network drive. ...So you have to mount the network drive as a local drive, make sure that it's mounted every time at startup, and THEN you can tell your audio player where to look for files as if they're on your same machine. In retrospect it sounds easy enough, right? But why on earth can't you just tell it to use the folder located at \\HTPC\Music that has been shared for eons? 

<><

Login or register to post comments
avatarSigh, stop substituting Linux for Ubuntu

Seriously guys,  stop using Linux as a synonym for Ubuntu and vise versa.  This guide only applies to the *buntu crap and does no good for any other real distro.  If your gonna write a buntu article then label it as such and don't use a bloody "How to in Linux" title.  In openSUSE for example all the above is done with one-click and the installer installs all the restricted packages and adds the needed repos.  This guide doesn't do jack shit for Fedora or Mandriva users as well.

Login or register to post comments
avatarI agree that "Linux" and

I agree that "Linux" and "Ubuntu" should not be used synonymously - but you have to understand that as far as desktop users go, Ubuntu has the majority of the installed base. To call them all "*buntu crap" is an injustice to the teams that spend countless hours developing what has become the most mainstream Linux distro ever... Sure, YOU think they're crap because you've gotten Billix to run well on your hardware, but that doesn't even scratch the surface. Don't spread your distate for the most adopted because you're a fanboy of one of the others. 

When I moved to Linux on my office PC, Ubuntu was the last one that I wanted to try out, but I ended up resting on it because the community is so much larger that the odds are so much greater that somebody has your issue in Ubuntu than any other distro. I mowed through multiple installations of Mandriva 2009.1, Xubuntu, and Kubuntu trying to find one that will work well, and finally rested on Ubuntu. Even the other *buntu distros didn't compare in the amount of resources available to Ubuntu users.

<><

Login or register to post comments
avatarSorry but Ubuntu does not

Sorry but Ubuntu does not have the majority of installed desktop linux share,  majority = 50% +1.  Yes it does have the largest percentage of installed desktop users but it does not by any means come close to being a majority even if you were to combine all the *buntu derivatives together.  OpenSUSE, Fedora, Mandriva, Debian, PCLinuxOS, Gentoo etc all have huge followings as well.  Canical itself contributes next to NOTHING back to linux in development.  It's one of the poorest contributors back to mainline projects.  Even Sony for brying out loud commits back to the kernel then Canical does.  Your testing of 4 distro's before settling on ubuntu is a bit of a joke.  3 of them are the same thing except for the desktop environement. That's hardly a sampling with enough variety to declare ubuntu as king.

 For someone that says "pretty savvy user with a lot of technical knowledge" but you can't even figure out how to access smb shares through media programs with out mounting it as a drive speaks volumes about your choice of distro and your level of knowledge in *nix OS's.  Hint: SMB:// goes a long way.

Login or register to post comments
avatarDude the projects themselves

Dude the projects themselves say that they do not support this feature. I'm not being an idiot. 

Login or register to post comments
avatari agree

i agree

Login or register to post comments
avatareasier way

I've always found:   apt-get install ubuntu-restricted-extras         a lot easier all in one.

 

installs:

 including MP3, DVD, Flash, Quicktime, WMA and WMV, including both
standalone files and content embedded in web pages.

 

https://help.ubuntu.com/community/RestrictedFormats

 

 

 

Login or register to post comments
avatarWow. Thanks for this, it's

Wow. Thanks for this, it's so simple!

Login or register to post comments

This Month's Issue
FEATURE How to Get FREE Programs, Services, Software & MoreFEATURE Digital Photo Printer RoundupHOW TOBuild a 3D CameraFEATUREDIY Arcade PCWHITE PAPERHow TRIM Works