MPV 配置文件分享
Linux 现在有不少优秀的播放器,不过说起来也就那么几款,其实也不算太多,只有 vlc、mpv、mplayer 这几款,不过吧,在 Windowss 和 macosx 下无非也就这几款而已,播放器还是别要求太多了。
之前分享过一次配置文件,openSUSE 下我的 mpv 配置分享
本人在 windows 一直坚持 mpc-pc 配合 k-lite code pack 解码包为主一样,在 Linux 下面则安装了 mpv 配置硬件解码,效果还是非常不错的,加上各种插件,体验爽的飞起,下面个人分享一下个人的配置文件,需要的人自取就可以了,由于我其实也是小白,所以对很多文件并不是很懂,所以其实也是修改了大佬们分享的配置文件,就目前而言,现在还是有效的;Linux 下 mpv 的配置文件夹/home/user/.config/mpv,如要使用配置文件只要新建 mpv.conf 将内容复制文件中即可,简单快捷,快捷键配置文件为同文件夹的 input.conf,同理,修改快捷键只要写入该文件中即可。
mpv.conf
###########
# General #
###########
save-position-on-quit
osc=no
border=no # no window title bar
msg-color # color log messages on terminal
term-osd-bar # display a progress bar on the terminal
use-filedir-conf # look for additional config files in the
#############
# Subtitles #
#############
sub-use-margins
sub-ass-force-margins
demuxer-mkv-subtitle-preroll # try to correctly show embedded subs when seeking
sub-auto=fuzzy # external subs don't have to match the file name exactly to autoload
sub-paths=ass:srt:sub:subs:subtitles # search for external subs in the listed subdirectories
embeddedfonts=yes # use embedded fonts for SSA/ASS subs
sub-fix-timing=no # do not try to fix gaps (which might make it worse in some cases)
sub-ass-force-style=Kerning=yes # allows you to override style parameters of ASS scripts
sub-bold=yes
################
# Video Output #
################
# Active VOs (and some other options) are set conditionally
# See here for more information: https://github.com/wm4/mpv-scripts/blob/master/auto-profiles.lua
# The script was slightly modified, functions from scripts/auto-profiles-functions.lua are imported
# Defaults for all profiles
profile=gpu-hq
icc-profile-auto
gpu-api=vulkan
hwdec=vaapi
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
dscale=mitchell
video-sync=display-resample
interpolation
tscale=oversample
[high-quality]
profile-desc=cond:is_desktop() and get('width', math.huge) < 3840
scale=ewa_lanczossharp
cscale=ewa_lanczossoft
scale-antiring=0.7
cscale-antiring=0.7
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes
[mid-quality]
profile-desc=cond:(is_laptop() and not on_battery() and get('width', math.huge) < 1920) or (is_desktop() and get('width', math.huge) >= 3840)
scale-antiring=1.0
cscale-antiring=1.0
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes
[low-quality]
profile-desc=cond:is_laptop() and (on_battery() or get('width', math.huge) >= 1920)
scale-antiring=0.0
cscale-antiring=0.0
dither-depth=no
correct-downscaling=no
sigmoid-upscaling=no
deband=no
[60FPS]
profile-desc=cond:is_laptop() and get('container-fps', 0) >= 59
[4K]
profile-desc=cond:get('width', -math.huge) >= 3840
vd-lavc-threads=32
[4K-inverted]
profile-desc=cond:get('width', -math.huge) < 3840
vd-lavc-threads=0
[default]
#[audio]
audio-device='pulse/alsa_output.pci-0000_00_1f.3.analog-stereo'
audio-spdif=ac3,eac3,dts-hd,truehd
af=scaletempo2
input.conf
WHEEL_UP add volume 2 # 滚轮上增加 2% 音量
WHEEL_DOWN add volume -2 # 滚轮下减少 2% 音量
WHEEL_LEFT seek 10 # 滚轮左快进 10 秒
WHEEL_RIGHT seek -10 # 滚轮右后退 10 秒
UP add volume 5
DOWN add volume -5
LEFT seek -5
RIGHT seek 5
t cycle ontop # 置顶
这是本人惯用的快捷键,需要的话直接复制放入 input.conf 文件中即可
插件方面,我印象中蜥蜴只支持 lua,不支持 js,以下是我尝试用的插件;
简单说一下插件的功能
- assrt,为在线搜索下载字幕的插件,来源为伪射手网,现在基本是从 v-sub 上获取字幕,但是老番还是可以用的
- autoload,自动加载同文件夹的视频文件为列表
- autosub,自动加载各种语言的字幕,对于看电影应该是很有用的
- cycle-video-rotate,画面旋转脚本
- mpv_crop_script,截图插件
- mpv_thumbnail_script,播放条缩略图
- playlistmanager,加载同文件夹的视频文件为播放列表,shit+enter 快捷方式
- stats,增加文件相信信息和状态
- quick-scale,对于无边框的用户来说,画面的放大缩小是个问题,这个是快捷键控制放大缩小的
- playlist-view、gallery-thumbgen,播放列表、播放文件画廊,也会方便很多
安装上述插件后,加入下列内容到 input.conf 里,就可以正常使用了,当然可以根据需要自行修改就是了
# alt 加左右旋转视频,配合 cycle-video-rotate.lua 脚本
Alt+LEFT script-message Cycle_Video_Rotate -90
Alt+RIGHT script-message Cycle_Video_Rotate 90
# alt+9,0 快速调整窗口尺寸, 配合 quick-scale.lua
Alt+9 script-message Quick_Scale "1920" "1080" "0.9" "-1"
Alt+8 script-message Quick_Scale "1920" "1080" "0.8" "-1"
Alt+0 script-message Quick_Scale "1920" "1080" "0.5" "-1"
# 字幕在线加载
ctrl+a script-binding assrt
# 弹幕在线加载
Ctrl+d script-binding mpvdanmakuloader/load
#mpv crop,截图功能
shift+c script-binding crop-screenshot
#playlist-view-close
g script-message contact-sheet-close; script-message playlist-view-toggle
c script-message playlist-view-close; script-message contact-sheet-toggle
#Anime4K
CTRL+1 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_M.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode A (Fast)"
CTRL+2 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_M.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode B (Fast)"
CTRL+3 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Upscale_Denoise_CNN_x2_M.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode C (Fast)"
CTRL+4 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_M.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl;~~/shaders/Anime4K_Restore_CNN_S.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode A+A (Fast)"
CTRL+5 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_M.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_M.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Restore_CNN_Soft_S.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode B+B (Fast)"
CTRL+6 no-osd change-list glsl-shaders set "~~/shaders/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K_Upscale_Denoise_CNN_x2_M.glsl;~~/shaders/Anime4K_AutoDownscalePre_x2.glsl;~~/shaders/Anime4K_AutoDownscalePre_x4.glsl;~~/shaders/Anime4K_Restore_CNN_S.glsl;~~/shaders/Anime4K_Upscale_CNN_x2_S.glsl"; show-text "Anime4K: Mode C+A (Fast)"
CTRL+0 no-osd change-list glsl-shaders clr ""; show-text "GLSL shaders cleared"
‘’‘
已经上传 github,需要的自己下载就好啦,[mpv-script-lazy](https://github.com/Mackel123/mpv-scripts-lazy) 以上。