Say Hello to MPV

If a normal user who his/her needs are listening music, browsing web, watching video and etc start using GNU/Linux, he or she will be certainly satisfied with this OS. Something which is important for a newbie GNU/Linux user is multimedia and in GNU/Linux world we have lot of players which the user will choose one and start watching movies and etc.

main

In this post we gonna talk about MPV that is forked from Mplayer and Mplayer2 and it can support almost all subtitle and video codecs types.

Installing MPV:
For installing MPV on your Debian-based GBU/Linux use following command in terminal :

sudo apt install mpv

For installing MPV on Arch Linux/Manjaro and Arch-based distribution :

sudo pacman -S mpv

Configure MPV:

MPV settings are being controlled by these three file :

mpv.conf

input.conf

lua-settings/osc.conf

For more information about these file check the links below:

mpv.conf

osc

input

The recommended configuration for mpv.conf file:

--hwdec=vaapi
--video-aspect='16:9'
--save-position-on-quit
--sub-text-font='Droid Naskh Shift Alt'
--sub-text-color='#ffff00'
--sub-scale-with-window='yes'
--secondary-sid='auto'
--geometry='50%:50%'
--autofit-larger='70%x70%'
--sub-codepage=utf8:cp1256

  MPV usage:

Open a terminal and use mpv command:

mpv video.mp4

For more information to how use MPV in terminal use following command:

man mpv

CLI Shell is really good however thousands of people can’t work with CLI so we need good graphical interfaces on MPV to control it.

Test VA-API:

For testing VA-API we play a video in two different ways and then we check CPU usage together, I got a Lenovo G-500 laptop and we test videos on that which here you can see the informations about my Laptop:

CPU Model name:Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz
VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
Mem:3.7G

Look at the video informations:

General
Complete name                            : bbb_sunflower_2160p_60fps_normal.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/avc1)
File size                                : 642 MiB
Duration                                 : 10mn 34s
Overall bit rate                         : 8 488 Kbps
Movie name                               : Big Buck Bunny, Sunflower version
Performer                                : Blender Foundation 2008, Janus Bager Kristensen 2013
Composer                                 : Sacha Goedegebure
Genre                                    : Animation
Encoded date                             : UTC 2013-12-17 16:40:26
Tagged date                              : UTC 2013-12-17 16:40:26
Comment                                  : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
©com                                     : Jan Morgenstern

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 10mn 34s
Bit rate                                 : 8 000 Kbps
Maximum bit rate                         : 35.1 Mbps
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 60.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.016
Stream size                              : 605 MiB (94%)
Writing library                          : x264 core 120
Encoding settings                        : cabac=1 / ref=4 / deblock=1:1:1 / analyse=0x3:0x133 / me=tesa / subme=11 / psy=1 / psy_rd=0.40:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=16 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=8000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:0.60
Encoded date                             : UTC 2013-12-17 16:40:26
Tagged date                              : UTC 2013-12-17 16:40:29

Audio #1
ID                                       : 2
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Codec ID                                 : 6B
Duration                                 : 10mn 34s
Bit rate mode                            : Constant
Bit rate                                 : 160 Kbps
Maximum bit rate                         : 165 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 12.1 MiB (2%)
Writing library                          : LAME3.99r
Encoding settings                        : -m j -V 4 -q 3 -lowpass 17.5 -b 160
Encoded date                             : UTC 2013-12-17 16:40:28
Tagged date                              : UTC 2013-12-17 16:40:29

Audio #2
ID                                       : 3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : ac-3
Duration                                 : 10mn 34s
Bit rate mode                            : Constant
Bit rate                                 : 320 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 spf)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 24.2 MiB (4%)
Encoded date                             : UTC 2013-12-17 16:40:28
Tagged date                              : UTC 2013-12-17 16:40:29

When VA-API is activate:

mpv-vaapi-1024x576

When VA-API is disable:

mpv-without-vaapi-1024x576

Now is time to install GUI for MPV, here you can see a list of front-end for MPV:

  1. Baka MPlayer
  2. Bomi
  3. GNOME MPV
  4. SMPlayer
  5. Xt7-player-mpv

 

Baka MPlayer

baka-mplayer

Baka Mplayer is QT-based player, for compiling this application from source code first install the list of following dependencies:

  • gcc
  • pkgconfig
  • libmpv (or compile mpv with libmpv support)
  • youtubedl (optional, for streaming youtube videos)
  • qt5base
  • qt5qmake
  • qt5tools
  • qt5declarative
  • qt5svg
  • qt5network
  • qt5x11extras
After installing the dependencies use commands below:
git clone -b release https://github.com/u8sand/Baka-MPlayer.git
cd "Baka-MPlayer"
./configure CONFIG+=install_translations
make -j `grep -c ^processor /proc/cpuinfo`
sudo make install

But there is more simple way to get this video player if you use Arch Linux use command below:

sudo pacman -S baka-mplayer

Some abilities in Baka Mplayer:

  • Gesture seeking.
  • Smart playlist.
  • Dim Desktop.
  • Hardware accelerated playback (vdpau, vaapi, vda).
  • Youtube playback support (and others).
  • Multilingual support (we are looking for translators!).
  • And more…

Bomi bomi

For installing this video player on Arch Linux use this command:

yaourt -S bomi

If you use Debian-Based distributions use following commands:

sudo add-apt-repository ppa:darklin20/bomi
sudo apt-get update
sudo apt-get install bomi

If you use other distributions see here.
Bomi abilities:

  • Playback
  • Various media files and DVD
  • Multi-chapter files (mkv)
  • Playback speed
  • A-B repeat specified by time
  • A-B repeat specified by subtitle
  • Playback history
  • Playlist support
  • Resume playback
  • Hardware-accelerated decoding
  • Accurate seeking
  • Tri-level steps for seeking
  • Seeking by subtitle
  • Image slide show

GNOME MPV

Gnom-mpv

Gnome MPV is a simple GUI based on GTK for MPV, for install this video player from source code first install following packages:

  • appstream-glib (build)
  • autotools (build)
  • autoconf-archive (build)
  • pkg-config (build)
  • gcc (build)
  • intltool (build)
  • python2 (build)
  • glib2
  • gtk3
  • libmpv
  • youtube-dl (optional)

Now download this zip and extract it in $HOME then use following command:

./autogen.sh && make && sudo make install

If you have Arch Linux, there is an easier way to do this, just run following command in terminal and then the video player will be installed:

yaourt -S gnome-mpv

If you take a look at it’s preferences you can see that it has some options for MPV:

per-gnome-pvm

 

Smplayer

smplayerYou can find Smplayer in many distributions sources so for installing this video player, use command below for Ubuntu/Debian:

sudo apt install smplayer

For Arch Linux/manjaro :

sudo pacman -S smplayer

After installing go and choose MPV in Smplayer preferences :

mpv-smplayer

Now go to Preferences > Advanced > Options for MPV then configure other thing about MPV there !

sm-option

 

Xt7-player-mpv

x7

xt7-player-mpv has been built based on QT and it’s a full option GUI for MPV which even let you to work with DVB-T cards !

Installing:

For install this video player from source code first install following list of dependencies:

Gambas 3 (usually the very latest version)
Qt4
mpv

After installing dependencies enter commands below in terminal one by one:

git clone https://github.com/kokoko3k/xt7-player-mpv.git
cd xt7-player-mpv/
/path/to/gambas/binaries/gbc3 -e -a -g -t -p -m
/path/to/gambas/binaries/gba3
./xt7-player-mpv.gambas

If you use Arch Linux its a easier way to install this player:

yaourt -S xt7-player-mpv

For activating MPV options in the vide player go to it’s settings:

x-setting