home

mpv 调教日志

mpv 从本质上其实和 MplayerX 类似,他们都是基于 mplayer 进行开发的,解码器也都调用了 FFmpeg,但是前者由于有社区支持,解决问题的效率远高于后者。

mpv 没有 GUI 配置面板,一切配置都写在一个 .conf 文件中。这就给了很大的灵活性,用户可以根据自己需要进行配置(包括硬件加速类型,播放界面布局等等),新增模块后也能对应进行配置。

安装

你可以直接下载可运行的二进制文件,也可通过 Homebrew 进行安装。为了便于今后本体和依赖的升级,我用了 Homebrew。

PLAIN
$ brew update
$ brew install mpv

这样安装后的 mpv 只包含默认的组件,能够满足一般播放需求。如果要安装其它组件,可以运行下面的命令获得更多构建选项:

PLAIN
$ brew info mpv

今后只需运行下面的命令就能获取更新信息

PLAIN
$ brew update

配置

配置文件位于 ./.config/mpv/mpv.conf(可能需要新建),以下是我的配置文件。当然你如果嫌麻烦也可以不配置。

PLAIN
#osd message, you can press o to display the osd message
osd-status-msg="${time-pos/full} / ${length/full} (${percent-pos}%)"
 
#makes the player window stay on top of other windows
ontop=no
 
#always save the current playback position on quit
save-position-on-quit=yes
 
#adjust the initial window size to 80%
geometry=80%
 
#for network play
cache=8192
 
#choose the default subtitle to chinese
slang=zh,chi
 
#for GB2312 GBK BIG5 charset, use enca convert them to utf8
sub-codepage=enca:zh:utf8:cp936
 
# Use hardware decoding
hwdec=auto
 
# Subtitles
sub-auto=fuzzy
sub-font-size=48
 
# OSD
osd-bar-h=1.5
osd-border-size=2
osd-color='#CCFFFFFF'
osd-border-color='#99000000'
osd-duration=2000
osd-font='PingFangSC-Regular'
sub-font='PingFangSC-Regular'
 
# No window border
no-border
 
# Youtube
ytdl
 
display-fps=60

扩展

BiliDan

一个观看 B 站视频的 Python 程序,没有广告,没有 Flash,有弹幕。

cd /blog