Linux video players - a comparison
fter creating a 640×480 AVI movie on my new D90 digital camera, I decided to check whether Linux had a suitable multimedia player. Ideally, it would have to work without recompiling the kernel and X11, searching the Internet for libraries, and installing new sound drivers as we used to do in the old days. The Linux computer was an HP xw4600 Workstation with an Intel Core2 Duo CPU E8300 @ 2.83GHz. This is an x86_64 system running Suse11 and X11. The movie was a 640×424 24 fps AVI file of oak leaves blowing in the wind, taken from my back deck. It turns out there are several good video players for Linux. I also tested the movie viewers' ability to read MPEG files of 3D rotating molecules created by Chimera.
Mplayer
Screen shot of mplayer playing .avi file
Mplayer compiled and installed flawlessly, and played the movie. There was
even sound. However, it was not at all happy about it, saying "Your
system is too SLOW to play this!"
It was necessary to shrink the mplayer
screen to about half the normal size to eliminate the jerkiness in the picture.
Turning the sound off (with the 'm' option) had no effect.
Mplayer also played the .mpeg
movies of molecules, but only at about
2-3 frames/sec. If a 2.83 GHz Core2 Duo is "too slow" to play 480p, I give up.
If you compile mplayer with the enable-gui
option, you also get
gmplayer
, which has a GTK-based menu interface. Before gmplayer will
run, you need to install a skin from
http://www.mplayerhq.hu/dload.html. A good way to do this is to unpack the
“skin” tar file in /usr/local/share/mplayer/skins/,
and then make a soft link by typing, for example, ln -s Blue default
.
Not all of the skin tarfiles work--some are missing the crucial skin
file.
On my system, gmplayer did indeed start up, putting a slick little progress bar with volume control and VCR icons on the screen. The progress bar slowly moved from left to right and then disappeared as the window automatically closed. If you click on the “stop” icon, you get a big window with the word “MPLAYER” printed on it. All very nice ... but still, I think it would be even better if it actually played the movie. That's just my opinion. On the other hand, it probably does save a lot of CPU cycles.
Screen shot of gmplayer playing .avi file
What's happening, of course, it that mplayer needs something called “xvideo”
before it will do anything. Looking up “xvideo” on the Internet brings
you into a whole new world of sleaze. Typing xvinfo
in X11 prints the
following:
X-Video Extension version 2.2
screen #0
no adaptors present
This is starting to look like work. Time to move on.
Xine
Xine wouldn't compile on my Suse11 system, saying Unable to find
libfaad
. So I installed it from the Suse installation DVD using yast2.
Upon startup, Xine immediately crashed, bringing down the X Window system with
it, and left me on the text mode command line.
Realplayer
Realplayer was provided as an RPM. Installation terminated abnormally with a
script error, but in fact the installation had worked, and all that was
necessary was to create a link
/usr/bin/realplay -> /opt/real/RealPlayer/realplay.bin
.
Once this was done,
Realplay started up satisfactorily, but unfortunately it could not play
the .avi file or any of the .mpeg files of molecules.
VLC Media Player for Linux
Screen shot of VLC playing .avi file
In addition to having a less than classy web page, VLC refused to compile,
saying it needed something called libmad
from
http://www.underbit.com/products/mad/. Libmad would also not compile, saying
unrecognized command line option "-fforce-mem"
. However, it turned
out that libmad and ffmpeg were already on the Suse DVD. I installed them using
Suse's yast2 utility, but the VLC script still claimed to be unable to find
ffmpeg
, so I started to compile it with the --disable-ffmpeg
option. At this point, it complained about not being able to find libmpeg2
.
I installed this from yast2,
which caused Suse (no doubt in exasperation) to automatically download and install
another 40 MB of stuff, apparently including VLC itself, because it was no longer
necessary for me to compile it.
While playing the movie,
VLC printed a number of error messages on the screen, including 119 repetitions
of the message:
[0x174c340] main subpicture error: blending YUVA to J422 failed
.
Although utterly cryptic, at least the error message was printed in pretty green
and red colors. VLC also played the .mpeg molecule movies. However, the filename
was plastered on top of the image window for the first few seconds. The window is
automatically closed when the movie is finished. VLC has numerous options,
selectable in a Qt4 menu interface.
Unfortunately, after playing a movie, VLC caused the soundcard to hang, which
means VLC only played a movie correctly once. The second time, it gave an
error message that said:
Potential ALSA version problem:
VLC failed to initialize your sound output device (if any).
Please update alsa-lib to version 1.0.23-2-g8d80d5f or higher to try to fix this issue.
The only way to fix this problem was to reboot.
Totem
Screen shot of totem playing .avi file
Of all the Linux movie viewers I tested,
I had the most success with Totem. When I tried to install it from the Suse
DVD, yast2 refused to mount the DVD and insisted that I insert CD#1 (which I
don't have) instead. Suse downloaded and installed it anyway, but it would
not start, saying libnvtvsimple.so.0: cannot open shared object file:
No such file or directory
. After I installed this library, totem
started up and played the movie in an ordinary-looking but reasonable
window.
At startup, the movie window was displayed at 450×300, as shown; pressing '1' resized it to its original size (640×424). Totem played the movie at a normal speed, with sound, and without dropouts. Unlike mplayer, totem kept the first frame open when the movie was finished instead of quitting. Totem was unable to play .mpeg files.
Alkaloid-based movie viewers
For whatever reason, KDE developers have settled on the convention of naming video applications after alkaloids, nitrogen-containing molecules that are generally highly poisonous. Kaffeine is probably the best-known of these.
Upon startup, Kaffeine displayed a beautiful screen with a picture of a bomb inside a gear. Impressive, but not really what I was after.
Screen shot of Kaffeine not playing .avi file
Codeine is a very simple Qt app based on the Xine library, so you need to install that first. The author promises that new features will never be added.
Codeine could not be compiled on my system, giving the message
Configure could not find either the xine library or header on your system. You
should ammend the relevant paths. If you know which ones please email me so I
can update this message!
I didn't have the heart to tell the author that xine.h was in the standard location: /usr/include. There's probably some easy way to tell the script where the files are, but considering what happened when I tried to run Xine, I was probably better off not trying.
Windows XP
Screen shot of Windows Media Player playing .avi file
Windows Media Player, on an identical computer, played both the .avi and .mpeg videos smoothly, at normal speed and size, with no dropouts, over the network. As is typical with Windows, there's nothing to compile and no drivers to install, and--at least so far--you don't even have to give your firstborn son to Bill Gates. It seems that Windows is a little ahead of Linux on this front: Linux users are too busy recompiling things to think about things like “having sons.” However, Linux video applications have made great progress in the past few years and I have every confidence we'll catch up someday.
The Windows program was also a little slicker than the Linux ones. However, to be fair, most of the Linux programs can be fitted with “skins” that change their appearance.
Other Linux Movie Viewers
- AVIplayer - Development abandoned, only available as a CVS.
- Berkeley MPEG tools - No longer available on the Internet, server is gone.
- MTV - No longer available on the Internet, server is gone.
- MPEG4IP - A collection of source code, not intended for end users. Development abandoned.