Files
mpv-config/README.md
T
2026-04-03 12:46:33 +02:00

81 lines
3.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# .config/mpv
一套 mpv 播放器配置,集成 uosc 界面、多种着色器方案和自动更新机制。
## Credits
原始仓库为 [emoeem/mpv](https://github.com/emoeem/mpv)。根据我的需要精简了一些功能,同时做了一些修复。
## 结构
```
mpv.conf # 主配置(全局设置 + Profile 定义)
input.conf # 键位绑定与右键菜单
inputevent_key.conf # inputevent.lua 增强键位(单击/双击/长按)
profiles.conf # 场景预设(游戏/电影/动画/低功耗/直播等)
manager.json # 脚本和着色器的 git 自动更新源
scripts/ # Lua 脚本
script-opts/ # 脚本配置
shaders/ # GPU 着色器NNEDI3/FSRCNNX/Ani4K/Anime4K/ravu/igv 等)
fonts/ # 字体
icc/ # ICC 色彩配置文件
```
## 主要功能
- **界面**uosc 界面 + 右键菜单 + 缩略图预览 + 命令面板
- **色彩管理**ICC / Target 双模式HDR 直通与色调映射,动态峰值检测
- **着色器**NNEDI3、FSRCNNX、Ani4K、AniSD、Anime4K、ravu-zoom、SSIM
- **条件 Profile**:根据分辨率 / HDR / 帧率 / 刷新率 / 网络等自动调整参数
- **字幕**自动加载、编码检测GB18030、在线搜索assrt、自动同步autosubsync
- **音频**96kHz 重采样、独占模式、多声道自动下混调节、ReplayGain
- **播放管理**历史记录simplehistory、进度保存、文件浏览器、播放列表管理
- **网络**yt-dlp 集成、浏览器 Cookie、自动缓存优化
- **更新**:按 M 键通过 manager.lua 从 git 自动更新所有脚本和着色器
## 着色器方案
`mpv.conf` 的 Profile 激活区切换(取消注释对应行):
| Profile | 适用场景 | GPU 开销 |
| --------- | --------------- | -------- |
| NNEDI3 | 通用 | 中 |
| NNEDI3+ | 通用64 变体) | 高 |
| ravu-zoom | 通用 | 中 |
| FSRCNNX | HD 内容 | 中 |
| FSRCNNX+ | SD 内容去伪影 | 中 |
| Ani4K | 动画 | 极高 |
| AniSD | SD 动画 | 极高 |
| Anime4K | 动画 | 低 |
| SSIM | 低性能需求 | 低 |
其中:
- Ani4K / AniSD 着色器(`shaders/Ani4K/`)来自 [Sirosky/Upscale-Hub](https://github.com/Sirosky/Upscale-Hub)。
- nnedi3 / ravu 着色器(`shaders/nnedi3/``shaders/ravu/`)来自 [mpv-prescalers](https://github.com/bjin/mpv-prescalers)。
## 外部依赖
见 [DEPENDENCIES.md](DEPENDENCIES.md)。
## 更新流程
1. 在 mpv 中按 `M` 触发 manager.lua观察控制台输出确认无 `FAILED` 条目。可能会有其他报错如 `[manager] Fehler: externes Repository manager existiert bereits.`,这是正常的。只需要确保不出现全大写的 `FAILED` 即可。
2. 将 manager.lua 在 dest 目录产生的嵌套 `.git` 目录迁移到仓库内的 `.manager/`(避免根仓库误判为 submodule幂等可重复执行
```bash
REPO=$(git -C ~/.config/mpv rev-parse --show-toplevel)
GITSTORE="$REPO/.manager"
mkdir -p "$GITSTORE"
find -L ~/.config/mpv -mindepth 2 -name .git -type d | while read gitdir; do
dest="${gitdir%/.git}"
rel="${dest#$REPO/}"
name=$(echo "$rel" | tr '/' '-')
mv "$gitdir" "$GITSTORE/$name"
depth=$(echo "$rel" | tr -cd '/' | wc -c)
ups=$(printf '../%.0s' $(seq 1 $((depth + 1))))
echo "gitdir: ${ups}.manager/$name" > "$dest/.git"
done
```
3. 重启 mpv检查控制台有无 `unknown key` 或脚本加载失败的警告
4. 若有 `unknown key` 警告,说明对应脚本的配置项发生变化,找 `script-opts/` 下同名 `.conf` 对照脚本源码更新