Video on Linux

703

Still images just aren’t enough anymore–you probably want to watch streaming and downloaded videos on your Linux computer, as well as digital television and optical discs like DVD and Blu-Ray. And you probably want to capture, edit, and tweak your own videos before sharing them online. Good news. Although legal hassles by format owners remain a stumbling block for some, the technology to accomplish video on has already arrived.

Playback

The major Linux desktop environments each include a default application for playing back standard video files; KDE offers Kaffeine and GNOME offers Totem. They are not the only options, though: developers produce a variety of video player projects that vary in their simplicity, ease-of-use, and support for harder-to-find video formats.

Apart from the desktop defaults, the most important projects are VLC, Xine, and MPlayer, all three of which are cross-platform players available for proprietary operating systems, too. Each has its own graphical user interface, but can also function as an under-the-hood playback engine for other applications–that functionality is why there are so many alternatives for video playback. Applications like KPlayer, noatun, and GNOME MPlayer are built on top of these engines.

To play back embedded video inside a Web browser, you will need an appropriate browser plugin. Most video sharing sites deliver their video by wrapping it inside Adobe’s proprietary Flash component. Adobe makes a Flash browser plugin for Linux that supports most (if not all) of the features used in its Windows and Mac OS X variants, which may be enough for your needs. You can also use an open source alternative like Gnash or Swfdec, which do not have Adobe’s commercial backing but are less prone to the memory leaks and browser crashes that many users report with the official Flash plugin. Other plugins support direct playback of videos inside the Web page, such as Mozilla-plugin-vlc and Cortado.

Optical Discs and Codecs

Most of the aforementioned video players can directly play optical discs such as DVDs. This functionality is controversial in some places, however, because an industry group claims patents on the way DVDs encode video and in some locations chooses to legally threaten anyone who implements DVD playback without paying royalties. The same is true for other video formats (or codecs) used for online video, such as Microsoft’s Windows Media Video (WMV). Luckily, if your circumstance dictates that you need to purchase a sanctioned video playback solution, you have alternatives, such as the LinDVD player for discs and the Fluendo codec packs for general video.

The legal situation surrounding Blu-Ray discs is much the same as it is for DVDs, but software support has not yet caught up to make Blu-Ray playback simple.

Because of the legal issues, many in the Linux community support the adoption and promotion of free video codecs, such as Xiph.org’s Theora, the BBC’s Dirac, and others that can be legally incorporated into free software projects without fear of reprisal.

Transcoding

In addition to playback, the video engines already discussed are capable of transcoding files from one format to another. This is helpful if you want to maintain an archive of DVD content on hard disk, because you can choose a compressed format to conserve space, and conserve power by not spinning the optical drive. You can also transcode files for playback on portable devices, which may support a limited range of codecs, have much smaller storage capacity, and require a lower screen resolution. There are many command-line tools to convert video between formats, such as the MPlayer project’s mencoder. To make use of it, you will need to consult the Web site or another tutorial to understand which of the myriad of options you need to specify.

Thoggen is a graphical DVD transcoder that rips content to the free Theora video codec and Vorbis audio codec. Its limited selection of output formats makes it very simple to use. For more options, try OGMRip, K9Copy, AcidRip, or dvd::rip. All offer multiple output formats and advanced options for tuning output parameters like bit rate and audio quality. All of these applications are designed specifically for Linux, but the task is common to other operating systems as well. Consequently, some cross-platform transcoding programs are available, too. HandBrake and WinFF originated on other operating systems, for example, but Linux ports are actively supported by developers.

Media Centers

As television sets and home theaters become increasingly intertwined with personal computers, more and more users are accessing their video content through “media center” applications. Here again Linux is a major player, both in the embedded market (where you will find Linux running quietly beneath the application layer of many set-top boxes), and as a choice for homebrew and enthusiast crowd.

Media center applications range from streaming video aggregation tools like Miro, which can subscribe to content through video podcast services, search video hosting sites, and find content over Bittorrent, to all-in-one solutions that include video playback alongside audio playback, photo browsing, and other multimedia features. Elisa is one such al-in-one media center; it uses the GStreamer media framework that powers several popular audio and video tools, but hides the details behind a simple to use interface. Elisa can run on desktop Linux distributions and be controlled by a keyboard, but can also accept commands from infrared remote controls courtesy of the LIRC subsystem, allowing it to run on media room friendly boxes alongside the DVD player and CD changer.

Boxee is another powerful option, an open source product built on top of the XBMC media center. Boxee runs on Linux as well as on Mac OS X and Windows. It can play video content from a wide variety of network sources, although support for commercial services like Hulu in the Linux builds often lags behind the other operating systems. If you like Boxee but can’t find the content plugins you want, try XBMC. Boxee uses the same code as XBMC project, so plugins are almost always compatible.

MythTV is widely-used media center that focuses on recording television like commercial digital video recorder (DVR) products. Building a MythTV DVR requires video capture hardware, but is flexible enough to support analog and digital TV–including HDTV–via broadcast, cable, and satellite from any region on the globe. MythTV supports plugins for other media types, such as music, photos, games, DVDs, and general video playback. It can transcode recorded programs to other formats, automatically archiving them, and multiple MythTV boxes can be easily networked together to share recording and transcoding duties.

Although it is not as well-known as MythTV, the Freevo project is another highly-respected Linux DVR. It supports most of the same features, including scheduled recording, and watching, pausing, and rewinding live television. There is one proprietary DVR package available for Linux, SageTV. SageTV began as a Windows-only application, but has supported Linux for several years.

All of these media center applications make fine additions to regular Linux distributions, but if you are assembling a dedicated home theater PC, you may wish to consdier using a specially-tuned distribution that handles configuration details for you. Many of these distributions like KnoppMyth, LinuxMCE, Mythbuntu, and Mythdora, center on MythTV support. GeeXboX uses Freevo, and XBMC Live uses XBMC. Not all require doing a full installation; KnoppMyth for exmaple is specifically designed so that it could run well as a Live CD.

Editing

As plentiful as video playback choices are for the Linux user, it is only half of the landscape. Should you want to capture and edit videos on your own, you do not have as many alternatives, but you can certainly get the job done. Most consumer and prosumer video cameras for sale today capture DV video or its high-definition derivative, HDV. DV is a digital format, even though it is often stored on magnetic cassettes. The dvgrab command line utility can directly transfer DV content from a Firewire-connected video camera with no loss in quality. Most users would find it easier to use the graphical application Kino (from the makers of dvgrab) instead, however, to monitor the captured video in a preview window and to take advantage of Kino’s editing features.

Kino allows you to perform basic nonlinear video editing to DV files: you can annotate, reorder, split, combine, and add effects and titles. Kino can also export your finished work in a variety of sizes, file formats, and video and audio codecs. As useul as Kino is, however, it is tied to DV input and intermediate files–if you need to edit content in a different format, you must first transcode it into DV.

The Kdenlive editor, on the other hand, builds on the FFmpeg library and thus supports many input formats. Kdenlive’s user interface features a horizontal timeline-based track editor, a feature common to many video editors but not used by Kino. It also has a library of special effects and a built-in titler. Kdenllive is deigned to work with the KDE environment, but runs in GNOME just as well.

If Kino and Kdenlive do not meet your needs, there are other options. Pitivi is an up-and-coming video editor built with the GStreamer multimedia framework. Avidemux was originally used mainly as a format conversion tool, but has since developed into an editor in its own right. LiVES serves a combination of purposes; it is a non-linear video editor, and a live “VJ” performance tool, with which you can mix and playback video content in real time.

Several years ago, a commercial company produced a non-linear Linux video editor called Broadcast 2000. Broadcast 2000 was eventually abandoned, but much of the code becamse the basis for a new project called Cinelerra. Cinelerra was designed from the beginning to support more “professional” level editing features, including compositing. However, it has long suffered from stability problems. In 2008, a group of developers decided to take the free Cinelerra code and fork it into a new application called Lumiera that would see more freuqent updates and better stability for daily use. Lumiera is not yet ready for production use, but is a promising application to watch.

Another option worth investigating is the Blender 3-D modeler and editor. The Blender Foundation regularly uses Blender to produce high-quality content through artistic projects like animated shorts and video games. Over the course of these projects, the once simple compositing functionality of Blender has grown into a respectable video editing environment in its own right.

Finally, Linux is used on workstations and render farms in professional movie studios and production houses. Consequently, there are pro-level, proprietary video tools available for those with the resources to buy them. A good place to look for more information on this class of software tool is the software page at linuxmovies.org.

DVD Authoring

Once your edit is perfect, complete with special effects, soundtrack, and titles, you may want to upload it directly to the Web on your blog or on one of the popular social networking video sites–or you might want to write it to a DVD suitable for playback on a standard DVD player. To do that, you will need a DVD authoring program, and there are several excellent choices on Linux. QDVDAuthor, DeVeDe, Tovid, and DvdStyler all allow you to create a professionally organized DVD image, complete with all of the niceties allowed by the format: multiple audio tracks, subtitles, chapters, and nested menus. They can then export the video and audio to the necessary format, create the DVD directory structure, and write out an ISO image that you can burn onto a writable or rewritable DVD. Crafting an easy-to-navigate DVD menu structure can take some work, though–be prepared to take the DVD authoring step just as seriously as the video editing process itself.

Working with video on Linux involves a lot of pieces: playback engines, front end applications, codec support, browser plugins, editors, and auxiliary tools. In most cases, the best place to go for application-specific help whn ou encounter a problem is to the Web site of the application itself. Many of the applications mentioned above are cross-platform, and are used by people who are not used to the programmer-specific conventions of the Linux and Unix world. You are likely to find helpful tutorials written for end-users, as well as a good support forum.

For the more cutting-edge applications, including those that are new or are specific to Linux, you may find a mailing list or and IRC channel to be the best method of getting in touch with the project’s team and those who can answer your questions. And if all else fails, remember that there are likely thousands of other Linux users using the same application, so try your distribution’s support forum or a general Linux discussion site to find a kindred spirit.