Basic mplayer Usage from Command-Line
There are many ways to play media files from the command-line. In fact, in recent weeks past, here at Unixmen we’ve shown you how do it with a couple of different methods.
Today, I’m gonna show you a few basic commands which can be used in a terminal by almost anyone, beginner or advanced. Some users may run into some issues with audio and/or video quality with their own systems’ hardware. But that’s ok because I will also show you how you can get things running smoothly by editing just one file.
The software we are going to use is probably one of the oldest yet most configurable and robust tools available. Mplayer has been around for a long time and is available on a range of platforms.
The easiest way to install mplayer is through your command-line. Just pop open a terminal and enter one of the following:
% sudo apt-get install mplayer
% sudo yum install mplayer
% sudo zypper in mplayer
It’s important to note that mplayer may not be available in the repositories that you have enabled. You may have to enable some extra repositories that contain the mplayer package and dependencies.
For Ubuntu, you will find the newest mplayer package in the Medibuntu repository. In Fedora, you will have to enable the RPM Fusion repositories. And in OpenSUSE, you will find it by enabling the Non-OSS repository.
Once you have enabled the appropriate repository, just go back and enter the command above relevant to your distribution.
Once the installation of mplayer is complete, you are now ready to play a media file. Navigate through your filesystem to where you media files are stored. For the sake of this test, we’ll go to ~/Music:
% cd ~/Music
Use the ls command to list what is in the directory:
% ls The Offspring – Greatest Hits
Now it helps to cd again in to the directory of files that you wish to play:
% cd The\ Offspring\ -\ Greatest\ Hits/ % ls 01. Foo bar.mp3 02. Foo bar 2.mp3 03. Etc. >>>
Now, we want to play Track 01. That’s easy, we just type the following to get the track playing:
% mplayer 01.\ Foo\ bar.mp3
Your terminal will post some output on the information of the file currently playing. It seems like a lot of information at first, but this is absolutely normal.
After you’ve listened to Track 01, now you want to hear the whole album. Type the following to play all the tracks on the album:
% mplayer *.mp3
Again, you will the usual output and then the track will start playing and continue on for the entirety of the album.
Playing video files is exactly the same. The only difference is once you have typed in the command like this:
% mplayer ~/Movies/Hackers_DVD.XviD.mp4
You will get another X window open and then the video file will begin to play.
Now, how do you control all that media? There’s no interface or buttons. That’s ok, we don’t need them. Remember, everything you are doing here is from the command line.
Here are some important keys to take note of which will help you get started with your media functions:
Q = Quit P = Pause Up arrow = Jump forward in file more Right arrow = Jump forward in file less Down arrow = Jump back in file more Left arrow = Jump back in file less ) = Volume up ( = Volume down M = Volume mute F = Full screen view O = On-screen display V = Toggle subtitles in video
In basic day-to-day usage of mplayer, you really will not need anything more than what I have shown above. It’s best to keep things simple as command-line stuff can get very confusing for beginners and new users. If you want more advanced functions from your keyboard, refer to the mplayer man pages which has everything covered. There is a lot of information in the man pages for mplayer:
% man mplayer
Most of the time you will be abe to play media without any issues on most modern systems. But in the past, I have experienced some issues with playback on some systems. I will show you a few tips that you can do to counter most common playback problems.
First, create a mplayer config file by entering the following:
% touch ~/.mplayer/config
And now to edit the file:
% nano ~/.mplayer/config
Now enter the following text in to the configuration file:
zoom=yes vo=x11 ao=alsa
The above will solve most people problems.
I hope you enjoy using mplayer from the command-line. Play around with it and have some fun and you come to appreciate its raw power to handle your media.
Like us on Facebook
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- How To Install Netflix In Ubuntu : Hi unixmen readers! How are you? In this article we will teach you how to install the desktop vers...2 comments |
- How To Configure Linux Clients To Authenticate Using OpenLDAP : This is the continuation of our previous tutorial. In our previous tutorial we learned how to instal...2 comments |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Setup IT And Asset Management System With GLPI On Debian/Ubuntu : GLPI is the Information Resource-Manager with an additional Administration Interface. You can use it...0 comments |
- Install lamp with 1 command in Ubuntu 12.10, 13.04 Raring Ringtail & LinuxMint13 : Updated: 10/09/2012 :LAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform ...0 comments |
- Install FrostWire 5.6.9 In Elementary OS ‘Luna’/ Ubuntu / Linux Mint
- Setup IT And Asset Management System With GLPI On Debian/Ubuntu
- How To Configure Linux Clients To Authenticate Using OpenLDAP
- How To Install Netflix In Ubuntu
- cowsay And fortune Combined Together
- How To Show Username On Panel In Ubuntu 13.04/13.10
- Setup DNS Server On openSUSE 13.1
- TeamViewer 9 Final Has Been Released!
- Twelve Vulnerabilities Have Been Fixed In Ubuntu 12.04, Time To Update
- OpenLDAP Installation and Configuration in Ubuntu 12.10/13.04/13.10 And Debian 6/7
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .