Breaking Eggs And Making Omelettes

Topics On Multimedia Technology and Reverse Engineering


Archives:

MPlayer 1.0rc1 Reviewed

October 27th, 2006 by Multimedia Mike

MPlayer recently blessed their latest 1.0 release candidate. As some readers may know, MPlayer is where I cut my teeth in practical multimedia hacking– that was 5 years ago, right about this time of year. Makes me sentimental just to think about it.


MPlayer logo

Other commitments have kept me from coming up with anything interesting for this blog. Instead, I thought I would see how well this release fulfills my original goals from when I embarked on this multimedia hacking adventure so many years ago. It runs on Linux, is free, and is open source, so all of those bases are covered. Now let’s see if it’s simple to install and can handle any file I throw at it (I’ll defer on the GUI goal for the time being).

I thought building would be the first step, blindly assuming that the download portion would be a no-brainer. As of this writing, the USA mirror (www3) does not have the package. But there are other mirrors; there is even a torrent file, though I’m not sure if that’s really warranted for an 8 megabyte file.

So now the first real challenge– building. I go for the no-brainer build, a straight ./configure with no options. I see that MPlayer still performs the admirable effort to craft a custom recreation of a standard autoconf-generated configure script. (But I can tell the difference– this script doesn’t allow building from a separate directory.)

Many pieces of software have a ton of legalese-laden disclaimers warning you that the software might not function as advertised and that the creators can not be held liable. This configure script repeatedly advises the user not trust the program if the user dared to deviate from the default configuration in any manner.

Proceed with build… no problem; same with install.

Running MPlayer will be a showcase of the state of open source multimedia on Linux. I run an AMD64 machine with a native x86_64 kernel and no 32-bit support libraries. Thus, I have no closed 32-bit modules at my disposal. I proceed to test with a sampling from my sizable collection of multimedia files. I don’t run with any command line options because A) I’m too lazy to RTFM; and B) I want know how the program performs in its default state.

I run one of my old stand-bys– an AVI file from late 2001 with 1024×468 MPEG-4 and MP3 audio. The first thing I notice is a brilliant, “I wish I had thought of it”-type feature: The video window pops up perfectly centered in the screen. I really need to steal adapt that feature for xine’s standard xine-ui.

Random MPEG files look good. Every tricky or buggy MPEG file I could find works well; I’d expect nothing less from this project. Standard MP3 files are fine. QuickTime files– MPlayer perfectly plays a particular .MOV file that has been giving me trouble in xine with bleeding green from the sides (because xine has a slightly outdated and buggy version of FFmpeg’s H.264 decoder). This also includes the latest version of Kostya’s VC-1 decoder and plays that perfectly, and efficiently.

I try some FLV files– I find one that exhibits all kinds of bugs. But to be perfectly fair, I have no assurance that this is a properly constructed FLV file, so I’ll gloss over that for now. I have a negligible collection of Real media files for no real reason other than that I just haven’t gotten around to deleting them yet. I can never remember which Real codecs are supported via open source code. However, none of my files seems to play and some even segfault MPlayer. But, hey, who cares about Real files anyway? Oh wait, here’s a .rm file that actually does play. Wow– 160×120 RV20 video, the best that 1999 had to offer, apparently.

Let’s see if it can do some more — ah — obscure formats, as I hear that MPlayer is approximately the one non-FFmpeg program that can actually leverage FFmpeg’s libavformat demuxers. It can demux WC3 MVE files and play the audio, but not the video. 4xm plays but ADPCM audio is not recognized or played correctly (PCM is fine). Interplay MVE demuxes with no video and audio is messed up. Same with Id CIN files. No luck on Westwood VQA files. Smacker looks decent. I could probably go on and on about this but the impressive point remains that MPlayer can actually make use of libavformat demuxers. If the MPlayer team were so motivated, I’m certain they could make all the fringe formats work in short order.

How about the formats I added so long ago? FLIC, Id RoQ, and Sega FILM all still check out. Good to know. The FILM demuxer even plays non-interleaved stereo data correctly, which surprised me.

I wonder what MPlayer does these days if I throw a DVD at it? Throwing a DVD ISO at it… hmm, it goes right into playing the main movie whilst playing the audio from the main menu. After the main menu music has transpired, it proceeds to play a random portion of audio from the movie. Simply seeking somewhere seems to fix the problem. Well, MPlayer has never been legendary for playing DVDs out of the box; that’s still xine’s territory.

How about network capability? I just want to catch up on a QuickTime movie trailer via HTTP streaming. It plays an HTTP URL quite well, though it gets a bit unhappy if I try to seek. MPlayer seems to do strange things on HTTP streaming, perhaps upon encountering difficulty– it goes into a loop of constantly reconnecting to the remote host and complaining that it can’t resolve the name via IPv6.

So that pretty much does it for all the multimedia features I care deeply about. On balance, I’m incredibly impressed by how MPlayer functions in its default state, i.e., by invoking ‘mplayer <media.file>’ with no special arguments. The biggest problem I noticed was that some files get grotesquely out of sync. To be fair, I can’t remember if these files are in sync with the official player. Oddly, the engine seems to be aware of the unsync as indicated by the console output. I suspect this means that I can somehow instruct the engine to keep sync using some switch, but why should I have to? I suspect that I don’t understand this problem well enough yet.

The stated lack of configure-time flexibility is fascinating. Or rather, the lack of supported flexibility. Open source software types pride themselves flexibility. The theme here is that you can deviate from the preset path, but you do so at your own risk.

Posted in Open Source Multimedia | 13 Comments »

13 Responses

  1. RC Says:

    FLV support is still limited. Many don’t play. Your file is quite likely fine.

    A/V sync is tricky. “-mc 10 -framedrop” will probably fix your problem, with the notable side effect of having some videos freeze-up for up to 10 seconds (while audio plays) after seeking or after a frame is lost (eg. network congestion).

  2. Reimar Döffinger Says:

    IIRC the only thing that configure warns heavily about is using –enable options. That is only because it causes the feature to be enabled whatever happens – e.g. even if the needed headers are not installed. For 99% percent of users, the right thing to do is just to install the right development packages.

  3. DonDiego Says:

    Nice review :-)

    Try the GUI one of these days and let us know what you think. We have some skins that are far less klunky than the xine default (and a port of the xine-lcd skin) ;-p

    Dunno what is/was wrong with the US mirror. It has had some hiccups during the last days, but it sure worked right after the release and right now when I tried again. And yes, the torrents are actually helping the bandwidth consumption, which is massive.

    I may add out-of-tree building capacities someday, it’s not hard or much work, I’m just lazy. What do you mean by lack of configure-time configurability? There is plenty and it’s all supported. It seems I need to rephrase the warning about the –enable options, which skip autodetection (possibly causing compilation to fail).

    RV30 and RV40, i.e. RealVideo 3.0/4.0 are only supported via binary codecs. Maybe we’ll put some effort into the game formats someday, who knows. Or maybe we can convince you to have another stint with MPlayer and fix them yourself :-) It’s probably very simple, just nobody has had the motivation so far …

    We’re interested in all the samples that MPlayer had trouble with, please make them available to me at some point.

  4. DonDiego Says:

    Bah, Westwood VQA files don’t even work in ffplay. Some work in xine, others crash xine. Do you have a VQA demuxer in xine that you never bothered to port to libavformat?

  5. Multimedia Mike Says:

    VQA is somewhat of an ongoing item. I’ve been wanting to make a parser for Hachoir to help in studying all the variations (every game that used it tweaked it a little or a lot).

    The US mirror seems to be working now.

    Out of tree building isn’t huge, though it can help with multiple parallel configurations from the same tree. About the lack of supported flexibility, I was referring to this output from ./configure:

    Do not report compilation errors if you used any of the --enable-* options
    (except --enable-gui and maybe --enable-debug).
    
  6. Kostya Says:

    Concerning VQA, I still have got here my patch for VQA v1 support (Legend of Kyrandia III). I cannot remember when I sent it to you, maybe it got lost.

  7. Multimedia Mike Says:

    @Kostya– found it. I will see if it still applies to the code and get it in the repository.

  8. DonDiego Says:

    Roberto fixed the RM files.

    I’ve changed the text you mentioned to be (hopefully) less misleading. It now reads

    NOTE: The –enable-* parameters unconditionally force options on, completely skipping autodetection. This behavior is unlike what you may be used to from autoconf-based configure scripts that can decide to override you. This greater level of control comes at a price. You may have to provide the correct compiler and linker flags yourself.

    If you used one of these options (except –enable-gui and similar ones that turn on internal features) and experience a compilation or linking failure, make sure you have passed the necessary compiler/linker flags to configure.

    I hope this comes closer to conveying the intended meaning. By no means are non-default configurations unsupported, on the contrary ..

  9. DonDiego Says:

    4XM audio should be working now…

  10. DonDiego Says:

    All of those fringe formats should be working now. For some the video does not display right yet. This is due to libswscale not supporting the PAL8 colorspace yet. This will be fixed once FFmpeg switches to libswscale.

    Hey, review us more often, you find interesting issues and it sure motivates us to fix some bugs and shortcomings :-)

  11. Diego Biurrun Says:

    Westwood VQA files work much better now after Kostya’s fixes. Better than xine even ;-)

  12. Kyrandia III Says:

    I noticed the comment about the VQA v1 support patch to receive sound for the Legend of Kyrandia III. I have Leg of Kyr. I, II, & III for PC. Sound works for I & II, but not III. My computer was purchased in 2005….long after Leg. of Kyr. III came out. Is there a way to get sound for this program?

    Thanks!

  13. Multimedia Mike Says:

    All of the Kyrandia games seem to be DOS games, so try DosBox.