mpv播放器+SVP4+Anime4K简单配置

以Ubuntu24.10为例

安装mpv

1
2
sudo apt install mpv
cp -r /usr/share/doc/mpv/ ~/.config/

第一次配置

1
gnome-text-editor ~/.config/mpv/input.conf

写入archlinux wiki的示例配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
shift+s         screenshot each-frame
Shift+UP seek 600
Shift+DOWN seek -600
= cycle video-unscaled
- cycle-values window-scale 2 3 1 .5
WHEEL_UP add volume 5
WHEEL_DOWN add volume -5
WHEEL_LEFT ignore
WHEEL_RIGHT ignore
Alt+RIGHT add video-rotate 90
Alt+LEFT add video-rotate -90
Alt+- add video-zoom -0.25
Alt+= add video-zoom 0.25
Alt+j add video-pan-x -0.05
Alt+l add video-pan-x 0.05
Alt+i add video-pan-y 0.05
Alt+k add video-pan-y -0.05
Alt+BS set video-zoom 0; set video-pan-x 0; set video-pan-y 0

同理编辑~/.config/mpv/mpv.conf并写入

1
2
3
4
5
6
7
8
9
10
11
12
13
sub-auto=fuzzy
sub-bold=yes
sub-font="Noto Sans CJK SC Medium"
profile=high-quality
video-sync=display-resample
interpolation
# hwdec=auto auto-safe
hwdec=auto-copy
hwdec-codecs=all
force-window=yes
audio-spdif=ac3,eac3,dts-hd,truehd
save-position-on-quit
pulse-latency-hacks=yes

配置SVP

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo apt install g++ make autoconf automake libtool pkg-config nasm git meson dh-autoreconf
sudo apt install libzimg-dev
sudo apt install cython3
cd
git clone https://github.com/vapoursynth/vapoursynth.git
cd vapoursynth
./autogen.sh
./configure
make -j4
sudo make install
cd ..
sudo ldconfig
sudo ln -s /usr/local/lib/python3.12/site-packages/vapoursynth.so /usr/lib/python3.12/lib-dynload/vapoursynth.so
vspipe
1
gnome-text-editor ~/.config/mpv/mpv.conf

添加内容

1
2
3
4
5
6
7
[svp]
input-ipc-server=/tmp/mpvsocket # Receives input from SVP
hr-seek-framedrop=no # Fixes audio desync
watch-later-options-remove=vf # Do not remember SVP's video filters

# Can fix stuttering in some cases, in other cases probably causes it. Try it if you experience stuttering.
#opengl-early-flush=yes

之后启动mpv使用

1
mpv --profile=svp <URL>/<path/to/video>/<path/to/*>

配置Anime4K

1
2
3
4
5
6
7
8
cd 
# wget "https://github.com/bloc97/Anime4K/releases/download/v4.0.1/Anime4K_v4.0.zip"
# unzip Anime4K_v4.0.zip -d ~/.config/mpv/shaders
wget "https://github.com/Tama47/Anime4K/releases/download/v4.0.1/GLSL_Mac_Linux_Low-end.zip" # 低配显卡
wget "https://github.com/Tama47/Anime4K/releases/download/v4.0.1/GLSL_Mac_Linux_High-end.zip" # 高配显卡
mv ~/.config/mpv/mpv.conf ~/.config/mpv/mpv.conf.bak
mv ~/.config/mpv/input.conf ~/.config/mpv/input.conf.bak
unzip GLSL_Mac_Linux_Low-end.zip -d ~/.config/mpv

然后可以把之前的配置文件追加到Anime4K的配置文件后面


mpv播放器+SVP4+Anime4K简单配置
https://rukkhadevata123.github.io/2024/11/08/mpv/
作者
Dawn Chirps
发布于
2024年11月8日
许可协议