Difference between revisions of "MPlayer"

From ArchWiki
Jump to: navigation, search
(Usage)
m (codeline -> ic)
Line 205: Line 205:
  
 
Smplayer may have trouble opening mp4 (and probably flv) videos. If it plays only audio without video here is the fix:
 
Smplayer may have trouble opening mp4 (and probably flv) videos. If it plays only audio without video here is the fix:
Open your {{Codeline|~/.mplayer/config}} file and add
+
Open your {{Ic|~/.mplayer/config}} file and add
  
 
   [extension.mp4]
 
   [extension.mp4]
Line 216: Line 216:
 
=== (S)mplayer fails to resume playback after pause ===
 
=== (S)mplayer fails to resume playback after pause ===
  
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 {{Codeline|~/.mplayer/config}} file and add
+
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
  
 
   ao=pulse
 
   ao=pulse

Revision as of 16:47, 11 December 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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

The Template:Package Official package is available in [extra]:

# pacman -S mplayer

Alternatively, the latest development version can be install from the AUR (Template:Package AUR).

You may also want to try mplayer2, a fork of mplayer:

# pacman -S mplayer2

mplayer2 has several improvements over mplayer. see mplayer2 vs mplayer

Additional installation tips

Frontends/GUIs

There are several GUIs for MPlayer.

  • Qt: Template:Package Official is in the extra repository. The smplayer-themes package provides themes for it.
  • Gtk+: Template:Package AUR and Template:Package Official are in the AUR and community repos, respectively.
  • gmplayer: this gui is no longer included in the mplayer package. There is an alternative mplayer package (mplayer-x) in AUR in which the gmplayer gui is enabled.

Browser integration

If you want to let MPlayer control video viewing in your favorite web browser, install the following:

Firefox

# pacman -S gecko-mediaplayer
Note: Depends on gnome-mplayer, which provides a complete frontend to MPlayer.

Konqueror

# pacman -S kmplayer
Note: Also provides a complete frontend to MPlayer.

Usage

Configuration

System-wide configuration is located in Template:Filename, whereas the user-local settings are stored in Template:Filename. The file Template:Filename is a good starting point.

An example configuration:

Template:File

Keybindings

This is a list of the most basic MPlayer keys.
Key Description
p Toggle pause/play.
Space Toggle pause/play.
Backspace Return to menu when using dvdnav.
Left Seek backward ten seconds.
Right Seek forward ten seconds.
Down Seek backward one minute.
Up 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.
j 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 Where You Left Off

The AUR contains an elegant perl wrapper-script which will allow autoresuming from the point at which playback was stopped Template:Package AUR.

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.

DESIGN LIMITATION

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)

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.

1. Using a conf file

Append the following to either the system-wide or user-specific config files

vo=vdpau,
vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivxvdpau,
Note: The trailing commas are important!
Warning: The ffodivxvdpau is only supported by the most recent series of nVidia hardware. Consider omitting it based on your specific hardware.

2. Using a wrapper script

The AUR contains a trivial bash script called Template:Package AUR that detects which vc to use and when to use vo=vdpau.

Translucent Video with radeon 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 Template:Filename:

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 mp4 (and probably flv) videos. If it plays only audio without video here is the fix: Open your ~/.mplayer/config file and add

 [extension.mp4]
 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.

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

(S)mplayer fails to resume playback after pause

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 ~/.mplayer/config file and add

 ao=pulse

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

Transparent SMPlayer in Gnome with Composite enabled

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
   export XLIB_SKIP_ARGB_VISUALS=1
   exec smplayer.real "$@"
   EOF
   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!

Watching streamed video

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

$ mplayer -playlist link-to-stream.asx 

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

Seek forward/backward 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.

idx=yes

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.

softvol=1
softvol-max=600

Stream mplayer audio to jackd

Edit Template:Filename and add:

ao=jack

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.

Then edit Template:Filename to change the following line from:

Exec=mplayer %U

To:

Exec=mplayer "%F"

If you got frontend/GUI enter GUI name in Exec=gui_name "%F".

External links