Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Package:Mpv"

From Funtoo
Jump to navigation Jump to search
(Corrected some typos, updated the config file paths to reflect the changes made to mpv.)
(Added more information regarding usage and configuration.)
Line 2: Line 2:
|Summary=Video player based on MPlayer/mplayer2.
|Summary=Video player based on MPlayer/mplayer2.
|CatPkg=media-video/mpv
|CatPkg=media-video/mpv
|Maintainer=Oleg  
|Maintainer=Oleg
|Homepage=http://mpv.io/
|Homepage=http://mpv.io/
}}
}}
mpv is a fork of mplayer2, to learn more about the differences take a look at their [https://github.com/mpv-player/mpv/blob/master/DOCS/man/changes.rst docs].
mpv is a simple and lightweight media player for video and audio. As a fork of mplayer2, it shares some features while introducing others. To learn more about the differences take a look at their [https://github.com/mpv-player/mpv/blob/master/DOCS/man/changes.rst docs].
Currently there is the version 0.11 available in Funtoo.
 
Due to it's high flexibility and configurability, mpv is great for media center usage, lightweight systems or just users who know what they want in a media player. For a more out-of-the-box solution, several alternatives like {{Package|media-video/vlc}} or {{Package|media-video/totem}} are recommended.
 
{{fancynote|Read the [https://github.com/mpv-player/mpv/wiki/FFmpeg-versus-Libav mpv wiki] to understand ffmpeg vs libav especially in regard to mpv.
{{fancynote|Read the [https://github.com/mpv-player/mpv/wiki/FFmpeg-versus-Libav mpv wiki] to understand ffmpeg vs libav especially in regard to mpv.
If you are interested you  might even read the article [http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html The FFmpeg/Libav situation] }}
If you are interested you  might even read the article [http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html The FFmpeg/Libav situation] }}
==Installation==
==Installation==
<console>
<console>
###i## emerge media-video/mpv
###i## emerge media-video/mpv
</console>
==Usage==
mpv does not ship with a graphical user interface (besides the video display). The easiest way to play a video is:
<console>
###i## mpv /path/to/video/file
</console>
</console>
==General configuration==
Since this is not very comfortable, you can of course set mpv as the default application for video playback. Depending on your environment you can use either the configuration tools provided by your desktop environment/file manager; for more info, see [https://wiki.archlinux.org/index.php/Default_applications].
mpv does not come with a graphical user interface (besides the video display). All settings are placed in a config file, a short example is provided below:
 
===Controls===
Because there are no gui elements, keyboard shortcuts are used to control mpv. The following table provides the most important one; check the manpage ({{c|man mpv}}) for more.
 
{{TableStart}}
<tr class="info"><th>Command</th><th>Shortcut</th></tr>
<tr><td>Play/Pause</td><td>Space or p</td></tr>
<tr><td>Increase/Decrease volume</td><td>/ and * or 9 and 0</td></tr>
<tr><td>Quit</td><td>q</td></tr>
<tr><td>Cycle through the available audio tracks</td><td>#</td></tr>
<tr><td>Show OSD</td><td>o</td></tr>
{{TableEnd}}
 
You may change all of these bindings (and more) to your custom using the config file.
 
==Configuration==
Even though mpv works fine without a config file, the configuration options allow to adjust a lot of settings.
A short example is provided below:
{{File|name=~/.config/mpv/mpv.conf|body=
{{File|name=~/.config/mpv/mpv.conf|body=
# Save the video position on quit
# Save the video position on quit
Line 25: Line 49:
vo=opengl
vo=opengl
}}
}}
The config file is completely optional, but mpv is highly customizable. It is suggested that you  take a look at the man page:
All possible options are listed in the man page:
<console>
<console>
###i##  man mpv
###i##  man mpv
</console>
</console>
==Input configuration==
===Keybindings===
You may create a separate file called ''input.conf'' for customizing the shortcuts for mpv. The example below binds the key "n" to skip to the next video in the current playlist and the key "p" to skip to the previous video:
You may create a separate file called ''input.conf'' for customizing the shortcuts for mpv. The example below binds the key "n" to skip to the next video in the current playlist and the key "p" to skip to the previous video:
{{File|name=~/.config/mpv/input.conf|body=
{{File|name=~/.config/mpv/input.conf|body=
Line 36: Line 60:
}}
}}
The man page provides information about all possible bindings.
The man page provides information about all possible bindings.
==Twitch/Youtube playback==
mpv is capable of playing ''twitch.tv''/''youtube'' streams and videos. To enable this, install {{Package|net-misc/youtube-dl}} and enable the ''lua'' useflag on media-video/mpv.
<console>
###i## emerge -a net-misc/youtube-dl
###i## echo "media-video/mpv lua" >> /etc/portage/package.use
</console>
After everything is set up, use the ''--ytdl'' parameter for youtube and twitch playback:
<console>
###i## mpv --ytdl [url]
</console>
{{EbuildFooter}}
{{EbuildFooter}}

Revision as of 18:51, January 7, 2016

Mpv

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

mpv is a simple and lightweight media player for video and audio. As a fork of mplayer2, it shares some features while introducing others. To learn more about the differences take a look at their docs.

Due to it's high flexibility and configurability, mpv is great for media center usage, lightweight systems or just users who know what they want in a media player. For a more out-of-the-box solution, several alternatives like No results or No results are recommended.

   Note

Read the mpv wiki to understand ffmpeg vs libav especially in regard to mpv. If you are interested you might even read the article The FFmpeg/Libav situation

Installation

root # emerge media-video/mpv

Usage

mpv does not ship with a graphical user interface (besides the video display). The easiest way to play a video is:

root # mpv /path/to/video/file

Since this is not very comfortable, you can of course set mpv as the default application for video playback. Depending on your environment you can use either the configuration tools provided by your desktop environment/file manager; for more info, see [1].

Controls

Because there are no gui elements, keyboard shortcuts are used to control mpv. The following table provides the most important one; check the manpage (man mpv) for more.

CommandShortcut
Play/PauseSpace or p
Increase/Decrease volume/ and * or 9 and 0
Quitq
Cycle through the available audio tracks#
Show OSDo

You may change all of these bindings (and more) to your custom using the config file.

Configuration

Even though mpv works fine without a config file, the configuration options allow to adjust a lot of settings. A short example is provided below:

   ~/.config/mpv/mpv.conf
# Save the video position on quit
save-position-on-quit

# Use the vdpau driver for hardware decoding (for nvidia cards)
hwdec=vdpau

# Video output driver. A list can be displayed via: mpv -vo=help
vo=opengl

All possible options are listed in the man page:

root #  man mpv

Keybindings

You may create a separate file called input.conf for customizing the shortcuts for mpv. The example below binds the key "n" to skip to the next video in the current playlist and the key "p" to skip to the previous video:

   ~/.config/mpv/input.conf
n playlist_next
p playlist_prev

The man page provides information about all possible bindings.

Twitch/Youtube playback

mpv is capable of playing twitch.tv/youtube streams and videos. To enable this, install No results and enable the lua useflag on media-video/mpv.

root # emerge -a net-misc/youtube-dl
root # echo "media-video/mpv lua" >> /etc/portage/package.use

After everything is set up, use the --ytdl parameter for youtube and twitch playback:

root # mpv --ytdl [url]