Video Codecs and the Free World
Few video producers ever would have guessed that the term codec would become a household term, but with so many codecs on the market, average computer users have little choice but to be painfully aware that if their computer does not have the correct codec installed, they will not be able to view their favorite Web or DVD video content. Therefore, any computer enthusiast, professional sysadmin or video producer should be familiar with codecs, why they exist and how to deal with them.
The term codec is a combination of two words: code and decode. The concept is simple; if I had only one page of paper upon which I wanted to write two pages of content, I might write a note in some kind of code, leaving out certain letters or words. This would fit the content onto the one page allotted, but it would make no sense to intended readers, unless I gave those readers a key on how to decode the writing so they could piece it all back together and understand what had been written. This is precisely what a codec does with video.
Ideally, a codec effectively delivers high-quality video to end users in a reasonable amount of download time. However, large companies often opt to use a codec for its exclusivity so they can charge for the key to decode that video, such as with DVDs and streaming video. So the reason that many codecs exist at all is not to further the quality and effectiveness of video compression and delivery, but to hinder delivery to the nonpaying audience—sometimes even at the expense of video quality.
End users, system administrators and video content producers are all affected by codec compatibility and availability. Being familiar with codecs is important, as computers are now the hub of many people's entertainment centers.
A missing codec typically affects the entire system. If, for example, Xvid is not installed on the system, Xvid will not be available for Web browsers, media players or media editors. Install the Xvid component, and all of the applications on a GNU/Linux system will recognize it and utilize it when needed.
With proprietary software, even though a system has a codec installed, proprietary applications may not utilize the codec, simply because it has been programmed not to use the codec for political reasons. There is no practical reason, for instance, that Digidesign's Avid or Apple's Final Cut Pro cannot recognize and edit Ogg files, especially given the price tags of these applications.
Keep in mind that there is a difference between a codec and a file format. File formats, such as .mp4, .mov or .avi, are actually just containers for video and audio streams. So an .mp4 file, for example, may use a codec like Xvid, h.264, x264, Decklink and so on, or it may, in fact, use the actual MPEG-4 codec (or any number of other codecs). Although the system usually can detect the actual codec being used within a file, it may confuse the user if a file format (container) is taken to be the same thing as a codec (encoder).
Most systems come with a certain amount of codecs ready to use with the OS's default Web browser and media player. Apple and Microsoft bundle their own proprietary and supported codecs with their systems, and Linux distros distribute their supported open-source codecs. Still, in all three cases, end users or system administrators are going to have to download non-bundled and unsupported codecs at some point.
On today's systems, acquiring codecs often is reduced to a few clicks of the mouse. The smoothest experience for end users may easily be on the Linux desktop, as distributions, such as Ubuntu, Linspire, Fedora and OpenSUSE, are so sensitive to the Linux-doesn't-play-media preconception that they have made it almost automated.
To get a codec to watch DVDs on your Linux machine, simply place a DVD into the computer, and the default player opens (such as Totem or Kaffeine or Xine). If an MPEG-2 decoder is not installed already, the system offers to download and install it. A few clicks of the mouse, and the codec is installed, and the movie player, usually without so much as a relaunch, plays the DVD.
Similarly, most Web browsers will detect a missing codec and either direct users to the Web site containing the downloadable installer for the codec, or, even better, the system will intervene and offer to download and install the package automatically. Again, with a few clicks of the mouse, the codec is installed and ready to enable the video in the browser.
If the Web browser attempts to play a video without the proper codec installed, there are cases where the only feedback the user will get is a blank space where the video should be. You can, however, easily force the system to prompt for a codec download.
First, right-click on the empty space in the browser where the video should be playing, and open that movie (it may be missing sound and picture though) in your distro's default movie player. When the system's media player is unable to play the video, it will offer to find the appropriate codec and install it.
If the Linux system does not recognize the codec being used, or if your distro of choice does not offer an automated codec solution, you can do a little detective work and discover what codec you need to find and install it manually.
This kind of codec forensics is most easily done with VideoLAN's VLC player; it's free, open source and prepackaged for most popular Linux distros. Once you've installed VLC player on your system, open the movie you want to play. Most likely, VLC will play the video, but if you still need to discover its codec so that the video can play on your system outside the VLC player, go to the View menu and select Stream and Video Info. This opens a comprehensive list of the streams (video, audio, timecode, subtitle and so on) contained in the file and what codec was used in creating each stream.
Armed with this information, go back to your distribution's package manager, and search for the codec that VLC has revealed is being used. Or, if you are running Slackware or Gentoo or something similar, seek out the codec on-line. A typical open-source solution will be a GStreamer package, containing a number of open-source decoders for popular proprietary codecs. Again, these can be installed either via your package manager or manually.
If you are trying to achieve in-browser playability, be aware that sometimes a decoding package, such as Flash, will be specific to the Web browser in which you are trying to view video. So, take care to install the correct package for compatibility with your browser (Firefox, Konqueror, Opera and so on).
After you've installed the codec, relaunch your browser if necessary, and try to play the video again.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Reply to comment | Linux Journal
2 hours 39 min ago - Nice article, thanks for the
13 hours 20 min ago - I once had a better way I
19 hours 6 min ago - Not only you I too assumed
19 hours 23 min ago - another very interesting
21 hours 16 min ago - Reply to comment | Linux Journal
23 hours 10 min ago - Reply to comment | Linux Journal
1 day 6 hours ago - Reply to comment | Linux Journal
1 day 6 hours ago - Favorite (and easily brute-forced) pw's
1 day 8 hours ago - Have you tried Boxen? It's a
1 day 14 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
In later version of ffmpeg
In later version of ffmpeg you need to prefix
the video codec with lib
e.g libxvid and not xvid
great explanation
This whole codecs business always felt like a big scam to me, and now I know why- because it is! Thanks for a detailed and helpful article.
Video Codecs
Yes i agree! I would be also happy, if you have explained which kind of video codec is best in current scenario. e.g H.264, MPEG-4, xvid etc
for instance i came across to one blog called: video codecs :pros & Cons
Video codecs
Video codecs in linux and windows have always been a hassle for me. I go so far as to not even bother unless the video format is flash. As far as DVDs I'll put it in a regular DVD player thank you.
As far as DVDs I'll put it
As far as DVDs I'll put it in a regular DVD player thank you.
Yes it is true.