Sunday, December 26, 2010

Mplayer on UNIX and VLC on Windows by Girish Venkatachalam

Linux,Girish

2010/10/26

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: http://linuxjournal.com/9787.

I wrote this article long ago.

Still the novelty does not seem to wane...

Comments: Click Here.

Want to showcase your product to our audience? Check our advertising options.



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them.

I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. If you have any question, please do feel free to contact me.


Source: http://feedproxy.google.com/~r/aplawrence/DOLL/~3/wVTJ3lk6fW0/mplayer.html

cell phone eva longoria ipad iphone Lindsay Lohan

No comments:

Post a Comment