MPV 配置备忘录

文档

更新

  • 不要使用覆盖旧版本文件的形式进行更新!
  • (如有必要,事先备份配置 + scoop reset mpv
  • 下载
    • releases, mpv-lazy-*-noVS.7z
    • 下载对应 tag tarball,合并 portable_config/shaders
    • 单独下载 vs 快速部署包, py.x_x_x+vs.Rxx-portablez
  • Diff: portable_config 目录与 mpv-cfg repo 对比,备份新配置到 mpv-{linux,win}.conf
  • Workflow: 先 commit 一份版本更新,完成修改同步到 $env:SCOOP\persist\mpv$XDG_CONFIG_HOME/mpv,测试正常再 commit 一份细微改动,最后 tag
  • 其余文件放到 $env:SCOOP\apps\mpv\current
  • 安装:运行 $env:SCOOP\apps\mpv\current\installer\mpv-install.bat

配置

使用 profile 实现自动切换配置,满足不同格式匹配不同解码模式的需求,示例(profiles.conf 中补充):

[native_hwdec_auto]
 profile-desc = 超过2k宽度的片源自动dx纯硬解
 profile-cond = width>=2000
 profile-restore = copy
 hwdec = d3d11va

示例

20260000 版本的 input_uosc.conf 截屏 > 窗口(无 OSD)写错了,改成 screenshot subtitles

# mpv.conf
 ########
 # 基础 #
 ########
#hwdec = auto-copy # Linux

 ########
 # 功能 #
 ########
 idle = no
 watch-later-options = start,vid,aid,sid
 keepaspect-window = yes
 gpu-shader-cache = yes

 ########
 # 音频 #
 ########
#ao = wasapi # Windows
 ao = alsa # Linux, pipewire not working
 volume = 80

 ########
 # 视频 #
 ########
 tscale = oversample
 sigmoid-upscaling = yes
 correct-downscaling = yes

 ####################
 # 脚本 滤镜 着色器 #
 ####################
#background-blur-radius = 8
 
#vf-append = vapoursynth="~~/vs/MEMC_MVT_LQ.vpy" # Windows
#glsl-shaders = "~~/shaders/Anime4K/Anime4K_Clamp_Highlights.glsl;~~/shaders/Anime4K/Anime4K_Restore_CNN_M.glsl;~~/shaders/Anime4K/Anime4K_Upscale_CNN_x2_S.glsl"
 glsl-shaders-append = "~~/shaders/QCOM/QCOM_SGEDS_ms_RT.glsl"
#glsl-shader-opts-append = QCOM_SGEDS_ms_RT/STR=2.0

 ########
 # 字幕 #
 ########
 sub-border-size = 2
 sub-blur = 0
 sub-color = "#FFFFFF"

 ########
 # 截图 #
 ########
 screenshot-format = avif
 screenshot-tag-colorspace = yes
 screenshot-high-bit-depth = yes
#screenshot-template = "~~desktop/%F-%wH%wM%wS"  # Windows
 screenshot-template = "~/Pictures/%F-%wH%wM%wS" # Linux

Linux

Linux mpv 配置只需小幅修改,已经整合进 示例,下面两点没搞定

  • hwdec: 虽然正确加载了 MESA-INTEL,但会提示缺少 libcuda.so.1,然鹅 xlocate 只查到 nvidia-libs,显然与我 Intel 无关……
  • ICC 色彩配置: 提前安装 colord/xiccd 并导入 icc/icm 色彩配置 还是不行,再看吧

命令行运行一堆 option not found,可能是 Windows only,也可能是 Void 打包的 mpv stable 版本太旧,全都注释掉即可:

# profiles.conf
[HDR_generic]
#hdr-reference-white = 100
#hdr-peak-percentile = 99.99

# mpv.conf

 ########
 # 视频 #
 ########
#background-tile-color-0 = "#B4B4B4"
#background-tile-color-1 = "#DCDCDC"
#background-tile-size = 128

 ####################
 # 脚本 滤镜 着色器 #
 ####################
#background-blur-radius = 8

 ########
 # 字幕 #
 ########
#sub-hdr-peak = 100
#image-subs-hdr-peak = 10000

Linux 使用 VapourSyhth 比较麻烦,也可能是 Void 不太行,列个表

  • 更新 VapourSyhth R73,对应 Python 3.12-3.14
  • 打包 vapoursynth-mvtools (meson) 和 k7sfunc (python3-pep517) 并安装
  • 重新编译 mpv(template 启用 vapoursynth/javascript options)
  • 检查命令
$ vspipe --version
VapourSynth Video Processing Library
Copyright (c) 2012-2025 Fredrik Mellbin
Core R73
API R4.1
API R3.6
Options: -

$ pip list | grep k7sfunc
k7sfunc                      1.0.5

$ mpv -v | grep "List of enabled features:" | grep vapoursynth
[cplayer] List of enabled features: alsa build-date cdda cplugins dmabuf-interop-gl dmabuf-wayland drm dvbin dvdnav egl egl-drm egl-wayland egl-x11 ffmpeg gbm gl glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libplacebo linux-fstatfs lua memfd-create memrchr pipewire posix posix-shm ppoll pthread-condattr-setclock pulse rubberband rubberband-3 sndio sndio-1-9 uchardet vaapi vaapi-drm vaapi-wayland vaapi-x11 vapoursynth vdpau vector vk-khr-display vt.h vulkan wayland wayland-protocols-1-32 wayland-protocols-1-38 wayland-protocols-1-39 wayland-protocols-1-41 x11 xv zimg zimg-st428 zlib

即使这样也只达成了运行 vpy 的前提,具体脚本和依赖还要参考其他打包了的发行版自行编译和调试,非常折腾。

补帧 + 超分


旧版

下面为基于 MPV 使用引导 的旧版历史内容,基本不具备参考价值,仅归档。

进阶

  1. 脚本增强
    • 3.1.3 条件配置
    • 3.1.4 YTDL 集成(在环境变量 PATH 中即可)
    • 3.2 外置脚本
  2. 第三方着色器
  3. VapourSynth (下载 VapourSynth64-Portable-Rxx.zip

存放

目录

  • %APPDATA%/mpv/: 全局设置
  • X:/xxxxx/mpv/portable_config/: 最高优先级,会忽略全局设置,便携

C:\ProgramData\chocolatey\lib\mpv.install

Vinfall's Geekademy

Sine īrā et studiō