1. MPV播放器

视频教程【mpv播放器,安装配置,脚本推荐,包含文件管理器,最近播放,缩略图等等,最重磅的支持杜比视界

1.1. 概述

a free, open source, and cross-platform media player

简单来说,就是一个开源的,多平台的媒体播放器,支持视频,音频,图片等等。

托管地址:https://github.com/mpv-player/mpv

官网:https://mpv.io/

下载地址:https://mpv.io/installation/

文档:https://mpv.io/manual/stable/

1.2. 下载安装

本次以Win10平台为例,下载最新稳定版:点击开始下载

下载完成之后解压,不要解压到C盘下(权限太高),建议放到其他盘符,比如我的是解压路径是 D:\Program Files\mpv-x86_64-v3-20231210-git-443c248\,双击 mpv.exe 即可运行mpv播放器。

关联格式:快速打开mpv

进入解压目录下的 installer 文件夹,有个 mpv-install.bat 管理员权限 运行,等待完成,按任意键退出。

创建属于自己配置文件夹,用于自定义配置,安装插件等

  1. 进入解压的目录,新建 portable_config文件夹,以后配置就放在这个文件夹下,
  2. 进入 portable_config文件夹,
  3. 新建 mpv.conf文件,这代表了mpv的配置文件,
  4. 新建 input.conf文件,存放自定义的快捷键配置,
  5. 新建 scripts文件夹,以后安装第三方脚本就放在这个目录下,
  6. 新建 script-opts文件夹,存放第三方脚本配置。

到此安装基本完成。

2. 脚本

为了更好的体验,自定义配置。

为了避免冗余,以下所有脚本都遵循上述规范的配置,即:

  • scripts : 脚本文件
  • input.conf : 自定义快捷键
  • mpv.conf : mpv配置

2.1. 杜比视界

杜比视界 DV HDR 常见的播放器都不支持,mpv只需要在 mpv.conf 中添加两行代码即可让颜色正常化

不过加上之后内存占用变高,看情况开吧。

vo=gpu-next     # 杜比视界颜色正常化
gpu-context=win # 杜比视界颜色正常化

2.2. 缩略图

需要第三方脚本支持:https://github.com/po5/thumbfast

  1. 下载项目下的 thumbfast.luaosc.lua,提示:点击可直接下载。

  2. 下载之后把 thumbfast.lua 放入 mpv目录/portable_config\,也就是 mpv.conf 同目录。

  3. osc.lua 放入 mpv目录/portable_config\scripts

  4. input.conf 加入一行

Ctrl+r 	load-script "~~home/thumbfast.lua";show-text "载入略缩图脚本"

重启mpv,即可生效,需要启用时, 按 ctrl+r即可加载缩略图。

如果需要默认加载,把 thumbfast.lua 放入 scripts 中即可。不过占内存,不建议。

2.3 文件浏览器

功能:在 mpv 中浏览和打开文件和文件夹。

该脚本在 mpv API 之外不使用任何东西,因此在所有平台上都应该是相同的。浏览器可以上下移动目录,开始播放文件和文件夹,或者将它们添加到队列中。

地址https://github.com/CogentRedTester/mpv-file-browser

快捷键

Ctrl+o 打开脚本,进入选择
键盘上下键 选择列表
enter 选中播放
键盘左右键 切换文件夹
ECS 关闭列表

脚本配置

mpv目录\portable_config\script-opts\file_browser.conf

# 注意使用英文 , 隔开
root=~/,C:/,D:/,E:/

2.4 最近播放

https://github.com/hacel/recent

快捷键 ` : 打开最近播放

配置

mpv目录\portable_config\script-opts\recent.conf

auto_run_idle=no 关闭mpv打开时显示最近播放,默认为yes

auto_save=yes
save_bind=
auto_save_skip_past=
auto_run_idle=no	# 关闭mpv打开时显示最近播放,默认为yes
write_watch_later=yes
display_bind=`
mouse_controls=yes
log_path=history.log
date_format=%d/%m/%y %X
show_paths=no
split_paths=yes
font_scale=50
border_size=0.7
hi_color=H46CFFF
ellipsis=no

3. mpv.conf

vo=gpu-next     # 杜比视界颜色正常化
gpu-context=win # 杜比视界颜色正常化
volume=70		# 默认音量设为70

4. 常用快捷键

以下皆为内置快捷键

f		全屏
j J		循环当前的字幕
[ ] 	将当前播放速度减小/增加10%
backspace	将速度重置为正常
m		静音,再按取消静音
9 0		调小音量/调大音量
space p		暂停,再按取消暂停
q		停止播放并退出
Q		停止播放并退出,如果重新播放,尽可能恢复播放的文件的播放位置

关于快捷键可查看 附录-快捷键

附录

快捷键

图示:

mpbindings.png

快捷键 中文 英文
LEFT and RIGHT 向后/向前跳转5秒。Shift+箭头进行1秒精确跳转(见–hr-seek)。 Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek (see --hr-seek).
UP and DOWN 向前/向后跳转1分钟。Shift+箭头进行5秒精确跳转(见–hr-seek)。 Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see --hr-seek).
Ctrl+LEFT and Ctrl+RIGHT 跳转到上一个/下一个字幕。受一些限制,可能并不总是有效;参见sub-seek命令。 Seek to the previous/next subtitle. Subject to some restrictions and might not always work; see sub-seek command.
Ctrl+Shift+LEFT and Ctrl+Shift+RIGHT 调整字幕延迟,以便下一个或上一个字幕立即显示。这对于将字幕与音频同步特别有用。 Adjust subtitle delay so that the next or previous subtitle is displayed now. This is especially useful to sync subtitles to audio.
[ and ] 将当前播放速度减小/增加10%。 Decrease/increase current playback speed by 10%.
当前播放速度减半/加倍。 Halve/double current playback speed.
BACKSPACE 将播放速度重置为正常。 Reset playback speed to normal.
Shift+BACKSPACE 撤销上次跳转。仅当播放列表条目未更改时有效。再次按下将返回到原始位置。有关详细信息,请参阅revert-seek命令。 Undo the last seek. This works only if the playlist entry was not changed. Hitting it a second time will go back to the original position. See revert-seek command for details.
Shift+Ctrl+BACKSPACE 标记当前位置。然后Shift+BACKSPACE将使用该标记位置作为还原位置(一旦您跳回,标记将被重置)。您可以使用此功能在文件中进行跳转,然后返回到您离开的确切位置。 Mark the current position. This will then be used by Shift+BACKSPACE as revert position (once you seek back, the marker will be reset). You can use this to seek around in the file and then return to the exact position where you left off.
< and > 在播放列表中向后/向前。 Go backward/forward in the playlist.
ENTER 在播放列表中向前。 Go forward in the playlist.
p and SPACE 暂停(再次按下取消暂停)。 Pause (pressing again unpauses).
. 向前一步。按一次将暂停,每连续按下一次将播放一帧,然后再次进入暂停模式。 Step forward. Pressing once will pause, every consecutive press will play one frame and then go into pause mode again.
, 向后一步。按一次将暂停,每连续按下一次将倒放一帧,然后再次进入暂停模式。 Step backward. Pressing once will pause, every consecutive press will play one frame in reverse and then go into pause mode again.
q 停止播放并退出。 Stop playing and quit.
Q 类似于q,但存储当前播放位置。如果可能的话,稍后再次播放相同的文件将在旧的播放位置继续播放。请参阅RESUMING PLAYBACK。 Like q, but store the current playback position. Playing the same file later will resume at the old playback position if possible. See RESUMING PLAYBACK.
/ and * 减小/增大音量。 Decrease/increase volume.
9 and 0 减小/增大音量。 Decrease/increase volume.
m 静音。 Mute sound.
_ 循环浏览可用的视频轨道。 Cycle through the available video tracks.
# 循环浏览可用的音频轨道。 Cycle through the available audio tracks.
E 循环浏览可用的版本。 Cycle through the available Editions.
f 切换全屏(另请参阅–fs)。 Toggle fullscreen (see also --fs).
ESC 退出全屏模式。 Exit fullscreen mode.
T 切换置顶(另请参阅–ontop)。 Toggle stay-on-top (see also --ontop).
w and W 减小/增大平移和扫描范围。当前e键目前执行相同操作,但不建议使用。 Decrease/increase pan-and-scan range. The e key does the same as W currently, but use is discouraged.
o and P 在OSD上显示进度条、已用时间和总持续时间。 Show progression bar, elapsed time and total duration on the OSD.
O 在OSD状态之间切换正常和播放时间/持续时间。 Toggle OSD states between normal and playback time/duration.
v 切换字幕可见性。 Toggle subtitle visibility.
j and J 循环浏览可用的字幕。 Cycle through the available subtitles.
z and Z 通过+/- 0.1秒调整字幕延迟。当前x键执行相同操作,但不建议使用。 Adjust subtitle delay by +/- 0.1 seconds. The x key does the same as Z currently, but use is discouraged.
l 设置/清除A-B循环点。有关详细信息,请参阅ab-loop命令。 Set/clear A-B loop points. See ab-loop command for details.
L 切换无限循环。 Toggle infinite looping.
Ctrl++ and Ctrl± 通过+/- 0.1秒调整音频延迟(A/V同步)。 Adjust audio delay (A/V sync) by +/- 0.1 seconds.
Shift+g and Shift+f 通过+/- 10%调整字幕字体大小。 Adjust subtitle font size by +/- 10%.
u 在SSA/ASS字幕中切换仅应用–sub-ass-*覆盖(默认)和几乎完全覆盖它们的常规字幕样式。有关更多信息,请参阅–sub-ass-override。 Switch between applying only --sub-ass-* overrides (default) to SSA/ASS subtitles, and overriding them almost completely with the normal subtitle style. See --sub-ass-override for more info.
V 切换字幕VSFilter纵横比兼容模式。有关更多信息,请参阅–sub-ass-vsfilter-aspect-compat。 Toggle subtitle VSFilter aspect compatibility mode. See --sub-ass-vsfilter-aspect-compat for more info.
r and R 上/下移动字幕。当前t键执行相同操作,但不建议使用。 Move subtitles up/down. The t key does the same as R currently, but use is discouraged.
s 拍摄截图。 Take a screenshot.
S 拍摄截图,不带字幕。(这取决于VO驱动程序支持与否。) Take a screenshot, without subtitles. (Whether this works depends on VO driver support.)
Ctrl+s 拍摄截图,如窗口显示(带字幕、OSD和缩放视频)。 Take a screenshot, as the window shows it (with subtitles, OSD, and scaled video).
PGUP and PGDWN 跳转到上一个/下一个章节的开始。在大多数情况下,“上一个”实际上将会到达当前章节的开始;请参阅–chapter-seek-threshold。 Seek to the beginning of the previous/next chapter. In most cases, “previous” will actually go to the beginning of the current chapter; see --chapter-seek-threshold.
Shift+PGUP and Shift+PGDWN 向后或向前跳转10分钟。(这曾经映射到不带Shift的PGUP/PGDWN。) Seek backward or forward by 10 minutes. (This used to be mapped to PGUP/PGDWN without Shift.)
d 激活/停用去隔行。 Activate/deactivate deinterlacer.
A 循环切换宽高比覆盖。 Cycle aspect ratio override.
Ctrl+h 切换硬件视频解码开/关。 Toggle hardware video decoding on/off.
Alt+LEFT, Alt+RIGHT, Alt+UP, Alt+DOWN 移动视频矩形(平移)。 Move the video rectangle (panning).
Alt++ and Alt± 将Alt与+或-键组合可更改视频缩放。 Combining Alt with the + or - keys changes video zoom.
Alt+BACKSPACE 重置平移/缩放设置。 Reset the pan/zoom settings.
F8 显示播放列表和其中的当前位置(仅在使用UI窗口时有用,在终端上损坏)。 Show the playlist and the current position in it (useful only if a UI window is used, broken on the terminal).
F9 显示音频和字幕流列表(仅在使用UI窗口时有用,在终端上损坏)。 Show the list of audio and subtitle streams (useful only if a UI window is used, broken on the terminal).
i and I 显示/切换显示有关当前播放文件的统计信息的叠加层,例如编解码器、帧速率、丢帧数等。有关更多信息,请参阅STATS。 Show/toggle an overlay displaying statistics about the currently playing file such as codec, framerate, number of dropped frames and so on. See STATS for more information.
DEL 在OSC之间循环显示可见性:从不/自动(鼠标移动)/始终 Cycle OSC visibility between never / auto (mouse-move) / always
` 显示控制台。(ESC关闭它。有关CONSOLE的详细信息,请参阅CONSOLE。) Show the console. (ESC closes it again. See CONSOLE.)
1 and 2 调整对比度。 Adjust contrast.
3 and 4 调整亮度。 Adjust brightness.
5 and 6 调整伽马值。 Adjust gamma.
7 and 8 调整饱和度。 Adjust saturation.
Alt+0 (and Command+0 on macOS) 将视频窗口调整为原始大小的一半。 Resize video window to half its original size.
Alt+1 (and Command+1 on macOS) 将视频窗口调整为其原始大小。 Resize video window to its original size.
Alt+2 (and Command+2 on macOS) 将视频窗口调整为其原始大小的两倍。 Resize video window to double its original size.
Command + f (macOS only) 切换全屏(另请参阅–fs)。 Toggle fullscreen (see also --fs).
PAUSE 暂停。 Pause.
STOP 停止播放并退出。 Stop playing and quit.
PREVIOUS and NEXT 向后/向前跳转1分钟。 Seek backward/forward 1 minute.
ZOOMIN and ZOOMOUT 更改视频缩放。 Changes video zoom.