oreilly.comSafari Books Online.Conferences.


Streaming Media With Linux
Pages: 1, 2, 3, 4, 5, 6

Some other formats and players


Macromedia's Shockwave Flash is a compact streaming media file format playable by a browser plug-in (Netscape-only for Linux). The plug-in is available for free from Macromedia: Follow the link to download the tarball, then unpack it and place the contents in your Netscape plug-ins directory ($HOME/.netscape/plug-ins or /usr/lib/netscape/plug-ins). Restart Netscape and you're ready to experience the wonders and marvels of Flash streaming multimedia. Using the Flash player is a transparent process: If the plug-in is correctly installed all you need to do is log on to a Flash page, use the player's handy set of controls, then relax and enjoy.

Flash at Bossmonster.
Figure 8. Flash at Bossmonster.

Unfortunately I did not find any fully developed Flash authoring tools or broadcast servers for Linux, nor could I find any console Flash players; however, a search on Freshmeat located some interesting items, including Ming (a library for creating Flash content) and the Swift Tools. The Swift Tools come closest to providing a Flash content-creation suite for Linux users, but its Swift-Generator still requires templates produced by a template-generator in Windows. The Swift-MP3 file converter and the Swift-Inspector are standalone Linux applications that work with existing Flash files.

Macromedia is to be commended for supplying Linux users with the free plug-in, and Flash is capable of some incredible effects (see Marc Stricklin's eerie brittlebones and Maruto's Once Upon A Forest for some great demonstrations of streaming Flash power), and the player usually works flawlessly. However, if another player (such as XMMS or RealPlayer) is up and running, your Flash pages may remain silent until the other player is closed. Any other problems with the Linux Flash plug-in should be reported to Macromedia.


MPEG-4 is a collection of standards, protocols, and tools for compressed audio and video that is attracting the attention of major manufacturers of communications devices from cell phones to synthesizers. Many electroaoustic music composers are also familiar with MPEG-4 in the form of SAOL (structured audio object language), but SAOL is only one possible implementation of the MPEG-4 standard. A complete description of MPEG-4 and SAOL is beyond the scope of this article, but this quote supplies a useful summary:

"MPEG-4 Audio Version 1 integrates the worlds of synthetic and natural coding of audio. The synthetic coding part is comprised of tools for the realization of symbolically defined music and speech. This includes MIDI and text-to-speech systems. Furthermore, tools for the 3-D localization of sound are included, allowing the creation of artificial sound environments using artificial and natural sources. MPEG-4 audio also standardizes natural audio coding at bit rates ranging from 2 Kbps up to 64 Kbps. To achieve the highest audio quality within the full range of bit rates, three types of codecs have been defined: a parametric codec for the lower bit rates in the range, a Code Excited Linear Predictive (CELP) codec for the medium bit rates in the range, and Time to Frequency (TF) codecs, including MPEG-2 AAC and Vector-Quantiser based, for the higher bit rates in the range. Furthermore, a number of functionalities are provided to facilitate a wide variety of applications which would range from intelligible speech to high quality multichannel audio." -- MPEG Audio FAQ: MPEG-4

As might be expected, streaming media quality and delivery are priority issues for the MPEG-4 designers, but there are currently no streaming MPEG-4 players or netcasters. That situation will change soon: iVAST Inc. is developing an MPEG-4-based streaming media software solution for broadband network services, and Philips Semiconductors is working on the hardware end to supply an MPEG-4 engine on a single chip (their TriMedia media processor).

MPEG-4 is certainly a very flexible and capable solution to the streaming media needs of the modern Internet. Unfortunately it's not quite ready for primetime, and it remains to be seen how it might step into the positions currently held by the MP3 format. I know that I'll keep a close watch on its development. Readers desiring more information on the MPEG-4 standards should consult the pages on the Web at Eric Scheirer's MPEG-4 Structured Audio and the Web3D sites.

Setting up web browsers for streaming audio

I must tell you that I had entirely too much fun while researching the material for this section. Internet broadcasting is a flourishing medium, as I quickly discovered, and I spent hours at work listening to newscasts from Egypt, talk shows from England and Russia, and music programs from Thailand, Turkey, and Hong Kong. Thanks to the miracle of plug-ins and helper applications, all I had to do was select interesting links and let my players do the rest. Of course, I had my web browser properly configured for receiving and playing streamng audio, and in this section I'll show you how you can do it too.

Preparing Netscape for RealAudio

The RealPlayer installation will automatically set up your Netscape preferences. As noted above, RealPlayer handles more than its proprietary RA (RealAudio), RAM (RealAudio Metafile), and RM (RealMedia) files. The installation will overwrite any custom settings in your preferences for WAV, AIFF, and AU files. However, because the player works flawlessly with those formats and provides a useful set of transport controls, I recommend keeping it as a handy multiformat audio player for Netscape.

Preparing Lynx for RealAudio

Lynx is a popular text-mode web browser included with most mainstream Linux distributions. Since its basic design ignores graphics, Lynx is lightweight and very fast, even on slower modem connections. However, the program can render certain MIME types with the appropriate helpers, and it can be configured for rendering streaming audio.

Setting up Lynx for RealAudio is a somewhat involved procedure. First you'll need to edit your $HOME/lynx.cfg file, making sure that the following lines are uncommented and edited for your system:


These two files allow you to specify new MIME types and indicate their players to Lynx.

Next you must create and edit your personal extension map and mailcap files for playing RealAudio. Your mime.types file should include these lines:

audio/realaudio         ra ram
audio/pn-realaudio      ra ram
audio/x-pn-realaudio    ra ram
audio/rn-realaudio      ra ram
audio/vnd.rn-realaudio  ra ram

and your .personal_mailcap file should include these settings :

audio/realaudio; trplayer %s
audio/pn-realaudio; trplayer %s
audio/x-pn-realaudio; trplayer %s
audio/rn-realaudio; trplayer %s
audio/vnd.rn-realaudio; trplayer %s

Now Lynx can play any RealAudio streams in the RA and RAM formats at the Linux console. However, a few caveats remain: Sites using the application/smil MIME type will not work with TRPlayer, and of course sites using the RealPlayer plug-in are also unavailable (Lynx does not support plug-ins). If you have difficulties with certain sites, comment out the mailcap entries and see how Lynx reports the MIME type for the offending page (it will display the type along with a request to download or cancel the requested file). You can try adding the new type to your mime.types file, coupling it with TRPlayer in your .personal_mailcap file, but there's no guarantee that TRPlayer will actually be able to handle the file type. Trial and error seems to be the method for figuring out how some MIME types get handled, and I ask readers to let me know if there are other types that behave well with TRPlayer.

Pages: 1, 2, 3, 4, 5, 6

Next Pagearrow

Linux Online Certification

Linux/Unix System Administration Certificate Series
Linux/Unix System Administration Certificate Series — This course series targets both beginning and intermediate Linux/Unix users who want to acquire advanced system administration skills, and to back those skills up with a Certificate from the University of Illinois Office of Continuing Education.

Enroll today!

Linux Resources
  • Linux Online
  • The Linux FAQ
  • Linux Kernel Archives
  • Kernel Traffic

  • Sponsored by: