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}}.

−

:This is a list of the most basic MPlayer keys. For a complete list of keyboard shortcuts look at {{ic|man mplayer}}.

{|

{|

Line 170:

Line 176:

== Tips and Tricks ==

== Tips and Tricks ==

−

===Automatic Resuming Where You Left Off===

+

=== Automatic resuming from where you left off ===

−

+

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.

−

The [[AUR]] contains an elegant perl wrapper-script which will allow autoresuming from the point at which playback was stopped {{AUR|mplayer-resumer}}.

−

−

Usage is trivial: simply call the wrapper-script in place of mplayer.

−

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.

−

−

'''RATIONALE'''

−

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.

+

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

+

$ mplayer-resumer [options] [path/to/file]

−

'''DESIGN LIMITATION'''

+

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.

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 (modern Nvidia cards only)===

+

=== Enabling VDPAU (for modern NVIDIA cards only) ===

−

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 {{Pkg|nvidia}} driver is installed and consider one of the following two methods to automatically enable VDPAU for playback.

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 {{Pkg|nvidia}} driver is installed and consider one of the following two methods to automatically enable VDPAU for playback.

−

==== 1. Using a conf file ====

+

==== Using a configuration file ====

−

Append the following to either the system-wide ({{ic|/etc/mplayer/mplayer.conf}}) or user-specific ({{ic|~/.mplayer/config}}) 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 video codec to use and when to use VDPAU as the video output.

−

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.

+

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.

−

===Translucent Video with radeon and Composite enabled===

+

=== Translucent video with Radeon cards and Composite enabled ===

−

+

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

−

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

+

$ mplayer -vo xv:adaptor=1 <file>

−

−

$ 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:

−

Open your {{Ic|~/.mplayer/config}} file and add

+

=== SMPlayer: No video issue ===

+

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 fails to resume playback after pause ===

+

=== 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 {{ic|-ao pulse}} argument or by adding

−

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

+

the following to your {{ic|~/.mplayer/config}} file:

−

ao=pulse

ao=pulse

−

In SMPlayer you have to change your "Output-driver" under "General" - "Audio" in the options.

+

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

−

===Transparent SMPlayer in Gnome with Composite enabled===

+

=== 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:

−

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]

+

{{hc|/usr/bin/smplayer.helper|<nowiki>

+

export XLIB_SKIP_ARGB_VISUALS=1

+

exec smplayer.real "$@"</nowiki>

+

}}

−

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 ===

+

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 {{ic|~/.mplayer/config}}:

+

subfont-osd-scale=2

−

===Watching streamed video===

+

=== Watching streamed video ===

−

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

+

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

−

+

$ mplayer -playlist link-to-stream.asx

−

$ mplayer -playlist link-to-stream.asx

+

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

−

−

To play the stream, as these are playlists of streams and won't be playable by omitting the -playlist option.

−

−

===Play 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:

+

=== 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 -nocache dvdnav://

−

===Seek forward/backward in a downloading file===

+

=== Seek in a downloading file ===

−

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.

+

If you want to be able to seek in a video file which is still downloading whilst watching it, add the following to your {{ic|~/.mplayer/config}} file:

−

idx=yes

idx=yes

−

===Increase the total volume===

+

=== Increase the total volume ===

−

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.

+

If the maximal volume provided by the sound settings is not loud enough, you can increase the volume from MPlayer itself. To do this, you have to activate {{ic|softvol}} and set a maximal level (with a range between 10 and 10000). This can be achieved by adding the following to your {{ic|~/.mplayer/config}} file:

−

softvol=1

softvol=1

softvol-max=600

softvol-max=600

−

===Stream mplayer audio to jackd===

+

=== MPlayer with JACK support ===

−

+

To have MPlayer audio output directed to [[JACK]] as its default behavior, edit {{ic|~/.mplayer/config}} and add:

−

To have mplayer audio output directed to [[JACK]] as its default behavior, edit {{ic|~/.mplayer/config}} and add:

+

ao=jack

−

−

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:

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]

−

{{ic|$ mplayer -ao jack [path]/filename}}

=== MPlayer fails to open files with spaces ===

=== 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 {{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:

−

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.

−

−

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 have a frontend/GUI enter GUI name in Exec=gui_name "%F".

+

If you use a frontend/GUI for MPlayer, enter its name in {{ic|<nowiki>Exec=gui_name "%F"</nowiki>}}.

* [http://how-to.wikia.com/wiki/How_to_configure_MPlayer How to configure MPlayer]

Revision as of 21:15, 6 March 2013

zh-CN:MPlayerMPlayer 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.

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.

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 modern NVIDIA cards only)

For a complete list of 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.

Using a configuration file

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

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:

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://

Seek in a downloading file

If you want to be able to seek in a video file which is still downloading whilst watching it, add the following to your ~/.mplayer/config file:

idx=yes

Increase the total volume

If the maximal volume provided by the sound settings is not loud enough, you can increase the volume from MPlayer itself. To do this, you have to activate softvol and set a maximal level (with a range between 10 and 10000). This can be achieved by adding the following to your ~/.mplayer/config file:

softvol=1
softvol-max=600

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".