3.1. Hacks 4772: Introduction
Using video under Linux is often regarded as voodoo. After all, many of the most popular video programs are complicated command-line utilities such as MPlayer and transcode, with upwards of one hundred options. What's worse, when you go online for help, many of the examples list long commands that look more like an incantation or line noise than a program.
Video formats don't make things easier either. Underneath that seemingly simple .avi file might be any number of video and audio codecs. With so many competing video codecs, different versions of those codecs, competing container formats, and the fact that many of these codecs require proprietary licensing, it's no wonder video under Linux mystifies people and leaves them running back to Windows.
It doesn't have to be this way. Out of the confusing and complicated command-line tools, a number of handy frontends have emerged that take a lot of the sting out of watching and editing video under Linux. When you find you need to stray from the basics, sometimes the command-line tools still provide you with the most power and flexibility, so it might comfort you to know that the command-line utilities themselves continue to improve as well. Nowadays they do a lot of the work of sorting out file formats on your behalf, so you don't have to worry nearly as much about endless strings of command-line arguments.
In this chapter, I cover a broad range of video hacks using mostly standard command-line tools. Many of these hacks build on each other, so I first introduce the basics of MPlayer, and then move into more advanced options in later hacks. While this isn't necessarily a guide to all things video, along the way I include useful information about video formats from VCDs and DVDs to the different ways MPlayer can output video. There are also a number of hacks that discuss video editing and conversion under Linux. Although this is a topic that can quickly get complicated, there are a few common tasks that most of us do over and over. I've tried to present you with the information you need for most of the general editing and conversion cases you will run into, with enough information that you can tweak it for those borderline cases.
When you know the tools, Linux can be a really powerful video platform. By the end of this chapter, you should be equipped with examples of how to make the most of these tools to do things under Linux that you might have been too intimidated to try or too busy to figure out before.