Difference between revisions of "MPlayer"

From ArchWiki
Jump to: navigation, search
(Frontends/GUIs: used the App template for the GUIs. added two more.)
m (Subject)
(45 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[Category:Audio/Video]]
+
[[Category:Player]]
 
[[cs:MPlayer]]
 
[[cs:MPlayer]]
 
[[el:MPlayer]]
 
[[el:MPlayer]]
Line 5: Line 5:
 
[[it:MPlayer]]
 
[[it:MPlayer]]
 
[[ru:MPlayer]]
 
[[ru:MPlayer]]
 +
[[es:MPlayer]]
 
[[uk:MPlayer]]
 
[[uk:MPlayer]]
 
[[zh-CN:MPlayer]]
 
[[zh-CN:MPlayer]]
 
'''MPlayer''' is a popular movie player for GNU/Linux. It has support for pretty much every video and audio format out there and is hence very versatile, even though most people use it for viewing videos.
 
'''MPlayer''' is a popular movie player for GNU/Linux. It has support for pretty much every video and audio format out there and is hence very versatile, even though most people use it for viewing videos.
  
==Installation==
+
== Installation ==
MPlayer can be installed with the standard {{Pkg|mplayer}} package or the VAAPI-enabled version {{Pkg|mplayer-vaapi}}, available in the [[official repositories]]. Alternatively, a development version is also available from the [[AUR]]: {{AUR|mplayer-svn}}.
+
  
You may also want to try [http://www.mplayer2.org/ mplayer2], a fork of mplayer. It can be installed with the {{Pkg|mplayer2}} package from the official repositories or {{AUR|mplayer2-git}} available in the AUR. It has several improvements over the original mplayer, see: [http://www.mplayer2.org/differences/ mplayer2 vs mplayer]
+
Various flavours of MPlayer can be [[pacman|installed]] from the [[official repositories]] or from the [[AUR]]:
 +
* {{Pkg|mplayer}} - Official package.
  
==Additional installation tips==
+
Notable variants are:
 +
* {{Pkg|mplayer-vaapi}} - VAAPI-enabled version.
 +
* {{AUR|mplayer-svn}} - Development version.
 +
* {{Pkg|mplayer2}} - Fork of MPlayer. with few [http://www.mplayer2.org/differences/ enhancements].
 +
* {{AUR|mplayer2-git}} - Development version of MPlayer2.
 +
* {{AUR|mpv-git}} - MPlayer/MPlayer2 fork with some changes. It is focused on speed and quality of development, though  this breaks compatibility with old hardware and software.
 +
{{Note|mpv is not meant to be a drop-in replacement. Be aware of its [https://github.com/mpv-player/mpv/blob/master/DOCS/man/en/changes.rst differences] if you want to use it.}}
  
===Frontends/GUIs===
+
== Additional installation tips ==
There are several GUIs for MPlayer.
+
* {{App|[[Wikipedia:SMPlayer|SMPlayer]]|A middleweight Qt front-end for MPlayer with additional patches.|http://smplayer.sourceforge.net/|{{Pkg|smplayer}}}}
+
* {{App|UMPlayer|A SMPlayer fork with extra features (CSS themes, YouTube integration, ShoutCast support. etc.)|http://www.umplayer.com/|{{AUR|umplayer}}}}
+
* {{App|GNOME-MPlayer|A simple GTK-based GUI for MPlayer.|http://kdekorte.googlepages.com/gnomemplayer|{{Pkg|gnome-mplayer}}}}
+
* {{App|Pymp|A PyGTK frontend for MPlayer|http://jdolan.dyndns.org/trac/wiki/Pymp|{{AUR|pymp}}}}
+
* {{App|KMPlayer|A video player plugin for Konqueror and basic MPlayer/Xine/ffmpeg/ffserver/VDR frontend for KDE.|http://kmplayer.kde.org/|{{AUR|kmplayer}}}}
+
* {{App|Xt7-Player|A graphical user interface for MPlayer written in Gambas, with a huge list of features.|http://xt7-player.sourceforge.net/xt7forum/|{{AUR|xt7-player}}}}
+
  
===Browser integration===
+
=== Frontends/GUIs ===
  
If you want to let MPlayer control video viewing in your favorite web browser, install the following:
+
* {{App|Deepin Media Player|Rich GTK2/Python interface for the Deepin desktop.|http://www.linuxdeepin.com/|{{AUR|deepin-media-player}}}}
 +
* {{App|GNOME MPlayer|Simple GTK+-based GUI for MPlayer.|http://kdekorte.googlepages.com/gnomemplayer|{{Pkg|gnome-mplayer}}}}
 +
* {{App|KMPlayer|Video player plugin for Konqueror and basic MPlayer/Xine/ffmpeg/ffserver/VDR frontend for KDE.|http://kmplayer.kde.org/|{{AUR|kmplayer}}}}
 +
* {{App|Pymp|PyGTK frontend for MPlayer.|http://jdolan.dyndns.org/trac/wiki/Pymp|{{AUR|pymp}}}}
 +
* {{App|Rosa Media Player|Multimedia player based on SMPlayer with clean and elegant UI.|http://www.rosalab.com/|{{AUR|rosa-media-player}}}}
 +
* {{App|[[Wikipedia:SMPlayer|SMPlayer]]|Middleweight Qt front-end for MPlayer with additional patches.|http://smplayer.sourceforge.net/|{{Pkg|smplayer}}}}
 +
* {{App|UMPlayer|SMPlayer fork with extra features (CSS themes, YouTube integration, ShoutCast support, etc.).|http://www.umplayer.com/|{{AUR|umplayer}}}}
 +
* {{App|Xt7-Player|Graphical user interface for MPlayer written in Gambas, with a huge list of features.|http://xt7-player.sourceforge.net/xt7forum/|{{AUR|xt7-player}}}}
  
====Firefox====
+
=== Browser integration ===
  
# pacman -S gecko-mediaplayer
+
If you want to let MPlayer control video viewing in your favorite web browser, install one of the following plugins for your browser.
  
{{Note| Depends on gnome-mplayer, which provides a complete frontend to MPlayer.}}
+
==== Firefox ====
  
====Konqueror====
+
A browser plugin is available in the official repositories with the {{Pkg|gecko-mediaplayer}} package.
{{AUR|kmplayer}} is in the [[AUR]].
+
  
{{Note| Also provides a complete frontend to MPlayer.}}
+
{{Note|It depends on {{Pkg|gnome-mplayer}}, which provides a complete frontend to MPlayer.}}
  
==Usage==
+
==== Konqueror ====
 +
 
 +
A plugin for Konqueror can be found in the [[AUR]] with the {{AUR|kmplayer}} package.
 +
 
 +
{{Note|{{AUR|kmplayer}} also provides a complete frontend to MPlayer.}}
 +
 
 +
==== Chromium ====
 +
 
 +
The {{Pkg|gecko-mediaplayer}} plugin for Firefox also works in [[Chromium]].
 +
 
 +
== Usage ==
 +
 
 +
=== Configuration ===
  
===Configuration===
 
 
System-wide configuration is located in {{ic|/etc/mplayer/mplayer.conf}}, whereas the user-local settings are stored in {{ic|~/.mplayer/config}}. The file {{ic|/etc/mplayer/example.conf}} is a good starting point.
 
System-wide configuration is located in {{ic|/etc/mplayer/mplayer.conf}}, whereas the user-local settings are stored in {{ic|~/.mplayer/config}}. The file {{ic|/etc/mplayer/example.conf}} is a good starting point.
  
An example configuration:  
+
An example configuration:
  
 
{{hc|/etc/mplayer/example.conf|2=
 
{{hc|/etc/mplayer/example.conf|2=
 
 
# default configuration that applies to every file
 
# default configuration that applies to every file
 
[default]
 
[default]
# use X11 for video output
+
 
vo=xv
+
# use X11 for video output, use a framebuffer as fallback
# use also for audio output
+
vo=xv,directfb
ao=alsa
+
 
# ao=oss # Use OSS4
+
# use alsa for audio output, choose oss4 as fallback
 +
ao=alsa,oss
 +
 
 
# multithreaded decoding of H264/MPEG-1/2 (valid: 1-8)
 
# multithreaded decoding of H264/MPEG-1/2 (valid: 1-8)
 
lavdopts=threads=2
 
lavdopts=threads=2
 +
 
# prefer using six channels audio
 
# prefer using six channels audio
 
channels = 6
 
channels = 6
 +
 
# scale the subtitles to the 3% of the screen size
 
# scale the subtitles to the 3% of the screen size
 
subfont-text-scale = 3
 
subfont-text-scale = 3
 +
 
# never use font config
 
# never use font config
 
nofontconfig = 1
 
nofontconfig = 1
 +
 +
# set the window title using the media filename, when not set with --title.
 +
use-filename-title=yes
 +
 
# add black borders so the movies have the same aspect ratio of the monitor
 
# add black borders so the movies have the same aspect ratio of the monitor
 
# for wide screen monitors
 
# for wide screen monitors
 
vf-add=expand=::::1:16/9:16
 
vf-add=expand=::::1:16/9:16
 +
 
# for non wide screen traditional monitors
 
# for non wide screen traditional monitors
 
#vf-add=expand=::::1:4/3:16
 
#vf-add=expand=::::1:4/3:16
  
#profile for up-mixing two channels audio to six channels
+
# disable screensaver
 +
heartbeat-cmd="xscreensaver-command -deactivate &" # stop xscreensaver
 +
stop-xscreensaver="yes" # stop gnome-screensaver
 +
 
 +
# correct pitch when speed is faster or slower than 1.0
 +
af=scaletempo
 +
 
 +
# allow to seek in a file which is still downloading whilst watching it
 +
idx=yes
 +
 
 +
# allow to increase the maximal volume
 +
#softvol=1
 +
#softvol-max=600
 +
 
 +
# skip displaying some frames to maintain A/V sync on slow systems
 +
framedrop=yes
 +
 
 +
# more intense frame dropping (breaks decoding)
 +
#hardframedrop=yes
 +
 
 +
# profile for up-mixing two channels audio to six channels
 
# use -profile 2chto6ch to activate
 
# use -profile 2chto6ch to activate
 
[2chto6ch]
 
[2chto6ch]
 
af-add=pan=6:1:0:.4:0:.6:2:0:1:0:.4:.6:2
 
af-add=pan=6:1:0:.4:0:.6:2:0:1:0:.4:.6:2
+
 
#profile to down-mixing six channels audio to two channels
+
# profile to down-mixing six channels audio to two channels
 
# use -profile 6chto2ch to activate
 
# use -profile 6chto2ch to activate
 
[6chto2ch]
 
[6chto2ch]
 
af-add=pan=2:0.7:0:0:0.7:0.5:0:0:0.5:0.6:0.6:0:0
 
af-add=pan=2:0.7:0:0:0.7:0.5:0:0:0.5:0.6:0.6:0:0
  
# Disable screensaver.
 
heartbeat-cmd="xscreensaver-command -deactivate &" # stop xscreensaver
 
stop-xscreensaver="yes" # stop gnome-screensaver
 
 
}}
 
}}
  
===Keybindings===
+
=== Key bindings ===
  
:''This is a list of the most basic MPlayer keys.''
+
System key bindings are configured via {{ic|/etc/mplayer/input.conf}}. Personal key bindings are stored in {{ic|~/.mplayer/input.conf}}. This is a list of some basic default MPlayer keys. For a complete list of keyboard shortcuts look at {{ic|man mplayer}}.
  
 
{|
 
{|
! width=50 align=left | Key
+
! width=85 align=left | Key
 
! align=left | Description
 
! align=left | Description
 
|-
 
|-
| p
+
| {{ic|p}}
 
| Toggle pause/play.
 
| Toggle pause/play.
 
|-
 
|-
| Space
+
| {{ic|Space}}
 
| Toggle pause/play.
 
| Toggle pause/play.
 
|-
 
|-
 
|-
 
|-
| Backspace
+
| {{ic|Backspace}}
 
| Return to menu when using dvdnav.
 
| Return to menu when using dvdnav.
 
|-
 
|-
| Left
+
| {{ic|←}}
 
| Seek backward ten seconds.
 
| Seek backward ten seconds.
 
|-
 
|-
| Right
+
| {{ic|→}}
 
| Seek forward ten seconds.
 
| Seek forward ten seconds.
 
|-
 
|-
| Down
+
| {{ic|↓}}
 
| Seek backward one minute.
 
| Seek backward one minute.
 
|-
 
|-
| Up
+
| {{ic|↑}}
 
| Seek forward one minute.
 
| Seek forward one minute.
 
|-
 
|-
| <
+
| {{ic|<}}
 
| Go back in the playlist.
 
| Go back in the playlist.
 
|-
 
|-
| >
+
| {{ic|>}}
 
| Go forward in the playlist.
 
| Go forward in the playlist.
 
|-
 
|-
| m
+
| {{ic|m}}
 
| Mute the sound.
 
| Mute the sound.
 
|-
 
|-
| 0
+
| {{ic|0}}
 
| Volume up.
 
| Volume up.
 
|-
 
|-
| 9
+
| {{ic|9}}
 
| Volume down.
 
| Volume down.
 
|-
 
|-
| f
+
| {{ic|f}}
 
| Toggle fullscreen mode.
 
| Toggle fullscreen mode.
 
|-
 
|-
| o
+
| {{ic|o}}
 
| Toggle OSD state.
 
| Toggle OSD state.
 
|-
 
|-
| v
+
| {{ic|v}}
 
| Toggle subtitle visibility.
 
| Toggle subtitle visibility.
 
|-
 
|-
Line 142: Line 185:
 
| Show filename.
 
| Show filename.
 
|-
 
|-
| 1, 2
+
| {{ic|1}}, {{ic|2}}
 
| Adjust contrast.
 
| Adjust contrast.
 
|-
 
|-
| 3, 4
+
| {{ic|3}}, {{ic|4}}
 
| Adjust brightness.
 
| Adjust brightness.
 
|-
 
|-
| j
+
| {{ic|j}}
 
| Cycle through the available subtitles.
 
| Cycle through the available subtitles.
 
|-
 
|-
| #
+
| {{ic|#}}
 
| Cycle through the available audio tracks.
 
| Cycle through the available audio tracks.
 
|}
 
|}
  
== Tips and Tricks ==
+
== Tips and tricks ==
===Automatic Resuming Where You Left Off===
+
  
The [[AUR]] contains an elegant perl wrapper-script which will allow autoresuming from the point at which playback was stopped {{AUR|mplayer-resumer}}.
+
=== Automatic resuming from where you left off ===
  
Usage is trivial: simply call the wrapper-script in place of mplayer.
+
To get this behavior, you can install the {{AUR|mplayer-resumer}} package from the [[AUR]]. The package contains a Perl wrapper script for MPlayer which will allow you to autoresume playback from the point it was last stopped.
Example:
+
$ mplayer-resumer [options] [path/]filename
+
  
If this script is restarted within $tdiff (default 5 seconds) then it will delete the file used to keep track of the videos resume position.
+
To use it, simply call the wrapper script in place of MPlayer:
 +
$ mplayer-resumer ''options'' ''path/to/file''
  
'''RATIONALE'''
+
If this script is restarted within a short amount of time after closing MPayer (default 5 seconds) then it will delete the file used to keep track of the videos resume position, effectively starting the video from the beginning.
  
Watching 90% of a video and stopping causes you to return to the beginning again the next time you watch it.  Remembering where you were in the video and resuming at that position is a much nicer behavior for the user.  By default, mplayer spits out timecode information that tells you where you are in the video, to the tenth of a second.  MPlayer also supports a seek feature on the command-line.  We can make use of these features to write an mplayer wrapper that will remember the last position in a video file and resume to it on playback.
+
If the video file to be played is on a read-only filesystem, or otherwise lives in a location that cannot be written to, resume will fail. This is because the current implementation uses a file parallel to the video file to store the timecode.
  
'''DESIGN LIMITATION'''
+
=== Enabling VDPAU===
  
If the video file to be played is on a read-only filesystem, or otherwise lives in a location that cannot be written to, resume will fail. This is because the current implementation uses a file parallel to the video file to store the timecode.
+
For a complete list of nVidia VDPAU capable hardware, see [http://en.wikipedia.org/wiki/PureVideo#Table_of_PureVideo_.28HD.29_GPUs this table]. Ensure the {{Pkg|nvidia}} driver is installed and consider one of the following two methods to automatically enable VDPAU for playback.
  
===Enabling VDPAU (modern nVidia cards only)===
+
For Intel/AMD, you can use {{AUR|libvdpau-va-gl}} — VAAPI backend for VDPAU. For AMD you should also install {{AUR|xvba-video}}. To use it, add:
 +
{{bc|
 +
#!/bin/sh
 +
export VDPAU_DRIVER&#61;va_gl
 +
}}
 +
to {{ic|/etc/profile.d/vdpau_vaapi.sh}}, make it executable:
 +
# chmod +x /etc/profile.d/vdpau_vaapi.sh
 +
and reboot or relogin.
  
For a complete list of VDPAU capable hardware, see [[http://en.wikipedia.org/wiki/PureVideo#Table_of_PureVideo_.28HD.29_GPUs this table]].  Ensure the ''nvidia'' driver is installed and consider one of the following two methods to automatically enable vdpau for playback.
+
==== Using a configuration file ====
 
+
==== 1. Using a conf file ====
+
Append the following to either the system-wide or user-specific config files
+
  
 +
Append the following to either the system-wide ({{ic|/etc/mplayer/mplayer.conf}}) or user-specific ({{ic|~/.mplayer/config}}) configuration files:
 
  vo=vdpau,
 
  vo=vdpau,
 
  vc=ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,ffwmv3vdpau,ffvc1vdpau,
 
  vc=ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,ffwmv3vdpau,ffvc1vdpau,
  
 
{{Note|The trailing commas are important! They tell MPlayer to fall back on other drivers and codecs should the specified ones not be found.}}
 
{{Note|The trailing commas are important! They tell MPlayer to fall back on other drivers and codecs should the specified ones not be found.}}
{{Warning|The ffodivxvdpau is only supported by the most recent series of nVidia hardware. Consider omitting it based on your specific hardware. See [[NVIDIA#Enabling_Pure_Video_HD_.28VDPAU.2FVAAPI.29|the NVIDIA page]] for more information.}}
+
{{Warning|The {{ic|ffodivxvdpau}} codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware. See [[NVIDIA#Enabling_Pure_Video_HD_.28VDPAU.2FVAAPI.29|the NVIDIA page]] for more information.}}
  
==== 2. Using a wrapper script ====
+
==== Using a wrapper script ====
  
The [[AUR]] contains a trivial bash script called {{AUR|mplayer-vdpau-auto}} that detects which vc to use and when to use vo=vdpau.
+
The [[AUR]] contains a trivial Bash script called {{AUR|mplayer-vdpau-auto}} that detects which video codec to use and when to use VDPAU as the video output.
  
===Translucent Video with radeon and Composite enabled===
+
Another simple wrapper is {{AUR|mplayer-vdpau-shell-git}}, which can recover from a VDPAU FATAL error.
 +
This wrapper uses the "-include" option to include a VDPAU configuration, so it will ignore any VDPAU specific settings in your {{ic|~/.mplayer/config}} file.
  
To get translucent video output in X you have to enable textured video in mplayer:
+
=== Translucent video with Radeon cards and Composite enabled ===
  
  $ mplayer -vo xv:adaptor=1 <File>
+
To get translucent video output in X you have to enable textured video in MPlayer:
 +
  $ mplayer -vo xv:adaptor=1 ''file''
  
 
Or add the following line to {{ic|~/.mplayer/config}}:
 
Or add the following line to {{ic|~/.mplayer/config}}:
 
 
  vo=xv:adaptor=1
 
  vo=xv:adaptor=1
  
You can use xvinfo to check which video modes your graphic card supports.
+
You can use {{ic|xvinfo}} to check which video modes your graphic card supports.
 
+
=== SMPlayer No Video Issue ===
+
  
SMPlayer may have trouble opening mp4 (and probably flv) videos. If it plays only audio without video here is the fix:
+
=== SMPlayer: No video issue ===
Open your {{Ic|~/.mplayer/config}} file and add
+
  
 +
SMPlayer may have trouble opening some {{ic|MP4}} (and probably {{ic|FLV}}) videos. If it plays only audio without any video, a possible fix is to add the following lines to your {{ic|~/.mplayer/config}} file:
 
   [extension.mp4]
 
   [extension.mp4]
 
   demuxer=mov
 
   demuxer=mov
  
If problem persists after doing so, it is because of smplayer is keeping settings for that specific file. Deleting file settings of smplayer will fix this.
+
If problem persists after doing so, it is because SMPlayer is keeping settings for that specific file. Deleting the settings for all the files that SMPlayer is keeping will solve this problem:
 +
$ rm -rf ~/.config/smplayer/file_settings
  
  $ rm -rf ~/.config/smplayer/file_settings
+
=== SMPlayer: fail to resume playback after pause ===
  
=== SMPlayer fails to resume playback after pause ===
+
SMPlayer might stop playing a video after pausing it if your audio output driver is incorrectly set. You can fix this by specifically setting your audio driver. For example, if you use PulseAudio, this can be done by starting MPlayer with the {{ic|-ao pulse}} argument or by adding
 +
the following to your {{ic|~/.mplayer/config}} file:
 +
ao=pulse
  
SMPlayer might stop playing a video after pausing it if your audio output driver is set wrong. If PulseAudio is used start mplayer with the "-ao pulse" argument or edit your {{Ic|~/.mplayer/config}} file and add
+
You can also change this from SMPlayer by going to ''Options > Preferences > General > Audio'' and setting the ''Output Driver'' option to '''pulse'''.
  
  ao=pulse
+
=== SMPlayer: no video when using transparency in GNOME ===
  
In SMPlayer you have to change your "Output-driver" under "General" - "Audio" in the options.
+
This problem may arise under GNOME when using Compiz to provide transparency: SMPlayer starts with a transparent screen with audio playing, but no video. To fix this, create (as root) a file with the contents:
 
+
{{hc|/usr/bin/smplayer.helper|<nowiki>
===Transparent SMPlayer in Gnome with Composite enabled===
+
export XLIB_SKIP_ARGB_VISUALS=1
 
+
exec smplayer.real "$@"</nowiki>
Have you noticed the transparent screen of smplayer when you are using compiz and maybe cairo-dock? Well it's ridiculous that when you open your videos using SMplayer you can just hear audio and no video! Here's how you fix this: [copy paste into terminal]
+
}}
  
    sudo bash -c "cat > /usr/bin/smplayer.helper" <<EOF
+
Then do the following:
    export XLIB_SKIP_ARGB_VISUALS=1
+
# chmod 755 /usr/bin/smplayer.helper
    exec smplayer.real "$@"
+
# mv /usr/bin/smplayer{,.real}
    EOF
+
# ln -sf smplayer.helper /usr/bin/smplayer
    sudo chmod 755 /usr/bin/smplayer.helper
+
    sudo mv /usr/bin/smplayer{,.real}
+
    sudo ln -sf smplayer.helper /usr/bin/smplayer
+
  
If you don't use sudo then just use "su" to login as root and do the above!
+
=== SMPlayer: OSD font too big / subtitle text too small ===
  
===Watching streamed video===
+
Since SMPlayer 0.8.2.1 (with MPlayer2 20121128-1), the ratio of the subtitle font to the OSD font is very strange. This can result in the OSD text filling the whole screen while the subtitles are very small and unreadable. This problem can be solved by adding:
If you want to play a video stream (e.g *.asx link) use:
+
-subfont-osd-scale 2
 +
or to the extra options passed to MPlayer from SMPlayer. These options are found in ''Options > Preferences > Advanced > Options for MPlayer''. This can also be achieved by adding the following line to {{ic|~/.mplayer/config}}:
 +
subfont-osd-scale=2
  
$ mplayer -playlist link-to-stream.asx
+
=== Watching streamed video ===
  
To play the stream, as these are playlists of streams and won't be playable by omitting the -playlist option.
+
If you want to play a video stream (e.g an {{ic|ASX}} link) use:
 +
$ mplayer -playlist link-to-stream.asx
 +
The {{ic|-playlist}} option is necessary because these streams are actually playlists and cannot be played without it.
  
===Play mplayer with dvdnav support===
+
=== MPlayer with DVDNav support ===
If you want to use mplayer with dvdnav support to enable the menus of a dvd then use the following syntax:
+
  
 +
If you want to use MPlayer with DVDNav (to enable the menus on DVDs), start it with the following options:
 
  $ mplayer -nocache dvdnav://
 
  $ mplayer -nocache dvdnav://
  
===Seek forward/backward in a downloading file===
+
=== MPlayer with JACK support ===
If you want to be able to seek forward and backward in a video file which is still downloading whilst watching it, add the following to your config file.
+
  
  idx=yes
+
To have MPlayer audio output directed to [[JACK]] as its default behavior, edit {{ic|~/.mplayer/config}} and add:
 +
  ao=jack
  
===Increase the total volume===
+
If you don't have JACK running all the time, you can have MPlayer output to JACK on an as-needed basis by invoking MPlayer from the command line as such:
If the maximal volume provided by the sound settings is not loud enough, you can increase the volume by mplayer itself. Activate softvol and set a maximal level which has to range between 10 and 10000.
+
$ mplayer -ao jack [path/to/file]
 
+
softvol=1
+
softvol-max=600
+
 
+
===Stream mplayer audio to jackd===
+
 
+
To have mplayer audio output directed to [[JACK]] as its default behavior, edit {{ic|~/.mplayer/config}} and add:
+
 
+
ao=jack
+
 
+
If you don't have JACK running all the time, you can have MPlayer output to JACK on an as-needed basis by invoking MPlayer from the command line as such:  
+
 
+
{{ic|$ mplayer -ao jack [path]/filename}}
+
  
 
=== MPlayer fails to open files with spaces ===
 
=== MPlayer fails to open files with spaces ===
  
If you try to open a file with spaces (The Movie) and mplayer fails. Saying that it could not open the file (file:///The%20Movie), where all spaces are converted to %20.  
+
MPlayer can fail to open a file with spaces (e.g. 'The Movie') by saying that it could not open the file {{ic|file:///The%20Movie}} (where all spaces are converted to {{ic|%20}}). This can be fixed by editing {{ic|/usr/share/applications/mplayer.desktop}} to changing the following line from:
 
+
Then edit {{ic|/usr/share/applications/mplayer.desktop}} to change the following line from:
+
+
 
  Exec=mplayer %U
 
  Exec=mplayer %U
 
 
To:
 
To:
 +
Exec=mplayer "%F"
  
Exec=mplayer "%F"
+
If you use a frontend/GUI for MPlayer, enter its name in {{ic|<nowiki>Exec=gui_name "%F"</nowiki>}}.
  
If you have a frontend/GUI enter GUI name in Exec=gui_name "%F".
+
== See also ==
  
==External links==
 
 
* [http://www.mplayerhq.hu/ Official MPlayer website]
 
* [http://www.mplayerhq.hu/ Official MPlayer website]
* [http://www.keyxl.com/aaa2fa5/302/MPlayer-keyboard-shortcuts.htm List of shortcut keys]
+
* [http://www.mplayer2.org/ Official MPlayer2 website]
 +
* [http://wiki.multimedia.cx/index.php?title=MPlayer_FAQ MPlayer FAQ]
 +
* [https://www.youtube.com/watch?v=n4Ul_A0VBVI MPlayer notes]
 +
* [https://help.ubuntu.com/community/MPlayerTips MPlayer tips]
 +
* [http://how-to.wikia.com/wiki/How_to_configure_MPlayer How to configure MPlayer]

Revision as of 20:36, 21 July 2013

MPlayer is a popular movie player for GNU/Linux. It has support for pretty much every video and audio format out there and is hence very versatile, even though most people use it for viewing videos.

Installation

Various flavours of MPlayer can be installed from the official repositories or from the AUR:

Notable variants are:

  • mplayer-vaapi - VAAPI-enabled version.
  • mplayer-svnAUR - Development version.
  • mplayer2 - Fork of MPlayer. with few enhancements.
  • mplayer2-gitAUR - Development version of MPlayer2.
  • mpv-gitAUR - MPlayer/MPlayer2 fork with some changes. It is focused on speed and quality of development, though this breaks compatibility with old hardware and software.
Note: mpv is not meant to be a drop-in replacement. Be aware of its differences if you want to use it.

Additional installation tips

Frontends/GUIs

  • Deepin Media Player — Rich GTK2/Python interface for the Deepin desktop.
http://www.linuxdeepin.com/ || deepin-media-playerAUR
  • GNOME MPlayer — Simple GTK+-based GUI for MPlayer.
http://kdekorte.googlepages.com/gnomemplayer || gnome-mplayer
  • KMPlayer — Video player plugin for Konqueror and basic MPlayer/Xine/ffmpeg/ffserver/VDR frontend for KDE.
http://kmplayer.kde.org/ || kmplayerAUR
  • Pymp — PyGTK frontend for MPlayer.
http://jdolan.dyndns.org/trac/wiki/Pymp || pympAUR
  • Rosa Media Player — Multimedia player based on SMPlayer with clean and elegant UI.
http://www.rosalab.com/ || rosa-media-playerAUR
  • SMPlayer — Middleweight Qt front-end for MPlayer with additional patches.
http://smplayer.sourceforge.net/ || smplayer
  • UMPlayer — SMPlayer fork with extra features (CSS themes, YouTube integration, ShoutCast support, etc.).
http://www.umplayer.com/ || umplayerAUR
  • Xt7-Player — Graphical user interface for MPlayer written in Gambas, with a huge list of features.
http://xt7-player.sourceforge.net/xt7forum/ || xt7-playerAUR

Browser integration

If you want to let MPlayer control video viewing in your favorite web browser, install one of the following plugins for your browser.

Firefox

A browser plugin is available in the official repositories with the gecko-mediaplayer package.

Note: It depends on gnome-mplayer, which provides a complete frontend to MPlayer.

Konqueror

A plugin for Konqueror can be found in the AUR with the kmplayerAUR package.

Note: kmplayerAUR also provides a complete frontend to MPlayer.

Chromium

The gecko-mediaplayer plugin for Firefox also works in Chromium.

Usage

Configuration

System-wide configuration is located in /etc/mplayer/mplayer.conf, whereas the user-local settings are stored in ~/.mplayer/config. The file /etc/mplayer/example.conf is a good starting point.

An example configuration:

/etc/mplayer/example.conf
# default configuration that applies to every file
[default]

# use X11 for video output, use a framebuffer as fallback
vo=xv,directfb

# use alsa for audio output, choose oss4 as fallback
ao=alsa,oss

# multithreaded decoding of H264/MPEG-1/2 (valid: 1-8)
lavdopts=threads=2

# prefer using six channels audio
channels = 6

# scale the subtitles to the 3% of the screen size
subfont-text-scale = 3

# never use font config
nofontconfig = 1

# set the window title using the media filename, when not set with --title.
use-filename-title=yes

# add black borders so the movies have the same aspect ratio of the monitor
# for wide screen monitors
vf-add=expand=::::1:16/9:16

# for non wide screen traditional monitors
#vf-add=expand=::::1:4/3:16

# disable screensaver
heartbeat-cmd="xscreensaver-command -deactivate &" # stop xscreensaver
stop-xscreensaver="yes" # stop gnome-screensaver

# correct pitch when speed is faster or slower than 1.0
af=scaletempo

# allow to seek in a file which is still downloading whilst watching it
idx=yes

# allow to increase the maximal volume
#softvol=1
#softvol-max=600

# skip displaying some frames to maintain A/V sync on slow systems
framedrop=yes

# more intense frame dropping (breaks decoding)
#hardframedrop=yes

# profile for up-mixing two channels audio to six channels
# use -profile 2chto6ch to activate
[2chto6ch]
af-add=pan=6:1:0:.4:0:.6:2:0:1:0:.4:.6:2

# profile to down-mixing six channels audio to two channels
# use -profile 6chto2ch to activate
[6chto2ch]
af-add=pan=2:0.7:0:0:0.7:0.5:0:0:0.5:0.6:0.6:0:0

Key bindings

System key bindings are configured via /etc/mplayer/input.conf. Personal key bindings are stored in ~/.mplayer/input.conf. This is a list of some basic default MPlayer keys. For a complete list of keyboard shortcuts look at man mplayer.

Key Description
p Toggle pause/play.
Space Toggle pause/play.
Backspace Return to menu when using dvdnav.
Seek backward ten seconds.
Seek forward ten seconds.
Seek backward one minute.
Seek forward one minute.
< Go back in the playlist.
> Go forward in the playlist.
m Mute the sound.
0 Volume up.
9 Volume down.
f Toggle fullscreen mode.
o Toggle OSD state.
v Toggle subtitle visibility.
I Show filename.
1, 2 Adjust contrast.
3, 4 Adjust brightness.
j Cycle through the available subtitles.
# Cycle through the available audio tracks.

Tips and tricks

Automatic resuming from where you left off

To get this behavior, you can install the mplayer-resumerAUR package from the AUR. The package contains a Perl wrapper script for MPlayer which will allow you to autoresume playback from the point it was last stopped.

To use it, simply call the wrapper script in place of MPlayer:

$ mplayer-resumer options path/to/file

If this script is restarted within a short amount of time after closing MPayer (default 5 seconds) then it will delete the file used to keep track of the videos resume position, effectively starting the video from the beginning.

If the video file to be played is on a read-only filesystem, or otherwise lives in a location that cannot be written to, resume will fail. This is because the current implementation uses a file parallel to the video file to store the timecode.

Enabling VDPAU

For a complete list of nVidia VDPAU capable hardware, see this table. Ensure the nvidia driver is installed and consider one of the following two methods to automatically enable VDPAU for playback.

For Intel/AMD, you can use libvdpau-va-glAUR — VAAPI backend for VDPAU. For AMD you should also install xvba-videoAUR. To use it, add:

#!/bin/sh
export VDPAU_DRIVER=va_gl

to /etc/profile.d/vdpau_vaapi.sh, make it executable:

# chmod +x /etc/profile.d/vdpau_vaapi.sh

and reboot or relogin.

Using a configuration file

Append the following to either the system-wide (/etc/mplayer/mplayer.conf) or user-specific (~/.mplayer/config) configuration files:

vo=vdpau,
vc=ffh264vdpau,ffmpeg12vdpau,ffodivxvdpau,ffwmv3vdpau,ffvc1vdpau,
Note: The trailing commas are important! They tell MPlayer to fall back on other drivers and codecs should the specified ones not be found.
Warning: The ffodivxvdpau codec is only supported by the most recent series of NVIDIA hardware. Consider omitting it based on your specific hardware. See the NVIDIA page for more information.

Using a wrapper script

The AUR contains a trivial Bash script called mplayer-vdpau-autoAUR that detects which video codec to use and when to use VDPAU as the video output.

Another simple wrapper is mplayer-vdpau-shell-gitAUR, which can recover from a VDPAU FATAL error. This wrapper uses the "-include" option to include a VDPAU configuration, so it will ignore any VDPAU specific settings in your ~/.mplayer/config file.

Translucent video with Radeon cards and Composite enabled

To get translucent video output in X you have to enable textured video in MPlayer:

$ mplayer -vo xv:adaptor=1 file

Or add the following line to ~/.mplayer/config:

vo=xv:adaptor=1

You can use xvinfo to check which video modes your graphic card supports.

SMPlayer: No video issue

SMPlayer may have trouble opening some MP4 (and probably FLV) videos. If it plays only audio without any video, a possible fix is to add the following lines to your ~/.mplayer/config file:

 [extension.mp4]
 demuxer=mov

If problem persists after doing so, it is because SMPlayer is keeping settings for that specific file. Deleting the settings for all the files that SMPlayer is keeping will solve this problem:

$ rm -rf ~/.config/smplayer/file_settings

SMPlayer: fail to resume playback after pause

SMPlayer might stop playing a video after pausing it if your audio output driver is incorrectly set. You can fix this by specifically setting your audio driver. For example, if you use PulseAudio, this can be done by starting MPlayer with the -ao pulse argument or by adding the following to your ~/.mplayer/config file:

ao=pulse

You can also change this from SMPlayer by going to Options > Preferences > General > Audio and setting the Output Driver option to pulse.

SMPlayer: no video when using transparency in GNOME

This problem may arise under GNOME when using Compiz to provide transparency: SMPlayer starts with a transparent screen with audio playing, but no video. To fix this, create (as root) a file with the contents:

/usr/bin/smplayer.helper
export XLIB_SKIP_ARGB_VISUALS=1
exec smplayer.real "$@"

Then do the following:

# chmod 755 /usr/bin/smplayer.helper
# mv /usr/bin/smplayer{,.real}
# ln -sf smplayer.helper /usr/bin/smplayer

SMPlayer: OSD font too big / subtitle text too small

Since SMPlayer 0.8.2.1 (with MPlayer2 20121128-1), the ratio of the subtitle font to the OSD font is very strange. This can result in the OSD text filling the whole screen while the subtitles are very small and unreadable. This problem can be solved by adding:

-subfont-osd-scale 2

or to the extra options passed to MPlayer from SMPlayer. These options are found in Options > Preferences > Advanced > Options for MPlayer. This can also be achieved by adding the following line to ~/.mplayer/config:

subfont-osd-scale=2

Watching streamed video

If you want to play a video stream (e.g an ASX link) use:

$ mplayer -playlist link-to-stream.asx

The -playlist option is necessary because these streams are actually playlists and cannot be played without it.

MPlayer with DVDNav support

If you want to use MPlayer with DVDNav (to enable the menus on DVDs), start it with the following options:

$ mplayer -nocache dvdnav://

MPlayer with JACK support

To have MPlayer audio output directed to JACK as its default behavior, edit ~/.mplayer/config and add:

ao=jack

If you don't have JACK running all the time, you can have MPlayer output to JACK on an as-needed basis by invoking MPlayer from the command line as such:

$ mplayer -ao jack [path/to/file]

MPlayer fails to open files with spaces

MPlayer can fail to open a file with spaces (e.g. 'The Movie') by saying that it could not open the file file:///The%20Movie (where all spaces are converted to %20). This can be fixed by editing /usr/share/applications/mplayer.desktop to changing the following line from:

Exec=mplayer %U

To:

Exec=mplayer "%F"

If you use a frontend/GUI for MPlayer, enter its name in Exec=gui_name "%F".

See also