Enter your email address:

Delivered by FeedBurner

mplayer - command line movie and music player - music over ssh


StumbleUpon Toolbar

Mplayer is one of most known movie players in Linux, and also in Mac OS, and Windows.

To install it in Debian / Ubuntu run:

sudo aptitude install mplayer

Mplayer has lots of options, and we will explore some of them here, the files format it can play according to its official site are:

MPEG/VOB, AVI, Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, RealMedia, Matroska, NUT, NuppelVideo, FLI, YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim, and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5 and even WMV movies..

Playing your music/video files

If you want to play your local files just use this command line

mplayer [filename(s)]

Yes you can put multiple files and they will be played in sequence, you can also use wildcards, lets suppose you have a directory with all Beatles' hits, just go to that directory and enter:

mplayer *

Now if you want to repeat a file multiple times enter

mplayer file1 -loop 2 file2 -loop 1 file3 -loop5

Here you will play file1 2 times file2 one time and file3 5 times, if you want to repeat all files the same amount of times use:

mplayer -loop 5 file1 file2 file3

This will play file1, file2 and file3 5 times, if you use the -loop parameter with 0, you will play the specified files in an infinite loop.

Playing DVDs

To play a standard DVD the syntax is as follow:

mplayer dvd://
[-dvd-device ]

You can also select a specific chapter in a track, the syntax is:

mplayer dvd://
-chapter

If your movie comes with different languages, you can choose which one to play with the -alang option, and then specify the priority of languages check the following example:

mplayer dvd://1 -alang es,en

this will try to play Spanish first, and if it can't it will play English instead.

Also you can choose the subtitles you wish to see, for this use the slang option, check the following example

mplayer dvd://1 -slang es,en

Just like the example above, this will try Spanish first and English then, but this time not for audio, but for subtitles.

Playing VCDs

To play VCDs is as simple as with the DVDs, just enter this on your command line

mplayer vcd://1 -cdrom-device /dev/cdrom

Be sure to specify the right path to your VCD device, which is your CDROM device.

Playing streaming video from the web

You can play videos directly from the web using http, rtsp, ftp or mms protocols just enter the right one in the command line:

mplayer http://your-music-server.com/file.avi

Tips

Playing Surround Multichannel files

mplayer dvd://1 -channels 6

Playing audio files over ssh connection

If you have your favorite music collection at home, and want to listen to it while at work, you can pass it over an ssh connection (of course could be better to take a CD with you)

ssh user@yourhomepc "cat file" | mplayer -

Do not forget to read: http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html

Trackback URL for this post:

http://www.go2linux.org/trackback/457
from stuff on Mon, 03/31/2008 - 11:01

Bookmarked your post over at Blog Bookmarker.com!

StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

well done~~~

well done~~~

Thank you very much for your

Thank you very much for your comments!

Guillermo Garron

hay alguna manera de ver

hay alguna manera de ver videos sin entorno grafico?
desde Ubuntu Server, por ejemplo

is there any way to watch videos without grafic enviroment?
from Ubuntu Server, for example

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting