APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Mplayer on UNIX and VLC on Windows

Girish Venkatachalam

Girish Venkatachalam is a UNIX hacker with more than a decade of networking and crypto programming experience. His hobbies include yoga, cycling, cooking and he runs his own business. Details here:

http://gayatri-hitech.com
http://spam-cheetah.com

There is an old joke that Windows folks swear by VLC and UNIX folks swear by mplayer.

What are these?

Both play multimedia files - both audio and video. But the approach taken towards solving this problem is quite different.

For programmers there is a whole world of difference between the two projects.

VLC is a French project and Mplayer a Hungarian one.

Both use FFMPEG backends - libavcodec library and friends to do the multimedia heavy lifting.

For some reason UNIX people always love mplayer for its flexibility, power and the smell of UNIX.

How do you smell UNIX?

It is about the power of the command line,the rich options and the intuitiveness of the interface.

VLC on the other hand is a GUI app and that is why without a doubt Windows people love it.

Both are free and open source and incredibly powerful.

VLC has certain features like EPG(Electronic Programming Guide) extraction from DVB Satellite feeds which is lacking in mplayer.

And Mplayer has loads of features that VLC does not have.

Throw any file at mplayer and it will handle it. Really well.

I face problems with obscure audio formats that the medical transcription industry uses and mplayer barks.

sndplay can handle it but not well.

sox is also only so so.

VLC is smarter than mplayer in many ways particularly if you are interested in embedding into the browser or if you wish to have largely a Windows audience with ports done to Linux and Mac.

Mplayer is also embeddable into the browser and runs admirably well on Windows.

But as I said above and have been saying again and again mplayer is 100% UNIX. And no mistake. Windows people can use it and there are plenty of GUI frontends for mplayer - technically called as skins.

And with skins mplayer can be a better GUI than VLC but still there is no single official GUI. Lack of consistency makes it hard for people from the Windows world.

What I love most about mplayer is its ability to get your work done with the least bit of effort.

For instance if you wish to obtain details about a playing file like file name, offset, playlist manipulation and so on, you can start mplayer like this.

$ mkfifo /tmp/inputfifo

$ mplayer -input file=/tmp/inputfifo file.mpg
 

By the way mplayer can play youtube flash videos perfectly well.

Now once you start mplayer like this you can obtain several pieces of interesting info from mplayer whilst it is playing like this.

$ echo "get_file_name" > /tmp/inputfifo
 

You can see that it spits out the details on STDOUT.

You can look at the list of full commands that mplayer understands here:

$ mplayer  -input cmdlist                                                                                     
seek                 Float [Integer]
edl_mark            
audio_delay          Float [Integer]
speed_incr           Float
speed_mult           Float
speed_set            Float
quit                 [Integer]
stop                
pause               
frame_step          
pt_step              Integer [Integer]
pt_up_step           Integer [Integer]
alt_src_step         Integer
loop                 Integer [Integer]
sub_delay            Float [Integer]
sub_step             Integer [Integer]
osd                  [Integer]
osd_show_text        String [Integer] [Integer]
osd_show_property_te String [Integer] [Integer]
volume               Float [Integer]
balance              Float [Integer]
use_master          
mute                 [Integer]
contrast             Integer [Integer]
gamma                Integer [Integer]
brightness           Integer [Integer]
hue                  Integer [Integer]
saturation           Integer [Integer]
frame_drop           [Integer]
sub_pos              Integer [Integer]
sub_alignment        [Integer]
sub_visibility       [Integer]
sub_load             String
sub_remove           [Integer]
vobsub_lang          [Integer]
sub_select           [Integer]

(Output snipped for brevity)
 

You can of course change volume, load files at runtime and so on.

Mplayer's playlist manipulation features are a bit primitive but you can get around it by combining various input commands.

Mplayer also comes with full support for LIRC IR remote control.

Of course these days people simply use iPhone over Wi Fi.

Mplayer has trouble handling high definition video streams from satellite and its caching engine does not

understand a thing about UDP memberships to read from a UDP multicast stream spat out by a satellite headend.

But it does a fairly decent job.

VLC excels at playback in Windows. Under UNIX it has not been properly tested I think.

Both projects are raw in certain ways and you can know that they are open source and not completely done.

But if you are building a commercial product with multimedia capabilities on an embedded platform then

surely mplayer is king.

It is 100% ANSI C code.

Its performance is what makes it what it is.

It has a whole bunch of audio and video drivers. It can rip DVDs and so on.

Take a look at: Linux Journal: An overview of the awesome power and configurability of MPlayer..

I wrote this article long ago.

Still the novelty does not seem to wane...



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> For some reason UNIX people always love mplayer for its flexibility, power and the smell of UNIX.


5 comments



Increase ad revenue 50-250% with Ezoic


More Articles by © Girish Venkatachalam







Tue Oct 26 23:09:26 2010: 9070   Sledge

gravatar


Hi,

VLC also has CLI integration and I have never had any trouble streaming, transcoding or playing anything using VLC under Linux (Ubuntu and Debian), Windows, or OS X.

I use VLC as the default on all three platforms and it is the only thing I use for unicast streaming. I am beginning to experiment with streaming servers (ala USTREAM) or peer-to-peer, which often combine VLC and bit torrent technology.

I can't imagine using anything else. I can't imagine anything is as powerful.



Tue Oct 26 23:56:44 2010: 9071   TonyLawrence

gravatar


I've never used mplayer. I use VLC on Mac for the rare times I need it (which is hardly ever).



Mon Dec 20 13:22:02 2010: 9172   Smokey

gravatar


When I watch videos, they tend to be very high quality, with esoteric codecs and large filesizes. I have a Win7 box (it was XP less than 2 years ago) and my MacBook (first mac: Powerbook g4).

Overall, I keep a copy of both on my Mac because sometimes one will be able to play a certain video the other chokes on, or it will have a certain feature that I prefer for that video. The funny thing is, on my Windows box I almost never open VLC. I use Media Player Classic (not the same as mplayer, I know) exclusively due to it's fast speed, stability, and being able to handle everything I can find on Usenet. Once in a blue moon, it will get a little choppy on a 15+ gb 1080p video or not QUITE pass my DTS to the receiver correctly and I'll switch it up and use VLC.

However, on my Mac, it is almost opposite. mplayer is somewhat of a joke, at least the recent builds. VLC is semi-rock solid, and can play most of the stuff, most of the time. But mplayer I only use when VLC just refuses (I'm sure it's happened, but I can't remember any specific time within 6 months), or this one time I couldn't get VLC to crop correctly but mplayer did. However, mplayer seems to be almost a half-finished product. Smack me if you want for relying on a gui to set 50 hot keys, but to me that's a deal breaker. It can't really play files better, it isn't more stable or faster, but with the recent builds more than 1/2 the gui is non-functional. It has even crashed recently! I mean, I'm sure someone is gonna fix it all someday, but unfortunately that is what I find all too often with "rock-solid" open source *nix software: it might have a great core, but it's brought down by either unusably crappy or downright buggy interfaces.

BTW, I'm not a Windows ppl, I'm a *nix ppl. I have a lengthy bashrc, I use TextMate exclusively and write my own plugins, I spend hours in terminal.

BUT: there is a time and a place for each. I have plenty of other stuff I can play with (next goal: full multikey bindings to anything* on OS X using SIMBL! stay tuned!) rather than hacking together my media player to watch some Arrested Development.

*By anything I mean scripts and applications. Emacs style move-the-cursor shortcuts are already built in.



Thu Jan 20 08:42:56 2011: 9243   Mockman

gravatar


I build mplayer and update it periodically through svn. I started using it because my old Powerbook was overmatched by most video and it was the most efficient player I could find. I have VLC installed but rarely use it. As someone mentioned, mplayer is unfinished. But the CLI version is great. Being able to control most things without having to hold down modifier keys is great.

Obviously not a solution for everybody but it's paid off for me.






Wed Oct 19 21:24:49 2011: 10046   anonymous

gravatar


Hi All,

FFmpeg is a linux based engine that is common to mplayer and vlc. Which version of the engine the player uses is uo to i's group. Everything you can do from a GUI interface seems to avaliable both for mplayer and vlc. Both have long lists of choices for input file formats, codecs, transcoding and rendering output.

------------------------
Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





Every piece of software written today is likely going to infringe on someone else's patent. (Miguel de Icaza)

I am not out to destroy Microsoft, that would be a completely unintended side effect. (Linus Torvalds)










This post tagged: