BSD DevCenter
oreilly.comSafari Books Online.Conferences.

advertisement


Playing Audio and Video Files with FreeBSD
Pages: 1, 2, 3

To augment plugger's audio/video support, I'll install three more applications from the ports collection: realplayer, divxplayer, and netshow. Each of these applications can be used as stand-alone players. They can also be called by Mozilla to play files directly from the browser.



The following chart shows which extensions I've successfully been able to play through Mozilla and which application provided the necessary support:

program	      mov  avi  mp4  rm  ram  mpg  mp3  m3u  asf  asx  wma  wmv

plugger        X    X                  X    X    X 
realplayer                   X    C         X    C 
divxPlayer     X    X   X 
netshow                                               ?         ?     ?

The C means choppy; I found that realplayer spent a lot of time buffering RAM and m3u files when played directly over the Internet. Your mileage will probably vary depending upon the speed of your Internet connection. However, plugger seemed to buffer m3u files nicely and played without choppiness. If I downloaded a RAM file and then played it through realplayer, it played without choppiness. I'll explain the ? in the chart when I describe the netshow port.

Let's start with the realplayer port. In order to install this port, you must first verify that your system is running Linux emulation:

$ pkg_info | grep linux
linux_base-7.1_1    The base set of packages needed in Linux mode

If you don't receive this output, install the Linux base:

$ cd /usr/ports/emulators/linux_base
$ make install clean

If you're running an older version of the Linux base, remove the old version before installing the latest version:

$ pkg_delete linux_base-"yournumber"

Replace "yournumber" with whatever version you received when you ran the above pkg_info command. Better yet, if you have learned how to use cvsup and portupgrade, let portupgrade upgrade the port for you.

Once you have the latest Linux base, you can install realplayer. This utility does have license restrictions, so first visit the Real.com website. You'll be prompted to fill in a short registration form. When you choose your OS, select Linux 2.x(libc6 i386) RPM and save your download to: /usr/ports/distfiles/rp8_linux20_libc6_i386_cs2_rpm. Then:

$ cd /usr/ports/audio/linux-realplayer
$ make install clean

Once you've installed the port, exit the superuser account and as your regular user:

$ cd /usr/local/lib/RealPlayer8
$ ./mimeinstall.sh
$ ./pluginstall.sh

The executable will be installed to /usr/local/bin/realplay. If you already have a Window Manager open when you install realplayer, close it and restart it before using the program for the first time.

This utility can be used as a stand-alone player that supports several file formats: rm, ram, mp3, and m3u. If you've never used it before, the Real.com channel list is a good place to start your experimentations.

If you have a fast Internet connection, you can play files directly over the Internet. Otherwise, save the file to disk and then use realplayer to play it.

Next, I'll install the DivX player. Again, note that this port requires the latest Linux base in order to install.

$ /usr/ports/graphics/linux-divxplayer 
$ make install clean

The executable will be installed to /usr/X11R6/bin/divxPlayer. The "P" in the filename is case-sensitive. This player can be used as a stand-alone player for movies that you have downloaded and saved to disk. When downloading the movie, it may have an avi, mov, or mp4 extension. Make sure that it was advertised as a DivX movie as this player will hang if you try to use it to play a Quicktime movie. On my system, I've made separate directories called DivX and Quicktime, so I remember which movies are which.

To get you started on DivX movies, try these sites:

http://www.divx.com/movies/
http://www.divxmovies.com/trailers/

If you're using the plugger port, it also plays DivX movies. This means if you click on a movie link, the movie will play in your browser. If you want to instead download the movie to play it later with divxPlayer, right click on the link and choose "Save link target as." Remember to save it to remember that it is a DivX movie.

Sometimes you'll come across zipped movies. For example, all of the trailers at divxmovies.com are zipped. You won't be able to play a zipped movie directly from the browser, and you'll have to unzip it before you can play it with divxPlayer. Even though the movies will have a zip extension, you can still unzip it from your FreeBSD system using the unzip utility. You may already have this utility if you've installed a port that uses it. To see if you do, use this command:

$ pkg_info | grep unzip
unzip-5.50          List, test and extract compressed files in a ZIP archive

If you don't get any results back, install the utility like so:

$ /usr/ports/archivers/unzip
$ make install clean

Now, whenever you need to unzip a file with a zip extension, simply do this:

$ unzip name_of_file.zip

Finally, the netshow port:

$ cd /usr/ports/graphics/netshow
$ make install clean

The executable will be installed to /usr/X11R6/bin/netshow. This player is intended to play Windows media file formats. Now, why did I put question marks in my chart? I think I didn't have any problems playing these files as netshow didn't complain. It told me it was buffering, and the little slider bar dutifully informed me how much of the file it was playing. However, the video consisted of a line about 1 mm wide. I assume that line should have been a larger screen displaying the video. And there was no audio. Now, this is the same computer that mplayer didn't like, so perhaps your mileage will vary. I'd be interested in hearing your experiences with this application.

Pages: 1, 2, 3

Next Pagearrow





Sponsored by: