Você está na página 1de 16

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

1 de 16

You are not logged in.

http://crunchbang.org/forums/viewtopic.php?id=20178

Topics: Active | Unanswered

Index Tips, Tricks & Scripts Mplayer for beginners


Pages: 1

Next

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

2 de 16

ivanovnegro

http://crunchbang.org/forums/viewtopic.php?id=20178

2012-06-08 02:56:45

Jul 15 2012 Added some gimmicks.


March 30 2013 Added compiling advice.
Just for fun I will put a little how-to on using mplayer/mplayer2 for the first timer. But we
will stay minimal, no GUI, just the command line.
I guess the app is already familiar to you, maybe you use it already with a graphical
frontend like SMplayer or Gnome MPlayer etc. to watch movies.
But we will be more interested how to use this little player just from our best friend, the
CLI.
As the options are unlimited it seems, I will just focus on the most obvious and important.
So, why you would like to run mplayer and especially from the command line. Easy to
answer, we love minimalism and Rhowaldt loves the terminal! It is fast, lightweight and
you can control it completely from the keyboard. It looks sexy on Openbox and is made to
run perfectly on all kind of light Window Managers, particularly on tilers. Of course you
can use it on any other environment, even on your Mac or Windows machine.
VLC is just too bloated for us, if you like that one, this how-to is not for you.
1. Installation
We have two choices, the original Mplayer or the fork Mplayer2. Both just do the same. I
won't speak here about the differences.
Personally I use mplayer2 just by accident and many things I will say here comes from that
perspective but also should be applicable to mplayer. They share anyway most of the
functions and keyboard controls.
Both apps can be found in the Debian repos, though, if you are on Statler/Squeeze, you
have to use backports to install mplayer2.
The original mplayer offers a nasty GUI, do not install it, stay in touch with Rhowaldt's
philosophy.
apt-get install mplayer
or
apt-get install mplayer2
2. Configuration
Out of the box mplayer should be able to play whatever you want, movies, music from all
kind of types. It comes with all the needed codecs as far as I can tell.

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

3 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

For some extra codecs, specially non-free stuff, you would need the Debian Multimedia
repo and take mplayer from there. On a default CrunchBang install that would not be
necessary.
Ok, we want to make some personal adjustments. Therefore we will put our changes into:
~/.mplayer/config
for Mplayer or into:
~/.mplayer2/config
for Mplayer2. For this one the first option is also possible as it is/should be fully
compatible.
You can put whatever you want in there when you know what you need. I will just show
my simple and personal configuration.
# Write your default config options here!
# use alsa for audio output
ao=alsa

# {obviously for your audio outpu

# use X11 for video output


vo=xv
# {obviously for your video outpu
# Disable screensaver
# {if the screensaver is interfer
heartbeat-cmd="xscreensaver-command -deactivate &" # stop xscreensaver
stop-xscreensaver="yes"
# Set subtitle file encoding
# {I use many languages and need
unicode=yes
utf8=yes
# Extras
idx=yes
softvol=1
softvol-max=600

# {means you can seek in a file th


# {activate softvol and softvol-ma

That should be all. I won't go into more details. If you are interested in more options look
at the documentaion from both projects or just:
man mplayer

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

4 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

gutterslob

2012-06-08 03:32:24
Huh? I thought everyone knew how to use mplayer!!
Nice basic config. Seems like a good start for first-time users, so props to ya, Blackheart!!
There's a heck of a lot more out there, though. We haven't even touched mencoder
configuration (~/.mplayer/mencoder.conf) or profiles yet. Mplayer's a beast!!
Do you get that annoying "Failed to open LIRC support" message with msgmodule output?
Hah, you should've compiled mplayer without LIRC support in the first place. Since it's too
late now, you can add ....
nolirc=yes
....to your config file. Should work for mplayer2 also.

Or you can just add that to your command or alias, like so;
alias play='mplayer -msgcolor -msgmodule -nolirc'

Basic embedded subtitle support;


For those of you that watch artsy "foreign" films or cartoons with embryo-faced characters
in container formats (mostly .mkv) that have softsubs (SSA/ASS), you can add these lines to
your config as well. That way mplayer will default to the fonts that came in the file instead
of relying on standard sans or whatever. This is particularly useful for shows that use
multiple styles of fonts (to differentiate between spoken dialogue, narration and thoughts,
for example);
ass=yes
embeddedfonts=yes
#fontconfig=yes
The last fontconfig line enables your system's fontconfig managed fonts. Uncomment if
you want that.
There are also options to control subtitle placement and even font hinting. Best to check
the man page under the "OSD/SUBTITLE OPTIONS" section. Actually, it's better you just
read the whole damn man page, like you should have in the first place.
Last edited by gutterslob (2012-06-08 15:32:08)

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

5 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

Kino

2012-06-08 07:18:39
A couple of things....
1. Mplayer won't play a file that has spaces in the filename (or things like exclamation
marks !!) from the command line. However, if I open the file in thunar with the custom
command mplayer %f then it plays ok. Is there a way around this?
2. This is more of a request than anything else:
I use vlc mainly because I can drag & drop files into a playlist to set my evening's
entertainment.
What about the possibility of an Openbox menu item which adds selected files to a playlist
playable with mplayer?
Or, alternatively, use thunar custom actions to create a playlist...
Last edited by Kino (2012-06-08 08:49:29)

Offline

Unia

Up - seek forward 1 minute


2012-06-08 09:05:43
Page down - seek backward 10 minutes
Page up - seek forward 10 minutes
Here's two aliases I use to have mplayer play a CD or show my webcam:
alias playcd='mplayer cdda://'
alias cam='mplayer tv://'
Also, the Arch Wiki has a good and extensive article on Mplayer that's worth a read:
https://wiki.archlinux.org/index.php/Mplayer
That only leaves me to say: nice guide!
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs
more work. --Carlos Torres
Github || Deviantart

Offline
5. Extras
We love fancy terminal outputs. If you want to have some color in your terminal while
playing a video file just open the file with:
mplayer -msgcolor -msgmodule /path/to/file

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

6 de 16

el_koraco

http://crunchbang.org/forums/viewtopic.php?id=20178

You can of course make an alias for it in your ~/.bashrc:

2012-06-08 10:38:54

Mine:
Kino wrote:
alias
-msgcolor -msgmodule'
A
coupleplay='mplayer
of things....
1. Mplayer won't play a file that has spaces in the filename
To avoid the message "Failed to open LIRC support" with the colors enabled, add this to
your config:
mplayer \firstletter and hit Tab.
Offline

dkeg

2012-06-08 10:55:07
if you use ranger as a file managar it integrates nicely with mplayer OOB. Select your file
and hit enter and your file opens with mplayer
grill it | the rocky path may just be the best path

Offline

file like this if you want 16:9:


mplayer -aspect 16:9 /path/to/file
For other aspect ratios, just use e.g. 16:10 etc.
If you find all the default terminal output too much, just add this to your conf file:
really-quiet="1"
If you want to watch some nice TV streams etc, Machinebacon made a nice how-to. Apply
it for mplayer.
If you prefer to watch Youtube videos from the console using mplayer and without
bothering with Flash, go to this thread from Johnraff
For basic embedded subtitle support, add this to your config:
ass=yes
embeddedfonts=yes
#fontconfig=yes
Thanks to Gutterslob.

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

7 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

Kino

2012-06-08 11:18:46
OK,
I figured out how to create a playlist using thunar custom actions (and it handles filenames
with spaces!):
1. Create a custom action.
Edit - Configure custom actions
make a new action e.g. Add to playlist with the following command:
echo %f >> /home/kino/playlist.txt
(edit as required)
and select video files from the Appearance Conditions
Select any video file in thunar and right-click to add that file to the playlist.
2. Select playlist in mplayer
mplayer -playlist playlist.txt
Note: I have not yet figured out how to delete selections from the playlist!
Last edited by Kino (2012-06-08 11:19:25)

Offline

ivanovnegro

Change it to your liking.

2012-06-08 15:40:42

The same happens with the audio language:


@Slob: Thanks. As I said, just for fun and the beginner has not to read the whole and long
Mplayer just has too many awesome options and you already provided some
man page.
nice additions for the config file. And many thanks for the LIRC support thing!
Mplayer is indeed a beast, because of that I left the stuff out about mencoder, not my
territory either.
@others: Keep it coming!
If you do not like it... roast your own!
MPD | mplayer | Firefox | fonts

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

8 de 16

johnraff

http://crunchbang.org/forums/viewtopic.php?id=20178

2012-06-08 16:59:48
Thank you - starting this was a good idea!
ivanovnegro wrote:
Out of the box mplayer should be able to play whatever you want, movies, music
from all kind of types. It comes with all the needed codecs as far as I can tell.
For some extra codecs, specially non-free stuff, you would need the Debian
Multimedia repo and take mplayer from there.
A lot of the non-free codecs you need are in the w32codecs package. I think that comes
with #! by default anyway though.
John
-------------------( a boring Japan blog , and idle twitterings )

Offline

el_koraco

On the mplayer page they have listed all possible graphical frontends if 2012-06-08
you want to 17:02:38
use
one with it in addition.
So does anybody know of a good stream for Euro 2012 and mplayer?
Also please share your own mplayer configuration file if of interest or you use some special
settings.

Offline

Unia

Have fun!
Last edited by ivanovnegro (2013-03-30 22:57:20)

2012-06-08 17:08:07

el_koraco wrote:
So does anybody know of a good stream for Euro 2012 and mplayer?
Offline

You don't have a tv?


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs
more work. --Carlos Torres
Github || Deviantart

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

9 de 16

vicshrike

http://crunchbang.org/forums/viewtopic.php?id=20178

2012-06-08 17:14:55
Thanks ivanov, will try, bookmarked.
#!, all else is but a shadow

Offline

el_koraco

2012-06-08 17:20:20

Unia wrote:
You don't have a tv?
no sir.
Offline

Unia

2012-06-08 17:38:01

el_koraco wrote:
Unia wrote:
You don't have a tv?
no sir.
Really? Why not?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs
more work. --Carlos Torres
Github || Deviantart

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

10 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

root

2012-06-08 17:48:18

Unia wrote:
el_koraco wrote:
Unia wrote:
You don't have a tv?
no sir.
Really? Why not?
Turn it on. Watch a while. Answer it for yourself.

/
Offline

el_koraco

2012-06-08 17:48:35
I haven't had a need to watch it in two years or something. Plus, it just takes up space.

Offline

Unia

2012-06-08 18:00:48
Well here's a reason to get one
match. Just wait till Saturday

Although... Poland vs Greece was not that good of a

Last edited by Unia (2012-06-08 18:00:59)

If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs
more work. --Carlos Torres
Github || Deviantart

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

11 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

ivanovnegro

2012-06-08 18:14:18

johnraff wrote:
I think that comes with #! by default anyway though.
On #! true but for default Debian not, therefore I mentioned it. Will review the how-to
anyway.
el_koraco wrote:
Unia wrote:
You don't have a tv?
no sir.
Me neither.
I mentioned it in the how-to. I used it just now to
But machinebacon's sript is for use.
watch the first game instead of going outside or to hunt bad quality Flash driven internet
streams.
Unia wrote:
Poland vs Greece was not that good of a match. Just wait till Saturday
Maybe Russia vs. Czech Republic will be better.
Last edited by ivanovnegro (2012-06-08 18:16:17)

If you do not like it... roast your own!


MPD | mplayer | Firefox | fonts

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

12 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

Unia

2012-06-08 18:43:29

ivanovnegro wrote:
Unia wrote:
Poland vs Greece was not that good of a match. Just wait till Saturday
Maybe Russia vs. Czech Republic will be better.
Maybe, it's on now. Is there a thread on this yet?
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs
more work. --Carlos Torres
Github || Deviantart

Offline

ivanovnegro

2012-06-08 20:52:23
^ As I was watching football with my Russian invasion I had here, no idea about a thread
but this game was great and the atmosphere here was superb.
!
If you do not like it... roast your own!
MPD | mplayer | Firefox | fonts

Offline

VastOne

2012-06-08 21:23:14
Nice How To Black Ops Ivan
Added to Quick References...
VSIDO | SolusOS
Words That Build Or Destroy

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

13 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

ivanovnegro

2012-06-08 22:12:47
^ Thanks!
If you do not like it... roast your own!
MPD | mplayer | Firefox | fonts

Offline

arclance

2012-06-08 23:16:03
If your computer can handle it I would recommend these -vo settings.
-vo gl:yuv=3:swapinterval=1:lscale=1:cscale=1
For me the quality is better than -vo xv.
I set some optional settings to increase video quality so it probably uses more power.
The output is vsynced if your OpenGL drivers support vsync.
gutterslob wrote:
There's a heck of a lot more out there, though. We haven't even touched mencoder
configuration (~/.mplayer/mencoder.conf) or profiles yet. Mplayer's a beast!!
Since mplayer2 was mentioned in the first post you should know that mencoder is not part
of mplayer2.
There is also a fork of SMPlayer called SMPlayer2 that has some improvements for use
with mplayer2.
My favorite is that it has a dbus interface for now playing information so you can have a
mplayer progress bar in conky.

Building Conky | iCalendar Conky | Weather Script | Background List


Fluxbox | SpaceFM

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

14 de 16

http://crunchbang.org/forums/viewtopic.php?id=20178

rhowaldt

2012-06-08 23:24:16
@ivanov: nice how-to! very basic, very good. and also some very basic stuff about ~ being
$HOME and using 'ls' and whatnot. almost makes me wanna do a 'the most basic of basic
terminal commands' thread...
and thanks for the mention!
gutterslob wrote:
Do you get that annoying "Failed to open LIRC support" message with msgmodule
output? Hah, you should've compiled mplayer without LIRC support in the first
place. Since it's too late now, you can add ....

Offline

Help fund CrunchBang, donate to the project!

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

15 de 16

gutterslob

http://crunchbang.org/forums/viewtopic.php?id=20178

2012-06-08 23:46:24

arclance wrote:
If your computer can handle it I would recommend these -vo settings.
-vo gl:yuv=3:swapinterval=1:lscale=1:cscale=1
For me the quality is better than -vo xv.
I set some optional settings to increase video quality so it probably uses more
power.
The output is vsynced if your OpenGL drivers support vsync.
I second this. Only problem with openGL rendering is that it can't decode Hi10p video
yet.... in my experience, at least.

arclance wrote:
Since mplayer2 was mentioned in the first post you should know that mencoder is
not part of mplayer2.
Thanks for the clarification. Didn't realize that since I only use Mplayer1.

arclance wrote:
There is also a fork of SMPlayer called SMPlayer2 that has some improvements for
use with mplayer2.
SMplayer has been a very decent player the few times I've used it. Only problem is that it
(used to) lack options for certain subtitle types and (more importantly) required QT. Fine if
you run KDE or RazorQT (or Crunchbang, since it includes VLC which brings in QT anyway),
but I can't really justify installing a new theme engine on my setups just for one
application. It would be my go-to GUI frontend if I was recommending Mplayer to a
newbie, for sure. Sh*ts all over the Gnome-Mplayer frontend.
Last edited by gutterslob (2012-06-08 23:46:38)

Point & Squirt

Offline

18/02/14 23:51

Mplayer for beginners (Page 1) / Tips, Tricks & Scripts /...

16 de 16

Pages: 1

http://crunchbang.org/forums/viewtopic.php?id=20178

Next

Index Tips, Tricks & Scripts Mplayer for beginners

Jump to
Tips, Tricks & Scripts

Atom topic feed


Go

Powered by FluxBB

Copyright 2012 CrunchBang Linux.


Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

18/02/14 23:51

Você também pode gostar