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
We need your assistance to stay live
This week Top Posts
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX : Wow! Early last week it was all over the internet, if you haven't heard it yet then this is the t...1 comment |
- Grive: An Unofficial, Open Source Linux Client For Google Drive : A couple of months before, we have featured a Linux client for Google Drive named Syncdrive, which w...1 comment |
- 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 |
- Install Sublime Text 3 In Fedora Easily With Fedy : Sublime Text is a sophisticated text editor for code, markup and prose. In this tutorial we are goi...0 comments |
- How To "Fix E: Could not open file /var/lib/dpkg/status" : QUESTION: I get the following error when I use sudo apt-get update: E: Could not open file /var/...0 comments |
- Install nSnake Game In Terminal : From github repo nsnake is a clone of the classic snake game that we all used to play on our cellp...0 comments |
- How To Access A LVM Drive / Partition in Ubuntu
- How To Disable Remember Open Files in Sublime Text 3
- Install Sublime Text 3 In Fedora Easily With Fedy
- Grive: An Unofficial, Open Source Linux Client For Google Drive
- Install nSnake Game In Terminal
- How To “Fix E: Could not open file /var/lib/dpkg/status”
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .