Overview of Linux Multimedia


Table of Contents

An Overview of Linux Multimedia 
Table of Contents 
History 
Hardware Considerations 
Multimedia Utilities 

An Overview of Linux Multimedia 

http://www.lugatgt.org/articles/multimedia/

Last updated: Sat Nov 16 2002

Presented at a LUG@GT meeting by Alex Rudnick and Martin Robinson. This document is copyright Alex Rudnick and Martin Robinson.

Table of Contents 

  1. History

    • 1.1. Overview
    • 1.2. Some Silly Dates
  2. Hardware Considerations

    • 2.1. Sound
    • 2.2. Video
  3. Multimedia Utilities

    • 3.1. Music

      3.1.1. amp
      3.1.2. mpg123
      3.1.3. mpg321
      3.1.4. xmms
      3.1.5. Ogg Vorbis Tools
    • 3.2. Video

      3.2.1. xanim
      3.2.2. mplayer
      3.2.3. xine
    • 3.3. Tracked Modules
    • 3.4. CD Ripping

History 

Overview 

In the past, the use of multimedia in Linux was hampered by the rarity of hardware accelerated XFree86 servers and finicky ISAPNP configuration. Full motion video software lacked the codec support that other operating systems enjoyed. The permeation of quality audio decoders on the platform, though, was well on its way.

As the accelerated XFree86 server and the release of DVD movies became more common, Linux became a usable platform for high quality multimedia video.

Some Silly Dates 

March 1996 Oldest date in isapnptool's changelog September 1996 O'Reilly publishes Linux Multimedia Guide by Jeff Trante 1997 Amp, written by Tomislav Uzelac, is the first desktop MP3 decoder November 1997 First X11Amp Beta released January 2000 MPAA files lawsuits for DeCSS DMCA violations

Hardware Considerations 

Multimedia demands more from computer hardware than many other computing activities, so there are some general requirements for having a fulfilling multimedia experience in Linux. Recently, support for popular hardware in Linux has been common.

Sound 

Most new sound cards have at least basic support in Linux. While many are supported directly by the kernel, there are several alternative options including the Advanced Linux Sound Architecture and (a commercial offering) the Open Sound System.

A sound card capable of 16-bit PCM output will suffice for all but the most extreme audiophile. Hardware MIDI support is less frequent for most cards, but utilities like timidity can simulate MIDI devices in software.

Video 

Video is generally the last mile in Linux multimedia. Most hardware acceleration still requires a fair amount of effort, although the most popular new cards are well supported. Nvidia releases a closed source accelerated driver for XFree86 (Linux only), while the now-defunct 3DFX's line of Voodoo cards and ATI's Radeon line have DRI (Direct Rendering Infrastructure) support in the Linux kernel.

Full motion video utilities can display hardware accelerated output through the X-Video (Xv) extensions available in XFree86 4.X. X-Video allows images to be displayed with quality scaling and filtering using shared memory segments. To test whether hardware accelerated Xv output is available, use the xvinfo(1) command.

Example xvinfo(1) output

$ xvinfo
X-Video Extension version 2.2
screen #0
  Adaptor #0: "NeoMagic Video Engine"
    number of ports: 1
    port base: 55
    operations supported: PutVideo PutImage
    supported visuals:
      depth 16, visualID 0x23
      depth 16, visualID 0x24
    number of attributes: 3
      "XV_COLORKEY" (range 0 to 16777215)
              client settable attribute
              client gettable attribute (current value is 2110)
      "XV_BRIGHTNESS" (range -128 to 127)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_INTERLACE" (range 0 to 2)

Multimedia Utilities 

Music 

Linux users have available to them a plethora of programs for use in playing MP3 audio, which may or may not continue to be the format of choice for storing gigs upon gigs of perfectly legal backups of your CD collection. Recently more popular, in light of legal hullabaloo when Fraunhofer began making demands on royalties for MP3 software, is the Ogg Vorbis format, which has some excellent software available as well. We'll discuss a few interesting options for playback.

amp 

amp, with its last release in 1997, was created by Tomislav Uzelac while he was a graduate student at the University of Zagreb in Croatia. This is yet a very viable solution for playing MP3 audio files — it is non-interactive, and Just Works from the commandline. A webpage from the PlayMedia site refers to amp's MP3 decoding algorithms as "the Rolls-Royce of MP3 playback technology." What I like about it is that it's very simple, and works nicely in small scripts. amp comes with Slackware, and there is a Debian package for it in the "non-free" section; it's not GPL'd, but the source is available and the author describes it as "free software". AMP stands for "Advanced Multimedia Products", which was Uzelac's company, later absorbed by PlayMedia. AMP is also the AMP in X11AMP, WinAMP, and MacAMP, which are (or at one point were) derivative works.

To learn more about Tomislav Uzelac, see http://www.playmedia.hr/tomislav.htm.

mpg123 

mpg123 plays and decodes MP3 audio files, and does it rather well. It's generally used for its simplicity, and because it works nicely as a backend for other programs, some of which work from the commandline, under X, with ncurses, or from within Emacs. While its source is available, mpg123's license does not allow for commercial uses, and as such, it isn't Free Software. Take a look at mpg321 for a Free option.

mpg123 can be found at http://www.mpg123.de/.

mpg321 

mpg321 is a Free replacement for mpg123, intended to replicate its functionality and allow people to integrate its code into new projects without licensing entanglements. It uses the Ogg Vorbis project's libao, although as of yet it doesn't play Ogg files (for that, see ogg123). In a move that could either be seen as helpful or obnoxious, mpg321's install scripts by default create a symlink called mpg123 to the mpg321 binary.

mpg321 lives at http://mpg321.sourceforge.net/.

xmms 

xmms stands for X MultiMedia System (formerly known as x11amp), and is a graphical, modular program, using various plugins to handle various sorts of media files that you might wish to play. It looks and feels very much like Winamp, for those familiar with that particular program. Most significantly, it's used to play MP3, although it also supports Ogg. xmms's plugin system allows new file formats, output methods, and effects to be added without disturbing the rest of the program. Particularly entertaining is the "voice removal" plugin, which comes with xmms. In a recent test, it managed to nearly completely remove Frank Sinatra's voice from "The Coffee Song", allowing for an almost perfect karaoke experience. Success with this particular plugin varies from vocalist to vocalist.

XMMS Screenshot

Ogg Vorbis Tools 

Ogg Vorbis is an "open, free" audio codec, free from patents and royalty problems, with a slick variable quality feature. It probably deserves its own presentation sometime later. Generally available are the excellent programs oggenc and ogg123, which encode and decode .ogg files, respectively. Particularly under Slackware, these ship as the "oggtools" package, but from vorbis.com, they can be had as vorbis-tools-1.0.tar.gz. These are not the only programs available for playing oggs, however — as mentioned earlier, xmms works nicely, as does Zinf (formerly FreeAMP), apparently. Various other packages are available, as are shell scripts to convert your entire MP3 collection into oggs. This is generally not considered as a good idea, however, as converting from one lossy format to another format lossy in different ways results in a cumulative loss of sound quality. The xiph.org folks recommend keeping one's MP3s (or just re-encoding straight from the CDs to Ogg) and encoding new music with oggenc, as many players can handle both formats. xmms supports Ogg Vorbis with no modification, and oggenc and ogg123 are very easy to use.

With great alacrity (and For Great Justice), take a look at:

http://www.xiph.org/

http://www.vorbis.com/

Video 

xanim 

At one point, xanim was the standard in Linux video playback. It apparently works not only under a wide variety of Unices, but also on a VAX. The last version (at least for a while) 2.80.1, came out 21 March 1999. These days, there may be some better options for video playback, but xanim is interesting for historical purposes. Apparently xanim can handle AVI, Quicktime (!), SGI Movie Format, and various other (more obscure) video codecs. It also can read audio and image files of various descriptions.

xanim home: http://xanim.ba.pubnix.com/

mplayer 

MPlayer can play your video for you. It does divx and most of the formats that you might expect to run across. It can also play DVDs, when compiled with libdvdread and libdvdcss installed. Thankfully, libdvdread and libdvdcss are relatively easy to find, download, and install. Earlier versions of mplayer could use Microsoft objects to decode DivX files (w32codecs.tgz), but these days, mplayer comes with FFMpeg, an open source alternative. mplayer can be used a few different ways to write to your X display, specified by the -vo option. On cards with Xv support, using -vo xv is a good idea. mplayer -vo help lists the possibilities for video output.

MPlayer is generally called from the command line. Here are a few examples of how it might be used.

mplayer -vo xv -framedrop -fs -zoom -dvd 1 -dvd-device /dev/cdrom}
mplayer -vo xv sailormoon.avi
mplayer -vo xv -fs -zoom sailormoon.avi

Check out: http://www.mplayerhq.hu/

xine 

xine can also play your video for you. It also handles most of the popular formats used these days, is skinnable (Oooh! Skinnable!) and features a sourceforge page with a very nice screenshot of it playing Tomb Raider. The xine is generally called with a graphical toolbar thing, so you can click on things instead of using commandline options, and it can also use the Xv drivers. If you have something to say about xine, ogle, or other video players, please interject those during our presentation.

To find out more about xine, take a look at http://xine.sourceforge.net/

Tracked Modules 

Xmp, the Extended Module Player, is a tracked module player which has support for a multitude of tracked module formats including XM, S3M, MOD, IT, and many others. If you have GUS or SoundBlaster AWE hardware, xmp can use the sequencer to play the modules. For more information see http://xmp.sf.net/.

CD Ripping 

There are quite a few useful utilities for ripping and encoding CD audio. Among these are cdparanoia, an excellent command-line ripper with error correction, lame, an MP3 encoder which supports MPEG 1, 2, and 2.5 layer III encoding, and oggenc, the official Ogg Vorbis encoder. Grip, a GNOME application can serve as a front end to all these utilities and will automate the entire ripping/encoding/tagging process involved in archiving CD audio.