SYNOPSIS 概要
mpv [选项] [文件|URL|播放列表|-]
DESCRIPTION 描述
mpv is a media player based on MPlayer and mplayer2. It supports a wide variety of video
file formats, audio and video codecs, and subtitle types. Special input URL
types are available to read input from a variety of sources other than disk
files. Depending on platform, a variety of different video and audio output
methods are supported.
mpv 是基于 MPlayer 和 mplayer2 的媒体播放器。它支持广泛的视频文件格式、音频和视频编解码器以及字幕类型。提供特殊输入 URL 类型,可用于从除磁盘文件以外的各种来源读取输入。根据平台,支持多种不同的视频和音频输出方法。
Usage examples to get you started quickly can be found at the end of this man
page.
快速入门的使用示例可以在本手册页的末尾找到。
INTERACTIVE CONTROL 交互式控制
mpv has a fully configurable, command-driven control layer which allows you
to control mpv using keyboard, mouse, or remote control (there is no
LIRC support - configure remotes as input devices instead).
mpv 具有一个完全可配置、命令驱动的控制层,允许您使用键盘、鼠标或遥控器(没有 LIRC 支持 - 请将遥控器配置为输入设备)来控制 mpv。
See the --input- options for ways to customize it.
请参阅 --input- 选项以了解自定义方法。
The following listings are not necessarily complete. See etc/input.conf
in the mpv source files for a list of default bindings. User input.conf
files and Lua scripts can define additional key bindings.
以下列表可能并不完整。有关默认绑定的列表,请参阅 mpv 源文件中的 etc/input.conf 。用户 input.conf 文件和 Lua 脚本可以定义额外的按键绑定。
See COMMAND INTERFACE and Key names sections for more details on
configuring keybindings.
有关配置按键绑定的更多详细信息,请参阅命令接口和按键名称部分。
See also --input-test for interactive binding details by key, and the
stats built-in script for key bindings list (including print to terminal). By
default, the ? key toggles the display of this list.
有关按按键进行交互绑定的详细信息,请参阅 --input-test ,以及用于按键绑定列表(包括打印到终端)的内置脚本 stats。默认情况下,? 按键切换此列表的显示。
Keyboard Control 键盘控制
- LEFT and RIGHT LEFT 和 RIGHT
- Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek
(see --hr-seek).
向后/向前搜索 5 秒。Shift+箭头进行 1 秒精确搜索(见 --hr-seek )。 - UP and DOWN 向上 和 向下
- Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see
--hr-seek).
向前/向后寻找 1 分钟。Shift+箭头键进行 5 秒精确寻找(见 --hr-seek )。 - Ctrl+LEFT and Ctrl+RIGHT
Ctrl+向左键和 Ctrl+向右键 - Seek to the previous/next subtitle. Subject to some restrictions and
might not always work; see sub-seek command.
跳转到上一个/下一个字幕。可能受到一些限制,不一定总是有效;请参阅 sub-seek 命令。 - Ctrl+Shift+LEFT and Ctrl+Shift+RIGHT
Ctrl+Shift+向左键和 Ctrl+Shift+向右键 - Adjust subtitle delay so that the previous or next subtitle is displayed
now. This is especially useful to sync subtitles to audio.
调整字幕延迟,以便显示上一个或下一个字幕。这对于同步字幕与音频特别有用。 - [ and ] [ 和 ]
- Decrease/increase current playback speed by 10%.
降低/提高当前播放速度 10%。 - { and } { 和 }
- Halve/double current playback speed.
将当前播放速度减半/加倍。 - BACKSPACE 退格键
- Reset playback speed to normal.
将播放速度重置为正常。 - Shift+BACKSPACE Shift+退格键
- 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.
撤销上一次的寻找。这仅在播放列表条目未被更改时有效。再次点击将返回到原始位置。有关详细信息,请参阅 revert-seek 命令。 - Shift+Ctrl+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.
标记当前位置。然后, Shift+BACKSPACE 将将其用作回退位置(一旦你返回,标记将被重置)。你可以使用此功能在文件中寻找,然后返回到你离开的确切位置。 - < and > < 和 >
- Go backward/forward in the playlist.
在播放列表中向前/向后移动。 - ENTER 输入
- Go forward in the playlist.
前进到播放列表。 - Shift+HOME and Shift+END
Shift+HOME 和 Shift+END - Go to the first/last playlist entry.
转到第一个/最后一个播放列表条目。 - p and SPACE p 和空格
- 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
- 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.
类似于 q ,但存储当前播放位置。稍后再次播放同一文件时,如果可能,将恢复到旧播放位置。参见“恢复播放”。 - / and * / 和 *
- Decrease/increase volume.
减小/增大音量。 - KP_DIVIDE and KP_MULTIPLY
KP_DIVIDE 和 KP_MULTIPLY - Decrease/increase volume.
减小/增大音量。 - 9 and 0 9 和 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
- Toggle fullscreen (see also --fs).
切换全屏(另见 --fs 。) - ESC
- Exit fullscreen mode. 退出全屏模式。
- T
- Toggle stay-on-top (see also --ontop).
切换置顶(另见 --ontop 。) - w and W w 和 W
- Decrease/increase pan-and-scan range. The e key does the same as
W currently, but use is discouraged. See --panscan for more
information.
减小/增加缩放范围。 e 键目前与 W 功能相同,但使用不推荐。更多信息请参阅 --panscan 。 - o and P o 和 P
- Show progression bar, elapsed time and total duration on the OSD.
在 OSD 上显示进度条、已过时间和总时长。 - O
- Toggle OSD states between normal and playback time/duration.
在正常和播放时间/持续时间之间切换 OSD 状态。 - v
- Toggle subtitle visibility.
切换字幕可见性。 - j and J j 和 J
- Cycle through the available subtitles.
循环切换可用的字幕。 - z and Z z 和 Z
- Adjust subtitle delay by -/+ 0.1 seconds. The x key does the same as
Z currently, but use is discouraged.
调整副标题延迟 -/+ 0.1 秒。当前 x 键与 Z 键功能相同,但使用不推荐。 - l
- Set/clear A-B loop points. See ab-loop command for details.
设置/清除 A-B 循环点。查看 ab-loop 命令以获取详细信息。 - L
- Toggle infinite looping.
切换无限循环。 - Ctrl++ and Ctrl+- Ctrl++ 和 Ctrl+-
- Adjust audio delay (A/V sync) by +/- 0.1 seconds.
通过 +/- 0.1 秒调整音频延迟(音视频同步)。 - Ctrl+KP_ADD and Ctrl+KP_SUBTRACT
Ctrl+KP_ADD 和 Ctrl+KP_SUBTRACT - Adjust audio delay (A/V sync) by +/- 0.1 seconds.
通过 +/- 0.1 秒调整音频延迟(音视频同步)。 - G and F G 和 F
- Adjust subtitle font size by +/- 10%.
调整字幕字体大小 ±10%。 - u
- 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.
在仅应用 --sub-ass-* 覆盖(默认)到 SSA/ASS 字幕和几乎完全用正常字幕样式覆盖它们之间切换。见 --sub-ass-override 了解更多信息。 - V
- Cycle through which video data gets used for ASS rendering.
See --sub-ass-use-video-data for more info.
循环使用哪些视频数据用于 ASS 渲染。见 --sub-ass-use-video-data 了解更多信息。 - r and R r 和 R
- Move subtitles up/down. The t key does the same as R currently, but
use is discouraged.
移动字幕上下。 t 键目前与 R 执行相同操作,但使用被不建议。 - s
- Take a screenshot. 截取屏幕截图。
- S
- Take a screenshot, without subtitles. (Whether this works depends on VO
driver support.)
截取屏幕截图,不包含字幕。(这能否工作取决于 VO 驱动程序支持。) - Ctrl+s
- Take a screenshot, as the window shows it (with subtitles, OSD, and scaled
video).
截取屏幕截图,如窗口所示(包含字幕、OSD 和缩放视频)。 - HOME 首页
- Seek to the beginning of the file.
移动到文件开头。 - PGUP and PGDWN PGUP 和 PGDN
- 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.
查找上一章/下一章的开头。在大多数情况下,“上一章”实际上会跳转到当前章节的开头;参见 --chapter-seek-threshold 。 - Shift+PGUP and Shift+PGDWN
Shift+PGUP 和 Shift+PGDWN - Seek backward or forward by 10 minutes. (This used to be mapped to
PGUP/PGDWN without Shift.)
向后或向前查找 10 分钟。(这曾经被映射到 PGUP/PGDWN,但不带 Shift。) - b
- Activate/deactivate debanding.
激活/禁用去频带。 - d
- Cycle the deinterlacing filter.
循环去隔行滤波器。 - 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++ 和 Alt+-
- Change video zoom. 更改视频缩放。
- Alt+KP_ADD and Alt+KP_SUBTRACT
Alt+KP_ADD 和 Alt+KP_SUBTRACT - Change video zoom. 更改视频缩放。
- Alt+BACKSPACE
- Reset the pan/zoom settings.
重置平移/缩放设置。 - F8
- Show the playlist and the current position in it.
显示播放列表及其当前位置。 - F9
- Show the list of audio and subtitle streams.
显示音频和字幕流列表。 - Ctrl+v
- Append the file or URL in the clipboard to the playlist. If nothing is
currently playing, it is played immediately. Only works on platforms that
support the clipboard property.
将剪贴板中的文件或 URL 添加到播放列表。如果没有正在播放的内容,它将立即播放。仅在支持 clipboard 属性的平台上有效。 - i and I i 和 I
- 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.
显示/切换显示当前播放文件统计信息的覆盖层,例如编解码器、帧率、丢失帧数等。有关更多信息,请参阅 STATS。
- ?
- Toggle an overlay displaying the active key bindings. See STATS for more
information.
切换显示活动按键绑定的覆盖层。有关更多信息,请参阅 STATS。 - DEL
- Cycle OSC visibility between never / auto (mouse-move) / always
在“从不”/自动(鼠标移动)/总是之间循环 OSC 可见性。 - `
- Show the console. (ESC closes it again. See CONSOLE.)
显示控制台。(按 ESC 关闭。见 控制台。)
(The following keys are valid only when using a video output that supports the
corresponding adjustment.)
(以下键仅在使用支持相应调整的视频输出时有效。)
- 1 and 2 1 和 2
- Adjust contrast. 调整对比度。
- 3 and 4 3 和 4
- Adjust brightness. 调整亮度。
- 5 and 6 5 和 6
- Adjust gamma. 调整伽玛。
- 7 and 8 7 和 8
- Adjust saturation. 调整饱和度。
- Alt+0 (and Command+0 on macOS)
Alt+0(以及在 macOS 上的 Command+0) - Resize video window to half its original size.
将视频窗口大小调整为原始大小的一半。 - Alt+1 (and Command+1 on macOS)
Alt+1(在 macOS 上为 Command+1) - Resize video window to its original size.
将视频窗口大小调整为原始大小。 - Alt+2 (and Command+2 on macOS)
Alt+2(在 macOS 上为 Command+2) - Resize video window to double its original size.
调整视频窗口大小至原始大小的两倍。 - Command + f (macOS only)
Command + f(仅限 macOS) - Toggle fullscreen (see also --fs).
切换全屏(另见 --fs 。)
(The following keybindings open a menu in the console that lets you choose from
a list of items by typing part of the desired item, by clicking the desired
item, or by navigating them with keybindings: Down and Ctrl+n go down,
Up and Ctrl+p go up, Page down and Ctrl+f scroll down one page,
and Page up and Ctrl+b scroll up one page.)
(以下快捷键在控制台中打开一个菜单,允许您通过输入所需项目的部分内容、点击所需项目或使用快捷键进行导航来从项目列表中选择: Down 和 Ctrl+n 向下移动, Up 和 Ctrl+p 向上移动, Page down 和 Ctrl+f 向下滚动一页,以及 Page up 和 Ctrl+b 向上滚动一页。)
In track menus, selecting the current tracks disables it.
在轨道菜单中,选择当前轨道将禁用它。
- g-p
- Select a playlist entry.
选择一个播放列表条目。 - g-s
- Select a subtitle track.
选择一个字幕轨道。 - g-S
- Select a secondary subtitle track.
选择一个辅助字幕轨道。 - g-a
- Select an audio track.
选择一个音频轨道。 - g-v
- Select a video track.
选择一个视频轨道。 - g-t
- Select a track of any type.
选择任何类型的轨道。 - g-c
- Select a chapter. 选择一个章节。
- g-e
- Select an MKV edition or DVD/Blu-ray title.
选择一个 MKV 版本或 DVD/Blu-ray 标题。 - g-l
- Select a subtitle line to seek to. This currently requires ffmpeg in
PATH, or in the same folder as mpv on Windows.
选择要跳转到的字幕行。这目前需要 ffmpeg 在 PATH 中,或者在 Windows 上 mpv 的同一文件夹中。 - g-d
- Select an audio device.
选择一个音频设备。 - g-h
- Select a file from the watch history. Requires --save-watch-history.
从观看历史记录中选择一个文件。需要 --save-watch-history 。 - g-w
- Select a file from watch later config files (see RESUMING PLAYBACK) to
resume playing. Requires --write-filename-in-watch-later-config.
从稍后观看配置文件中选择一个文件以继续播放(见 RESUMING PLAYBACK)。需要 --write-filename-in-watch-later-config 。 - g-b
- Select a defined input binding.
选择一个定义好的输入绑定。 - g-r
- Show the values of all properties.
显示所有属性的值。 - g-m, MENU, Ctrl+p g-m, 菜单, Ctrl+p
- Show a menu with miscellaneous entries.
显示包含杂项条目的菜单。
See SELECT for more information.
查看 SELECT 以获取更多信息。
(The following keys are valid if you have a keyboard with multimedia keys.)
(如果您有带多媒体键的键盘,以下键是有效的。)
- PAUSE 暂停
- Pause. 暂停。
- STOP 停止
- Stop playing and quit.
停止播放并退出。 - PREVIOUS and NEXT 上一页和下一页
- Seek backward/forward 1 minute.
向后/向前搜索 1 分钟。 - ZOOMIN and ZOOMOUT 放大和缩小
- Change video zoom. 更改视频缩放。
If you miss some older key bindings, look at etc/restore-old-bindings.conf
in the mpv git repository.
如果您错过了某些旧快捷键,请查看 mpv 代码库中的 etc/restore-old-bindings.conf 。
Mouse Control 鼠标控制
- Ctrl+left click Ctrl+左键点击
- Pan while holding the button, keeping the clicked part of the video under
the cursor.
按住按钮同时进行拖动,保持视频中被点击的部分位于光标下方。 - Left double click 左键双击
- Toggle fullscreen on/off.
切换全屏开/关。 - Right click 右键点击
- Toggle pause on/off. 切换暂停/开启。
- Forward/Back button 前进/后退按钮
- Skip to next/previous entry in playlist.
跳转到播放列表中的下一个/上一个条目。 - Wheel up/down 滚轮向上/向下
- Decrease/increase volume.
减小/增大音量。 - Wheel left/right 方向盘左/右
- Seek forward/backward 10 seconds.
快进/快退 10 秒。 - Ctrl+Wheel up/down Ctrl+滚轮上/下
- Change video zoom keeping the part of the video hovered by the cursor under
it.
更改视频缩放,保持鼠标悬停部分始终位于视频下方。
USAGE 用法
Command line arguments starting with - are interpreted as options,
everything else as filenames or URLs. All options except flag options (or
choice options which include yes) require a parameter in the form
--option=value.
以 - 开头的命令行参数被解释为选项,其余的作为文件名或 URL。除了标志选项(或包含 yes 的选择选项)之外的所有选项都需要以 --option=value 的形式提供参数。
One exception is the lone - (without anything else), which means media data
will be read from stdin. Also, -- (without anything else) will make the
player interpret all following arguments as filenames, even if they start with
-. (To play a file named -, you need to use ./-.)
一个例外是单独的 - (没有其他任何内容),这意味着媒体数据将从 stdin 读取。此外, -- (没有其他任何内容)将使播放器将所有后续参数解释为文件名,即使它们以 - 开头。(要播放名为 - 的文件,需要使用 ./- 。)
Every flag option has a no-flag counterpart, e.g. the opposite of the
--fs option is --no-fs. --fs=yes is same as --fs, --fs=no
is the same as --no-fs.
每个标志选项都有一个无标志对应选项,例如, --fs 选项的相反面是 --no-fs 。 --fs=yes 与 --fs 相同, --fs=no 与 --no-fs 相同。
If an option is marked as (XXX only), it will only work in combination with
the XXX option or if XXX is compiled in.
如果一个选项被标记为(仅 XXX),则它只能与 XXX 选项组合使用,或者如果 XXX 已编译进系统。
Legacy option syntax 旧选项语法
The --option=value syntax is not strictly enforced, and the alternative legacy syntax -option value and -option=value will also work. This is mostly for compatibility with MPlayer. Using these should be avoided. Their semantics can change any time in the future.
For example, the alternative syntax will consider an argument following the option a filename. mpv -fs no will attempt to play a file named no, because --fs is a flag option that requires no parameter. If an option changes and its parameter becomes optional, then a command line using the alternative syntax will break.
Until mpv 0.31.0, there was no difference whether an option started with -- or a single -. Newer mpv releases strictly expect that you pass the option value after a =. For example, before mpv --log-file f.txt would write a log to f.txt, but now this command line fails, as --log-file expects an option value, and f.txt is simply considered a normal file to be played (as in mpv f.txt).
The future plan is that -option value will not work anymore, and options with a single - behave the same as -- options.
Escaping spaces and other special characters
转义空格和其他特殊字符
Keep in mind that the shell will partially parse and mangle the arguments you
pass to mpv. For example, you might need to quote or escape options and
filenames:
请注意,shell 将会部分解析并损坏您传递给 mpv 的参数。例如,您可能需要引用或转义选项和文件名:
mpv "filename with spaces.mkv" --title="window title"
It gets more complicated if the suboption parser is involved. The suboption
parser puts several options into a single string, and passes them to a
component at once, instead of using multiple options on the level of the
command line.
如果涉及到子选项解析器,事情会变得更加复杂。子选项解析器将多个选项放入一个字符串中,并一次性传递给组件,而不是在命令行级别使用多个选项。
The suboption parser can quote strings with " and [...].
Additionally, there is a special form of quoting with %n% described below.
子选项解析器可以使用 " 和 [...] 引用字符串。此外,下面描述了带有 %n% 的特殊引用形式。
For example, assume the hypothetical foo filter can take multiple options:
例如,假设假设的 foo 过滤器可以接受多个选项:
mpv test.mkv --vf=foo:option1=value1:option2:option3=value3,bar
This passes option1 and option3 to the foo filter, with option2
as flag (implicitly option2=yes), and adds a bar filter after that. If
an option contains spaces or characters like , or :, you need to quote
them:
这会将 option1 和 option3 传递给 foo 过滤器,以 option2 作为标志(隐式地 option2=yes ),并在之后添加一个 bar 过滤器。如果选项包含空格或像 , 或 : 这样的字符,您需要引用它们:
mpv '--vf=foo:option1="option value with spaces",bar'
Shells may actually strip some quotes from the string passed to the commandline,
so the example quotes the string twice, ensuring that mpv receives the "
quotes.
Shell 实际上可能会从传递给命令行的字符串中删除一些引号,因此示例中字符串被引号引用两次,以确保 mpv 接收到的 " 引号正确。
The [...] form of quotes wraps everything between [ and ]. It's
useful with shells that don't interpret these characters in the middle of
an argument (like bash). These quotes are balanced (since mpv 0.9.0): the [
and ] nest, and the quote terminates on the last ] that has no matching
[ within the string. (For example, [a[b]c] results in a[b]c.)
[...] 形式的引号将 [ 和 ] 之间的所有内容括起来。这对于那些在参数中间不解释这些字符的 shell(如 bash)非常有用。这些引号是平衡的(自 mpv 0.9.0 以来): [ 和 ] 嵌套,引号在最后一个没有匹配的 ] 处结束,该 ] 在字符串内部没有对应的 [ 。(例如, [a[b]c] 结果为 a[b]c 。)
The fixed-length quoting syntax is intended for use with external
scripts and programs.
固定长度引用语法旨在与外部脚本和程序一起使用。
It is started with % and has the following format:
它以 % 开头,格式如下:
%n%string_of_length_n
Examples 示例
mpv '--vf=foo:option1=%11%quoted text' test.avi
Or in a script:
或者在脚本中:
mpv --vf=foo:option1=%`expr length "$NAME"`%"$NAME" test.avi
Note: where applicable with JSON-IPC, %n% is the length in UTF-8 bytes,
after decoding the JSON data.
注意:在适用 JSON-IPC 的情况下, %n% 是解码 JSON 数据后的 UTF-8 字节长度。
Suboptions passed to the client API are also subject to escaping. Using
mpv_set_option_string() is exactly like passing --name=data to the
command line (but without shell processing of the string). Some options
support passing values in a more structured way instead of flat strings, and
can avoid the suboption parsing mess. For example, --vf supports
MPV_FORMAT_NODE, which lets you pass suboptions as a nested data structure
of maps and arrays.
子选项传递给客户端 API 时也需要转义。使用 mpv_set_option_string() 与传递 --name=data 到命令行(但无需对字符串进行 shell 处理)完全相同。某些选项支持以更结构化的方式传递值,而不是扁平字符串,从而可以避免子选项解析的混乱。例如, --vf 支持 MPV_FORMAT_NODE ,这允许您将子选项作为嵌套的映射和数组数据结构传递。
Paths 路径
Some care must be taken when passing arbitrary paths and filenames to mpv. For
example, paths starting with - will be interpreted as options. Likewise,
if a path contains the sequence ://, the string before that might be
interpreted as protocol prefix, even though :// can be part of a legal
UNIX path. To avoid problems with arbitrary paths, you should be sure that
absolute paths passed to mpv start with /, and prefix relative paths with
./.
在将任意路径和文件名传递给 mpv 时必须小心。例如,以 - 开头的路径将被解释为选项。同样,如果路径包含序列 :// ,那么该序列之前的字符串可能会被解释为协议前缀,即使 :// 可以是合法的 UNIX 路径的一部分。为了避免与任意路径相关的问题,您应该确保传递给 mpv 的绝对路径以 / 开头,并且相对路径以 ./ 前缀。
Using the file:// pseudo-protocol is discouraged, because it involves
strange URL unescaping rules.
不建议使用 file:// 伪协议,因为它涉及奇怪的 URL 转义规则。
The name - itself is interpreted as stdin, and will cause mpv to disable
console controls. (Which makes it suitable for playing data piped to stdin.)
名称 - 本身被解释为 stdin,这将导致 mpv 禁用控制台控制。(这使得它适合播放通过 stdin 管道传输的数据。)
The special argument -- can be used to stop mpv from interpreting the
following arguments as options.
特殊参数 -- 可以用来阻止 mpv 将后续参数解释为选项。
For paths passed to mpv suboptions (options that have multiple : and
,-separated values), the situation is further complicated by the need to
escape special characters. To work around this, the path can instead be wrapped
in the "fixed-length" syntax, e.g. %n%string_of_length_n (see above).
对于传递给 mpv 子选项(具有多个值并以 - 分隔的选项)的路径,还需要转义特殊字符,这使得情况更加复杂。为了解决这个问题,可以将路径用“固定长度”语法包裹,例如 %n%string_of_length_n (见上文)。
When using the libmpv API, you should strictly avoid using mpv_command_string
for invoking the loadfile command, and instead prefer e.g. mpv_command
to avoid the need for filename escaping.
在使用 libmpv API 时,应严格避免使用 mpv_command_string 来调用 loadfile 命令,而应优先考虑例如 mpv_command 以避免需要转义文件名。
The same applies when you're using the scripting API, where you should avoid using
mp.command, and instead prefer using "separate parameter" APIs, such as
mp.commandv and mp.command_native.
同样适用于使用脚本 API 的情况,此时应避免使用 mp.command ,而应优先考虑使用“单独参数”API,例如 mp.commandv 和 mp.command_native 。
Some mpv options will interpret special meanings for paths starting with ~,
making it easy to dynamically find special directories, such as referring to the
current user's home directory or the mpv configuration directory.
某些 mpv 选项将为以 ~ 开头的路径赋予特殊含义,这使得动态查找特殊目录变得容易,例如引用当前用户的家目录或 mpv 配置目录。
When using the special ~ prefix, there must always be a trailing / after
the special path prefix. In other words, ~ doesn't work, but ~/ will work.
使用特殊 ~ 前缀时,必须在特殊路径前缀后始终跟有一个 / 。换句话说, ~ 不适用,但 ~/ 适用。
The following special paths/keywords are currently recognized:
以下特殊路径/关键字目前被识别:
Warning 警告
Beware that if --no-config is used, all of the "config directory"-based
paths (~~/, ~~home/ and ~~global/) will be empty strings.
请注意,如果使用 --no-config ,则所有基于 "配置目录"-的路径( ~~/ 、 ~~home/ 和 ~~global/ )都将为空字符串。
This means that ~~home/ would expand to an empty string, and that
sub-paths such as ~~home/foo/bar" would expand to a relative path
(foo/bar), which may not be what you expected.
这意味着 ~~home/ 将展开为空字符串,并且子路径如 ~~home/foo/bar" 将展开为相对路径( foo/bar ),这可能不是您预期的结果。
Furthermore, any commands that search in config directories will fail
to find anything, since there won't be any directories to search in.
此外,任何在配置目录中搜索的命令都将无法找到任何内容,因为没有可搜索的目录。
Be sure that your scripts can handle these "no config" scenarios.
请确保您的脚本可以处理这些 "无配置"场景。
Name 名称 | Meaning 含义 |
---|---|
~/ | The current user's home directory (equivalent to ~/ and
$HOME/ in terminal environments). 当前用户的家目录(在终端环境中相当于 ~/ 和 $HOME/ )。 |
~~/ | If the sub-path exists in any of mpv's config directories, then
the path of the existing file/dir is returned. Otherwise this
is equivalent to ~~home/. 如果子路径存在于 mpv 的任何配置目录中,则返回现有文件/目录的路径。否则,这相当于 ~~home/ 。 |
~~home/ | mpv's config dir (for example ~/.config/mpv/). mpv 的配置目录(例如 ~/.config/mpv/ )。 |
~~global/ | The global config path (such as /etc/mpv), if available
(not on win32). 全局配置路径(例如 /etc/mpv ),如果可用(非 win32)。 |
~~osxbundle/ | The macOS bundle resource path (macOS only). macOS 捆绑资源路径(仅 macOS)。 |
~~desktop/ | The path to the desktop (win32, macOS). 桌面路径(win32、macOS)。 |
~~exe_dir/ | The path to the directory containing mpv.exe (for config
file purposes, $MPV_HOME will override this) (win32 only). 目录中包含 mpv.exe 的路径(用于配置文件目的, $MPV_HOME 将覆盖此路径)(仅限 win32)。 |
~~cache/ | The path to application cache data (~/.cache/mpv/).
On some platforms, this will be the same as ~~home/. 应用程序缓存数据的路径( ~/.cache/mpv/ )。在某些平台上,这可能与 ~~home/ 相同。 |
~~state/ | The path to application state data (~/.local/state/mpv/).
On some platforms, this will be the same as ~~home/. 应用程序状态数据的路径( ~/.local/state/mpv/ )。在某些平台上,这可能与 ~~home/ 相同。 |
~~old_home/ | Do not use. 请勿使用。 |
Per-File Options 文件级选项
When playing multiple files, any option given on the command line usually
affects all files. Example:
在播放多个文件时,命令行上给出的任何选项通常会影响所有文件。例如:
mpv --a file1.mkv --b file2.mkv --c
File 文件 | Active options 活动选项 |
---|---|
file1.mkv | --a --b --c |
file2.mkv | --a --b --c |
(This is different from MPlayer and mplayer2.)
(这与 MPlayer 和 mplayer2 不同。)
Also, if any option is changed at runtime (via input commands), they are not
reset when a new file is played.
此外,如果在运行时(通过输入命令)更改了任何选项,当播放新文件时它们不会被重置。
Sometimes, it is useful to change options per-file. This can be achieved by
adding the special per-file markers --{ and --}. (Note that you must
escape these on some shells.) Example:
有时,按文件更改选项很有用。这可以通过添加特殊的按文件标记 --{ 和 --} 来实现。(注意,在某些 shell 中必须对这些标记进行转义。)示例:
mpv --a file1.mkv --b --\{ --c file2.mkv --d file3.mkv --e --\} file4.mkv --f
File 文件 | Active options 活动选项 |
---|---|
file1.mkv | --a --b --f |
file2.mkv | --a --b --f --c --d --e |
file3.mkv | --a --b --f --c --d --e |
file4.mkv | --a --b --f |
Additionally, any file-local option changed at runtime is reset when the current
file stops playing. If option --c is changed during playback of
file2.mkv, it is reset when advancing to file3.mkv. This only affects
file-local options. The option --a is never reset here.
此外,任何在运行时更改的文件本地选项,在当前文件停止播放时都会重置。如果在播放 file2.mkv 期间更改了选项 --c ,则在切换到 file3.mkv 时会重置。这仅影响文件本地选项。选项 --a 在这里永远不会重置。
List Options 列表选项
Some options which store lists of option values can have action suffixes. For
example, the --display-tags option takes a ,-separated list of tags, but
the option also allows you to append a single tag with --display-tags-append,
and the tag name can for example contain a literal , without the need for
escaping.
某些选项可以存储选项值的列表,并且可以具有操作后缀。例如, --display-tags 选项接受一个由 , 分隔的标签列表,但该选项还允许您使用 --display-tags-append 添加单个标签,并且标签名称可以例如包含一个字面量 , 而无需转义。
String list and path list options
字符串列表和路径列表选项
String lists are separated by ,. The strings are not parsed or interpreted
by the option system itself. However, most path or file list options use :
(Unix) or ; (Windows) as separator, instead of ,.
字符串列表由 , 分隔。字符串不会被选项系统本身解析或解释。然而,大多数路径或文件列表选项使用 : (Unix)或 ; (Windows)作为分隔符,而不是 , 。
They support the following operations:
它们支持以下操作:
Suffix 后缀 | Meaning 含义 |
---|---|
-set -设置 | Set a list of items (using the list separator, escaped with backslash) 设置一个项目列表(使用列表分隔符,用反斜杠转义) |
-append -追加 | Append single item (does not interpret escapes) 追加单个项目(不解释转义字符) |
-add -添加 | Append 1 or more items (same syntax as -set) 追加 1 个或多个项目(与-set 语法相同) |
-pre -预 | Prepend 1 or more items (same syntax as -set) 预置 1 个或多个项目(与 -set 的语法相同) |
-clr | Clear the option (remove all items) 清除选项(移除所有项目) |
-del | Delete 1 or more items if present (same syntax as -set) 如果存在,删除 1 个或多个项目(与-set 的语法相同) |
-remove | Delete item if present (does not interpret escapes) 如果存在则删除项目(不解释转义字符) |
-toggle -切换 | Append an item, or remove it if it already exists (no escapes) 追加一个项目,如果它已存在则移除(不进行转义) |
-append is meant as a simple way to append a single item without having
to escape the argument (you may still need to escape on the shell level).
-append 被视为一种简单的方法来追加单个项目,无需对参数进行转义(你仍然可能需要在 shell 级别上进行转义)。
Key/value list options 键/值列表选项
A key/value list is a list of key/value string pairs. In programming languages,
this type of data structure is often called a map or a dictionary. The order
normally does not matter, although in some cases the order might matter.
键/值列表是一系列键/值字符串对。在编程语言中,这种类型的数据结构通常被称为映射或字典。通常顺序不重要,尽管在某些情况下顺序可能很重要。
They support the following operations:
它们支持以下操作:
Suffix 后缀 | Meaning 含义 |
---|---|
-set -设置 | Set a list of items (using , as separator) 设置一个项目列表(使用 , 作为分隔符) |
-append -追加 | Append a single item (escapes for the key, no escapes for the value) 追加单个项目(键转义,值不转义) |
-add -添加 | Append 1 or more items (same syntax as -set) 追加 1 个或多个项目(与-set 语法相同) |
-clr | Clear the option (remove all items) 清除选项(移除所有项目) |
-del | Delete 1 or more keys if present (same syntax as -set) 如果存在,删除 1 个或多个键(与-set 的语法相同) |
-remove | Delete item by key if present (does not interpret escapes) 如果存在,则通过键删除项目(不解释转义字符) |
Keys are unique within the list. If an already present key is set, the existing
key is removed before the new value is appended.
键在列表中是唯一的。如果已存在键被设置,则在新值附加之前,现有的键将被移除。
If you want to pass a value without interpreting it for escapes or ,, it is
recommended to use the -append variant. When using libmpv, prefer using
MPV_FORMAT_NODE_MAP; when using a scripting backend or the JSON IPC, use an
appropriate structured data type.
如果您想传递一个不进行转义字符或 , 解释的值,建议使用 -append 变体。当使用 libmpv 时,建议使用 MPV_FORMAT_NODE_MAP ;当使用脚本后端或 JSON IPC 时,使用适当的结构化数据类型。
Prior to mpv 0.33, : was also recognized as separator by -set.
在 mpv 0.33 之前, : 也被 -set 识别为分隔符。
Object settings list options
对象设置列表选项
This is a very complex option type for some options, such as --af and --vf.
They often require complicated escaping. See VIDEO FILTERS for details.
这是一个非常复杂的选项类型,用于某些选项,例如 --af 和 --vf 。它们通常需要复杂的转义。请参阅 VIDEO FILTERS 获取详细信息。
They support the following operations:
它们支持以下操作:
Suffix 后缀 | Meaning 含义 |
---|---|
-set -设置 | Set a list of items (using , as separator) 设置一个项目列表(使用 , 作为分隔符) |
-append -追加 | Append single item 追加单个项目 |
-add -添加 | Append 1 or more items (same syntax as -set) 追加 1 个或多个项目(与-set 语法相同) |
-pre -预 | Prepend 1 or more items (same syntax as -set) 预置 1 个或多个项目(与 -set 的语法相同) |
-clr | Clear the option (remove all items) 清除选项(移除所有项目) |
-remove | Delete 1 or items if present (same syntax as -set) 删除 1 或存在的项目(与 -set 的语法相同) |
-toggle -切换 | Append an item, or remove it if it already exists 添加一个项目,如果它已存在则移除 |
-help -帮助 | Pseudo operation that prints a help text to the terminal 伪操作,用于在终端打印帮助文本 |
General 通用
Without suffix, the operation used is normally -set.
没有后缀时,使用的操作通常是 -set 。
Some operations like -add and -pre specify multiple items, but be
aware that you may need to escape the arguments. -append accepts a single,
unescaped item only (so the , separator will not be interpreted and
is passed on as part of the value).
一些操作(如 -add 和 -pre )指定多个项目,但请注意您可能需要转义参数。 -append 只接受单个未转义的项(因此 , 分隔符不会被解释,并将其作为值的一部分传递)。
Some options (like --sub-file, --audio-file, --glsl-shader) are
aliases for the proper option with -append action. For example,
--sub-file is an alias for --sub-files-append.
一些选项(如 --sub-file 、 --audio-file 、 --glsl-shader )是带有 -append 操作的正确选项的别名。例如, --sub-file 是 --sub-files-append 的别名。
Options of this type can be changed at runtime using the change-list
command, which takes the suffix (without the -) as separate operation
parameter.
此类型的选项可以使用 change-list 命令在运行时进行更改,该命令将后缀(不带 - )作为单独的操作参数。
An object settings list can hold up to 100 elements.
对象设置列表可以存储多达 100 个元素。
CONFIGURATION FILES 配置文件
Location and Syntax 位置和语法
You can put all of the options in configuration files which will be read every
time mpv is run. The system-wide configuration file 'mpv.conf' is in your
configuration directory (e.g. /etc/mpv or /usr/local/etc/mpv), the
user-specific one is ~/.config/mpv/mpv.conf. For details and platform
specifics (in particular Windows paths) see the FILES section.
您可以将所有选项放入配置文件中,这些文件将在每次运行 mpv 时被读取。系统级配置文件 'mpv.conf' 位于您的配置目录中(例如 /etc/mpv 或 /usr/local/etc/mpv ),用户特定的配置文件是 ~/.config/mpv/mpv.conf 。有关详细信息和平台特定信息(特别是 Windows 路径),请参阅“文件”部分。
User-specific options override system-wide options and options given on the
command line override both. The syntax of the configuration files is
option=value. Everything after a # is considered a comment. Options that
work without values can be enabled by setting them to yes and disabled by
setting them to no, and if the value is omitted, yes is implied. Even
suboptions can be specified in this way.
用户特定的选项会覆盖系统级选项,而命令行上的选项会覆盖两者。配置文件的语法是 option=value 。在 # 之后的所有内容都被视为注释。无需值的选项可以通过将其设置为 yes 来启用,通过将其设置为 no 来禁用,如果省略了值,则默认为 yes。甚至子选项也可以这样指定。
Example configuration file
示例配置文件
# Don't allow new windows to be larger than the screen. autofit-larger=100%x100% # Enable hardware decoding if available, =yes is implied. hwdec # Spaces don't have to be escaped. osd-playing-msg=File: ${filename}
Escaping special characters
转义特殊字符
This is done like with command line options. A config entry can be quoted with
", ', as well as with the fixed-length syntax (%n%) mentioned
before. This is like passing the exact contents of the quoted string as a
command line option. C-style escapes are currently _not_ interpreted on this
level, although some options do this manually (this is a mess and should
probably be changed at some point). The shell is not involved here, so option
values only need to be quoted to escape # anywhere in the value, ",
' or % at the beginning of the value, and leading and trailing
whitespace.
这就像使用命令行选项一样完成。配置条目可以用 " , ' 引用,也可以用之前提到的固定长度语法( %n% )。这就像将引用字符串的精确内容作为命令行选项传递。目前在这个级别上,C 样式的转义 _不_ 被解释,尽管一些选项会手动这样做(这很混乱,可能迟早需要改变)。这里不涉及 shell,因此选项值只需要引用以转义值中的任何位置 # , " , ' 或值开头的 % ,以及前导和尾随空格。
Putting Command Line Options into the Configuration File
将命令行选项放入配置文件
Almost all command line options can be put into the configuration file. Here
is a small guide:
几乎所有的命令行选项都可以放入配置文件。这里有一个小指南:
Option 选项 | Configuration file entry 配置文件条目 |
---|---|
--flag | flag |
-opt val | opt=val |
--opt=val | opt=val |
-opt "has spaces" | opt=has spaces |
File-specific Configuration Files
特定文件配置文件
You can also write file-specific configuration files. If you wish to have a
configuration file for a file called 'video.avi', create a file named
'video.avi.conf' with the file-specific options in it and put it in
~/.config/mpv/. You can also put the configuration file in the same directory
as the file to be played. Both require you to set the --use-filedir-conf
option (either on the command line or in your global config file). If a
file-specific configuration file is found in the same directory, no
file-specific configuration is loaded from ~/.config/mpv. In addition, the
--use-filedir-conf option enables directory-specific configuration files.
For this, mpv first tries to load a mpv.conf from the same directory
as the file played and then tries to load any file-specific configuration.
您也可以编写特定文件的配置文件。如果您希望为名为 'video.avi' 的文件创建配置文件,请创建一个名为 'video.avi.conf' 的文件,在其中包含特定文件的选项,并将其放在 ~/.config/mpv/ 中。您也可以将配置文件放在要播放的文件所在的同一目录中。两者都需要您设置 --use-filedir-conf 选项(无论是在命令行还是在您的全局配置文件中)。如果在同一目录中找到特定文件的配置文件,则不会从 ~/.config/mpv 加载特定文件配置。此外, --use-filedir-conf 选项启用特定目录的配置文件。为此,mpv 首先尝试从播放的文件所在的同一目录加载 mpv.conf,然后尝试加载任何特定文件的配置。
Profiles 配置文件
To ease working with different configurations, profiles can be defined in the
configuration files. A profile starts with its name in square brackets,
e.g. [my-profile]. All following options will be part of the profile. A
description (shown by --profile=help) can be defined with the
profile-desc option. To end the profile, start another one or use the
profile name default to continue with normal options.
为了方便处理不同的配置,可以在配置文件中定义配置文件。一个配置文件以方括号中的名称开始,例如 [my-profile] 。所有后续选项都将成为配置文件的一部分。可以使用 profile-desc 选项定义描述(通过 --profile=help 显示)。要结束配置文件,可以开始另一个配置文件或使用配置文件名称 default 继续使用常规选项。
You can list profiles with --profile=help, and show the contents of a
profile with --show-profile=<name> (replace <name> with the profile
name). You can apply profiles on start with the --profile=<name> option,
or at runtime with the apply-profile <name> command.
可以使用 --profile=help 列出配置文件,并使用 --show-profile=<name> 显示配置文件的内容(将 <name> 替换为配置文件名称)。您可以在启动时使用 --profile=<name> 选项应用配置文件,或在运行时使用 apply-profile <name> 命令应用。
Example mpv config file with profiles
带有配置文件的示例 mpv 配置文件
# normal top-level option fullscreen=yes # a profile that can be enabled with --profile=big-cache [big-cache] cache=yes demuxer-max-bytes=512MiB demuxer-readahead-secs=20 [network] profile-desc="profile for content over network" force-window=immediate # you can also include other profiles profile=big-cache [reduce-judder] video-sync=display-resample interpolation=yes # using a profile again extends it [network] demuxer-max-back-bytes=512MiB # reference a builtin profile profile=fast
Runtime profiles 运行时配置文件
Profiles can be set at runtime with apply-profile command. Since this
operation is "destructive" (every item in a profile is simply set as an
option, overwriting the previous value), you can't just enable and disable
profiles again.
配置文件可以在运行时使用 apply-profile 命令设置。由于此操作是“破坏性”的(配置文件中的每个项目都简单地设置为选项,覆盖之前的值),因此您不能再次启用和禁用配置文件。
As a partial remedy, there is a way to make profiles save old option values
before overwriting them with the profile values, and then restoring the old
values at a later point using apply-profile <profile-name> restore.
作为部分补救措施,有一种方法可以在覆盖配置文件值之前保存旧选项值,然后在稍后使用 apply-profile <profile-name> restore 恢复旧值。
This can be enabled with the profile-restore option, which takes one of
the following options:
这可以通过 profile-restore 选项启用,该选项接受以下选项之一:
- default
- Does nothing, and nothing can be restored (default).
无操作,且无法恢复(默认)。- copy
When applying a profile, copy the old values of all profile options to a backup before setting them from the profile. These options are reset to their old values using the backup when restoring.
应用配置文件时,在从配置文件设置之前,将所有配置选项的旧值复制到备份中。在恢复时,使用备份将这些选项重置为旧值。Every profile has its own list of backed up values. If the backup already exists (e.g. if apply-profile name was called more than once in a row), the existing backup is no changed. The restore operation will remove the backup.
每个配置文件都有自己的备份值列表。如果备份已存在(例如,如果连续多次调用了 apply-profile name ),则现有备份不会被更改。恢复操作将删除备份。It's important to know that restoring does not "undo" setting an option, but simply copies the old option value. Consider for example vf-add, appends an entry to vf. This mechanism will simply copy the entire vf list, and does _not_ execute the inverse of vf-add (that would be vf-remove) on restoring.
重要的是要知道,恢复操作不会“撤销”设置选项,而只是复制旧选项值。例如,考虑 vf-add ,向 vf 中追加条目。此机制将简单地复制整个 vf 列表,并且在恢复时不会执行 vf-add 的逆操作(那将是 vf-remove )。Note that if a profile contains recursive profiles (via the profile option), the options in these recursive profiles are treated as if they were part of this profile. The referenced profile's backup list is not used when creating or using the backup. Restoring a profile does not restore referenced profiles, only the options of referenced profiles (as if they were part of the main profile).
请注意,如果配置文件包含递归配置文件(通过 profile 选项),则这些递归配置文件中的选项被视为此配置文件的一部分。创建或使用备份时不会使用引用配置文件的备份列表。恢复配置文件不会恢复引用配置文件,只会恢复引用配置文件的选项(就像它们是主配置文件的一部分一样)。- copy-equal
- Similar to copy, but restore an option only if it has the same value as the value effectively set by the profile. This tries to deal with the situation when the user does not want the option to be reset after interactively changing it.
类似于 copy ,但仅在选项具有与配置文件实际设置的值相同的值时才恢复选项。这试图处理用户在交互式更改选项后不希望重置选项的情况。
Example 示例
[something] profile-restore=copy-equal vf-add=rotate=PI/2 # rotate by 90 degrees
Then running these commands will result in behavior as commented:
然后运行这些命令将导致如注释所示的行为:
set vf vflip apply-profile something vf add hflip apply-profile something # vf == vflip,rotate=PI/2,hflip,rotate=PI/2 apply-profile something restore # vf == vflip
Conditional auto profiles
条件自动配置文件
Profiles which have the profile-cond option set are applied automatically
if the associated condition matches (unless auto profiles are disabled). The
option takes a string, which is interpreted as Lua expression. If the
expression evaluates as truthy, the profile is applied. If the expression
errors or evaluates as falsy, the profile is not applied. This Lua code
execution is not sandboxed.
设置了 profile-cond 选项的配置文件,如果关联的条件匹配(除非禁用自动配置文件),则自动应用。该选项接受一个字符串,该字符串被解释为 Lua 表达式。如果表达式评估为真值,则应用配置文件。如果表达式出错或评估为假值,则不应用配置文件。此 Lua 代码执行不受沙箱限制。
Any variables in condition expressions can reference properties. If an
identifier is not already defined by Lua or mpv, it is interpreted as property.
For example, pause would return the current pause status. You cannot
reference properties with - this way since that would denote a subtraction,
but if the variable name contains any _ characters, they are turned into
-. For example, playback_time would return the property
playback-time.
条件表达式中的任何变量都可以引用属性。如果标识符尚未由 Lua 或 mpv 定义,则将其解释为属性。例如, pause 会返回当前暂停状态。您不能以这种方式引用属性,因为 - 表示减法,但如果变量名包含任何 _ 字符,它们将被转换为 - 。例如, playback_time 会返回属性 playback-time 。
A more robust way to access properties is using p.property_name or
get("property-name", default_value). The automatic variable to property
magic will break if a new identifier with the same name is introduced (for
example, if a function named pause() were added, pause would return a
function value instead of the value of the pause property).
访问属性的一种更健壮的方法是使用 p.property_name 或 get("property-name", default_value) 。如果引入了具有相同名称的新标识符(例如,如果添加了一个名为 pause() 的函数, pause 将返回函数值而不是 pause 属性的值),则自动变量到属性的魔法将失效。
Note that if a property is not available, it will return nil, which can
cause errors if used in expressions. These are logged in verbose mode, and the
expression is considered to be false.
请注意,如果属性不可用,它将返回 nil ,如果在表达式中使用可能会导致错误。这些错误会在详细模式下记录,并且表达式被视为假。
Whenever a property referenced by a profile condition changes, the condition
is re-evaluated. If the return value of the condition changes from falsy or
error to truthy, the profile is applied.
每当由配置文件条件引用的属性发生变化时,条件将被重新评估。如果条件的返回值从假或错误变为真,则应用配置文件。
This mechanism tries to "unapply" profiles once the condition changes from
truthy to falsy or error. If you want to use this, you need to set
profile-restore for the profile. Another possibility it to create another
profile with an inverse condition to undo the other profile.
此机制尝试在条件从真变为假或错误时“取消应用”配置文件。如果您想使用此功能,您需要为配置文件设置 profile-restore 。另一种可能性是创建另一个具有相反条件的配置文件来撤销另一个配置文件。
Recursive profiles can be used. But it is discouraged to reference other
conditional profiles in a conditional profile, since this can lead to tricky
and unintuitive behavior.
可以使用递归配置文件。但建议不要在条件配置文件中引用其他条件配置文件,因为这可能导致复杂且不直观的行为。
Example 示例
Make only HD video look funny:
仅使高清视频看起来有趣:
[something] profile-desc=HD video sucks profile-cond=width >= 1280 hue=-50
Make only videos containing "youtube" or "youtu.be" in their path brighter:
仅使路径中包含 "youtube" 或 "youtu.be" 的视频更亮:
[youtube] profile-cond=path:find('youtu%.?be') gamma=20
If you want the profile to be reverted if the condition goes to false again,
you can set profile-restore:
如果希望当条件再次变为假时恢复配置文件,您可以设置 profile-restore :
[something] profile-desc=Mess up video when entering fullscreen profile-cond=fullscreen profile-restore=copy vf-add=rotate=PI/2 # rotate by 90 degrees
This appends the rotate filter to the video filter chain when entering
fullscreen. When leaving fullscreen, the vf option is set to the value
it had before entering fullscreen. Note that this would also remove any
other filters that were added during fullscreen mode by the user. Avoiding
this is trickier, and could for example be solved by adding a second profile
with an inverse condition and operation:
当进入全屏时,此操作将 rotate 过滤器添加到视频过滤器链中。当离开全屏时, vf 选项将设置为进入全屏前的值。请注意,这也会移除用户在全屏模式下添加的任何其他过滤器。避免这种情况可能更困难,例如可以通过添加一个具有相反条件和操作的第二个配置文件来解决:
[something] profile-cond=fullscreen vf-add=@rot:rotate=PI/2 [something-inv] profile-cond=not fullscreen vf-remove=@rot
Warning 警告
Every time an involved property changes, the condition is evaluated again.
If your condition uses p.playback_time for example, the condition is
re-evaluated approximately on every video frame. This is probably slow.
每当涉及的属性发生变化时,条件都会重新评估。如果你的条件使用 p.playback_time ,例如,条件大约会在每个视频帧上重新评估一次。这可能会很慢。
This feature is managed by an internal Lua script. Conditions are executed as
Lua code within this script. Its environment contains at least the following
things:
此功能由内部 Lua 脚本管理。条件作为脚本内的 Lua 代码执行。其环境至少包含以下内容:
- (function environment table)
Every Lua function has an environment table. This is used for identifier access. There is no named Lua symbol for it; it is implicit.
每个 Lua 函数都有一个环境表。这用于标识符访问。没有命名的 Lua 符号表示它;它是隐式的。The environment does "magic" accesses to mpv properties. If an identifier is not already defined in _G, it retrieves the mpv property of the same name. Any occurrences of _ in the name are replaced with - before reading the property. The returned value is as retrieved by mp.get_property_native(name). Internally, a cache of property values, updated by observing the property is used instead, so properties that are not observable will be stuck at the initial value forever.
环境对 mpv 属性进行“魔法”访问。如果标识符尚未在 _G 中定义,它将检索同名的 mpv 属性。在读取属性之前,名称中的任何 _ 都将被替换为 - 。返回的值与 mp.get_property_native(name) 检索的值相同。内部,使用由观察属性更新的属性值缓存,因此不可观察的属性将永远停留在初始值。If you want to access properties, that actually contain _ in the name, use get() (which does not perform transliteration).
如果您想访问名称中实际上包含 _ 的属性,请使用 get() (它不执行转写)。Internally, the environment table has a __index meta method set, which performs the access logic.
内部,环境表有一个 __index 元方法集,它执行访问逻辑。- p
- A "magic" table similar to the environment table. Unlike the latter, this
does not prefer accessing variables defined in _G - it always accesses
properties.
一个类似于环境表的“魔法”表。与后者不同,这个不优先访问在 _G 定义的变量 - 它总是访问属性。 - get(name [, def])
Read a property and return its value. If the property value is nil (e.g. if the property does not exist), def is returned.
读取一个属性并返回其值。如果属性值为 nil (例如,如果属性不存在),则返回 def 。This is superficially similar to mp.get_property_native(name). An important difference is that this accesses the property cache, and enables the change detection logic (which is essential to the dynamic runtime behavior of auto profiles). Also, it does not return an error value as second return value.
这表面上类似于 mp.get_property_native(name) 。一个重要区别是,它访问属性缓存,并启用更改检测逻辑(这对于自动配置的动态运行时行为至关重要)。此外,它不会作为第二个返回值返回错误值。The "magic" tables mentioned above use this function as backend. It does not perform the _ transliteration.
上述“魔法”表使用此函数作为后端。它不执行 _ 转写。
In addition, the same environment as in a blank mpv Lua script is present. For
example, math is defined and gives access to the Lua standard math library.
此外,与空白 mpv Lua 脚本相同的运行环境也存在。例如, math 已定义,并提供对 Lua 标准数学库的访问。
Warning 警告
This feature is subject to change indefinitely. You might be forced to
adjust your profiles on mpv updates.
此功能可能无限期更改。您可能需要在 mpv 更新时调整您的配置文件。
Legacy auto profiles 遗产自动配置文件
Some profiles are loaded automatically using a legacy mechanism. The following
example demonstrates this:
一些配置文件使用旧机制自动加载。以下示例演示了这一点:
Auto profile loading 自动配置文件加载
[extension.mkv] profile-desc="profile for .mkv files" vf=vflip
The profile name follows the schema type.name, where type can be
protocol for the input/output protocol in use (see --list-protocols),
and extension for the extension of the path of the currently played file
(not the file format).
配置文件名称遵循模式 type.name ,其中类型可以是 protocol 用于当前使用的输入/输出协议(见 --list-protocols ),以及 extension 用于当前播放文件路径的扩展(不是文件格式)。
This feature is very limited, and is considered soft-deprecated. Use conditional
auto profiles.
此功能非常有限,被视为软弃用。请使用条件自动配置文件。
Using mpv from other programs or scripts
在其他程序或脚本中使用 mpv
There are three choices for using mpv from other programs or scripts:
从其他程序或脚本中使用 mpv 有三种选择:
Calling it as UNIX process. If you do this, do not parse terminal output. The terminal output is intended for humans, and may change any time. In addition, terminal behavior itself may change any time. Compatibility cannot be guaranteed.
将其作为 UNIX 进程调用。如果您这样做,请不要解析终端输出。终端输出是针对人类的,可能会随时更改。此外,终端行为本身也可能会随时更改。无法保证兼容性。Your code should work even if you pass --terminal=no. Do not attempt to simulate user input by sending terminal control codes to mpv's stdin. If you need interactive control, using --input-ipc-server or --input-ipc-client is recommended. This gives you access to the JSON IPC over unix domain sockets (or named pipes on Windows).
即使您传递 --terminal=no ,您的代码也应该能正常工作。不要尝试通过向 mpv 的 stdin 发送终端控制代码来模拟用户输入。如果您需要交互式控制,建议使用 --input-ipc-server 或 --input-ipc-client 。这为您提供了通过 UNIX 域套接字(或在 Windows 上的命名管道)访问 JSON IPC 的权限。Depending on what you do, passing --no-config or --config-dir may be a good idea to avoid conflicts with the normal mpv user configuration intended for CLI playback.
根据您的操作,传递 --no-config 或 --config-dir 可能是一个好主意,以避免与为 CLI 播放而设计的正常 mpv 用户配置发生冲突。Using --input-ipc-server or --input-ipc-client is also suitable for purposes like remote control (however, the IPC protocol itself is not "secure" and not intended to be so).
使用 --input-ipc-server 或 --input-ipc-client 也适用于远程控制等目的(然而,IPC 协议本身并不“安全”,也不打算如此)。Using libmpv. This is generally recommended when mpv is used as playback backend for a completely different application. The provided C API is very close to CLI mechanisms and the scripting API.
使用 libmpv。当 mpv 作为完全不同应用的播放后端时,通常推荐这样做。提供的 C API 与 CLI 机制和脚本 API 非常相似。Note that even though libmpv has different defaults, it can be configured to work exactly like the CLI player (except command line parsing is unavailable).
请注意,尽管 libmpv 有不同的默认设置,但它可以被配置得与 CLI 播放器完全一样(除了命令行解析不可用)。See EMBEDDING INTO OTHER PROGRAMS (LIBMPV).
查看 EMBEDDING INTO OTHER PROGRAMS (LIBMPV)。As a user script (LUA SCRIPTING, JAVASCRIPT, C PLUGINS). This is recommended when the goal is to "enhance" the CLI player. Scripts get access to the entire client API of mpv.
作为用户脚本(LUA 脚本编写,JAVASCRIPT,C 插件)。当目标是“增强”CLI 播放器时,这是推荐的。脚本可以访问 mpv 的整个客户端 API。This is the standard way to create third-party extensions for the player.
这是为播放器创建第三方扩展的标准方式。
All these access the client API, which is the sum of the various mechanisms
provided by the player core, as documented here: OPTIONS,
List of Input Commands, Properties, List of events (also see C API),
Hooks.
所有这些都访问客户端 API,它是播放器核心提供的各种机制的汇总,如在此处文档所述:选项,输入命令列表,属性,事件列表(也可参见 C API),钩子。
TAKING SCREENSHOTS 截取屏幕截图
Screenshots of the currently played file can be taken using the 'screenshot'
input mode command, which is by default bound to the s key. Files named
mpv-shotNNNN.jpg will be saved in the working directory, using the first
available number - no files will be overwritten. In pseudo-GUI mode, the
screenshot will be saved somewhere else. See PSEUDO GUI MODE.
当前播放文件的截图可以使用 'screenshot' 输入模式命令来获取,该命令默认绑定到 s 键。名为 mpv-shotNNNN.jpg 的文件将保存在工作目录中,使用第一个可用的数字 - 不会覆盖任何文件。在伪 GUI 模式下,截图将保存在其他位置。请参阅 PSEUDO GUI MODE。
A screenshot will usually contain the unscaled video contents at the end of the
video filter chain and subtitles. By default, S takes screenshots without
subtitles, while s includes subtitles.
截图通常包含视频滤镜链末尾未缩放的视频内容和字幕。默认情况下, S 不包含字幕进行截图,而 s 包含字幕。
Unlike with MPlayer, the screenshot video filter is not required. This
filter was never required in mpv, and has been removed.
与 MPlayer 不同, screenshot 视频滤镜不是必需的。这个滤镜在 mpv 中从未是必需的,并且已被移除。
TERMINAL STATUS LINE 终端状态行
During playback, mpv shows the playback status on the terminal. It looks like
something like this:
在播放过程中,mpv 在终端上显示播放状态。看起来像这样:
AV: 00:03:12 / 00:24:25 (13%) A-V: -0.000
The status line can be overridden with the --term-status-msg option.
状态行可以通过 --term-status-msg 选项进行覆盖。
The following is a list of things that can show up in the status line. Input
properties, that can be used to get the same information manually, are also
listed.
以下是在状态行中可能显示的项目列表。还包括可以手动获取相同信息的输入属性列表。
- AV: or V: (video only) or A: (audio only)
AV: 或 V: (仅视频)或 A: (仅音频) - The current time position in HH:MM:SS format (playback-time property)
当前时间位置,格式为 HH:MM:SS ( playback-time 属性) - The total file duration (absent if unknown) (duration property)
总文件时长(如果未知则不存在)( duration 属性) - Playback speed, e.g. x2.0. Only visible if the speed is not normal. This
is the user-requested speed, and not the actual speed (usually they should
be the same, unless playback is too slow). (speed property.)
播放速度,例如 x2.0 。仅在速度不是正常速度时可见。这是用户请求的速度,而不是实际速度(通常它们应该是相同的,除非播放速度过慢)。( speed 属性。) - Playback percentage, e.g. (13%). How much of the file has been played.
Normally calculated out of playback position and duration, but can fallback
to other methods (like byte position) if these are not available.
(percent-pos property.)
播放百分比,例如 (13%) 。表示文件播放了多少。通常根据播放位置和持续时间计算,但在这些不可用的情况下可以回退到其他方法(如字节位置)。( percent-pos 属性。) - The audio/video sync as A-V: 0.000. This is the difference between
audio and video time. Normally it should be 0 or close to 0. If it's growing,
it might indicate a playback problem. (avsync property.)
音频/视频同步为 A-V: 0.000 。这是音频和视频时间之间的差异。通常应该是 0 或接近 0。如果它在增长,可能表明播放问题。( avsync 属性。) - Total A/V sync change, e.g. ct: -0.417. Normally invisible. Can show up
if there is audio "missing", or not enough frames can be dropped. Usually
this will indicate a problem. (total-avsync-change property.)
总 A/V 同步变化,例如 ct: -0.417 。通常不可见。如果有音频“缺失”,或者无法丢弃足够的帧,则可能会显示。通常这会表明问题。( total-avsync-change 属性。) - Encoding state in {...}, only shown in encoding mode.
在 {...} 中显示编码状态,仅在编码模式下显示。 - Display sync state. If display sync is active (display-sync-active
property), this shows DS: 2.500/13, where the first number is average
number of vsyncs per video frame (e.g. 2.5 when playing 24Hz videos on 60Hz
screens), which might jitter if the ratio doesn't round off, or there are
mistimed frames (vsync-ratio), and the second number of estimated number
of vsyncs which took too long (vo-delayed-frame-count property). The
latter is a heuristic, as it's generally not possible to determine this with
certainty.
显示同步状态。如果显示同步处于活动状态( display-sync-active 属性),则显示 DS: 2.500/13 ,其中第一个数字是每视频帧的平均 vsync 数(例如,在 60Hz 屏幕上播放 24Hz 视频时为 2.5),如果比率四舍五入不精确,或者存在时间错误的帧( vsync-ratio ),则可能会出现抖动;第二个数字是估计的耗时过多的 vsync 数( vo-delayed-frame-count 属性)。后者是一种启发式方法,因为通常无法确定这一点。 - Dropped frames, e.g. Dropped: 4. Shows up only if the count is not 0. Can
grow if the video framerate is higher than that of the display, or if video
rendering is too slow. May also be incremented on "hiccups" and when the video
frame couldn't be displayed on time. (frame-drop-count property.)
If the decoder drops frames, the number of decoder-dropped frames is appended
to the display as well, e.g.: Dropped: 4/34. This happens only if
decoder frame dropping is enabled with the --framedrop options.
(decoder-frame-drop-count property.)
丢帧,例如 Dropped: 4 。只有当计数不为 0 时才会显示。如果视频帧率高于显示帧率,或者视频渲染太慢,则可能会增加。在“抽搐”和视频帧未能及时显示时也可能增加。( frame-drop-count 属性。)如果解码器丢帧,解码器丢帧的数量也会附加到显示上,例如: Dropped: 4/34 。这仅在解码器帧丢弃启用时才会发生,使用 --framedrop 选项。( decoder-frame-drop-count 属性。) - Cache state, e.g. Cache: 2s/134KB. Visible if the stream cache is enabled.
The first value shows the amount of video buffered in the demuxer in seconds,
the second value shows the estimated size of the buffered amount in kilobytes.
(demuxer-cache-duration and demuxer-cache-state properties.)
缓存状态,例如 Cache: 2s/134KB 。如果启用了流缓存,则可见。第一个值显示在解复用器中缓冲的视频量(以秒为单位),第二个值显示缓冲量的估计大小(以千字节为单位)。( demuxer-cache-duration 和 demuxer-cache-state 属性。)
LOW LATENCY PLAYBACK 低延迟播放
mpv is optimized for normal video playback, meaning it actually tries to buffer
as much data as it seems to make sense. This will increase latency. Reducing
latency is possible only by specifically disabling features which increase
latency.
mpv 针对正常视频播放进行了优化,这意味着它实际上会尝试缓冲尽可能多的数据。这将增加延迟。只有通过专门禁用增加延迟的功能,才能减少延迟。
The builtin low-latency profile tries to apply some of the options which can
reduce latency. You can use --profile=low-latency to apply all of them. You
can list the contents with --show-profile=low-latency (some of the options
are quite obscure, and may change every mpv release).
内置的 low-latency 配置文件尝试应用一些可以减少延迟的选项。您可以使用 --profile=low-latency 应用所有这些选项。您可以使用 --show-profile=low-latency 列出内容(一些选项相当晦涩,并且可能随着每个 mpv 版本的发布而更改。)
Be aware that some of the options can reduce playback quality.
请注意,一些选项可能会降低回放质量。
Most latency is actually caused by inconvenient timing behavior. You can disable
this with --untimed, but it will likely break, unless the stream has no
audio, and the input feeds data to the player at a constant rate.
大多数延迟实际上是由不便利的时间行为引起的。您可以使用 --untimed 来禁用此功能,但它可能会损坏,除非流没有音频,并且输入以恒定速率向播放器提供数据。
Another common problem is with MJPEG streams. These do not signal the correct
framerate. Using --untimed or --correct-pts=no --container-fps-override=60
might help.
另一个常见问题是与 MJPEG 流有关。这些流没有发出正确的帧率信号。使用 --untimed 或 --correct-pts=no --container-fps-override=60 可能会有所帮助。
For livestreams, data can build up due to pausing the stream, due to slightly
lower playback rate, or "buffering" pauses. If the demuxer cache is enabled,
these can be skipped manually. The experimental drop-buffers command can
be used to discard any buffered data, though it's very disruptive.
对于直播流,由于暂停流、略微降低的回放速率或“缓冲”暂停,数据可能会积累。如果启用解复用器缓存,这些可以手动跳过。可以使用实验性的 drop-buffers 命令来丢弃任何缓冲数据,尽管这非常具有破坏性。
In some cases, manually tuning TCP buffer sizes and such can help to reduce
latency.
在某些情况下,手动调整 TCP 缓冲区大小等可以帮助降低延迟。
Additional options that can be tried:
可以尝试的其他选项:
- --opengl-glfinish=yes, can reduce buffering in the graphics driver
--opengl-glfinish=yes ,可以减少图形驱动程序中的缓冲 - --opengl-swapinterval=0, same --opengl-swapinterval=0 ,相同
- --vo=xv, same --vo=xv ,相同
- without audio --framedrop=no --speed=1.01 may help for live sources
(results can be mixed)
无音频 --framedrop=no --speed=1.01 可能有助于实时源(结果可能混合)
RESUMING PLAYBACK 恢复播放
mpv is capable of storing the playback position of the currently playing file
and resume from there the next time that file is played. This is done with the
commands quit-watch-later (bound to Shift+Q by default) and
write-watch-later-config, and with the --save-position-on-quit option.
mpv 可以存储当前播放文件的播放位置,并在下次播放该文件时从该位置继续播放。这是通过命令 quit-watch-later (默认绑定为 Shift+Q)和 write-watch-later-config 以及 --save-position-on-quit 选项来实现的。
The difference between always quitting with a key bound to quit-watch-later
and using --save-position-on-quit is that the latter will save the playback
position even when mpv is closed with a method other than a keybinding, such as
clicking the close button in the window title bar. However if mpv is terminated
abruptly and doesn't have the time to save, then the position will not be saved.
For example, if you shutdown your system without closing mpv beforehand.
使用绑定到 quit-watch-later 的快捷键始终退出与使用 --save-position-on-quit 的区别在于,后者即使在通过非快捷键方式关闭 mpv(例如点击窗口标题栏的关闭按钮)时也会保存回放位置。然而,如果 mpv 被突然终止且没有时间保存,则位置将不会被保存。例如,如果您在没有先关闭 mpv 的情况下关闭系统。
mpv also stores options other than the playback position when they have been
modified after playback began, for example the volume and selected audio/subtitles,
and restores their values the next time the file is played. Which options are
saved can be configured with the --watch-later-options option.
当播放列表条目在回放开始后修改了其他选项(例如音量和选定的音频/字幕)时,mpv 也会存储这些选项,并在下次播放文件时恢复它们的值。可以配置 --watch-later-options 选项来指定哪些选项将被保存。
When playing multiple playlist entries, mpv checks if one them has a resume
config file associated, and if it finds one it restarts playback from it. For
example, if you use quit-watch-later on the 5th episode of a show, and
later play all the episodes, mpv will automatically resume playback from
episode 5.
在播放多个播放列表条目时,mpv 会检查其中是否有与它关联的恢复配置文件,如果找到,它将从该文件重新开始播放。例如,如果您在电视剧的第 5 集上使用 quit-watch-later ,然后播放所有剧集,mpv 将自动从第 5 集开始回放。
More options to configure this functionality are listed in Watch Later.
有关配置此功能的更多选项,请参阅稍后观看。
PROTOCOLS 协议
mpv://...
mpv protocol. This is used for starting mpv from URL handler. The protocol is stripped and the rest is passed to the player as a normal open argument. Only safe network protocols are allowed to be opened this way.
mpv 协议。此协议用于从 URL 处理程序启动 mpv。协议将被剥离,其余部分将作为正常打开参数传递给播放器。仅允许打开安全网络协议。
http://..., https://, ...
Many network protocols are supported, but the protocol prefix must always be specified. mpv will never attempt to guess whether a filename is actually a network address. A protocol prefix is always required.
支持许多网络协议,但必须始终指定协议前缀。mpv 从不会尝试猜测文件名是否实际上是网络地址。协议前缀始终是必需的。Note that not all prefixes are documented here. Undocumented prefixes are either aliases to documented protocols, or are just redirections to protocols implemented and documented in FFmpeg.
请注意,并非所有前缀都在此处有文档说明。未记录的前缀要么是记录中协议的别名,要么只是重定向到 FFmpeg 中实现和记录的协议。data: is supported, but needs to be in the format data://. This is done to avoid ambiguity with filenames. You can also prefix it with lavf:// or ffmpeg://.
data: 受支持,但需要以格式 data:// 的形式存在。这样做是为了避免与文件名产生歧义。您也可以在前面加上 lavf:// 或 ffmpeg:// 。
ytdl://...
By default, the youtube-dl hook script only looks at http(s) URLs. Prefixing an URL with ytdl:// forces it to be always processed by the script. This can also be used to invoke special youtube-dl functionality like playing a video by ID or invoking search.
默认情况下,youtube-dl 插件脚本只查看 http(s) URL。在 URL 前加上 ytdl:// 会强制脚本始终进行处理。这也可以用来调用特殊的 youtube-dl 功能,例如通过 ID 播放视频或调用搜索。Keep in mind that you can't pass youtube-dl command line options by this, and you have to use --ytdl-raw-options instead.
请注意,您不能通过这种方式传递 youtube-dl 命令行选项,而必须使用 --ytdl-raw-options 。
-
Play data from stdin.
从标准输入播放数据。
smb://PATH
Play a path from Samba share. (Requires FFmpeg support.)
从 Samba 共享播放路径。(需要 FFmpeg 支持。)
bd://[title][/device] --bluray-device=PATH
Play a Blu-ray disc. Since libbluray 1.0.1, you can read from ISO files by passing them to --bluray-device.
播放蓝光光盘。自 libbluray 1.0.1 版本起,您可以通过传递它们到 --bluray-device 来读取 ISO 文件。title can be: longest or first (selects the default playlist); mpls/<number> (selects <number>.mpls playlist); <number> (select playlist with the same index). mpv will list the available playlists on loading.
title 可以是: longest 或 first (选择默认播放列表); mpls/<number> (选择.mpls 播放列表); <number> (选择具有相同索引的播放列表)。mpv 将在加载时列出可用的播放列表。bluray:// is an alias. bluray:// 是一个别名。
dvd://[title][/device] --dvd-device=PATH
Play a DVD. DVD menus are not supported. If no title is given, the longest title is auto-selected. Without --dvd-device, it will probably try to open an actual optical drive, if available and implemented for the OS.
播放 DVD。DVD 菜单不受支持。如果没有指定标题,将自动选择最长的标题。如果没有 --dvd-device ,它可能会尝试打开实际的光驱,如果可用且操作系统已实现该功能。dvdnav:// is an old alias for dvd:// and does exactly the same thing.
dvdnav:// 是 dvd:// 的旧别名,执行完全相同的功能。
dvb://[cardnumber@]channel --dvbin-...
Digital TV via DVB. (Linux only.)
数字电视通过 DVB。 (仅限 Linux。)
mf://[@listfile|filemask|glob|printf-format] --mf-...
Play a series of images as video.
将一系列图像播放为视频。If the URL path begins with @, it is interpreted as the path to a file containing a list of image paths separated by newlines. If the URL path contains ,, it is interpreted as a list of image paths separated by ,. If the URL path does not contain % and if on POSIX platforms, is interpreted as a glob, and * is automatically appended if it was not specified. Otherwise, the printf sequences %[.][NUM]d, where NUM is one, two, or three decimal digits, and %% and are interpreted. For example, mf://image-%d.jpg plays files like image-1.jpg, image-2.jpg and image-10.jpg, provided that there are no big gaps between the files.
如果 URL 路径以 @ 开头,则解释为包含以换行符分隔的图像路径的文件路径。如果 URL 路径包含 , ,则解释为以 , 分隔的图像路径列表。如果 URL 路径不包含 % ,并且在 POSIX 平台上,则解释为 glob,如果没有指定,则自动追加 * 。否则,解释 printf 序列 %[.][NUM]d ,其中 NUM 是一位、两位或三位十进制数字,以及 %% 和。例如, mf://image-%d.jpg 播放文件如 image-1.jpg 、 image-2.jpg 和 image-10.jpg ,前提是文件之间没有大的间隔。
cdda://[device] --cdda-device=PATH
Play CD. You can select a specific range of tracks to play by using the --start and --end options and specifying chapters. Navigating forwards and backwards through tracks can also be done by navigating through chapters (PGUP and PGDOWN in the default keybinds).
播放 CD。您可以通过使用 --start 和 --end 选项并指定章节来选择播放特定范围的曲目。通过章节(默认快捷键中的 PGUP 和 PGDOWN )导航也可以在曲目之间前后导航。Example 示例
mpv cdda:// --start=#4 --end=#6This will start from track 4, play track 5, and then end.
这将从第 4 轨开始,播放第 5 轨,然后结束。
lavf://...
Access any FFmpeg libavformat protocol. Basically, this passed the string after the // directly to libavformat.
访问任何 FFmpeg libavformat 协议。基本上,这是将 // 后面的字符串直接传递给 libavformat。
av://type:options
This is intended for using libavdevice inputs. type is the libavdevice demuxer name, and options is the (pseudo-)filename passed to the demuxer.
此功能用于使用 libavdevice 输入。 type 是 libavdevice 解复用器名称, options 是传递给解复用器的(伪)文件名。Example 示例
mpv av://v4l2:/dev/video0 --profile=low-latency --untimedThis plays video from the first v4l input with nearly the lowest latency possible. It's a good replacement for the removed tv:// input. Using --untimed is a hack to output a captured frame immediately, instead of respecting the input framerate. (There may be better ways to handle this in the future.)
此功能以尽可能低的延迟播放第一个 v4l 输入的视频。它是移除的 tv:// 输入的良好替代品。使用 --untimed 是一种技巧,可以立即输出捕获的帧,而不是尊重输入帧率。(未来可能会有更好的处理方式。)avdevice:// is an alias. avdevice:// 是一个别名。
file://PATH
A local path as URL. Might be useful in some special use-cases. Note that PATH itself should start with a third / to make the path an absolute path.
本地路径作为 URL。在某些特殊用例中可能很有用。注意, PATH 本身应该以第三个 / 开头,以使路径成为绝对路径。
appending://PATH
Play a local file, but assume it's being appended to. This is useful for example for files that are currently being downloaded to disk. This will block playback, and stop playback only if no new data was appended after a timeout of about 2 seconds.
播放本地文件,但假设它正在被追加。这对于例如正在下载到磁盘的文件很有用。这将阻塞播放,并且只有在超时约 2 秒后没有新数据被追加的情况下才会停止播放。Using this is still a bit of a bad idea, because there is no way to detect if a file is actually being appended, or if it's still written. If you're trying to play the output of some program, consider using a pipe (something | mpv -). If it really has to be a file on disk, use tail to make it wait forever, e.g. tail -f -c +0 file.mkv | mpv -.
使用这个仍然是个坏主意,因为没有方法可以检测文件是否实际上正在被追加,或者它是否仍在写入。如果你试图播放某个程序的输出,考虑使用管道( something | mpv - )。如果它真的必须在磁盘上的文件,使用 tail 使其永远等待,例如 tail -f -c +0 file.mkv | mpv - 。
fd://123
Read data from the given file descriptor (for example 123). This is similar to piping data to stdin via -, but can use an arbitrary file descriptor. mpv may modify some file descriptor properties when the stream layer "opens" it.
从指定的文件描述符读取数据(例如 123)。这与通过 - 将数据管道传输到 stdin 类似,但可以使用任意文件描述符。当流层 "打开" 时,mpv 可能会修改一些文件描述符属性。
fdclose://123
Like fd://, but the file descriptor is closed after use. When using this you need to ensure that the same fd URL will only be used once.
与 fd:// 类似,但使用完毕后关闭文件描述符。使用此功能时,您需要确保相同的 fd URL 只使用一次。
edl://[edl specification as in edl-mpv.rst]
Stitch together parts of multiple files and play them.
将多个文件的片段拼接在一起并播放。
slice://start[-end]@URL
Read a slice of a stream.
读取流的一部分。start and end represent a byte range and accept suffixes such as KiB and MiB. end is optional.
start 和 end 表示字节范围,并接受如 KiB 和 MiB 这样的后缀。 end 是可选的。if end starts with +, it is considered as offset from start.
如果 end 以 + 开头,则被视为从 start 的偏移量。Only works with seekable streams.
仅适用于可寻址流。Examples: 示例:
mpv slice://1g-2g@cap.ts This starts reading from cap.ts after seeking 1 GiB, then reads until reaching 2 GiB or end of file. mpv slice://1g-+2g@cap.ts This starts reading from cap.ts after seeking 1 GiB, then reads until reaching 3 GiB or end of file. mpv slice://100m@appending://cap.ts This starts reading from cap.ts after seeking 100MiB, then reads until end of file.
null://
Simulate an empty file. If opened for writing, it will discard all data. The null demuxer will specifically pass autoprobing if this protocol is used (while it's not automatically invoked for empty files).
模拟一个空文件。如果以写入方式打开,它将丢弃所有数据。当使用此协议时, null 解复用器将特别传递自动探测(而对于空文件,它不会自动调用)。
memory://data
Use the data part as source data.
使用 data 部分作为源数据。
hex://data
Like memory://, but the string is interpreted as hexdump.
类似于 memory:// ,但字符串被解释为十六进制转储。
PSEUDO GUI MODE 伪 GUI 模式
mpv has no official GUI, other than the OSC (ON SCREEN CONTROLLER), which
is not a full GUI and is not meant to be. However, to compensate for the lack
of expected GUI behavior, mpv will in some cases start with some settings
changed to behave slightly more like a GUI mode.
mpv 没有官方的 GUI,除了 OSC(屏幕控制器),它不是一个完整的 GUI,也不打算成为。然而,为了弥补预期 GUI 行为的缺失,mpv 在某些情况下会以一些设置更改开始,以稍微更像 GUI 模式的行为。
Currently this happens only in the following cases:
目前这仅在以下情况下发生:
- if started using the mpv.desktop file on Linux (e.g. started from menus
or file associations provided by desktop environments)
如果使用 Linux 上的 mpv.desktop 文件启动(例如,从菜单或桌面环境提供的文件关联启动) - if started from explorer.exe on Windows (technically, if it was started on
Windows, and all of the stdout/stderr/stdin handles are unset)
如果从 Windows 的 explorer.exe 启动(技术上,如果它在 Windows 上启动,并且所有 stdout/stderr/stdin 句柄都未设置) - started out of the bundle on macOS
在 macOS 上从捆绑包外部启动 - if you manually use --player-operation-mode=pseudo-gui on the command line
如果您在命令行上手动使用 --player-operation-mode=pseudo-gui
This mode applies options from the builtin profile builtin-pseudo-gui, but
only if these haven't been set in the user's config file or on the command line,
which is the main difference to using --profile=builtin-pseudo-gui.
此模式应用内置配置文件 builtin-pseudo-gui 的选项,但仅在这些选项尚未在用户的配置文件或命令行上设置的情况下,这是与使用 --profile=builtin-pseudo-gui 的主要区别。
The profile is currently defined as follows:
配置文件当前定义如下:
[builtin-pseudo-gui] terminal=no force-window=yes idle=once screenshot-directory=~~desktop/
The pseudo-gui profile exists for compatibility. The options in the
pseudo-gui profile are applied unconditionally. In addition, the profile
makes sure to enable the pseudo-GUI mode, so that --profile=pseudo-gui
works like in older mpv releases:
为了兼容性,存在 pseudo-gui 配置文件。 pseudo-gui 配置文件中的选项无条件应用。此外,该配置文件确保启用伪 GUI 模式,以便 --profile=pseudo-gui 的工作方式类似于较老版本的 mpv 发布版:
[pseudo-gui] player-operation-mode=pseudo-gui
Warning 警告
Currently, you can extend the pseudo-gui profile in the config file the
normal way. This is deprecated. In future mpv releases, the behavior might
change, and not apply your additional settings, and/or use a different
profile name.
目前,您可以通过常规方式在配置文件中扩展 pseudo-gui 配置文件。这是已弃用的。在未来的 mpv 发布版中,行为可能会改变,并且可能不会应用您的附加设置,或者使用不同的配置文件名称。
OPTIONS 选项
Track Selection 跟踪选择
- --alang=<languagecode[,languagecode,...]>
Specify a prioritized list of audio languages to use, as IETF language tags. Equivalent ISO 639-1 two-letter and ISO 639-2 three-letter codes are treated the same. The first tag in the list that matches track's language in the file will be used. A track that matches more subtags will be preferred over one that matches fewer. See also --aid.
指定一个按优先级排序的音频语言列表,使用 IETF 语言标签。等效的 ISO 639-1 双字母和 ISO 639-2 三字母代码被同等对待。列表中第一个与文件中轨道语言匹配的标签将被使用。匹配更多子标签的轨道将优先于匹配较少子标签的轨道。另见 --aid 。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。Examples 示例
- mpv dvd://1 --alang=hu,en chooses the Hungarian language track
on a DVD and falls back on English if Hungarian is not available.
mpv dvd://1 --alang=hu,en 在 DVD 上选择匈牙利语言轨道,如果匈牙利语不可用,则回退到英语。 - mpv --alang=jpn example.mkv plays a Matroska file with Japanese
audio.
mpv --alang=jpn example.mkv 播放带有日语音频的 Matroska 文件。
- mpv dvd://1 --alang=hu,en chooses the Hungarian language track
on a DVD and falls back on English if Hungarian is not available.
- --slang=<languagecode[,languagecode,...]>
Equivalent to --alang, for subtitle tracks.
等同于 --alang ,用于字幕轨道。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。Examples 示例
- mpv dvd://1 --slang=hu,en chooses the Hungarian subtitle track on
a DVD and falls back on English if Hungarian is not available.
mpv dvd://1 --slang=hu,en 在 DVD 上选择匈牙利字幕轨道,如果不可用则回退到英语。 - mpv --slang=jpn example.mkv plays a Matroska file with Japanese
subtitles.
mpv --slang=jpn example.mkv 播放带有日语字幕的 Matroska 文件。 - mpv --slang=pt-BR example.mkv plays a Matroska file with Brazilian
Portuguese subtitles if available, and otherwise any Portuguese subtitles.
mpv --slang=pt-BR example.mkv 如果可用,则播放带有巴西葡萄牙语字幕的 Matroska 文件,否则播放任何葡萄牙语字幕。
- mpv dvd://1 --slang=hu,en chooses the Hungarian subtitle track on
a DVD and falls back on English if Hungarian is not available.
- --vlang=<...>
Equivalent to --alang and --slang, for video tracks.
等同于 --alang 和 --slang ,用于视频轨道。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。- --aid=<ID|auto|no>
Select audio track. auto selects the default, no disables audio. See also --alang. mpv normally prints available audio tracks on the terminal when starting playback of a file.
选择音频轨道。 auto 选择默认, no 禁用音频。另请参阅 --alang 。mpv 通常在播放文件时在终端上打印可用的音频轨道。--audio is an alias for --aid.
--audio 是 --aid 的别名。--aid=no or --audio=no disables audio playback. (The latter variant does not work with the client API.)
--aid=no 或 --audio=no 禁用音频播放。(后者与客户端 API 不兼容。)Note 注意
The track selection options (--aid but also --sid and the others) sometimes expose behavior that may appear strange. Also, the behavior tends to change around with each mpv release.
音轨选择选项( --aid 但也 --sid 以及其他)有时会表现出可能看似奇怪的行为。此外,行为会随着每个 mpv 版本发布而变化。The track selection properties will return the option value outside of playback (as expected), but during playback, the affective track selection is returned. For example, with --aid=auto, the aid property will suddenly return 2 after playback initialization (assuming the file has at least 2 audio tracks, and the second is the default).
音轨选择属性将在播放外返回选项值(如预期),但在播放期间,返回的是情感音轨选择。例如,使用 --aid=auto ,在播放初始化后, aid 属性会突然返回 2 (假设文件至少有 2 个音频轨道,第二个是默认的)。At mpv 0.32.0 (and some releases before), if you passed a track value for which a corresponding track didn't exist (e.g. --aid=2 and there was only 1 audio track), the aid property returned no. However if another audio track was added during playback, and you tried to set the aid property to 2, nothing happened, because the aid option still had the value 2, and writing the same value has no effect.
在 mpv 0.32.0(以及一些之前的版本)中,如果您传递了一个不存在对应音轨的音轨值(例如 --aid=2 而只有一个音频轨道), aid 属性会返回 no 。然而,如果在播放期间添加了另一个音频轨道,并且您尝试将 aid 属性设置为 2 ,则没有任何效果,因为 aid 选项仍然具有 2 的值,写入相同的值没有效果。With mpv 0.33.0, the behavior was changed. Now track selection options are reset to auto at playback initialization, if the option had tries to select a track that does not exist. The same is done if the track exists, but fails to initialize. The consequence is that unlike before mpv 0.33.0, the user's track selection parameters are clobbered in certain situations.
在 mpv 0.33.0 中,行为发生了改变。现在在播放初始化时,如果选项尝试选择一个不存在的轨道,则跟踪选择选项将重置为 auto 。如果轨道存在但初始化失败,也会这样做。结果是,与 mpv 0.33.0 之前不同,在某些情况下,用户的轨道选择参数会被破坏。Also since mpv 0.33.0, trying to select a track by number will strictly select this track. Before this change, trying to select a track which did not exist would fall back to track default selection at playback initialization. The new behavior is more consistent.
自 mpv 0.33.0 以来,尝试通过编号选择轨道将严格选择此轨道。在此更改之前,尝试选择一个不存在的轨道将在播放初始化时回退到默认轨道选择。新的行为更一致。Setting a track selection property at runtime, and then playing a new file might reset the track selection to defaults, if the fingerprint of the track list of the new file is different.
在运行时设置轨道选择属性,然后播放新文件可能会将轨道选择重置为默认值,如果新文件的轨道列表指纹不同。Be aware of tricky combinations of all of all of the above: for example, mpv --aid=2 file_with_2_audio_tracks.mkv file_with_1_audio_track.mkv would first play the correct track, and the second file without audio. If you then go back the first file, its first audio track will be played, and the second file is played with audio. If you do the same thing again but instead of using --aid=2 you run set aid 2 while the file is playing, then changing to the second file will play its audio track. This is because runtime selection enables the fingerprint heuristic.
请注意上述所有内容的复杂组合:例如, mpv --aid=2 file_with_2_audio_tracks.mkv file_with_1_audio_track.mkv 首先会播放正确的曲目,然后是第二个没有音频的文件。如果你然后返回到第一个文件,它的第一个音频轨道将被播放,第二个文件将带有音频播放。如果你再次执行相同的操作,但不是使用 --aid=2 ,而是在文件播放时运行 set aid 2 ,那么切换到第二个文件将播放其音频轨道。这是因为运行时选择启用了指纹启发式算法。Most likely this is not the end.
很可能这不是结束。- --sid=<ID|auto|no>
Display the subtitle stream specified by <ID>. auto selects the default, no disables subtitles.
显示由 <ID> 指定的字幕流。 auto 选择默认, no 禁用字幕。--sub is an alias for --sid.
--sub 是 --sid 的别名。--sid=no or --sub=no disables subtitle decoding. (The latter variant does not work with the client API.)
--sid=no 或 --sub=no 禁用字幕解码。(后者与客户端 API 不兼容。)- --vid=<ID|auto|no>
Select video channel. auto selects the default, no disables video.
选择视频通道。 auto 选择默认, no 禁用视频。--video is an alias for --vid.
--video 是 --vid 的别名。--vid=no or --video=no disables video playback. (The latter variant does not work with the client API.)
--vid=no 或 --video=no 禁用视频播放。(后者与客户端 API 不兼容。)If video is disabled, mpv will try to download the audio only if media is streamed with youtube-dl, because it saves bandwidth. This is done by setting the ytdl_format to "bestaudio/best" in the ytdl_hook.lua script.
如果禁用视频,当使用 youtube-dl 流媒体时,mpv 将尝试仅下载音频,因为这样可以节省带宽。这是通过在 ytdl_hook.lua 脚本中将 ytdl_format 设置为 "bestaudio/best" 来实现的。- --edition=<ID|auto>
- (Matroska files only)
Specify the edition (set of chapters) to use, where 0 is the first. If set
to auto (the default), mpv will choose the first edition declared as a
default, or if there is no default, the first edition defined.
(仅限 Matroska 文件)指定要使用的版本(章节集),其中 0 是第一个。如果设置为 auto (默认值),mpv 将选择声明的第一个默认版本,如果没有默认版本,则选择定义的第一个版本。 - --track-auto-selection=<yes|no>
Enable the default track auto-selection (default: yes). Enabling this will make the player select streams according to --aid, --alang, and others. If it is disabled, no tracks are selected. In addition, the player will not exit if no tracks are selected, and wait instead (this wait mode is similar to pausing, but the pause option is not set).
启用默认轨道自动选择(默认:是)。启用此功能将使播放器根据 --aid 、 --alang 等选择流。如果禁用,则不选择任何轨道。此外,如果未选择任何轨道,播放器不会退出,而是等待(此等待模式类似于暂停,但未设置暂停选项)。This is useful with --lavfi-complex: you can start playback in this mode, and then set select tracks at runtime by setting the filter graph. Note that if --lavfi-complex is set before playback is started, the referenced tracks are always selected.
这在 --lavfi-complex : 中非常有用,您可以在这种模式下开始播放,然后通过设置过滤器图来在运行时设置选择轨道。请注意,如果在播放开始之前设置了 --lavfi-complex ,则引用的轨道始终会被选中。- --subs-with-matching-audio=<yes|forced|no>
- When autoselecting a subtitle track, select it even if the selected audio
stream matches you preferred subtitle language (default: yes). If this
option is set to no, then no subtitle track that matches the audio
language will ever be autoselected by mpv regardless of --slang or
subs-fallback. If set to forced, then only forced subtitles
will be selected.
当自动选择字幕轨道时,即使所选音频流与您首选的字幕语言匹配(默认:是),也要选择它。如果此选项设置为 no ,则无论 --slang 或 subs-fallback 如何,mpv 都不会自动选择与音频语言匹配的字幕轨道。如果设置为 forced ,则只选择强制字幕。 - --subs-match-os-language=<yes|no>
- When autoselecting a subtitle track, select the track that matches the language of your OS
if the audio stream is in a different language if suitable (default track or a forced track
under the right conditions). Note that if --slang is set, this will be completely ignored
(default: yes).
当自动选择字幕轨道时,如果音频流使用不同的语言,则选择与您的操作系统语言匹配的轨道(默认轨道或符合条件下的强制轨道)。请注意,如果设置了 --slang ,则这将完全被忽略(默认:是)。 - --subs-fallback=<yes|default|no>
- When autoselecting a subtitle track, if no tracks match your preferred languages,
select a full track even if it doesn't match your preferred subtitle language (default: default).
Setting this to default means that only streams flagged as default will be selected.
当自动选择字幕轨道时,如果没有轨道匹配您首选的语言,则选择完整轨道,即使它不匹配您首选的字幕语言(默认:默认)。将此设置为默认意味着只有标记为默认的流会被选中。 - --subs-fallback-forced=<yes|no|always>
- When autoselecting a subtitle track, the default value of yes will prefer using a forced
subtitle track if the subtitle language matches the audio language and matches your list of
preferred languages. The special value always will only select forced subtitle tracks and
never fallback on a non-forced track. Conversely, no will never select a forced subtitle
track.
当自动选择字幕轨道时,默认值 yes 将优先使用强制字幕轨道,如果字幕语言与音频语言匹配且匹配您的首选语言列表。特殊值 always 只会选择强制字幕轨道,永远不会回退到非强制轨道。相反,no 永远不会选择强制字幕轨道。
Playback Control 播放控制
- --start=<relative time>
Seek to given time position.
跳转到指定的时间位置。The general format for times is [+|-][[hh:]mm:]ss[.ms]. If the time is prefixed with -, the time is considered relative from the end of the file (as signaled by the demuxer/the file). A + is usually ignored (but see below).
时间的一般格式为 [+|-][[hh:]mm:]ss[.ms] 。如果时间前缀为 - ,则时间被认为是相对于文件末尾的(如由解复用器/文件指示)。 + 通常会被忽略(但请参阅以下内容)。The following alternative time specifications are recognized:
以下替代时间指定被识别:pp% seeks to percent position pp (0-100).
pp% 寻求百分比位置 pp(0-100)。#c seeks to chapter number c. (Chapters start from 1.)
#c 寻求章节编号 c。(章节从 1 开始。)none resets any previously set option (useful for libmpv).
none 重置之前设置的任何选项(对 libmpv 有用)。If --rebase-start-time=no is given, then prefixing times with + makes the time relative to the start of the file. A timestamp without prefix is considered an absolute time, i.e. should seek to a frame with a timestamp as the file contains it. As a bug, but also a hidden feature, putting 1 or more spaces before the + or - always interprets the time as absolute, which can be used to seek to negative timestamps (useful for debugging at most).
如果提供 --rebase-start-time=no ,则使用 + 前缀会使时间相对于文件开始。没有前缀的时间戳被视为绝对时间,即应查找文件中包含的时间戳所在的帧。作为一个错误,但也是一个隐藏功能,在 + 或 - 前放置 1 或多个空格始终将时间解释为绝对时间,这可以用来查找负时间戳(最多用于调试)。Examples 示例
- --start=+56, --start=00:56
- Seeks to the start time + 56 seconds.
查找起始时间 + 56 秒。 - --start=-56, --start=-00:56
- Seeks to the end time - 56 seconds.
查找结束时间 - 56 秒。 - --start=01:10:00
- Seeks to 1 hour 10 min.
寻求 1 小时 10 分钟。 - --start=50%
- Seeks to the middle of the file.
寻求到文件中间。 - --start=30 --end=40
- Seeks to 30 seconds, plays 10 seconds, and exits.
寻求到 30 秒,播放 10 秒,然后退出。 - --start=-3:20 --length=10
- Seeks to 3 minutes and 20 seconds before the end of the file, plays
10 seconds, and exits.
寻求到文件结束前 3 分 20 秒,播放 10 秒,然后退出。 - --start='#2' --end='#4'
- Plays chapters 2 and 3, and exits.
播放第 2 和第 3 章节,然后退出。
- --end=<relative time>
- Stop at given time. Use --length if the time should be relative
to --start. See --start for valid option values and examples.
在指定时间停止。如果时间应相对于 --start ,请使用 --length 。有关有效选项值和示例,请参阅 --start 。 - --length=<relative time>
Stop after a given time relative to the start time. See --start for valid option values and examples.
在相对于开始时间的指定时间后停止。有关有效选项值和示例,请参阅 --start 。If both --end and --length are provided, playback will stop when it reaches either of the two endpoints.
如果提供了 --end 和 --length ,播放将在达到两个端点中的任何一个时停止。Obscurity note: this does not work correctly if --rebase-start-time=no, and the specified time is not an "absolute" time, as defined in the --start option description.
注意事项:如果 --rebase-start-time=no ,并且指定的时间不是在 --start 选项描述中定义的“绝对”时间,则此功能可能无法正确工作。- --rebase-start-time=<yes|no>
- Whether to move the file start time to 00:00:00 (default: yes). This
is less awkward for files which start at a random timestamp, such as
transport streams. On the other hand, if there are timestamp resets, the
resulting behavior can be rather weird. For this reason, and in case you
are actually interested in the real timestamps, this behavior can be
disabled with no.
是否将文件开始时间移动到 00:00:00 (默认:是)。对于开始于随机时间戳的文件,例如传输流,这样做会更不尴尬。另一方面,如果存在时间戳重置,结果行为可能会相当奇怪。因此,如果您实际上对真实时间戳感兴趣,可以通过 no 禁用此行为。 - --speed=<0.01-100>
Slow down or speed up playback by the factor given as parameter.
根据参数以给定倍数降低或提高播放速度。If --audio-pitch-correction (on by default) is used, playing with a speed higher than normal automatically inserts the scaletempo2 audio filter.
如果使用 --audio-pitch-correction (默认开启)并播放高于正常速度,则自动插入 scaletempo2 音频过滤器。- --pitch=<0.01-100>
Raise or lower the audio's pitch by the factor given as parameter. Does not affect playback speed. Playing with an altered pitch automatically inserts the scaletempo2 audio filter.
根据参数以给定倍数提高或降低音频的音调。不影响播放速度。以改变后的音调播放时自动插入 scaletempo2 音频过滤器。Since pitch change is achieved by combining pitch-preserving speed change and resampling, the range of pitch change is effectively limited by the min-speed and max-speed parameters of scaletempo2: for example, a min-speed of 0.25 limits the highest pitch factor to 4 (1/0.25).
由于音调变化是通过结合保持音调的速度变化和重采样实现的,因此音调变化范围实际上受到 scaletempo2 的 min-speed 和 max-speed 参数的限制:例如, min-speed 为 0.25 时,将最高音调倍数限制为 4(1/0.25)。In a standard 12-tone scale system, octaves are separated by a factor of 2 whereas semitones are represented by a factor of 2^(1/12). This means pitches can easily be shifted up or down with a simple multiplier.
在一个标准的 12 音阶系统中,八度之间以 2 的倍数分隔,半音以 2^(1/12)的倍数表示。这意味着音高可以通过简单的乘数轻松上下移动。Examples 示例
- --pitch=2
- Shifts the pitch up a full octave.
将音高提升一个完整八度。 - --pitch=0.5
- Shifts the pitch down an octave.
将音高降低一个八度。 - --pitch=1.498307 (2^(7/12))
- Shifts the pitch up a perfect fifth.
将音高上移一个纯五度。 - --pitch=0.667420 (2^(-7/12))
- Shifts the pitch down a perfect fifth.
将音高下移一个纯五度。 - --pitch=1.059463 (2^(1/12))
- Shifts the pitch up a semitone.
将音高提升半音阶。 - --pitch=0.943874 (2^(-1/12))
- Shifts the pitch down a semitone.
将音高降低半音阶。
- --pause
- Start the player in paused state.
以暂停状态启动播放器。 - --shuffle
- Play files in random order.
随机顺序播放文件。 - --playlist-start=<auto|index>
Set which file on the internal playlist to start playback with. The index is an integer, with 0 meaning the first file. The value auto means that the selection of the entry to play is left to the playback resume mechanism (default). If an entry with the given index doesn't exist, the behavior is unspecified and might change in future mpv versions. The same applies if the playlist contains further playlists (don't expect any reasonable behavior). Passing a playlist file to mpv should work with this option, though. E.g. mpv playlist.m3u --playlist-start=123 will work as expected, as long as playlist.m3u does not link to further playlists.
设置要从中开始播放的内部播放列表中的文件。索引是一个整数,其中 0 表示第一个文件。值 auto 表示播放条目选择留给播放恢复机制(默认)。如果给定索引的条目不存在,行为是不确定的,并且可能在未来的 mpv 版本中更改。如果播放列表包含其他播放列表(不要期望有任何合理的行为),也适用同样的情况。将播放列表文件传递给 mpv 应与此选项一起工作。例如, mpv playlist.m3u --playlist-start=123 将按预期工作,只要 playlist.m3u 不链接到其他播放列表。The value no is a deprecated alias for auto.
值 no 是 auto 的已弃用别名。- --playlist=<filename>
Play files according to a playlist file. Supports some common formats. If no format is detected, it will be treated as list of files, separated by newline characters. You may need this option to load plaintext files as a playlist. Note that XML playlist formats are not supported.
根据播放列表文件播放文件。支持一些常见格式。如果没有检测到格式,它将被视为由换行符分隔的文件列表。您可能需要此选项将纯文本文件作为播放列表加载。请注意,不支持 XML 播放列表格式。This option forces --demuxer=playlist to interpret the playlist file. Some playlist formats, notably CUE and optical disc formats, need to use different demuxers and will not work with this option. They still can be played directly, without using this option.
此选项强制 --demuxer=playlist 解析播放列表文件。一些播放列表格式,特别是 CUE 和光盘格式,需要使用不同的解复用器,并且不能使用此选项。它们仍然可以直接播放,而不使用此选项。You can play playlists directly, without this option. Before mpv version 0.31.0, this option disabled any security mechanisms that might be in place, but since 0.31.0 it uses the same security mechanisms as playing a playlist file directly. If you trust the playlist file, you can disable any security checks with --load-unsafe-playlists. Because playlists can load other playlist entries, consider applying this option only to the playlist itself and not its entries, using something along these lines:
您可以直接播放播放列表,而不使用此选项。在 mpv 版本 0.31.0 之前,此选项禁用了可能存在的任何安全机制,但从 0.31.0 版本开始,它使用与直接播放播放列表文件相同的安全机制。如果您信任播放列表文件,您可以使用 --load-unsafe-playlists 禁用任何安全检查。因为播放列表可以加载其他播放列表条目,考虑只将此选项应用于播放列表本身,而不是其条目,如下所示:mpv --{ --playlist=filename --load-unsafe-playlists --}
Warning 警告
The way older versions of mpv played playlist files via --playlist was not safe against maliciously constructed files. Such files may trigger harmful actions. This has been the case for all versions of mpv prior to 0.31.0, and all MPlayer versions, but unfortunately this fact was not well documented earlier, and some people have even misguidedly recommended the use of --playlist with untrusted sources. Do NOT use --playlist with random internet sources or files you do not trust if you are not sure your mpv is at least 0.31.0.
较旧版本的 mpv 通过 --playlist 播放播放列表文件的方式不安全,无法抵御恶意构造的文件。此类文件可能会触发有害操作。这种情况一直存在于所有低于 0.31.0 版本的 mpv 以及所有 MPlayer 版本中,但遗憾的是,这一事实之前并未得到很好的记录,甚至有人错误地建议使用 --playlist 从不可信的来源。如果您不确定您的 mpv 至少是 0.31.0 版本,请勿使用 --playlist 与随机的互联网来源或您不信任的文件。In particular, playlists can contain entries using protocols other than local files, such as special protocols like avdevice:// (which are inherently unsafe).
特别是,播放列表可以包含使用除本地文件之外的其他协议的条目,例如像 avdevice:// (本质上不安全)这样的特殊协议。- --chapter-merge-threshold=<number>
- Threshold for merging almost consecutive ordered chapter parts in
milliseconds (default: 100). Some Matroska files with ordered chapters
have inaccurate chapter end timestamps, causing a small gap between the
end of one chapter and the start of the next one when they should match.
If the end of one playback part is less than the given threshold away from
the start of the next one then keep playing video normally over the
chapter change instead of doing a seek.
合并几乎连续的有序章节部分的阈值(默认:100 毫秒)。一些带有有序章节的 Matroska 文件具有不准确的章节结束时间戳,导致当它们应该匹配时,一个章节的结束和下一个章节的开始之间存在一个小间隔。如果一个播放部分的结束时间小于给定阈值远离下一个部分的开始,则保持正常播放视频而不是进行搜索。 - --chapter-seek-threshold=<seconds>
- Distance in seconds from the beginning of a chapter within which a backward
chapter seek will go to the previous chapter (default: 5.0). Past this
threshold, a backward chapter seek will go to the beginning of the current
chapter instead. A negative value means always go back to the previous
chapter.
从章节开始到向后章节搜索将到达的前一个章节的时间差(默认:5.0)。超过此阈值,向后章节搜索将跳转到当前章节的开始。负值表示始终返回到前一个章节。 - --hr-seek=<no|absolute|yes|default>
Select when to use precise seeks that are not limited to keyframes. Such seeks require decoding video from the previous keyframe up to the target position and so can take some time depending on decoding performance. For some video formats, precise seeks are disabled. This option selects the default choice to use for seeks; it is possible to explicitly override that default in the definition of key bindings and in input commands.
选择何时使用不受关键帧限制的精确搜索。这种搜索需要从上一个关键帧解码到目标位置的视频,因此根据解码性能可能需要一些时间。对于某些视频格式,精确搜索被禁用。此选项选择用于搜索的默认选项;可以在键绑定定义和输入命令中显式覆盖该默认值。no: no: Never use precise seeks.
切勿使用精确查找。absolute: 绝对: Use precise seeks if the seek is to an absolute position in the file, such as a chapter seek, but not for relative seeks like the default behavior of arrow keys.
如果寻道是到文件的绝对位置,例如章节寻道,则使用精确寻道,但不适用于像箭头键默认行为那样的相对寻道。default: 默认: Like absolute, but enable hr-seeks in audio-only cases. The exact behavior is implementation specific and may change with new releases (default).
类似于 absolute ,但在仅音频的情况下启用 hr-seeks。确切行为取决于实现,并且可能随着新版本而更改(默认)。yes: Use precise seeks whenever possible.
尽可能使用精确搜索。always: 始终: Same as yes (for compatibility).
与 yes 相同(为了兼容性)。- --hr-seek-demuxer-offset=<seconds>
- This option exists to work around failures to do precise seeks (as in
--hr-seek) caused by bugs or limitations in the demuxers for some file
formats. Some demuxers fail to seek to a keyframe before the given target
position, going to a later position instead. The value of this option is
subtracted from the time stamp given to the demuxer. Thus, if you set this
option to 1.5 and try to do a precise seek to 60 seconds, the demuxer is
told to seek to time 58.5, which hopefully reduces the chance that it
erroneously goes to some time later than 60 seconds. The downside of
setting this option is that precise seeks become slower, as video between
the earlier demuxer position and the real target may be unnecessarily
decoded.
此选项存在是为了绕过由于某些文件格式解复用器的错误或限制导致的无法进行精确查找(如 --hr-seek )失败。一些解复用器无法在给定目标位置之前查找关键帧,而是跳到较晚的位置。此选项的值从分配给解复用器的时戳中减去。因此,如果您将此选项设置为 1.5 并尝试精确查找 60 秒,解复用器将被告知查找时间 58.5,这有望减少它错误地跳到 60 秒之后的时间的机会。设置此选项的缺点是精确查找会变慢,因为视频在较早的解复用器位置和实际目标之间可能被不必要地解码。 - --hr-seek-framedrop=<yes|no>
Allow the video decoder to drop frames during seek, if these frames are before the seek target. If this is enabled, precise seeking can be faster, but if you're using video filters which modify timestamps or add new frames, it can lead to precise seeking skipping the target frame. This e.g. can break frame backstepping when deinterlacing is enabled.
允许视频解码器在查找时丢弃帧,如果这些帧在查找目标之前。如果启用此功能,精确查找可以更快,但如果您使用修改时间戳或添加新帧的视频过滤器,可能会导致精确查找跳过目标帧。例如,当启用去隔行时,这可能会破坏帧回退。Default: yes 默认: yes
- --index=<mode>
Controls how to seek in files. Note that if the index is missing from a file, it will be built on the fly by default, so you don't need to change this. But it might help with some broken files.
控制文件中的搜索方式。注意,如果文件中缺少索引,它将默认动态构建,因此您不需要更改此设置。但这可能有助于一些损坏的文件。default: 默认: use an index if the file has one, or build it if missing
如果文件有一个索引,则使用它,如果没有,则构建它recreate: 重新创建: don't read or use the file's index
不要读取或使用文件的索引Note 注意
This option only works if the underlying media supports seeking (i.e. not with stdin, pipe, etc).
此选项仅在底层媒体支持搜索(即不适用于 stdin、管道等)时才有效。- --load-unsafe-playlists
Load URLs from playlists which are considered unsafe (default: no). This includes special protocols and anything that doesn't refer to normal files. Local files and HTTP links on the other hand are always considered safe.
从被视为不安全的播放列表中加载 URL(默认:否)。这包括特殊协议以及任何不指向常规文件的内容。另一方面,本地文件和 HTTP 链接始终被视为安全。In addition, if a playlist is loaded while this is set, the added playlist entries are not marked as originating from network or potentially unsafe location. (Instead, the behavior is as if the playlist entries were provided directly to mpv command line or loadfile command.)
此外,如果在此设置的情况下加载播放列表,则添加的播放列表条目不会被标记为来自网络或潜在的不安全位置。(其行为类似于播放列表条目直接提供给 mpv 命令行或 loadfile 命令。)- --access-references=<yes|no>
Follow any references in the file being opened (default: yes). Disabling this is helpful if the file is automatically scanned (e.g. thumbnail generation). If the thumbnail scanner for example encounters a playlist file, which contains network URLs, and the scanner should not open these, enabling this option will prevent it. This option also disables ordered chapters, mov reference files, opening of archives, and a number of other features.
跟随正在打开的文件中的任何引用(默认:是)。如果文件是自动扫描的(例如缩略图生成),禁用此功能可能会有所帮助。例如,如果缩略图扫描器遇到包含网络 URL 的播放列表文件,并且扫描器不应打开这些文件,启用此选项将防止它。此选项还将禁用有序章节、mov 引用文件、打开存档以及许多其他功能。On older FFmpeg versions, this will not work in some cases. Some FFmpeg demuxers might not respect this option.
在较旧的 FFmpeg 版本中,在某些情况下可能不起作用。一些 FFmpeg 解复用器可能不会尊重此选项。This option does not prevent opening of paired subtitle files and such. Use --autoload-files=no to prevent this.
此选项不能防止打开配对的字幕文件等。使用 --autoload-files=no 来防止此操作。This option does not always work if you open non-files (for example using dvd://directory would open a whole bunch of files in the given directory). Prefixing the filename with ./ if it doesn't start with a / will avoid this.
如果您打开非文件(例如使用 dvd://directory 会在给定目录中打开大量文件),此选项不一定总是起作用。如果文件名不以 / 开头,请使用 ./ 作为前缀以避免此问题。- --loop-playlist=<N|inf|force|no>, --loop-playlist
Loops playback N times. A value of 1 plays it one time (default), 2 two times, etc. inf means forever. no is the same as 1 and disables looping. If several files are specified on command line, the entire playlist is looped. --loop-playlist is the same as --loop-playlist=inf.
循环播放 N 次。值为 1 表示播放一次(默认), 2 表示播放两次,等等。 inf 表示无限循环。 no 与 1 相同,并禁用循环。如果命令行上指定了多个文件,则整个播放列表将循环播放。 --loop-playlist 与 --loop-playlist=inf 相同 。The force mode is like inf, but does not skip playlist entries which have been marked as failing. This means the player might waste CPU time trying to loop a file that doesn't exist. But it might be useful for playing webradios under very bad network conditions.
与 force 模式类似,但不会跳过标记为失败的播放列表条目。这意味着播放器可能会浪费 CPU 时间尝试循环一个不存在的文件。但在非常糟糕的网络条件下播放网络广播可能很有用。- --loop-file=<N|inf|no>, --loop=<N|inf|no>
Loop a single file N times. inf means forever, no means normal playback. For compatibility, --loop-file and --loop-file=yes are also accepted, and are the same as --loop-file=inf.
循环播放单个文件 N 次。 inf 表示无限循环, no 表示正常播放。为了兼容性, --loop-file 和 --loop-file=yes 也被接受,并且与 --loop-file=inf 相同 。The difference to --loop-playlist is that this doesn't loop the playlist, just the file itself. If the playlist contains only a single file, the difference between the two option is that this option performs a seek on loop, instead of reloading the file.
与 --loop-playlist 的区别在于,这个选项不会循环播放列表,只会循环文件本身。如果播放列表中只有一个文件,则这两个选项的区别在于,此选项在循环时执行查找,而不是重新加载文件。Note 注意
--loop-file counts the number of times it causes the player to seek to the beginning of the file, not the number of full playthroughs. This means --loop-file=1 will end up playing the file twice. Contrast with --loop-playlist, which counts the number of full playthroughs.
--loop-file 统计玩家将文件从头开始搜索的次数,而不是完整播放次数。这意味着 --loop-file=1 将会播放文件两次。与 --loop-playlist 相比,它统计完整播放次数。--loop is an alias for this option.
--loop 是此选项的别名。- --ab-loop-a=<time>, --ab-loop-b=<time>
Set loop points. If playback passes the b timestamp, it will seek to the a timestamp. Seeking past the b point doesn't loop (this is intentional).
设置循环点。如果播放超过 b 时间戳,它将跳转到 a 时间戳。超过 b 点后不会循环(这是故意的)。If a is after b, the behavior is as if the points were given in the right order, and the player will seek to b after crossing through a. This is different from old behavior, where looping was disabled (and as a bug, looped back to a on the end of the file).
如果 a 在 b 之后,则行为相当于点按顺序给出,玩家将在穿过 a 后寻求 b 。这与旧行为不同,旧行为中循环被禁用(并且作为一个错误,循环回文件末尾的 a )。If either options are set to no (or unset), looping is disabled. This is different from old behavior, where an unset a implied the start of the file, and an unset b the end of the file.
如果任一选项设置为 no (或未设置),则循环被禁用。这与旧行为不同,未设置的 a 表示文件开始,未设置的 b 表示文件末尾。The loop-points can be adjusted at runtime with the corresponding properties. See also ab-loop command.
可以通过相应的属性在运行时调整循环点。另请参阅 ab-loop 命令。- --ab-loop-count=<N|inf>
- Run A-B loops only N times, then ignore the A-B loop points (default: inf).
inf means that looping goes on forever. If this option is set to 0, A-B
looping is ignored, and even the ab-loop command will not enable looping
again (the command will show (disabled) on the OSD message if both loop
points are set, but ab-loop-count is 0).
仅运行 A-B 循环 N 次,然后忽略 A-B 循环点(默认:无限)。 inf 表示循环永远进行。如果此选项设置为 0,则忽略 A-B 循环,并且即使 ab-loop 命令也不会再次启用循环(如果设置了两个循环点,但 ab-loop-count 为 0,则命令将在 OSD 消息上显示 (disabled) )。 - --ordered-chapters=<yes|no>
- Enable support for Matroska ordered chapters. mpv will load and
search for video segments from other files, and will also respect any
chapter order specified for the main file (default: yes).
启用对 Matroska 有序章节的支持。mpv 将加载并搜索来自其他文件的视频段,并且还将尊重为主文件指定的任何章节顺序(默认:是)。 - --ordered-chapters-files=<playlist-file>
Loads the given file as playlist, and tries to use the files contained in it as reference files when opening a Matroska file that uses ordered chapters. This overrides the normal mechanism for loading referenced files by scanning the same directory the main file is located in.
将指定的文件作为播放列表加载,并在打开使用有序章节的 Matroska 文件时尝试使用其中包含的文件作为参考文件。这将覆盖正常机制,通过扫描主文件所在的同一目录来加载参考文件。Useful for loading ordered chapter files that are not located on the local filesystem, or if the referenced files are in different directories.
对于加载不在本地文件系统上的有序章节文件,或者参考文件位于不同目录的情况非常有用。Note: a playlist can be as simple as a text file containing filenames separated by newlines.
注意:播放列表可以是一个简单的文本文件,其中包含通过换行符分隔的文件名。- --chapters-file=<filename>
Load chapters from this file, instead of using the chapter metadata found in the main file.
从该文件加载章节,而不是使用主文件中找到的章节元数据。This accepts a media file (like mkv) or even a pseudo-format like ffmetadata and uses its chapters to replace the current file's chapters. This doesn't work with OGM or XML chapters directly.
此功能接受媒体文件(如 mkv)或伪格式如 ffmetadata,并使用其章节替换当前文件的章节。此功能不能直接与 OGM 或 XML 章节一起使用。- --sstep=<sec>
Skip <sec> seconds after every frame.
每帧后跳过秒。Note 注意
Without --hr-seek, skipping will snap to keyframes.
没有 --hr-seek ,跳过将自动对齐到关键帧。- --stop-playback-on-init-failure=<yes|no>
- Stop playback if either audio or video fails to initialize (default: no).
With no, playback will continue in video-only or audio-only mode if one
of them fails. This doesn't affect playback of audio-only or video-only
files.
如果音频或视频初始化失败则停止播放(默认:否)。使用 no ,如果其中一个失败,则播放将仅以视频或音频模式继续。这不会影响仅音频或视频文件的播放。 - --play-direction=<forward|+|backward|->
Control the playback direction (default: forward). Setting backward will attempt to play the file in reverse direction, with decreasing playback time. If this is set on playback starts, playback will start from the end of the file. If this is changed at during playback, a hr-seek will be issued to change the direction.
控制播放方向(默认:正向)。设置 backward 将尝试以反向方向播放文件,播放时间递减。如果在此设置播放开始时,播放将从文件末尾开始。如果在播放过程中更改,将发出 hr-seek 以更改方向。+ and - are aliases for forward and backward.
+ 和 - 是 forward 和 backward 的别名。The rest of this option description pertains to the backward mode.
此选项描述的其余部分适用于 backward 模式。Note 注意
Backward playback is extremely fragile. It may not always work, is much slower than forward playback, and breaks certain other features. How well it works depends mainly on the file being played. Generally, it will show good results (or results at all) only if the stars align.
反向播放非常脆弱。它可能并不总是有效,比正向播放慢得多,并且会破坏某些其他功能。它的工作效果主要取决于正在播放的文件。通常,只有当所有星星都排成一行时,它才会显示良好的结果(或者任何结果)。mpv, as well as most media formats, were designed for forward playback only. Backward playback is bolted on top of mpv, and tries to make a medium effort to make backward playback work. Depending on your use-case, another tool may work much better.
mpv 以及大多数媒体格式都仅设计用于正向播放。反向播放是附加在 mpv 之上的,并试图尽力使反向播放工作。根据您的使用情况,另一个工具可能效果会好得多。Backward playback is not exactly a 1st class feature. Implementation tradeoffs were made, that are bad for backward playback, but in turn do not cause disadvantages for normal playback. Various possible optimizations are not implemented in order to keep the complexity down. Normally, a media player is highly pipelined (future data is prepared in separate threads, so it is available in realtime when the next stage needs it), but backward playback will essentially stall the pipeline at various random points.
反向播放并不是一个一等特性。在实现上做出了权衡,这对反向播放不利,但同时也不会对正常播放造成不利。为了降低复杂性,没有实现各种可能的优化。通常,媒体播放器高度管道化(未来数据在单独的线程中准备,以便在下一个阶段需要时实时可用),但反向播放将本质上在各个随机点阻塞管道。For example, for intra-only codecs are trivially backward playable, and tools built around them may make efficient use of them (consider video editors or camera viewers). mpv won't be efficient in this case, because it uses its generic backward playback algorithm, that on top of it is not very optimized.
例如,对于仅内编解码器来说,向后播放是显而易见的,围绕它们构建的工具可能能够有效地使用它们(考虑视频编辑器或相机查看器)。在这种情况下,mpv 不会很高效,因为它使用其通用的向后播放算法,而这个算法本身并不是非常优化。If you just want to quickly go backward through the video and just show "keyframes", just use forward playback, and hold down the left cursor key (which on CLI with default config sends many small relative seek commands).
如果您只想快速向后浏览视频并仅显示“关键帧”,请使用正向播放,并按住左光标键(在默认配置的 CLI 中,这会发送许多小相对搜索命令)。The implementation consists of mostly 3 parts:
实现主要分为 3 个部分:- Backward demuxing. This relies on the demuxer cache, so the demuxer cache
should (or must, didn't test it) be enabled, and its size will affect
performance. If the cache is too small or too large, quadratic runtime
behavior may result.
向后解复用。这依赖于解复用器缓存,因此解复用器缓存应该(或必须,未对其进行测试)启用,其大小将影响性能。如果缓存太小或太大,可能会导致二次方运行时行为。 - Backward decoding. The decoder library used (libavcodec) does not support
this. It is emulated by feeding bits of data in forward, putting the
result in a queue, returning the queue data to the VO in reverse, and
then starting over at an earlier position. This can require buffering an
extreme amount of decoded data, and also completely breaks pipelining.
反向解码。所使用的解码器库(libavcodec)不支持此功能。通过正向输入数据位,将结果放入队列,将队列数据反向返回给 VO,然后从较早的位置重新开始来实现仿真。这可能需要缓冲大量解码数据,并且完全破坏了流水线。 - Backward output. This is relatively simple, because the decoder returns
the frames in the needed order. However, this may cause various problems
because filters see audio and video going backward.
反向输出。这相对简单,因为解码器以所需顺序返回帧。然而,这可能会引起各种问题,因为过滤器看到音频和视频在反向流动。
Known problems: 已知问题:
- It's fragile. If anything doesn't work, random behavior may occur.
In simple cases, the player will just play nonsense and artifacts.
In other cases, it may get stuck or heat the CPU. (Exceeding memory usage
significantly beyond the user-set limits would be a bug, though.)
它很脆弱。如果任何东西不起作用,可能会出现随机行为。在简单情况下,播放器将播放无意义的内容和伪影。在其他情况下,它可能会卡住或加热 CPU。(然而,超过用户设置的内存限制显著增加将是一个错误。) - Performance and resource usage isn't good. In part this is inherent to
backward playback of normal media formats, and in parts due to
implementation choices and tradeoffs.
性能和资源使用不佳。部分原因是正常媒体格式的回放本身具有,部分原因是实现选择和权衡。 - This is extremely reliant on good demuxer behavior. Although backward
demuxing requires no special demuxer support, it is required that the
demuxer performs seeks reliably, fulfills some specific requirements
about packet metadata, and has deterministic behavior.
这极其依赖于良好的解复用器行为。尽管向后解复用不需要特殊的解复用器支持,但解复用器必须能够可靠地进行搜索,满足一些关于数据包元数据的特定要求,并且具有确定性行为。 - Starting playback exactly from the end may or may not work, depending on
seeking behavior and file duration detection.
从末尾开始播放可能工作也可能不工作,这取决于搜索行为和文件持续时间检测。 - Some container formats, audio, and video codecs are not supported due to
their behavior. There is no list, and the player usually does not detect
them. Certain live streams (including TV captures) may exhibit problems
in particular, as well as some lossy audio codecs. h264 intra-refresh is
known not to work due to problems with libavcodec. WAV and some other raw
audio formats tend to have problems - there are hacks for dealing with
them, which may or may not work.
由于某些容器格式、音频和视频编解码器的行为,不支持它们。没有列表,并且播放器通常不会检测到它们。某些实时流(包括电视捕获)可能会出现特定问题,以及一些有损音频编解码器。由于 libavcodec 的问题,h264 intra-refresh 已知无法工作。WAV 和一些其他原始音频格式往往存在问题 - 有一些处理它们的技巧,这些技巧可能或可能不工作。 - Backward demuxing of subtitles is not supported. Subtitle display still
works for some external text subtitle formats. (These are fully read into
memory, and only backward display is needed.) Text subtitles that are
cached in the subtitle renderer also have a chance to be displayed
correctly.
不支持字幕的向后解复用。对于某些外部文本字幕格式,字幕显示仍然有效。(这些将被完全读入内存,只需要向后显示。)在字幕渲染器中缓存的文本字幕也有机会正确显示。 - Some features dealing with playback of broken or hard to deal with files
will not work fully (such as timestamp correction).
一些处理损坏或难以处理的文件的功能可能无法完全工作(例如时间戳校正)。 - If demuxer low level seeks (i.e. seeking the actual demuxer instead of
just within the demuxer cache) are performed by backward playback, the
created seek ranges may not join, because not enough overlap is achieved.
如果通过向后播放执行解复用器的低级查找(即查找实际的解复用器而不是仅限于解复用器缓存),创建的查找范围可能不会连接,因为重叠不足。 - Trying to use this with hardware video decoding will probably exhaust all
your GPU memory and then crash a thing or two. Or it will fail because
--hwdec-extra-frames will certainly be set too low.
尝试使用此功能与硬件视频解码结合可能会耗尽您的 GPU 内存,然后导致一些程序崩溃。或者它将失败,因为 --hwdec-extra-frames 肯定会被设置得太低。 - Stream recording is broken. --stream-record may keep working if you
backward play within a cached region only.
流录制已损坏。如果仅在缓存区域内回放, --stream-record 可能仍然可以工作。 - Relative seeks may behave weird. Small seeks backward (towards smaller
time, i.e. seek -1) may not really seek properly, and audio will
remain muted for a while. Using hr-seek is recommended, which should have
none of these problems.
相对定位可能表现异常。小范围向后定位(即朝较小的时间,即 seek -1 )可能实际上无法正确定位,并且音频将保持静音一段时间。建议使用 hr-seek,它应该没有这些问题。 - Some things are just weird. For example, while seek commands manipulate
playback time in the expected way (provided they work correctly), the
framestep commands are transposed. Backstepping will perform very
expensive work to step forward by 1 frame.
有些事情就是很奇怪。例如,虽然定位命令以预期的方式操作播放时间(前提是它们能正确工作),但帧步命令是错位的。向后步进将执行非常昂贵的操作以向前步进 1 帧。
Tuning: 调整:
- Remove all --vf/--af filters you have set. Disable hardware
decoding. Disable functions like SPDIF passthrough.
删除您设置的 --vf / --af 过滤器。禁用硬件解码。禁用如 SPDIF 透传等功能。 - Increasing --video-reversal-buffer might help if reversal queue
overflow is reported, which may happen in high bitrate video, or video
with large GOP. Hardware decoding mostly ignores this, and you need to
increase --hwdec-extra-frames instead (until you get playback without
logged errors).
如果报告了回放队列溢出,增加 --video-reversal-buffer 可能有所帮助,这可能在高比特率视频或大型 GOP 视频中发生。硬件解码主要忽略这一点,您需要增加 --hwdec-extra-frames (直到您获得无错误日志的回放)。 - The demuxer cache is essential for backward demuxing. Make sure to set
--cache=yes. The cache size might matter. If it's too small, a queue
overflow will be logged, and backward playback cannot continue, or it
performs too many low level seeks. If it's too large, implementation
tradeoffs may cause general performance issues. Use
--demuxer-max-bytes to potentially increase the amount of packets the
demuxer layer can queue for reverse demuxing (basically it's the
--video-reversal-buffer equivalent for the demuxer layer).
解复用器缓存对于向后解复用至关重要。请确保设置 --cache=yes 。缓存大小可能很重要。如果太小,将记录队列溢出,回放无法继续,或者执行过多的低级搜索。如果太大,实现权衡可能会导致性能问题。使用 --demuxer-max-bytes 可能有增加解复用器层可以排队进行反向解复用的数据包数量的作用(基本上是解复用器层的 --video-reversal-buffer 相当物)。 - Setting --vd-queue-enable=yes can help a lot to make playback smooth
(once it works).
设置 --vd-queue-enable=yes 可以在很大程度上帮助使回放流畅(一旦它工作)。 - --demuxer-backward-playback-step also factors into how many seeks may
be performed, and whether backward demuxing could break due to queue
overflow. If it's set too high, the backstep operation needs to search
through more packets all the time, even if the cache is large enough.
--demuxer-backward-playback-step 也会影响到可能执行多少次查找,以及是否由于队列溢出而导致反向解复用可能中断。如果设置得太高,回退操作需要不断搜索更多的数据包,即使缓存足够大。 - Setting --demuxer-cache-wait may be useful to cache the entire file
into the demuxer cache. Set --demuxer-max-bytes to a large size to
make sure it can read the entire cache; --demuxer-max-back-bytes
should also be set to a large size to prevent that tries to trim the
cache.
设置 --demuxer-cache-wait 可能有助于将整个文件缓存到解复用器缓存中。将 --demuxer-max-bytes 设置为较大的大小以确保它可以读取整个缓存; --demuxer-max-back-bytes 也应该设置为较大的大小以防止尝试修剪缓存。 - If audio artifacts are audible, even though the AO does not underrun,
increasing --audio-backward-overlap might help in some cases.
如果音频伪影可闻,即使 AO 没有欠载,增加 --audio-backward-overlap 在某些情况下可能有所帮助。
- Backward demuxing. This relies on the demuxer cache, so the demuxer cache
should (or must, didn't test it) be enabled, and its size will affect
performance. If the cache is too small or too large, quadratic runtime
behavior may result.
- --video-reversal-buffer=<bytesize>, --audio-reversal-buffer=<bytesize>
For backward decoding. Backward decoding decodes forward in steps, and then reverses the decoder output. These options control the approximate maximum amount of bytes that can be buffered. The main use of this is to avoid unbounded resource usage; during normal backward playback, it's not supposed to hit the limit, and if it does, it will drop frames and complain about it.
用于反向解码。反向解码以步进方式向前解码,然后反转解码器的输出。这些选项控制可以缓存的近似最大字节数。这主要用于避免无界资源使用;在正常反向播放期间,不应达到限制,如果达到限制,它将丢弃帧并对此进行抱怨。Use this option if you get reversal queue overflow errors during backward playback. Increase the size until the warning disappears. Usually, the video buffer will overflow first, especially if it's high resolution video.
在向后播放时遇到回放队列溢出错误时请使用此选项。增加大小直到警告消失。通常,视频缓冲区会首先溢出,尤其是如果是高分辨率视频。This does not work correctly if video hardware decoding is used. The video frame size will not include the referenced GPU and driver memory. Some hardware decoders may also be limited by --hwdec-extra-frames.
如果使用视频硬件解码,则此操作可能不会正确执行。视频帧大小将不包括引用的 GPU 和驱动内存。某些硬件解码器也可能受到 --hwdec-extra-frames 的限制。How large the queue size needs to be depends entirely on the way the media was encoded. Audio typically requires a very small buffer, while video can require excessively large buffers.
队列大小需要多大完全取决于媒体编码的方式。音频通常只需要非常小的缓冲区,而视频可能需要非常大的缓冲区。(Technically, this allows the last frame to exceed the limit. Also, this does not account for other buffered frames, such as inside the decoder or the video output.)
(技术上,这允许最后一帧超过限制。此外,这也不考虑其他缓冲帧,例如解码器内部或视频输出中的缓冲帧。)This does not affect demuxer cache behavior at all.
这根本不影响解复用器缓存行为。See --list-options for defaults and value range. <bytesize> options accept suffixes such as KiB and MiB.
查看 --list-options 以获取默认值和值范围。 <bytesize> 选项接受后缀,例如 KiB 和 MiB 。- --video-backward-overlap=<auto|number>, --audio-backward-overlap=<auto|number>
Number of overlapping keyframe ranges to use for backward decoding (default: auto) ("keyframe" to be understood as in the mpv/ffmpeg specific meaning). Backward decoding works by forward decoding in small steps. Some codecs cannot restart decoding from any packet (even if it's marked as seek point), which becomes noticeable with backward decoding (in theory this is a problem with seeking too, but --hr-seek-demuxer-offset can fix it for seeking). In particular, MDCT based audio codecs are affected.
用于向后解码的重叠关键帧范围数量(默认:自动)(“关键帧”应理解为在 mpv/ffmpeg 特定含义中)。向后解码通过小步正向解码来实现。某些编解码器无法从任何数据包(即使标记为寻址点)重新启动解码,这在向后解码时尤为明显(理论上这同样是寻址的问题,但 --hr-seek-demuxer-offset 可以修复寻址问题)。特别是基于 MDCT 的音频编解码器受到影响。The solution is to feed a previous packet to the decoder each time, and then discard the output. This option controls how many packets to feed. The auto choice is currently hardcoded to 0 for video, and uses 1 for lossy audio, 0 for lossless audio. For some specific lossy audio codecs, this is set to 2.
解决方案是在每次解码时向解码器提供前一个数据包,然后丢弃输出。此选项控制要提供多少个数据包。目前 auto 选项对于视频硬编码为 0,对于有损音频使用 1,对于无损音频使用 0。对于某些特定的有损音频编解码器,此值设置为 2。--video-backward-overlap can potentially handle intra-refresh video, depending on the exact conditions. You may have to use the --vd-lavc-show-all option as well.
--video-backward-overlap 可能能够处理内部刷新视频,具体取决于确切条件。您可能还需要使用 --vd-lavc-show-all 选项。- --video-backward-batch=<number>, --audio-backward-batch=<number>
Number of keyframe ranges to decode at once when backward decoding (default: 1 for video, 10 for audio). Another pointless tuning parameter nobody should use. This should affect performance only. In theory, setting a number higher than 1 for audio will reduce overhead due to less frequent backstep operations and less redundant decoding work due to fewer decoded overlap frames (see --audio-backward-overlap). On the other hand, it requires a larger reversal buffer, and could make playback less smooth due to breaking pipelining (e.g. by decoding a lot, and then doing nothing for a while).
在向后解码时一次解码的关键帧范围数量(默认:视频为 1,音频为 10)。另一个毫无意义的调整参数,没有人应该使用。这应该只会影响性能。理论上,将音频的数字设置为大于 1 将减少由于较少的回退操作和较少的冗余解码工作(由于解码重叠帧较少)而产生的开销(见 --audio-backward-overlap )。另一方面,它需要更大的反转缓冲区,并且可能会因为打破流水线(例如,解码很多,然后一段时间不做任何事情)而使播放不够平滑。It probably never makes sense to set --video-backward-batch. But in theory, it could help with intra-only video codecs by reducing backstep operations.
可能永远没有设置 --video-backward-batch 的意义。但在理论上,它可以通过减少回退操作来帮助仅内编码的视频编解码器。- --demuxer-backward-playback-step=<seconds>
Number of seconds the demuxer should seek back to get new packets during backward playback (default: 60). This is useful for tuning backward playback, see --play-direction for details.
解复用器在向后播放期间应回退多少秒以获取新数据包(默认:60)。这对于调整向后播放很有用,请参阅 --play-direction 以获取详细信息。Setting this to a very low value or 0 may make the player think seeking is broken, or may make it perform multiple seeks.
将此值设置为非常低或 0 可能会导致播放器认为搜索已损坏,或者可能导致它执行多次搜索。Setting this to a high value may lead to quadratic runtime behavior.
将此值设置为高值可能会导致二次方运行时行为。
Program Behavior 程序行为
- --help, --h
Show short summary of options.
显示选项的简短摘要。You can also pass a string to this option, which will list all top-level options which contain the string in the name, e.g. --h=scale for all options that contain the word scale. The special string * lists all top-level options.
您还可以传递一个字符串到这个选项,这将列出所有名称中包含该字符串的顶级选项,例如,对于所有包含单词 scale 的选项,使用 --h=scale 。特殊字符串 * 列出所有顶级选项。- -v
- Increment verbosity level, one level for each -v found on the command
line.
增加详细程度级别,每次在命令行中找到 -v 就增加一级。 - --version, -V
- Print version string and exit.
打印版本字符串并退出。 - --no-config
Do not load default configuration or any user files. This prevents loading of both the user-level and system-wide mpv.conf and input.conf files. Other user files are blocked as well, such as resume playback files and cache files. This option only takes effect when used as a command line flag.
不要加载默认配置或任何用户文件。这防止了加载用户级和系统级的 mpv.conf 和 input.conf 文件。其他用户文件也会被阻止,例如恢复播放文件和缓存文件。此选项仅在用作命令行标志时生效。Note 注意
Files explicitly requested by command line options, like --include or --use-filedir-conf, will still be loaded.
由命令行选项明确请求的文件,如 --include 或 --use-filedir-conf ,仍然会被加载。See also: --config-dir. 另请参阅: --config-dir 。
- --list-options
- Prints all available options.
打印所有可用选项。 - --list-properties
- Print a list of the available properties.
打印可用属性的列表。 - --list-protocols
- Print a list of the supported protocols.
打印支持的协议列表。 - --log-file=<path>
Opens the given path for writing, and print log messages to it. Existing files will be truncated. The log level is at least -v -v, but can be raised via --msg-level (the option cannot lower it below the forced minimum log level).
以写入模式打开指定的路径,并将日志消息打印到其中。现有文件将被截断。日志级别至少为 -v -v ,但可以通过 --msg-level (选项不能将其降低到强制最低日志级别)提高。A special case is the macOS bundle, it will create a log file at ~/Library/Logs/mpv.log by default.
一个特殊情况是 macOS 包,它将默认在 ~/Library/Logs/mpv.log 创建一个日志文件。- --config-dir=<path>
Force a different configuration directory. If this is set, the given directory is used to load configuration files, and all other configuration directories are ignored. This means the global mpv configuration directory as well as per-user directories are ignored, and overrides through environment variables (MPV_HOME) are also ignored.
强制使用不同的配置目录。如果设置了此选项,则使用指定的目录来加载配置文件,并忽略所有其他配置目录。这意味着将忽略全局 mpv 配置目录以及用户目录,并且也忽略通过环境变量( MPV_HOME )进行的覆盖。Note that the cache and state paths (~~/cache, ~~/state) are not considered "configuration" and keep their auto-detection logic.
请注意,缓存和状态路径( ~~/cache , ~~/state )不被视为“配置”,并保持其自动检测逻辑。Note that the --no-config option takes precedence over this option.
请注意, --no-config 选项优先于此选项。- --dump-stats=<filename>
Write certain statistics to the given file. The file is truncated on opening. The file will contain raw samples, each with a timestamp. To make this file into a readable, the script TOOLS/stats-conv.py can be used (which currently displays it as a graph).
将某些统计信息写入指定的文件。文件在打开时将被截断。文件将包含原始样本,每个样本都有一个时间戳。要将此文件转换为可读格式,可以使用脚本 TOOLS/stats-conv.py (当前显示为图形).This option is useful for debugging only.
此选项仅用于调试。- --idle=<no|yes|once>
Makes mpv wait idly instead of quitting when there is no file to play. Mostly useful in input mode, where mpv can be controlled through input commands. (Default: no)
当没有文件可播放时,使 mpv 空闲等待而不是退出。主要在输入模式下有用,在此模式下,mpv 可以通过输入命令进行控制。(默认: no )once will only idle at start and let the player close once the first playlist has finished playing back.
once 仅在开始时空闲,并在第一个播放列表播放完毕后关闭播放器。- --include=<configuration-file>
- Specify configuration file to be parsed after the default ones.
指定要解析的配置文件,在默认配置文件之后。 - --load-scripts=<yes|no>
- If set to no, don't auto-load scripts from the scripts
configuration subdirectory (usually ~/.config/mpv/scripts/).
(Default: yes)
如果设置为 no ,则不要从 scripts 配置子目录(通常为 ~/.config/mpv/scripts/ )自动加载脚本。(默认: yes ) - --script=<filename>, --scripts=file1.lua:file2.lua:...
Load a Lua script. The second option allows you to load multiple scripts by separating them with the path separator (: on Unix, ; on Windows).
加载 Lua 脚本。第二个选项允许您通过路径分隔符(Unix 上的 : ,Windows 上的 ; )分隔来加载多个脚本。--scripts is a path list option. See List Options for details.
--scripts 是一个路径列表选项。有关详细信息,请参阅列表选项。- --script-opt=<key=value>, --script-opts=key1=value1,key2=value2,...
Set options for scripts. A script can query an option by key. If an option is used and what semantics the option value has depends entirely on the loaded scripts. Values not claimed by any scripts are ignored.
设置脚本的选项。脚本可以通过键查询选项。如果使用选项,其值具有的语义完全取决于加载的脚本。任何脚本未声明的值都将被忽略。Each use of the --script-opt option will add another option to the internal list, while --script-opts takes a list of options at once, and overwrites the internal list with it. The latter is a key/value list option. See List Options for details.
每次使用 --script-opt 选项都会将另一个选项添加到内部列表中,而 --script-opts 一次接受一个选项列表,并用它覆盖内部列表。后者是一个键/值列表选项。有关详细信息,请参阅列表选项。- --merge-files
- Pretend that all files passed to mpv are concatenated into a single, big
file. This uses timeline/EDL support internally.
假设传递给 mpv 的所有文件都被连接成一个单独的大文件。这内部使用时间轴/EDL 支持。 - --profile=<profile1,profile2,...>
- Use the given profile(s), --profile=help displays a list of the
defined profiles.
使用指定的配置文件, --profile=help 显示定义的配置文件列表。 - --reset-on-next-file=<all|option1,option2,...>
Normally, mpv will try to keep all settings when playing the next file on the playlist, even if they were changed by the user during playback. (This behavior is the opposite of MPlayer's, which tries to reset all settings when starting next file.)
通常,mpv 在播放播放列表中的下一个文件时将尝试保留所有设置,即使用户在播放过程中更改了它们。(这种行为与 MPlayer 相反,MPlayer 在启动下一个文件时尝试重置所有设置。)Default: Do not reset anything.
默认:不重置任何内容。This can be changed with this option. It accepts a list of options, and mpv will reset the value of these options on playback start to the initial value. The initial value is either the default value, or as set by the config file or command line.
可以通过此选项更改此设置。它接受一个选项列表,mpv 将在播放开始时将这些选项的值重置为初始值。初始值是默认值,或由配置文件或命令行设置。The special name all resets as many options as possible.
特殊名称 all 将尽可能重置多个选项。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。Examples 示例
- --reset-on-next-file=pause
Reset pause mode when switching to the next file.
--reset-on-next-file=pause 在切换到下一个文件时重置暂停模式。 - --reset-on-next-file=fullscreen,speed
Reset fullscreen and playback speed settings if they were changed
during playback.
--reset-on-next-file=fullscreen,speed 如果在播放过程中进行了更改,则重置全屏和播放速度设置。 - --reset-on-next-file=all
Try to reset all settings that were changed during playback.
--reset-on-next-file=all 尝试重置在播放过程中更改的所有设置。
- --reset-on-next-file=pause
Reset pause mode when switching to the next file.
- --show-profile=<profile>
- Show the description and content of a profile. Lists all profiles if no
parameter is provided.
显示个人资料的描述和内容。如果没有提供参数,则列出所有个人资料。 - --use-filedir-conf
Look for a file-specific configuration file in the same directory as the file that is being played. See File-specific Configuration Files.
在正在播放的文件所在的同一目录中查找特定文件的配置文件。参见特定文件配置文件。Warning 警告
May be dangerous if playing from untrusted media.
如果从不受信任的媒体播放,可能存在危险。- --ytdl=<yes|no>
Enable the youtube-dl hook-script. It will look at the input URL, and will play the video located on the website. This works with many streaming sites, not just the one that the script is named after. This requires a recent version of youtube-dl to be installed on the system (default: yes).
启用 youtube-dl 钩子脚本。它将检查输入 URL,并播放位于网站上的视频。这适用于许多流媒体网站,而不仅仅是脚本命名的那个网站。这需要在系统上安装最近版本的 youtube-dl(默认:是)。If the script can't do anything with an URL, it will do nothing.
如果脚本对 URL 无能为力,它将什么都不做。This accepts a set of options, which can be passed to it with the --script-opts option (using ytdl_hook- as prefix):
此操作接受一组选项,可以使用 --script-opts 选项(使用 ytdl_hook- 作为前缀)传递给它:- try_ytdl_first=<yes|no>
- If 'yes' will try parsing the URL with youtube-dl first, instead of the
default where it's only after mpv failed to open it. This mostly depends
on whether most of your URLs need youtube-dl parsing.
如果选择 'yes',将首先尝试使用 youtube-dl 解析 URL,而不是默认情况下在 mpv 打开失败之后。这主要取决于您的大多数 URL 是否需要 youtube-dl 解析。 - exclude=<URL1|URL2|...
A |-separated list of URL patterns which mpv should not use with youtube-dl. The patterns are matched after the http(s):// part of the URL.
一个由 | 分隔的 URL 模式列表,mpv 不应与 youtube-dl 一起使用。模式匹配在 URL 的 http(s):// 部分之后。^ matches the beginning of the URL, $ matches its end, and you should use % before any of the characters ^$()%|,.[]*+-? to match that character.
^ 匹配 URL 的开头, $ 匹配其结尾,您应该在匹配 ^$()%|,.[]*+-? 中的任何字符之前使用 % 。URLs are converted to lower case before matching.
URLs 在匹配之前被转换为小写。Examples 示例
- --script-opts=ytdl_hook-exclude='^youtube%.com'
will exclude any URL that starts with http://youtube.com or
https://youtube.com.
--script-opts=ytdl_hook-exclude='^youtube%.com' 将排除以 http://youtube.com 或 https://youtube.com 开头的任何 URL 。 - --script-opts=ytdl_hook-exclude='%.mkv$|%.mp4$'
will exclude any URL that ends with .mkv or .mp4.
--script-opts=ytdl_hook-exclude='%.mkv$|%.mp4$' 将排除以 .mkv 或 .mp4 结尾的任何 URL 。
See more lua patterns here: https://www.lua.org/manual/5.1/manual.html#5.4.1
在此处查看更多 lua 模式:https://www.lua.org/manual/5.1/manual.html#5.4.1- --script-opts=ytdl_hook-exclude='^youtube%.com'
will exclude any URL that starts with http://youtube.com or
https://youtube.com.
- include=<URL1|URL2|...
A |-separated list of URL patterns which mpv should try to parse with youtube-dl first when try_ytdl_first is no. The patterns are matched in the same way as exclude.
一个由 | 分隔的 URL 模式列表,mpv 应首先尝试使用 youtube-dl 解析这些模式,当 try_ytdl_first 为 no 时。模式匹配方式与 exclude 相同。Default: ^%w+%.youtube%.com/|^youtube%.com/|^youtu%.be/|^%w+%.twitch%.tv/|^twitch%.tv/ 默认: ^%w+%.youtube%.com/|^youtube%.com/|^youtu%.be/|^%w+%.twitch%.tv/|^twitch%.tv/
- all_formats=<yes|no>
If 'yes' will attempt to add all formats found reported by youtube-dl (default: no). Each format is added as a separate track. In addition, they are delay-loaded, and actually opened only when a track is selected (this should keep load times as low as without this option).
如果选择 'yes',将尝试添加由 youtube-dl 报告的所有找到的格式(默认:no)。每个格式都作为单独的轨道添加。此外,它们是延迟加载的,实际上只有在选择轨道时才会打开(这应该可以保持没有此选项时的加载时间)。It adds average bitrate metadata, if available, which means you can use --hls-bitrate to decide which track to select. (HLS used to be the only format whose alternative quality streams were exposed in a similar way, thus the option name.)
如果可用,它将添加平均比特率元数据,这意味着您可以使用 --hls-bitrate 来决定选择哪个轨道。(HLS 曾经是唯一一种以类似方式公开替代质量流的格式,因此选项名称。)Tracks which represent formats that were selected by youtube-dl as default will have the default flag set. This means mpv should generally still select formats chosen with --ytdl-format by default.
代表由 youtube-dl 默认选择的格式的轨道将设置默认标志。这意味着 mpv 通常仍然会默认选择使用 --ytdl-format 选择的格式。Although this mechanism makes it possible to switch streams at runtime, it's not suitable for this purpose for various technical reasons. (It's slow, which can't be really fixed.) In general, this option is not useful, and was only added to show that it's possible.
尽管这种机制可以在运行时切换流,但由于各种技术原因,它不适合此目的。(它很慢,这实际上无法真正修复。)一般来说,此选项并不实用,仅添加以表明这是可能的。There are two cases that must be considered when doing quality/bandwidth selection:
在进行质量/带宽选择时必须考虑两种情况:Completely separate audio and video streams (DASH-like). Each of these streams contain either only audio or video, so you can mix and combine audio/video bandwidths without restriction. This intuitively matches best with the concept of selecting quality by track (what all_formats is supposed to do).
完全分离的音频和视频流(类似 DASH)。这些流中的每一个都只包含音频或视频,因此您可以无限制地混合和组合音频/视频带宽。这直观地与按轨道选择质量的概念( all_formats 应该执行的操作)最匹配。Separate sets of muxed audio and video streams. Each version of the media contains both an audio and video stream, and they are interleaved. In order not to waste bandwidth, you should only select one of these versions (if, for example, you select an audio stream, then video will be downloaded, even if you selected video from a different stream).
分离的复用音频和视频流集合。每种媒体版本都包含音频和视频流,并且它们是交错排列的。为了不浪费带宽,您应该只选择这些版本中的一个(例如,如果您选择音频流,则即使您从不同的流中选择了视频,也会下载视频)。mpv will still represent them as separate tracks, but will set the title of each track to muxed-N, where N is replaced with the youtube-dl format ID of the originating stream.
mpv 仍然将它们表示为单独的轨道,但会将每个轨道的标题设置为 muxed-N ,其中 N 将被原始流的 youtube-dl 格式 ID 替换。
Some sites will mix 1. and 2., but we assume that they do so for compatibility reasons, and there is no reason to use them at all.
一些网站会混合 1.和 2.,但我们假设它们这样做是为了兼容性原因,实际上完全没有必要使用它们。- force_all_formats=<yes|no>
If set to 'yes', and all_formats is also set to 'yes', this will try to represent all youtube-dl reported formats as tracks, even if mpv would normally use the direct URL reported by it (default: yes).
如果设置为'yes',并且 all_formats 也设置为'yes',这将尝试将 youtube-dl 报告的所有格式表示为轨道,即使 mpv 通常会使用它报告的直接 URL(默认:yes)。It appears this normally makes a difference if youtube-dl works on a master HLS playlist.
这似乎在 youtube-dl 在主 HLS 播放列表上工作时会有所不同。If this is set to 'no', this specific kind of stream is treated like all_formats is set to 'no', and the stream selection as done by youtube-dl (via --ytdl-format) is used.
如果设置为'no',这种特定的流将像 all_formats 设置为'no'一样处理,并且使用 youtube-dl(通过 --ytdl-format )进行的流选择将被使用。- thumbnails=<all|best|none>
Add thumbnails as video tracks (default: none).
添加缩略图作为视频轨道(默认:无)。Thumbnails get downloaded when they are added as tracks, so 'all' can have a noticeable impact on how long it takes to open the video when there are a lot of thumbnails.
当缩略图作为轨道添加时,它们会被下载,因此当缩略图很多时,'all'可能会对打开视频所需的时间产生明显影响。- use_manifests=<yes|no>
- Make mpv use the master manifest URL for formats like HLS and DASH,
if available, allowing for video/audio selection in runtime (default:
no). It's disabled ("no") by default for performance reasons.
如果可用,让 mpv 使用 HLS 和 DASH 等格式的 master manifest URL,允许在运行时选择视频/音频(默认:否)。默认情况下禁用("no"),出于性能考虑。 - ytdl_path=youtube-dl
- Configure paths to youtube-dl's executable or a compatible fork's. The
paths should be separated by : on Unix and ; on Windows. mpv looks in
order for the configured paths in PATH and in mpv's config directory.
The defaults are "yt-dlp", "yt-dlp_x86" and "youtube-dl". On Windows
the suffix extension is not necessary, but only ".exe" is acceptable.
配置 youtube-dl 的可执行文件或兼容分支的路径。在 Unix 上,路径应由:分隔,在 Windows 上由;分隔。mpv 将按照配置的路径顺序在 PATH 和 mpv 的配置目录中查找。默认值为"yt-dlp","yt-dlp_x86"和"youtube-dl"。在 Windows 上,不需要后缀扩展名,但只接受".exe"。
Why do the option names mix _ and -?
为什么选项名称会混合使用 _ 和 - ?I have no idea.
我不知道。- --ytdl-format=<ytdl|best|worst|mp4|webm|...>
Video format/quality that is directly passed to youtube-dl. The possible values are specific to the website and the video, for a given url the available formats can be found with the command youtube-dl --list-formats URL. See youtube-dl's documentation for available aliases. (Default: bestvideo+bestaudio/best)
直接传递给 youtube-dl 的视频格式/质量。可能的值特定于网站和视频,对于给定的 url,可以通过命令 youtube-dl --list-formats URL 查找可用的格式。有关可用的别名,请参阅 youtube-dl 的文档。(默认: bestvideo+bestaudio/best )The ytdl value does not pass a --format option to youtube-dl at all, and thus does not override its default. Note that sometimes youtube-dl returns a format that mpv cannot use, and in these cases the mpv default may work better.
ytdl 值根本不会将 --format 选项传递给 youtube-dl,因此不会覆盖其默认设置。请注意,有时 youtube-dl 返回的格式是 mpv 无法使用的,在这些情况下,mpv 的默认设置可能更好。- --ytdl-raw-options=<key>=<value>[,<key>=<value>[,...]]
Pass arbitrary options to youtube-dl. Parameter and argument should be passed as a key-value pair. Options without argument must include =.
将任意选项传递给 youtube-dl。参数和参数应以键值对的形式传递。没有参数的选项必须包含 = 。There is no sanity checking so it's possible to break things (i.e. passing invalid parameters to youtube-dl).
没有进行合理性检查,因此可能会破坏某些东西(例如,向 youtube-dl 传递无效参数)。A proxy URL can be passed for youtube-dl to use it in parsing the website. This is useful for geo-restricted URLs. After youtube-dl parsing, some URLs also require a proxy for playback, so this can pass that proxy information to mpv. Take note that SOCKS proxies aren't supported and https URLs also bypass the proxy. This is a limitation in FFmpeg.
可以为 youtube-dl 传递一个代理 URL,以便在解析网站时使用它。这对于地理限制的 URL 很有用。在 youtube-dl 解析后,某些 URL 也需要代理进行播放,因此可以将该代理信息传递给 mpv。请注意,SOCKS 代理不受支持,并且 https URL 也会绕过代理。这是 FFmpeg 的限制。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。Example 示例
- --ytdl-raw-options=username=user,password=pass
- --ytdl-raw-options=force-ipv6=
- --ytdl-raw-options=proxy=[http://127.0.0.1:3128]
- --ytdl-raw-options-append=proxy=http://127.0.0.1:3128
- --js-memory-report=<yes|no>
- Enable memory reporting for javascript scripts in the stats overlay.
This is disabled by default because it has an overhead and increases
memory usage. This option will only work if it is enabled before mpv is
started.
启用在统计叠加中为 javascript 脚本启用内存报告。默认情况下此功能是禁用的,因为它会产生开销并增加内存使用。此选项仅在 mpv 启动之前启用时才会生效。 - --load-stats-overlay=<yes|no>
- Enable the builtin script that shows useful playback information on a key
binding (default: yes). By default, the i key is used (I to make
the overlay permanent).
启用内置脚本,该脚本在按键绑定上显示有用的回放信息(默认:是)。默认情况下,使用 i 键(使用 I 使覆盖永久)。 - --load-console=<yes|no>
- Enable the built-in script to handle textual input (default: yes).
启用内置脚本以处理文本输入(默认:是)。 - --load-commands=<yes|no>
- Enable the built-in script to enter commands in the console (default: yes).
The ` key is used to activate this by default.
启用内置脚本以在控制台中输入命令(默认:是)。默认使用 ` 键激活此功能。 - --load-auto-profiles=<yes|no|auto>
- Enable the builtin script that does auto profiles (default: auto). See
Conditional auto profiles for details. auto will load the script,
but immediately unload it if there are no conditional profiles.
启用内置脚本以自动生成配置文件(默认:自动)。有关条件自动配置文件的详细信息,请参阅条件自动配置文件。 auto 将加载脚本,但如果没有条件配置文件,将立即卸载它。 - --load-select=<yes|no>
- Enable the builtin script that lets you select from lists of items (default:
yes). By default, its keybindings start with the g key.
启用内置脚本,允许您从项目列表中选择(默认:是)。默认情况下,其快捷键从 g 键开始。 - --load-positioning=<yes|no>
- Enable the builtin script that provides various keybindings to pan videos
and images (default: yes).
启用内置脚本,提供各种键绑定以滚动视频和图像(默认:是)。 - --player-operation-mode=<cplayer|pseudo-gui>
- For enabling "pseudo GUI mode", which means that the defaults for some
options are changed. This option should not normally be used directly, but
only by mpv internally, or mpv-provided scripts, config files, or .desktop
files. See PSEUDO GUI MODE for details.
启用 "伪 GUI 模式",这意味着某些选项的默认值已更改。此选项通常不应直接使用,而应由 mpv 内部、mpv 提供的脚本、配置文件或.desktop 文件使用。有关详细信息,请参阅 PSEUDO GUI MODE。
Watch Later 稍后观看
- --save-position-on-quit
Always save the current playback position on quit, and also when the loadfile command is used to replace the current playlist. When this file is played again later, the player will seek to the old playback position on start. This does not happen if playback of a file is stopped in other ways. For example, going to the next file in the playlist will not save the position, and will start playback at beginning the next time the file is played.
退出时始终保存当前播放位置,并在使用 loadfile 命令替换当前播放列表时也保存。稍后再次播放此文件时,播放器将在启动时跳转到旧的播放位置。如果以其他方式停止播放文件,则不会发生此情况。例如,转到播放列表中的下一个文件将不会保存位置,并且下一次播放该文件时将从开头开始播放。This behavior is disabled by default, but is always available when quitting the player with Shift+Q.
默认情况下禁用此行为,但始终在按 Shift+Q 退出播放器时可用。See RESUMING PLAYBACK. 查看 RESUMING PLAYBACK。
- --watch-later-dir=<path>
The directory in which to store the "watch later" temporary files.
存储 "稍后观看" 临时文件的目录。--watch-later-directory is an alias for --watch-later-dir.
--watch-later-directory 是 --watch-later-dir 的别名。If this option is unset, the files will be stored in a subdirectory named "watch_later" underneath the local state directory (usually ~/.local/state/mpv/).
如果未设置此选项,文件将存储在本地状态目录(通常为 ~/.local/state/mpv/ )下的名为 "watch_later" 的子目录中。- --resume-playback=<yes|no>
- Restore playback position from the watch_later configuration
subdirectory, usually ~/.config/mpv/watch_later/ (default: yes).
从 watch_later 配置子目录恢复播放位置,通常为 ~/.config/mpv/watch_later/ (默认:是)。 - --resume-playback-check-mtime=<yes|no>
- Only restore the playback position from the watch_later configuration
subdirectory (usually ~/.config/mpv/watch_later/) if the file's
modification time is the same as at the time of saving. This may prevent
skipping forward in files with the same name which have different content.
(Default: no)
仅在文件的修改时间与保存时相同的情况下,从 watch_later 配置子目录(通常为 ~/.config/mpv/watch_later/ )恢复播放位置。这可以防止在具有相同名称但内容不同的文件中跳过。 (默认: no ) - --watch-later-options=option1,option2,...
The options that are saved in "watch later" files if they have been changed since when mpv started. These values will be restored the next time the files are played. Note that the playback position is saved via the start option.
保存到“稍后观看”文件中的选项,如果它们自 mpv 启动以来已更改。这些值将在下次播放文件时恢复。请注意,播放位置是通过 start 选项保存的。When removing options, existing watch later data won't be modified and will still be applied fully, but new watch later data won't contain these options.
在删除选项时,现有的稍后观看数据不会修改,并且仍然会完全应用,但新的稍后观看数据将不包含这些选项。See --help=watch-later-options for the list of the properties that are restored by default.
查看 --help=watch-later-options 以获取默认恢复的属性列表。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。Examples 示例
- --watch-later-options-remove=sid
The subtitle track selection will not be restored.
--watch-later-options-remove=sid 字幕轨道选择将不会被恢复。 - --watch-later-options-remove=volume
--watch-later-options-remove=mute
The volume and mute state won't be saved to watch later files.
--watch-later-options-remove=volume --watch-later-options-remove=mute 音量静音状态不会保存到稍后观看的文件中。 - --watch-later-options=start
No option will be saved to watch later files, except the playback
position.
--watch-later-options=start 除了播放位置外,不会将任何选项保存到稍后观看的文件中。
- --watch-later-options-remove=sid
The subtitle track selection will not be restored.
- --write-filename-in-watch-later-config
Prepend the watch later config files with the name of the file they refer to. This is simply written as comment on the top of the file.
将引用的文件名添加到“watch later”配置文件的开头。这简单地写在文件顶部作为注释。Warning 警告
This option may expose privacy-sensitive information and is thus disabled by default.
此选项可能会暴露隐私敏感信息,因此默认禁用。- --ignore-path-in-watch-later-config
- Ignore path (i.e. use filename only) when using watch later feature.
(Default: disabled)
使用“watch later”功能时忽略路径(即仅使用文件名)。(默认:禁用)
Watch History 观看历史
- --save-watch-history
Whether to save which files are played. These can be then selected with the default g-h key binding.
是否保存播放的文件。然后可以使用默认的 g-h 快捷键进行选择。Warning 警告
This option may expose privacy-sensitive information and is thus disabled by default.
此选项可能会暴露隐私敏感信息,因此默认禁用。- --watch-history-path=<path>
The path in which to store the watch history. Default: ~~state/watch_history.jsonl (see PATHS).
存储监视历史记录的路径。默认: ~~state/watch_history.jsonl (参见 PATHS)。This file contains one JSON object per line. Its time field is the UNIX timestamp when the file was opened, its path field is the normalized path, and its title field is the title when it was available.
此文件每行包含一个 JSON 对象。其 time 字段是文件打开时的 UNIX 时间戳,其 path 字段是归一化路径,其 title 字段是可用时的标题。
Video 视频
- --vo=<driver>
- Specify the video output backend to be used. See VIDEO OUTPUT DRIVERS for
details and descriptions of available drivers.
指定要使用的视频输出后端。有关详细信息以及可用驱动程序的描述,请参阅视频输出驱动程序。 - --vd=<...>
Specify a priority list of video decoders to be used, according to their family and name. See --ad for further details. Both of these options use the same syntax and semantics; the only difference is that they operate on different codec lists.
指定要使用的视频解码器的优先级列表,根据其家族和名称。参见 --ad 以获取更多详细信息。这两个选项使用相同的语法和语义;唯一的区别是它们操作不同的编解码器列表。Note 注意
See --vd=help for a full list of available decoders.
参见 --vd=help 以获取可用解码器的完整列表。- --vf=<filter1[=parameter1:parameter2:...],filter2,...>
- Specify a list of video filters to apply to the video stream. See
VIDEO FILTERS for details and descriptions of the available filters.
The option variants --vf-add, --vf-pre, and --vf-clr exist
to modify a previously specified list, but you should not need these for
typical use.
指定要应用于视频流的视频过滤器列表。有关可用过滤器的详细信息及其描述,请参阅 VIDEO FILTERS。选项变体 --vf-add 、 --vf-pre 和 --vf-clr 存在用于修改之前指定的列表,但在典型使用中您可能不需要这些。 - --untimed
- Do not sleep when outputting video frames. Useful for benchmarks when used
with --audio=no.
输出视频帧时不要睡眠。与 --audio=no 结合使用时对基准测试很有用。 - --framedrop=<mode>
Skip displaying some frames to maintain A/V sync on slow systems, or playing high framerate video on video outputs that have an upper framerate limit.
跳过显示一些帧以在慢速系统上保持音视频同步,或在具有上限帧率的视频输出上播放高帧率视频。The argument selects the drop methods, and can be one of the following:
此参数选择丢弃方法,可以是以下之一:- <no> <无>
- Disable any frame dropping. Not recommended, for testing only.
禁用任何帧丢弃。不建议使用,仅用于测试。 - <vo> <音>
Drop late frames on video output (default). This still decodes and filters all frames, but doesn't render them on the VO. Drops are indicated in the terminal status line as Dropped: field.
在视频输出时丢弃过晚的帧(默认)。这仍然解码和过滤所有帧,但不在 VO 上渲染它们。丢弃的帧在终端状态行中的 Dropped: 字段中指示。In audio sync. mode, this drops frames that are outdated at the time of display. If the decoder is too slow, in theory all frames would have to be dropped (because all frames are too late) - to avoid this, frame dropping stops if the effective framerate is below 10 FPS.
在音频同步模式下,这会丢弃在显示时过时的帧。如果解码器太慢,理论上所有帧都必须丢弃(因为所有帧都太晚) - 为了避免这种情况,如果有效帧率低于 10 FPS,则停止帧丢弃。In display-sync. modes (see --video-sync), this affects only how A/V drops or repeats frames. If this mode is disabled, A/V desync will in theory not affect video scheduling anymore (much like the display-resample-desync mode). However, even if disabled, frames will still be skipped (i.e. dropped) according to the ratio between video and display frequencies.
在显示同步模式(见 --video-sync )中,这仅影响视频和音频帧的丢失或重复。如果此模式被禁用,理论上将不再影响视频调度(类似于 display-resample-desync 模式)。然而,即使禁用,帧仍然会根据视频和显示频率之间的比例被跳过(即丢失)。This is the recommended mode, and the default.
这是推荐的模式,也是默认模式。- <decoder> <解码器>
Old, decoder-based framedrop mode. (This is the same as --framedrop=yes in mpv 0.5.x and before.) This tells the decoder to skip frames (unless they are needed to decode future frames). May help with slow systems, but can produce unwatchable choppy output, or even freeze the display completely.
旧的、基于解码器的帧丢失模式。(这与 mpv 0.5.x 及之前版本中的 --framedrop=yes 相同。)这告诉解码器跳过帧(除非它们是解码未来帧所需的)。可能有助于慢速系统,但可能会产生难以观看的卡顿输出,甚至完全冻结显示。This uses a heuristic which may not make sense, and in general cannot achieve good results, because the decoder's frame dropping cannot be controlled in a predictable manner. Not recommended.
这使用了一种可能没有意义的方法,并且通常无法获得良好的结果,因为解码器的帧丢弃无法以可预测的方式控制。不推荐使用。Even if you want to use this, prefer decoder+vo for better results.
即使你想使用这个,也建议使用 decoder+vo 以获得更好的结果。The --vd-lavc-framedrop option controls what frames to drop.
--vd-lavc-framedrop 选项控制要丢弃哪些帧。- <decoder+vo> <解码器+语音>
- Enable both modes. Not recommended. Better than just decoder mode.
启用两种模式。不推荐使用。比仅 decoder 模式更好。
Note 注意
--vo=vdpau has its own code for the vo framedrop mode. Slight differences to other VOs are possible.
--vo=vdpau 拥有自己用于 vo framedrop 模式的代码。与其他 VOs 可能存在细微差异。- --video-latency-hacks=<yes|no>
Enable some things which tend to reduce video latency by 1 or 2 frames (default: no). Note that this option might be removed without notice once the player's timing code does not inherently need to do these things anymore. Using this option is known to break other options such as interpolation, so it is not recommended to enable this.
启用一些可能会减少视频延迟 1 或 2 帧的功能(默认:不启用)。请注意,一旦玩家的定时代码不再需要执行这些操作,此选项可能会不通知就被移除。使用此选项已知会破坏其他选项,如插值,因此不建议启用此选项。This does: 这会做到:
- Use the demuxer reported FPS for frame dropping. This avoids the
player needing to decode 1 frame in advance, lowering total latency in
effect. This also means that if the demuxer reported FPS is wrong, or
the video filter chain changes FPS (e.g. deinterlacing), then it could
drop too many or not enough frames.
使用解复用器报告的 FPS 进行帧丢弃。这避免了播放器需要提前解码 1 帧,从而降低总延迟。这也意味着,如果解复用器报告的 FPS 错误,或者视频过滤器链更改 FPS(例如,去隔行扫描),则可能会丢弃过多的帧或不足的帧。 - Disable waiting for the first video frame. Normally the player waits for
the first video frame to be fully rendered before starting playback
properly. Some VOs will lazily initialize stuff when rendering the first
frame, so if this is not done, there is some likeliness that the VO has
to drop some frames if rendering the first frame takes longer than needed.
禁用等待第一个视频帧。通常播放器会在正确开始播放之前等待第一个视频帧完全渲染。一些 VO 会在渲染第一个帧时懒加载一些内容,所以如果这样做,那么如果渲染第一个帧所需时间超过预期,VO 可能会丢失一些帧。
- Use the demuxer reported FPS for frame dropping. This avoids the
player needing to decode 1 frame in advance, lowering total latency in
effect. This also means that if the demuxer reported FPS is wrong, or
the video filter chain changes FPS (e.g. deinterlacing), then it could
drop too many or not enough frames.
- --display-fps-override=<fps>
Set the display FPS used with the --video-sync=display-* modes. By default, a detected value is used. Keep in mind that setting an incorrect value (even if slightly incorrect) can ruin video playback. On multi-monitor systems, there is a chance that the detected value is from the wrong monitor.
设置与 --video-sync=display-* 模式一起使用的显示 FPS。默认情况下,使用检测到的值。请注意,设置不正确的值(即使略微不正确)可能会破坏视频播放。在多显示器系统中,检测到的值可能是来自错误的显示器。Set this option only if you have reason to believe the automatically determined value is wrong.
仅在有理由相信自动确定的值错误时设置此选项。- --hwdec=<api1,api2,...|no|auto|auto-copy>
Specify the hardware video decoding API that should be used if possible. Whether hardware decoding is actually done depends on the video codec. If hardware decoding is not possible, mpv will fall back on software decoding.
尽可能指定应使用的硬件视频解码 API。是否实际进行硬件解码取决于视频编解码器。如果无法进行硬件解码,mpv 将回退到软件解码。Hardware decoding is not enabled by default, to keep the out-of-the-box configuration as reliable as possible. However, when using modern hardware, hardware video decoding should work correctly, offering reduced CPU usage, and possibly lower power consumption. On older systems, it may be necessary to use hardware decoding due to insufficient CPU resources; and even on modern systems, sufficiently complex content (eg: 4K60 AV1) may require it.
默认情况下未启用硬件解码,以尽可能保持出厂配置的可靠性。然而,当使用现代硬件时,硬件视频解码应能正确工作,降低 CPU 使用率,并可能降低功耗。在较旧的系统上,可能需要使用硬件解码,因为 CPU 资源不足;甚至在现代系统上,足够复杂的内容(例如:4K60 AV1)可能也需要它。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。Note 注意
Use the Ctrl+h shortcut to toggle hardware decoding at runtime. It toggles this option between auto and no.
使用 Ctrl+h 快捷键在运行时切换硬件解码。它将在 auto 和 no 之间切换此选项。If you decide you want to use hardware decoding by default, the general recommendation is to try out decoding with the command line option, and prove to yourself that it works as desired for the content you care about. After that, you can add it to your config file.
如果您决定希望默认使用硬件解码,一般建议是尝试使用命令行选项进行解码,并证明它确实为您关心的内容按预期工作。之后,您可以将它添加到您的配置文件中。When testing, you should start by using hwdec=auto as it will limit itself to choosing from hwdecs that are actively supported by the development team. If that doesn't result in working hardware decoding, you can try hwdec=auto-unsafe to have it attempt to load every possible hwdec, but if auto didn't work, you will probably need to know exactly which hwdec matches your hardware and read up on that entry below.
在测试时,您应该首先使用 hwdec=auto ,因为它将限制自己从开发团队积极支持的 hwdecs 中进行选择。如果这没有导致有效的硬件解码,您可以尝试 hwdec=auto-unsafe ,让它尝试加载每个可能的 hwdec,但如果 auto 不起作用,您可能需要确切知道哪个 hwdec 与您的硬件匹配,并阅读下面的条目。If auto produced the desired results, we recommend just sticking with that and only setting a specific hwdec in your config file if it is really necessary.
如果 auto 产生了期望的结果,我们建议就坚持使用它,并且只有在确实有必要的情况下才在您的配置文件中设置特定的 hwdec。If you use the Ubuntu package, keep in mind that their /etc/mpv/mpv.conf contains hwdec=vaapi, which is less than ideal as it may not be the right choice for your system, and it may end up using an inefficient wrapper library under the covers. We recommend removing this line or deleting the file altogether.
如果您使用 Ubuntu 软件包,请注意,它们的 /etc/mpv/mpv.conf 包含 hwdec=vaapi ,这并不理想,因为它可能不是您系统的正确选择,并且最终可能会在幕后使用一个低效的包装库。我们建议删除此行或完全删除文件。Note 注意
Even if enabled, hardware decoding is still only white-listed for some codecs. See --hwdec-codecs to enable hardware decoding in more cases.
即使启用,硬件解码也仅对某些编解码器进行白名单。参见 --hwdec-codecs 以在更多情况下启用硬件解码。Which method to choose?
选择哪种方法?- If you only want to enable hardware decoding at runtime, don't set the
parameter, or put hwdec=no into your mpv.conf (relevant on
distros which force-enable it by default, such as on Ubuntu). Use the
Ctrl+h default binding to enable it at runtime.
如果您只想在运行时启用硬件解码,不要设置该参数,或将 hwdec=no 放入您的 mpv.conf (在默认强制启用的发行版上相关,例如在 Ubuntu 上)。使用 Ctrl+h 默认绑定在运行时启用它。 - If you're not sure, but want hardware decoding always enabled by
default, put hwdec=yes into your mpv.conf, and acknowledge that
this may cause problems.
如果您不确定,但希望硬件解码始终默认启用,请将 hwdec=yes 放入您的 mpv.conf ,并承认这可能会引起问题。 - If you want to test available hardware decoding methods, pass
--hwdec=auto --hwdec-codecs=all and look at the terminal output.
如果您想测试可用的硬件解码方法,请传递 --hwdec=auto --hwdec-codecs=all 并查看终端输出。 - If you're a developer, or want to perform elaborate tests, you may
need any of the other possible option values.
如果您是开发者或想进行详细测试,您可能需要其他可能的选项值。
This option accepts a comma delimited list of api types, along with certain special values:
此选项接受以逗号分隔的 api 类型列表,以及某些特殊值:no: no: always use software decoding (default)
始终使用软件解码(默认)auto: enable any whitelisted hw decoder (see below)
启用任何白名单硬件解码器(见下文)auto-unsafe: forcibly enable any hw decoder found (see below)
强制启用找到的任何硬件解码器(见下文)yes: exactly the same as auto
完全相同于 autoauto-safe: exactly the same as auto
完全相同于 autoNote 注意
Special values can be mixed with api names. eg: vaapi,auto will try and use the vaapi hwdec, and if that fails, will run through the normal auto logic.
特殊值可以与 api 名称混合使用。例如: vaapi,auto 将尝试使用 vaapi hwdec,如果失败,将运行正常的 auto 逻辑。Actively supported hwdecs:
积极支持的 hwdecs:d3d11va: requires --vo=gpu with --gpu-context=d3d11 or --gpu-context=angle (Windows 8+ only)
需要使用 --vo=gpu 与 --gpu-context=d3d11 或 --gpu-context=angle (仅限 Windows 8 及以上版本)d3d11va-copy: copies video back to system RAM (Windows 8+ only)
将视频复制回系统 RAM(仅限 Windows 8 及以上版本)videotoolbox: requires --vo=gpu (macOS 10.8 and up), or --vo=libmpv (iOS 9.0 and up)
需要使用 --vo=gpu (macOS 10.8 及以上版本),或 --vo=libmpv (iOS 9.0 及以上版本)videotoolbox-copy: copies video back into system RAM (macOS 10.8 or iOS 9.0 and up)
将视频复制回系统 RAM(macOS 10.8 或 iOS 9.0 及以上版本)vaapi: requires --vo=gpu, --vo=vaapi or --vo=dmabuf-wayland (Linux only)
需要 --vo=gpu , --vo=vaapi 或 --vo=dmabuf-wayland (仅限 Linux)vaapi-copy: copies video back into system RAM (Linux with some GPUs or Windows)
将视频复制回系统 RAM (Linux 和某些 GPU 或 Windows)nvdec: requires --vo=gpu (Any platform CUDA is available)
需要 --vo=gpu (任何平台 CUDA 都可用)nvdec-copy: copies video back to system RAM (Any platform CUDA is available)
将视频复制回系统 RAM(任何平台 CUDA 可用)drm: requires --vo=gpu (Linux only)
需要 --vo=gpu (仅限 Linux)drm-copy: copies video back to system RAM (Linux only)
将视频复制回系统 RAM (仅限 Linux)vulkan: requires --vo=gpu-next (Any platform with Vulkan Video Decoding)
需要 --vo=gpu-next (支持 Vulkan 视频解码的任何平台)vulkan-copy: copies video back to system RAM (Any platform with Vulkan Video Decoding)
将视频复制回系统 RAM (支持 Vulkan 视频解码的任何平台)Other hwdecs (only use if you know you have to):
其他 hwdec(仅在您知道必须使用时使用):dxva2: requires --vo=gpu with --gpu-context=d3d11, --gpu-context=angle or --gpu-context=dxinterop (Windows only)
需要使用 --vo=gpu 与 --gpu-context=d3d11 , --gpu-context=angle 或 --gpu-context=dxinterop (仅限 Windows)dxva2-copy: copies video back to system RAM (Windows only)
将视频复制回系统 RAM(仅限 Windows)vdpau: requires --vo=gpu with --gpu-context=x11, or --vo=vdpau (Linux only)
需要 --vo=gpu 与 --gpu-context=x11 ,或 --vo=vdpau (仅限 Linux)vdpau-copy: copies video back into system RAM (Linux with some GPUs only)
将视频复制回系统 RAM(仅限某些 GPU 的 Linux)mediacodec: requires --vo=gpu --gpu-context=android or --vo=mediacodec_embed (Android only)
需要 --vo=gpu --gpu-context=android 或 --vo=mediacodec_embed (仅限 Android)mediacodec-copy: copies video back to system RAM (Android only)
将视频复制回系统 RAM(仅限 Android)cuda: requires --vo=gpu (Any platform CUDA is available)
需要 --vo=gpu (任何平台 CUDA 都可用)cuda-copy: copies video back to system RAM (Any platform CUDA is available)
将视频复制回系统 RAM(任何平台 CUDA 可用)crystalhd: copies video back to system RAM (Any platform supported by hardware)
将视频复制回系统 RAM(任何硬件支持的平台)rkmpp: requires --vo=gpu (some RockChip devices only)
需要 --vo=gpu (仅限某些 RockChip 设备)auto tries to automatically enable hardware decoding using the first available method, but allows only whitelisted methods that are considered "safe". This is supposed to be a reasonable way to enable hardware decoding by default in a config file (even though you shouldn't do that anyway; prefer runtime enabling with Ctrl+h). Unlike auto-unsafe, this will not try to enable unknown or known-to-be-bad methods. In addition, this may disable hardware decoding in other situations when it's known to cause problems, but currently this mechanism is quite primitive. (As an example for something that still causes problems: certain combinations of HEVC and Intel chips on Windows tend to cause mpv to crash, most likely due to driver bugs.)
auto 尝试自动使用第一个可用方法启用硬件解码,但只允许白名单中的“安全”方法。这应该是在配置文件中默认启用硬件解码的合理方式(尽管你实际上不应该这样做;建议使用 Ctrl+h 在运行时启用)。与 auto-unsafe 不同,它不会尝试启用未知或已知有问题的方法。此外,当已知这会导致问题时,它还可能在其他情况下禁用硬件解码,但目前这种机制相当原始。(例如,某些仍然会导致问题的东西:Windows 上 HEVC 和 Intel 芯片的某些组合往往会引起 mpv 崩溃,最有可能是因为驱动程序错误。)auto-unsafe is similar to auto, but without the whitelist. In general, you should never need to use this beyond debugging or development use. Any known unsafe hwdec you want to test can simply be appended to the list option such as --hwdec=auto,unsafe-hwdec. This still depends what VO you are using. See the list above, for which --vo and gpu-context is required for a given hwdec. It will go down the list of available hwdecs until one is successfully initialised. If all of them fail, it will fallback to software decoding.
auto-unsafe 与 auto 类似,但没有白名单。通常情况下,您不需要在调试或开发之外使用此功能。您想测试的任何已知不安全的 hwdec 可以简单地追加到列表选项中,例如 --hwdec=auto,unsafe-hwdec 。这仍然取决于您使用的 VO。请参阅上面的列表,其中对于给定的 hwdec 需要 --vo 和 gpu-context 。它将遍历可用的 hwdec 列表,直到成功初始化一个。如果所有这些都失败,它将回退到软件解码。auto-copy selects only modes that copy the video data back to system memory after decoding. This selects modes like vaapi-copy (and so on), but it only allows whitelisted methods that are considered "safe". If none of these work, hardware decoding is disabled. This mode is usually guaranteed to incur no additional quality loss compared to software decoding (assuming modern codecs and an error free video stream), and will allow CPU processing with video filters. This mode works with all video filters and VOs.
auto-copy 仅选择在解码后将视频数据复制回系统内存的模式。这选择了类似于 vaapi-copy (等等)的模式,但它只允许被认为是“安全”的白名单方法。如果这些方法都不起作用,则禁用硬件解码。此模式通常保证与软件解码相比不会产生额外的质量损失(假设现代编解码器和无错误的视频流),并且将允许使用视频过滤器进行 CPU 处理。此模式与所有视频过滤器以及 VOs 兼容。auto-copy-safe is an alias for auto-copy
auto-copy-safe 是 auto-copy 的别名auto-copy-unsafe is the same as auto-copy except that it goes through all methods and not just the whitelisted ones that are considered "safe".
auto-copy-unsafe 与 auto-copy 相同,但它是通过所有方法,而不仅仅是被认为是“安全”的白名单方法。Because these copy the decoded video back to system RAM, they're often less efficient than the direct modes, and may not help too much over software decoding if you are short on CPU resources.
因为这些会将解码后的视频复制回系统 RAM,所以它们通常比直接模式效率低,如果您 CPU 资源不足,可能对软件解码的帮助不大。Note 注意
Most non-copy methods only work with the OpenGL GPU backend. Currently, only the vaapi, nvdec, cuda and vulkan methods work with Vulkan.
大多数非复制方法仅适用于 OpenGL GPU 后端。目前,只有 vaapi 、 nvdec 、 cuda 和 vulkan 方法适用于 Vulkan。The vaapi mode, if used with --vo=gpu or --vo=gpu-next most likely works with Intel and AMD GPUs only. It requires the opengl EGL backend if the GPU does not support drm modifiers.
如果与 --vo=gpu 或 --vo=gpu-next 一起使用, vaapi 模式最有可能仅适用于 Intel 和 AMD GPU。如果 GPU 不支持 drm 修饰符,则需要 opengl EGL 后端。nvdec and nvdec-copy are the newest, and recommended method to do hardware decoding on Nvidia GPUs.
nvdec 和 nvdec-copy 是在 Nvidia GPU 上进行硬件解码的最新、推荐方法。cuda and cuda-copy are an older implementation of hardware decoding on Nvidia GPUs that uses Nvidia's bitstream parsers rather than FFmpeg's. This can lead to feature deficiencies, such as incorrect playback of HDR content, and nvdec/nvdec-copy should always be preferred unless you specifically need Nvidia's deinterlacing algorithms. To use this deinterlacing you must pass the option: vd-lavc-o=deint=[weave|bob|adaptive]. Pass weave (or leave the option unset) to not attempt any deinterlacing.
cuda 和 cuda-copy 是 Nvidia GPU 上硬件解码的较旧实现,它使用 Nvidia 的比特流解析器而不是 FFmpeg 的。这可能导致功能不足,例如 HDR 内容播放不正确,并且 nvdec / nvdec-copy 应始终优先考虑,除非您特别需要 Nvidia 的去隔行算法。要使用此去隔行功能,您必须传递选项: vd-lavc-o=deint=[weave|bob|adaptive] 。传递 weave (或保留选项未设置)以不尝试任何去隔行。Quality reduction with hardware decoding
硬件解码导致的画质降低In theory, hardware decoding does not reduce video quality (at least for the codecs h264 and HEVC). However, due to restrictions in video output APIs, as well as bugs in the actual hardware decoders, there can be some loss, or even blatantly incorrect results. This has largely ceased to be a problem with modern hardware, but there is a lot of hardware out there, so caveat emptor. Known problems are discussed below, but the list cannot be considered exhaustive, as even hwdecs that work well on certain hardware generations may be problematic on other ones.
从理论上讲,硬件解码不会降低视频质量(至少对于 h264 和 HEVC 编解码器)。然而,由于视频输出 API 的限制以及实际硬件解码器中的错误,可能会有一些损失,甚至可能是明显错误的结果。在现代硬件上,这已经不再是问题,但市面上有很多硬件,所以消费者需谨慎。以下讨论了已知问题,但此列表不能被认为是详尽的,因为即使在某些硬件代际上表现良好的 hwdecs 也可能在其他代际上存在问题。In some cases, RGB conversion is forced, which means the RGB conversion is performed by the hardware decoding API, instead of the shaders used by --vo=gpu. This means certain colorspaces may not display correctly, and certain filtering (such as debanding) cannot be applied in an ideal way. This will also usually force the use of low quality chroma scalers instead of the one specified by --cscale. In other cases, hardware decoding can also reduce the bit depth of the decoded image, which can introduce banding or precision loss for 10-bit files.
在某些情况下,RGB 转换被强制执行,这意味着 RGB 转换由硬件解码 API 执行,而不是由 --vo=gpu 使用的着色器执行。这意味着某些色彩空间可能无法正确显示,并且某些过滤(如去带)可能无法以理想的方式应用。这通常还会强制使用低质量色度缩放器,而不是由 --cscale 指定的缩放器。在其他情况下,硬件解码还可以降低解码图像的位深度,这可能会为 10 位文件引入带状或精度损失。vdpau always does RGB conversion in hardware, which does not support newer colorspaces like BT.2020 correctly. However, vdpau doesn't support 10 bit or HDR encodings, so these limitations are unlikely to be relevant.
vdpau 始终在硬件中执行 RGB 转换,这不支持像 BT.2020 这样的新色彩空间。然而, vdpau 不支持 10 位或 HDR 编码,因此这些限制可能不太相关。dxva2 is not safe. It appears to always use BT.601 for forced RGB conversion, but actual behavior depends on the GPU drivers. Some drivers appear to convert to limited range RGB, which gives a faded appearance. In addition to driver-specific behavior, global system settings might affect this additionally. This can give incorrect results even with completely ordinary video sources.
dxva2 不安全。它似乎始终使用 BT.601 进行强制 RGB 转换,但实际行为取决于 GPU 驱动程序。一些驱动程序似乎转换为有限范围的 RGB,这会导致颜色变淡。除了驱动程序特定的行为外,全局系统设置还可能进一步影响。这甚至可能在使用完全普通的视频源时产生错误的结果。mediacodec is not safe. It forces RGB conversion (not with -copy) and how well it handles non-standard colorspaces is not known. In the rare cases where 10-bit is supported the bit depth of the output will be reduced to 8.
mediacodec 不安全。它强制进行 RGB 转换(不是使用 -copy )并且不知道它处理非标准色彩空间的能力如何。在罕见的情况下,如果支持 10 位,输出位深将降低到 8 位。cuda should usually be safe, but depending on how a file/stream has been mixed, it has been reported to corrupt the timestamps causing glitched, flashing frames. It can also sometimes cause massive framedrops for unknown reasons. Caution is advised, and nvdec should always be preferred.
cuda 通常应该是安全的,但根据文件/流的混合方式,有报告称它会导致时间戳损坏,造成闪烁帧。有时也可能由于未知原因造成大量帧率下降。建议谨慎操作,并且始终优先使用 nvdec 。crystalhd is not safe. It always converts to 4:2:2 YUV, which may be lossy, depending on how chroma sub-sampling is done during conversion. It also discards the top left pixel of each frame for some reason.
crystalhd 不安全。它总是转换为 4:2:2 YUV,这可能会在转换过程中由于色度子采样方式不同而造成损失。此外,出于某种原因,它还会丢弃每个帧的左上角像素。If you run into any weird decoding issues, frame glitches or discoloration, and you have --hwdec turned on, the first thing you should try is disabling it.
如果您遇到任何奇怪的解码问题、帧闪烁或颜色失真,并且您已开启 --hwdec ,您应该首先尝试禁用它。- If you only want to enable hardware decoding at runtime, don't set the
parameter, or put hwdec=no into your mpv.conf (relevant on
distros which force-enable it by default, such as on Ubuntu). Use the
Ctrl+h default binding to enable it at runtime.
- --gpu-hwdec-interop=<auto|all|no|name>
This option is for troubleshooting hwdec interop issues. Since it's a debugging option, its semantics may change at any time.
此选项用于解决 hwdec 互操作问题。由于它是一个调试选项,其语义可能随时更改。This is useful for the gpu and libmpv VOs for selecting which hwdec interop context to use exactly. Effectively it also can be used to block loading of certain backends.
这对于选择要使用的确切 hwdec 互操作上下文的 gpu 和 libmpv VOs 非常有用。实际上,它也可以用来阻止某些后端的加载。If set to auto (default), the behavior depends on the VO: for gpu, it does nothing, and the interop context is loaded on demand (when the decoder probes for --hwdec support). For libmpv, which has has no on-demand loading, this is equivalent to all.
如果设置为 auto (默认值),行为取决于 VO:对于 gpu ,它不起作用,互操作上下文将在需要时加载(当解码器探测 --hwdec 支持时)。对于没有按需加载的 libmpv ,这相当于 all 。The empty string is equivalent to auto.
空字符串等同于 auto 。If set to all, it attempts to load all interop contexts at GL context creation time.
如果设置为 all ,则在创建 GL 上下文时尝试加载所有互操作上下文。Other than that, a specific backend can be set, and the list of them can be queried with help (mpv CLI only).
除此之外,可以设置特定的后端,并且可以通过 help (仅限 mpv CLI)查询它们的列表。Runtime changes to this are ignored (the current option value is used whenever the renderer is created).
对此的运行时更改将被忽略(创建渲染器时始终使用当前选项值)。- --hwdec-extra-frames=<N>
Number of GPU frames hardware decoding should preallocate (default: see --list-options output). If this is too low, frame allocation may fail during decoding, and video frames might get dropped and/or corrupted. Setting it too high simply wastes GPU memory and has no advantages.
GPU 帧硬件解码应预分配的数量(默认:见 --list-options 输出)。如果这个值太低,解码过程中帧分配可能会失败,视频帧可能会丢失和/或损坏。设置得太高会简单地浪费 GPU 内存,没有任何优势。This value is used only for hardware decoding APIs which require preallocating surfaces (known examples include d3d11va and vaapi). For other APIs, frames are allocated as needed. The details depend on the libavcodec implementations of the hardware decoders.
此值仅用于需要预分配表面的硬件解码 API(已知示例包括 d3d11va 和 vaapi )。对于其他 API,帧按需分配。具体细节取决于硬件解码器的 libavcodec 实现。The required number of surfaces depends on dynamic runtime situations. The default is a fixed value that is thought to be sufficient for most uses. But in certain situations, it may not be enough.
所需表面的数量取决于动态运行时情况。默认值是一个被认为是大多数用途足够固定的值。但在某些情况下,可能不足以满足需求。- --hwdec-image-format=<name>
Set the internal pixel format used by hardware decoding via --hwdec (default no). The special value no selects an implementation specific standard format. Most decoder implementations support only one format, and will fail to initialize if the format is not supported.
通过 --hwdec 设置硬件解码使用的内部像素格式(默认 no )。特殊值 no 选择特定实现的标准化格式。大多数解码器实现只支持一种格式,如果格式不受支持,将无法初始化。Some implementations might support multiple formats. In particular, videotoolbox is known to require uyvy422 for good performance on some older hardware. d3d11va can always use yuv420p, which uses an opaque format, with likely no advantages.
某些实现可能支持多种格式。特别是,videotoolbox 在旧硬件上为了获得良好的性能,通常需要使用 uyvy422 。d3d11va 始终可以使用 yuv420p ,它使用不透明格式,可能没有优势。- --cuda-decode-device=<auto|0..>
Choose the GPU device used for decoding when using the cuda or nvdec hwdecs with the OpenGL GPU backend, and with the cuda-copy or nvdec-copy hwdecs in all cases.
当使用 OpenGL GPU 后端和 cuda 或 nvdec hwdecs 进行解码时,请选择用于解码的 GPU 设备,以及在所有情况下使用 cuda-copy 或 nvdec-copy hwdecs。For the OpenGL GPU backend, the default device used for decoding is the one being used to provide gpu output (and in the vast majority of cases, only one GPU will be present).
对于 OpenGL GPU 后端,默认用于解码的设备是用于提供 gpu 输出的设备(并且在绝大多数情况下,只有一个 GPU)。For the copy hwdecs, the default device will be the first device enumerated by the CUDA libraries - however that is done.
对于 copy hwdecs,默认设备将是 CUDA 库枚举的第一个设备——无论这样做的方式如何。For the Vulkan GPU backend, decoding must always happen on the display device, and this option has no effect.
对于 Vulkan GPU 后端,解码必须始终在显示设备上发生,此选项无效果。- --vaapi-device=<device file|adapter name>
Choose the DRM device for vaapi-copy. This should be the path to a DRM device file. (Default: /dev/dri/renderD128)
选择用于 vaapi-copy 的 DRM 设备。这应该是 DRM 设备文件的路径。(默认: /dev/dri/renderD128 )On Windows this takes adapter name as an input. Will pick the default adapter if unset. Alternatives are listed when the name "help" is given.
在 Windows 上,此选项以适配器名称作为输入。如果未设置,将选择默认适配器。当给出“help”名称时,将列出替代选项。- --panscan=<0.0-1.0>
Enables pan-and-scan functionality (cropping the sides of e.g. a 16:9 video to make it fit a 4:3 display without black bands). The range controls how much of the image is cropped. May not work with all video output drivers.
启用平移和扫描功能(例如,裁剪 16:9 视频的两侧,使其适合 4:3 显示器而不出现黑色边带)。范围控件控制裁剪多少图像。可能不适用于所有视频输出驱动程序。This option has no effect if --video-unscaled option is used.
此选项在使用 --video-unscaled 选项时没有效果。The difference between --panscan and --video-zoom is that --panscan can only zoom in until either the video width or height fills the window, while --video-zoom can zoom in or out arbitrary amounts, and also works with --video-unscaled.
在 --panscan 和 --video-zoom 之间的区别是 --panscan 只能放大到视频宽度或高度填满窗口为止,而 --video-zoom 可以任意放大或缩小,并且还与 --video-unscaled 一起工作。- --video-aspect-override=<ratio|no>
Override video aspect ratio, in case aspect information is incorrect or missing in the file being played.
覆盖视频宽高比,以防正在播放的文件中的宽高信息不正确或缺失。These values have special meaning:
这些值具有特殊含义:no: no: use the method of the --video-aspect-method option (default)
使用 --video-aspect-method 选项的方法(默认)0: disable aspect ratio handling, pretend the video has square pixels (deprecated, use --video-aspect-override=no --video-aspect-method=ignore instead)
禁用纵横比处理,假装视频具有正方形像素(已弃用,请使用 --video-aspect-override=no --video-aspect-method=ignore 代替)-1: strictly prefer the container aspect ratio (deprecated, use --video-aspect-override=no --video-aspect-method=container instead)
严格优先选择容器纵横比(已弃用,请使用 --video-aspect-override=no --video-aspect-method=container 代替)But note that handling of these special values might change in the future.
但请注意,这些特殊值的处理可能在将来发生变化。Examples 示例
- --video-aspect-override=4:3 or --video-aspect-override=1.3333 --video-aspect-override=4:3 或 --video-aspect-override=1.3333
- --video-aspect-override=16:9 or --video-aspect-override=1.7777 --video-aspect-override=16:9 或 --video-aspect-override=1.7777
- --no-video-aspect-override or --video-aspect-override=no --no-video-aspect-override 或 --video-aspect-override=no
- --video-aspect-method=<bitstream|container|ignore>
This sets the default video aspect determination method (if the aspect is _not_ overridden by the user with --video-aspect-override or others).
这设置了默认的视频宽高比确定方法(如果宽高比没有被用户通过 --video-aspect-override 或其他方式覆盖)。container: Strictly prefer the container aspect ratio. This is apparently the default behavior with VLC, at least with Matroska. Note that if the container has no aspect ratio set, the behavior is the same as with bitstream.
严格优先选择容器的宽高比。这显然是 VLC 的默认行为,至少在 Matroska 中是这样。请注意,如果容器没有设置宽高比,其行为与比特流相同。bitstream: 比特流: Strictly prefer the bitstream aspect ratio, unless the bitstream aspect ratio is not set. This is apparently the default behavior with XBMC/kodi, at least with Matroska.
严格优先选择比特流宽高比,除非未设置比特流宽高比。这显然是 XBMC/kodi 的默认行为,至少在 Matroska 中是这样。ignore: 忽略: Disable aspect ratio handling, pretend the video has square pixels.
禁用宽高比处理,假装视频具有正方形像素。The current default for mpv is container.
mpv 的当前默认值为 container 。Normally you should not set this. Try the various choices if you encounter video that has the wrong aspect ratio in mpv, but seems to be correct in other players.
通常您不应该设置此选项。如果在 mpv 中遇到视频纵横比错误,但在其他播放器中看起来是正确的,请尝试各种选择。- --video-unscaled=<no|yes|downscale-big>
Disable scaling of the video. If the window is larger than the video, black bars are added. Otherwise, the video is cropped, unless the option is set to downscale-big, in which case the video is fit to window. The video still can be influenced by the other --video-... options. This option disables the effect of --panscan.
禁用视频缩放。如果窗口比视频大,则添加黑色边框。否则,视频将被裁剪,除非将选项设置为 downscale-big ,在这种情况下,视频将适应窗口。视频仍然可能受到其他 --video-... 选项的影响。此选项禁用 --panscan 的效果。Note that the scaler algorithm may still be used, even if the video isn't scaled. For example, this can influence chroma conversion. The video will also still be scaled in one dimension if the source uses non-square pixels (e.g. anamorphic widescreen DVDs).
请注意,即使视频没有缩放,缩放算法仍然可能被使用。例如,这可以影响色度转换。如果源使用非正方形像素(例如,变形宽屏 DVD),视频也将在一个维度上缩放。This option is disabled if --keepaspect=no is used.
如果使用 --keepaspect=no ,则此选项被禁用。- --video-pan-x=<value>, --video-pan-y=<value>
Moves the displayed video rectangle by the given value in the X or Y direction. The unit is in fractions of the size of the scaled video (the full size, even if parts of the video are not visible due to panscan or other options).
通过给定的值在 X 或 Y 方向上移动显示的视频矩形。单位是缩放视频大小的分数(即使由于 panscan 或其他选项,视频的部分不可见,也是整个视频的大小)。For example, displaying a video fullscreen on a 1920x1080 screen with --video-pan-x=-0.1 would move the video 192 pixels to the left and --video-pan-y=-0.1 would move the video 108 pixels up.
例如,在 1920x1080 屏幕上使用 --video-pan-x=-0.1 将全屏显示视频,会使视频向左移动 192 像素,而使用 --video-pan-y=-0.1 会使视频向上移动 108 像素。This option is disabled if --keepaspect=no is used.
如果使用 --keepaspect=no ,则此选项被禁用。- --video-rotate=<0-359|no>
Rotate the video clockwise, in degrees. If no is given, the video is never rotated, even if the file has rotation metadata. (The rotation value is added to the rotation metadata, which means the value 0 would rotate the video according to the rotation metadata.)
顺时针旋转视频,单位为度。如果给出 no ,即使文件有旋转元数据,视频也不会旋转。(旋转值将添加到旋转元数据中,这意味着 0 将根据旋转元数据旋转视频。)When using hardware decoding without copy-back, only 90° steps work, while software decoding and hardware decoding methods that copy the video back to system memory support all values between 0 and 359.
在使用无拷贝回显的硬件解码时,只有 90° 步长有效,而软件解码以及将视频拷贝回系统内存的硬件解码方法支持 0 到 359 之间的所有值。- --video-crop=<[W[xH]][+x+y]>, --video-crop=<x:y>
- Crop the video by starting at the x, y offset for w, h pixels. The crop is
applied to the source video rectangle (before anamorphic stretch) by the VO.
A crop rectangle that is not within the video rectangle will be ignored.
This works with hwdec, unlike the equivalent 'lavfi-crop'. When offset is
omitted, the central area will be cropped. Setting the crop to empty one
--video-crop=0x0+0+0 overrides container crop and disables cropping.
Setting the crop to --video-crop="" disables manual cropping and restores
the container crop if it's specified.
通过从 x, y 偏移开始裁剪视频,裁剪 w, h 像素。裁剪由 VO 应用到源视频矩形(在变形拉伸之前),不在视频矩形内的裁剪矩形将被忽略。这与等效的 'lavfi-crop' 不同,此操作与 hwdec 一起工作。当省略偏移时,将裁剪中央区域。将裁剪设置为空 --video-crop=0x0+0+0 将覆盖容器裁剪并禁用裁剪。将裁剪设置为 --video-crop="" 将禁用手动裁剪并恢复容器裁剪(如果已指定)。 - --video-zoom=<value>
Adjust the video display scale factor by the given value. The parameter is given log 2. For example, --video-zoom=0 is unscaled, --video-zoom=1 is twice the size, --video-zoom=-2 is one fourth of the size, and so on.
通过给定值调整视频显示缩放因子。该参数以 2 为底的对数给出。例如, --video-zoom=0 为未缩放, --video-zoom=1 为两倍大小, --video-zoom=-2 为四分之一大小,以此类推。This option is disabled if --keepaspect=no is used.
如果使用 --keepaspect=no ,则此选项被禁用。- --video-scale-x=<value>, --video-scale-y=<value>
Multiply the video display size with the given value (default: 1.0). If a non-default value is used, this will be different from the window size, so video will be either cut off, or black bars are added.
将视频显示大小乘以给定值(默认:1.0)。如果使用非默认值,则与窗口大小不同,因此视频可能会被截断,或者添加黑色边框。This value is multiplied with the value derived from --video-zoom and the normal video aspect ratio. This option is disabled if --keepaspect=no is used.
此值与从 --video-zoom 得到的值以及正常视频宽高比相乘。如果使用 --keepaspect=no ,则此选项将禁用。- --video-align-x=<-1-1>, --video-align-y=<-1-1>
When the video is bigger than the window, these move the displayed rectangle to show different parts of the video. --video-align-y=-1 would display the top of the video, 0 would display the center (default), and 1 would display the bottom.
当视频大于窗口大小时,这些操作将移动显示的矩形以显示视频的不同部分。 --video-align-y=-1 将显示视频顶部, 0 将显示中心(默认),而 1 将显示视频底部。When the video is smaller than the window and --video-recenter is disabled, these move the video rectangle within the black borders, which are usually added to pad the video to the window if video and window aspect ratios are different. --video-align-y=-1 would move the video to the top of the window (leaving a border only on the bottom), 0 would center it, and 1 would put the video at the bottom of the window.
当视频小于窗口且 --video-recenter 禁用时,这些操作将在黑色边框内移动视频矩形,这些边框通常添加以填充视频至窗口,如果视频和窗口宽高比不同。 --video-align-y=-1 将将视频移动到窗口顶部(只留下底部边框), 0 将将其居中,而 1 将将视频放置在窗口底部。If video and screen aspect match perfectly, these options do nothing.
如果视频和屏幕宽高比完全匹配,则这些选项不执行任何操作。Unlike --video-pan-x and --video-pan-y, these don't go beyond the video's or window's boundaries or make the displayed rectangle drift off after zooming.
与 --video-pan-x 和 --video-pan-y 不同,这些不会超出视频或窗口的边界,也不会在缩放后使显示的矩形漂移。This option is disabled if --keepaspect=no is used.
如果使用 --keepaspect=no ,则此选项被禁用。- --video-recenter=<yes|no>
Whether to behave as if --video-align-x and --video-align-y were 0 when the video becomes smaller than the window in the respective direction
当视频在相应方向上小于窗口时,是否表现得像 --video-align-x 和 --video-align-y 为 0。After zooming in until the video is bigger the window, panning with --video-align-x and/or --video-align-y, and zooming out until the video is smaller than the window, this is useful to recenter the video in the window.
在视频大于窗口之前缩放,使用--video-align-x 和/或--video-align-y 进行平移,然后缩放直到视频小于窗口,这有助于在窗口中重新居中视频。Default: no. 默认:no。
- --video-margin-ratio-left=<val>, --video-margin-ratio-right=<val>, --video-margin-ratio-top=<val>, --video-margin-ratio-bottom=<val>
Set extra video margins on each border (default: 0). Each value is a ratio of the window size, using a range 0.0-1.0. For example, setting the option --video-margin-ratio-right=0.2 at a window size of 1000 pixels will add a 200 pixels border on the right side of the window.
设置每个边框的额外视频边距(默认:0)。每个值是窗口大小的比例,使用范围 0.0-1.0。例如,在 1000 像素的窗口大小上设置选项 --video-margin-ratio-right=0.2 将在窗口右侧添加 200 像素的边框。The video is "boxed" by these margins. The window size is not changed. In particular it does not enlarge the window, and the margins will cause the video to be downscaled by default. This may or may not change in the future.
视频被这些边距“包围”。窗口大小不会改变。特别是它不会放大窗口,并且边距将默认导致视频缩放。这可能在将来改变,也可能不会。The margins are applied after 90° video rotation, but before any other video transformations.
边距在 90°视频旋转之后应用,但在任何其他视频转换之前。This option is disabled if --keepaspect=no is used.
如果使用 --keepaspect=no ,则此选项被禁用。Subtitles still may use the margins, depending on --sub-use-margins and similar options.
字幕仍然可能使用边距,这取决于 --sub-use-margins 和类似选项。These options were created for the OSC. Some odd decisions, such as making the margin values a ratio (instead of pixels), were made for the sake of the OSC. It's possible that these options may be replaced by ones that are more generally useful. The behavior of these options may change to fit OSC requirements better, too.
这些选项是为 OSC 创建的。一些奇怪的决定,例如将边距值设为比率(而不是像素),是为了满足 OSC 的需求。这些选项可能会被更通用的选项所取代。这些选项的行为也可能改变,以更好地适应 OSC 的要求。- --correct-pts=<yes|no>
- --correct-pts=no switches mpv to a mode where video timing is
determined using a fixed framerate value (either using the
--container-fps-override option, or using file information). Sometimes,
files with very broken timestamps can be played somewhat well in this mode.
Note that video filters, subtitle rendering, seeking (including hr-seeks and
backstepping), and audio synchronization can be completely broken in this mode.
--correct-pts=no 将 mpv 切换到一种使用固定帧率值确定视频时序的模式(无论是使用 --container-fps-override 选项,还是使用文件信息)。有时,在这种模式下,带有非常破损的时间戳的文件可以播放得相对较好。请注意,在这种模式下,视频过滤器、字幕渲染、搜索(包括 hr-seeks 和 backstepping)以及音频同步可能会完全损坏。 - --container-fps-override=<float>
Override video framerate. Useful if the original value is wrong or missing.
覆盖视频帧率。如果原始值错误或缺失,则很有用。Note 注意
Works in --correct-pts=no mode only.
仅在 --correct-pts=no 模式下工作。- --deinterlace=<yes|no|auto>
Enable or disable deinterlacing (default: no). Interlaced video shows ugly comb-like artifacts, which are visible on fast movement. Enabling this typically inserts the bwdif video filter in order to deinterlace the video, or lets the video output apply deinterlacing if supported.
启用或禁用去隔行扫描(默认:否)。隔行扫描的视频会显示难看的梳状伪影,这在快速移动时尤为明显。启用此功能通常会在视频插入 bwdif 过滤器以去隔行,或者如果支持,则让视频输出应用去隔行扫描。When using auto, mpv will insert a deinterlacing filter if ffmpeg detects that the video frame is interlaced. Be aware that there can be false positives in certain cases, such as when files are encoded as interlaced despite the video not actually being so. This is why auto is not the default value.
当使用 auto 时,如果 ffmpeg 检测到视频帧是隔行扫描的,mpv 将插入一个去隔行滤波器。请注意,在某些情况下可能会出现误报,例如文件被编码为隔行扫描,而实际上视频并非如此。这就是为什么 auto 不是默认值的原因。Keep in mind that using this filter will conflict with any manually inserted deinterlacing filters, and that this will make video look worse if it's not actually interlaced.
请注意,使用此滤波器将与任何手动插入的去隔行滤波器冲突,并且如果视频实际上不是隔行扫描的,这将使视频看起来更差。- --deinterlace-field-parity=<tff|bff|auto>
Specify the field parity/order when deinterlacing (default: auto). Each frame of an interlaced video is divided into two fields, which are then separately transmitted. Top field represents even lines while bottom field represents odd lines. When deinterlacing the deinterlacer needs to know the correct temporal order of the fields else the video will appear jittery.
去隔行时指定场奇偶性/顺序(默认:自动)。隔行扫描视频的每一帧被分为两个场,然后分别传输。上场代表偶数行,而下场代表奇数行。去隔行时,去隔行器需要知道场的正确时间顺序,否则视频将出现抖动。auto will automatically try to detect the field order of the video, tff forces top field first while bff forces bottom field first.
auto 将自动尝试检测视频的场顺序, tff 强制先传输上场,而 bff 强制先传输下场。- --frames=<number>
Play/convert only first <number> video frames, then quit.
仅播放/转换第一个 <number> 视频帧,然后退出。--frames=0 loads the file, but immediately quits before initializing playback. (Might be useful for scripts which just want to determine some file properties.)
--frames=0 加载文件,但立即退出初始化播放。(可能对只想确定某些文件属性的脚本有用。)For audio-only playback, any value greater than 0 will quit playback immediately after initialization. The value 0 works as with video.
对于仅音频播放,任何大于 0 的值将在初始化后立即退出播放。值为 0 时与视频相同。- --video-output-levels=<outputlevels>
RGB color levels used with YUV to RGB conversion. Normally, output devices such as PC monitors use full range color levels. However, some TVs and video monitors expect studio RGB levels. Providing full range output to a device expecting studio level input results in crushed blacks and whites, the reverse in dim gray blacks and dim whites.
在 YUV 到 RGB 转换中使用的 RGB 颜色级别。通常,输出设备如 PC 显示器使用全范围颜色级别。然而,一些电视和视频监视器期望使用工作室 RGB 级别。向期望工作室级别输入的设备提供全范围输出会导致黑色和白色压缩,反之在暗灰色黑色和暗白色中。Not all VOs support this option. Some will silently ignore it.
并非所有 VOs 都支持此选项。一些将静默忽略它。Available color ranges are:
可用的颜色范围包括:auto: automatic selection (equals to full range) (default)
自动选择(等于全范围)(默认)limited: 有限: limited range (16-235 per component), studio levels
有限范围(每个组件 16-235),工作室级别full: 完整: full range (0-255 per component), PC levels
全范围(每个组件 0-255),PC 级别Note 注意
It is advisable to use your graphics driver's color range option instead, if available.
如果可用,建议使用您的显卡驱动程序的色彩范围选项。- --hwdec-codecs=<codec1,codec2,...|all>
Allow hardware decoding for a given list of codecs only. The special value all always allows all codecs.
仅允许给定列表中的编解码器进行硬件解码。特殊值 all 总是允许所有编解码器。You can get the list of allowed codecs with mpv --vd=help. Remove the prefix, e.g. instead of lavc:h264 use h264.
您可以使用 mpv --vd=help 获取允许的编解码器列表。移除前缀,例如,使用 lavc:h264 而不是 h264 。By default, this is set to h264,vc1,hevc,vp8,vp9,av1,prores. Note that the hardware acceleration special codecs like h264_vdpau are not relevant anymore, and in fact have been removed from FFmpeg in this form.
默认情况下,这设置为 h264,vc1,hevc,vp8,vp9,av1,prores 。请注意,像 h264_vdpau 这样的硬件加速专用编解码器不再相关,实际上这种形式的 FFmpeg 已经移除了它们。This is usually only needed with broken GPUs, where a codec is reported as supported, but decoding causes more problems than it solves.
这通常只在 GPU 损坏时需要,其中编解码器报告为支持,但解码引起的问题比解决的问题更多。Note 注意
On some broken drivers (e.g. NVIDIA on Linux), probing for codecs which the GPU does not support can unnecessarily slow down video playback initialization. To alleviate this, explicitly specify a list which only includes the codecs supported on the setup.
在某些损坏的驱动程序(例如 Linux 上的 NVIDIA)中,探测 GPU 不支持的视频编解码器可能会不必要地减慢视频播放初始化。为了缓解这种情况,明确指定一个只包含在设置上支持的编解码器的列表。- --hwdec-software-fallback=<yes|no|N>
Fallback to software decoding if the hardware-accelerated decoder fails (default: 3). If this is a number, then fallback will be triggered if N frames fail to decode in a row. 1 is equivalent to yes.
如果硬件加速解码器失败则回退到软件解码(默认:3)。如果这是一个数字,则当连续 N 帧解码失败时将触发回退。1 等同于 yes 。Setting this to a higher number might break the playback start fallback: if a fallback happens, parts of the file will be skipped, approximately by to the number of packets that could not be decoded. Values below an unspecified count will not have this problem, because mpv retains the packets.
将此设置为更高的数字可能会破坏回放开始回退:如果发生回退,文件的部分将被跳过,大约相当于无法解码的数据包数量。低于未指定计数的值将不会出现此问题,因为 mpv 会保留这些数据包。- --vd-lavc-check-hw-profile=<yes|no>
- Check hardware decoder profile (default: yes). If no is set, the
highest profile of the hardware decoder is unconditionally selected, and
decoding is forced even if the profile of the video is higher than that.
The result is most likely broken decoding, but may also help if the
detected or reported profiles are somehow incorrect.
检查硬件解码器配置文件(默认:是)。如果 no 被设置,则无条件选择硬件解码器的最高配置文件,即使视频的配置文件高于该配置文件,也会强制解码。结果很可能是解码损坏,但如果有检测或报告的配置文件不正确,也可能有所帮助。 - --vd-lavc-film-grain=<auto|cpu|gpu>
Enables film grain application on the GPU. If video decoding is done on the CPU, doing film grain application on the GPU can speed up decoding. This option can also help hardware decoding, as it can reduce the number of frame copies done.
启用 GPU 上的电影颗粒应用。如果视频解码在 CPU 上完成,则可以在 GPU 上应用电影颗粒以加快解码。此选项还可以帮助硬件解码,因为它可以减少帧复制的数量。By default, it's set to auto, so if the VO supports film grain application, then it will be treated as gpu. If the VO does not support this, then it will be treated as cpu, regardless of the setting. Currently, only gpu-next supports film grain application.
默认情况下,它设置为 auto ,因此如果 VO 支持电影颗粒应用,则它将被视为 gpu 。如果 VO 不支持此功能,则无论设置如何,它都将被视为 cpu 。目前,只有 gpu-next 支持电影颗粒应用。- --vd-lavc-dr=<auto|yes|no>
Enable direct rendering (default: auto). If this is set to yes, the video will be decoded directly to GPU video memory (or staging buffers). This can speed up video upload, and may help with large resolutions or slow hardware. This works only with the following VOs:
启用直接渲染(默认:自动)。如果设置为 yes ,则视频将直接解码到 GPU 视频内存(或暂存缓冲区)。这可以加快视频上传,并可能有助于处理高分辨率或硬件较慢的情况。此功能仅适用于以下 VO:- gpu: requires at least OpenGL 4.4 or Vulkan.
gpu :需要至少 OpenGL 4.4 或 Vulkan。 - libmpv: The libmpv render API has optional support.
libmpv :libmpv 渲染 API 具有可选支持。
The auto option will try to guess whether DR can improve performance on your particular hardware. Currently this enables it on AMD or NVIDIA if using OpenGL or unconditionally if using Vulkan.
Using video filters of any kind that write to the image data (or output newly allocated frames) will silently disable the DR code path.
- gpu: requires at least OpenGL 4.4 or Vulkan.
- --vd-lavc-bitexact
- Only use bit-exact algorithms in all decoding steps (for codec testing).
- --vd-lavc-fast (MPEG-1/2 and H.264 only)
- Enable optimizations which do not comply with the format specification and
potentially cause problems, like simpler dequantization, simpler motion
compensation, assuming use of the default quantization matrix, assuming YUV
4:2:0 and skipping a few checks to detect damaged bitstreams.
启用不符合格式规范且可能引起问题的优化,例如更简单的去量化、更简单的运动补偿、假设使用默认量化矩阵、假设 YUV 4:2:0 并跳过一些检测损坏比特流的检查。 - --vd-lavc-o=<key>=<value>[,<key>=<value>[,...]]
Pass AVOptions to libavcodec decoder. Note, a patch to make the o= unneeded and pass all unknown options through the AVOption system is welcome. A full list of AVOptions can be found in the FFmpeg manual.
将 AVOptions 传递给 libavcodec 解码器。注意,一个使 o= 不再需要并通过 AVOption 系统传递所有未知选项的补丁是受欢迎的。AVOptions 的完整列表可以在 FFmpeg 手册中找到。Some options which used to be direct options can be set with this mechanism, like bug, gray, idct, ec, vismv, skip_top (was st), skip_bottom (was sb), debug.
一些以前是直接选项的选项可以通过此机制设置,例如 bug 、 gray 、 idct 、 ec 、 vismv 、 skip_top (曾是 st )、 skip_bottom (曾是 sb )、 debug 。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。Example 示例
--vd-lavc-o=debug=pict
- --vd-lavc-show-all=<yes|no>
- Show even broken/corrupt frames (default: no). If this option is set to
no, libavcodec won't output frames that were either decoded before an
initial keyframe was decoded, or frames that are recognized as corrupted.
显示即使损坏/损坏的帧(默认:否)。如果此选项设置为否,libavcodec 不会输出在初始关键帧解码之前解码的帧,或者被识别为损坏的帧。 - --vd-lavc-skiploopfilter=<skipvalue> (H.264, HEVC only) --vd-lavc-skiploopfilter=<skipvalue> (H.264, 仅 HEVC)
Skips the loop filter (AKA deblocking) during decoding. Since the filtered frame is supposed to be used as reference for decoding dependent frames, this has a worse effect on quality than not doing deblocking on e.g. MPEG-2 video. But at least for high bitrate HDTV, this provides a big speedup with little visible quality loss. Codecs other than H.264 or HEVC may have partial support for this option (often only all and none).
在解码过程中跳过环路滤波器(又称去块)。由于滤波后的帧应作为解码依赖帧的参考,因此这比在例如 MPEG-2 视频上不进行去块对质量的影响更差。但至少对于高比特率 HDTV,这可以提供很大的速度提升,同时几乎看不到质量损失。除了 H.264 或 HEVC 之外的编解码器可能对此选项有部分支持(通常只有 all 和 none )。<skipvalue> can be one of the following:
<skipvalue> 可以是以下之一:none: Never skip. 从不跳过。 default: 默认: Skip useless processing steps (e.g. 0 size packets in AVI).
跳过无用的处理步骤(例如 AVI 中的 0 大小数据包)。nonref: Skip frames that are not referenced (i.e. not used for decoding other frames, the error cannot "build up").
跳过未引用的帧(即未用于解码其他帧,错误无法“累积”)。bidir: Skip B-Frames. 跳过 B 帧。 nonkey: 非关键帧: Skip all frames except keyframes.
跳过所有帧,除了关键帧。all: Skip all frames. 跳过所有帧。 - --vd-lavc-skipidct=<skipvalue> (MPEG-1/2/4 only) --vd-lavc-skipidct=<skipvalue> (仅 MPEG-1/2/4)
- Skips the IDCT step. This degrades quality a lot in almost all cases
(see skiploopfilter for available skip values).
跳过 IDCT 步骤。在几乎所有情况下都会严重降低质量(参见 skiploopfilter 以获取可跳过的值)。 - --vd-lavc-skipframe=<skipvalue>
- Skips decoding of frames completely. Big speedup, but jerky motion and
sometimes bad artifacts (see skiploopfilter for available skip values).
完全跳过帧的解码。大幅提升速度,但动作可能不流畅,有时出现不良伪影(参见 skiploopfilter 了解可用的跳过值)。 - --vd-lavc-framedrop=<skipvalue>
- Set framedropping mode used with --framedrop (see skiploopfilter for
available skip values).
设置与 --framedrop 一起使用的 framedropping 模式(有关可用的 skip 值,请参阅 skiploopfilter)。 - --vd-lavc-threads=<N>
- Number of threads to use for decoding. Whether threading is actually
supported depends on codec (default: 0). 0 means autodetect number of cores
on the machine and use that, up to the maximum of 16. You can set more than
16 threads manually.
用于解码的线程数。是否实际支持线程取决于编解码器(默认:0)。0 表示自动检测机器上的核心数并使用该数,最多为 16。您可以手动设置超过 16 个线程。 - --vd-lavc-assume-old-x264=<yes|no>
- Assume the video was encoded by an old, buggy x264 version (default: no).
Normally, this is autodetected by libavcodec. But if the bitstream contains
no x264 version info (or it was somehow skipped), and the stream was in fact
encoded by an old x264 version (build 150 or earlier), and if the stream
uses 4:4:4 chroma, then libavcodec will by default show corrupted video.
This option sets the libavcodec x264_build option to 150, which
means that if the stream contains no version info, or was not encoded by
x264 at all, it assumes it was encoded by the old version. Enabling this
option is pretty safe if you want your broken files to work, but in theory
this can break on streams not encoded by x264, or if a stream encoded by a
newer x264 version contains no version info.
"假设视频是由旧版、有缺陷的 x264 版本编解码的(默认:否)。通常,这由 libavcodec 自动检测。但如果比特流不包含 x264 版本信息(或它被某种方式跳过),并且实际上是由旧版 x264 版本(构建 150 或更早)编解码的,并且如果流使用 4:4:4 色度,那么 libavcodec 默认会显示损坏的视频。此选项将 libavcodec x264_build 选项设置为 150 ,这意味着如果流不包含版本信息,或者根本不是由 x264 编解码的,它假定是由旧版本编解码的。如果您希望损坏的文件能够工作,启用此选项相当安全,但从理论上讲,这可能会在不是由 x264 编解码的流上中断,或者如果由较新版本的 x264 编解码的流不包含版本信息。 - --vd-apply-cropping
- Certain video codecs support cropping, meaning that only a sub-rectangle of
the decoded frame is intended for display. This option controls how cropping
is handled by libavcodec. Cropping during decoding has certain limitations
with regards to alignment and hardware decoding. If this option is enabled,
decoder will apply the crop, else VO will handle it. Enabled by default.
某些视频编解码器支持裁剪,这意味着仅对解码帧的子矩形进行显示。此选项控制 libavcodec 如何处理裁剪。解码过程中的裁剪在对齐和硬件解码方面存在某些限制。如果启用此选项,解码器将应用裁剪,否则 VO 将处理。默认启用。 - --swapchain-depth=<N>
- Allow up to N in-flight frames. This essentially controls the frame
latency. Increasing the swapchain depth can improve pipelining and prevent
missed vsyncs, but increases visible latency. This option only mandates an
upper limit, the implementation can use a lower latency than requested
internally. A setting of 1 means that the VO will wait for every frame to
become visible before starting to render the next frame. (Default: 3)
允许最多 N 个正在传输的帧。这实际上控制了帧延迟。增加 swapchain 深度可以提高流水线和防止错过 vsync,但会增加可见延迟。此选项仅强制规定上限,实现可以使用比请求的内部延迟更低的延迟。设置为 1 表示 VO 将在开始渲染下一帧之前等待每个帧变得可见。(默认:3)
Audio 音频
- --audio-pitch-correction=<yes|no>
If this is enabled (default), playing with a speed different from normal automatically inserts the scaletempo2 audio filter. You can insert filters besides scaletempo2 and modify their params using Conditional auto profiles:
如果启用(默认),以不同于正常速度播放会自动插入 scaletempo2 音频过滤器。您可以在 scaletempo2 之外插入过滤器并使用条件自动配置文件修改它们的参数:[af_insert] profile-cond=speed ~= 1 profile-restore=copy af-add=scaletempo2=search-interval=50 # Insert filter and params here.
Filters set this way replace the scaletempo2 default, instead of overlapping with it. If there are multiple audio filters inserted that can do pitch correction, then only the last one in the filter chain is used. For details on the specifics of each available filter, see the audio filter section.
以这种方式设置的过滤器将替换 scaletempo2 默认值,而不是与其重叠。如果有多个可以执行音调校正的音频过滤器插入,则仅使用过滤器链中的最后一个。有关每个可用过滤器的具体细节,请参阅音频过滤器部分。- --audio-device=<name>
Use the given audio device. This consists of the audio output name, e.g. alsa, followed by /, followed by the audio output specific device name. The default value for this option is auto, which tries every audio output in preference order with the default device.
使用指定的音频设备。这包括音频输出名称,例如 alsa ,然后是 / ,然后是特定音频输出的设备名称。此选项的默认值为 auto ,它以优先级顺序尝试每个音频输出,并使用默认设备。You can list audio devices with --audio-device=help. This outputs the device name in quotes, followed by a description. The device name is what you have to pass to the --audio-device option. The list of audio devices can be retrieved by API by using the audio-device-list property.
您可以使用 --audio-device=help 列出音频设备。这将输出带引号的设备名称,后跟描述。设备名称是您需要传递给 --audio-device 选项的内容。可以通过使用 audio-device-list 属性通过 API 检索音频设备列表。While the option normally takes one of the strings as indicated by the methods above, you can also force the device for most AOs by building it manually. For example name/foobar forces the AO name to use the device foobar. However, the --ao option will strictly force a specific AO. To avoid confusion, don't use --ao and --audio-device together.
虽然该选项通常采用上述方法中指示的字符串之一,但您也可以通过手动构建来强制大多数 AO 使用设备。例如, name/foobar 强制 AO name 使用设备 foobar 。然而, --ao 选项将严格强制特定的 AO。为了避免混淆,请勿同时使用 --ao 和 --audio-device 。Example for ALSA ALSA 示例
MPlayer and mplayer2 required you to replace any ',' with '.' and any ':' with '=' in the ALSA device name. For example, to use the device named dmix:default, you had to do:
MPlayer 和 mplayer2 要求您在 ALSA 设备名称中将任何 ',' 替换为 '.',将任何 ':' 替换为 '='。例如,要使用名为 dmix:default 的设备,您必须执行以下操作:-ao alsa:device=dmix=default
In mpv you could instead use:
在 mpv 中,您可以使用以下命令:--audio-device=alsa/dmix:default
- --audio-exclusive=<yes|no>
Enable exclusive output mode. In this mode, the system is usually locked out, and only mpv will be able to output audio.
启用独占输出模式。在此模式下,系统通常被锁定,只有 mpv 能够输出音频。This only works for some audio outputs, such as wasapi, coreaudio, pipewire and audiounit. Other audio outputs silently ignore this option. They either have no concept of exclusive mode, or the mpv side of the implementation is missing.
此功能仅适用于某些音频输出,例如 wasapi , coreaudio , pipewire 和 audiounit 。其他音频输出会静默忽略此选项。它们要么没有独占模式的概念,要么 mpv 实现方面的实现缺失。- --audio-fallback-to-null=<yes|no>
- If no audio device can be opened, behave as if --ao=null was given. This
is useful in combination with --audio-device: instead of causing an
error if the selected device does not exist, the client API user (or a
Lua script) could let playback continue normally, and check the
current-ao and audio-device-list properties to make high-level
decisions about how to continue.
如果无法打开音频设备,则表现得像是给出了 --ao=null 。这与 --audio-device 结合使用很有用:如果选定的设备不存在,则不会引发错误,客户端 API 用户(或 Lua 脚本)可以让播放继续正常进行,并检查 current-ao 和 audio-device-list 属性,以做出高级决策,决定如何继续。 - --ao=<driver>
- Specify the audio output drivers to be used. See AUDIO OUTPUT DRIVERS for
details and descriptions of available drivers.
指定要使用的音频输出驱动程序。有关详细信息及可用驱动程序的描述,请参阅音频输出驱动程序。 - --af=<filter1[=parameter1:parameter2:...],filter2,...>
- Specify a list of audio filters to apply to the audio stream. See
AUDIO FILTERS for details and descriptions of the available filters.
The option variants --af-add, --af-pre, and --af-clr exist
to modify a previously specified list, but you should not need these for
typical use.
指定要应用于音频流的音频过滤器列表。有关详细信息及可用过滤器的描述,请参阅音频过滤器。选项变体 --af-add , --af-pre 和 --af-clr 存在以修改之前指定的列表,但在典型使用中通常不需要这些。 - --audio-spdif=<codecs>
List of codecs for which compressed audio passthrough should be used. This works for both classic S/PDIF and HDMI.
应使用压缩音频透传的编解码器列表。此功能适用于经典 S/PDIF 和 HDMI。Possible codecs are ac3, dts, dts-hd, eac3, truehd. Multiple codecs can be specified by separating them with ,. dts refers to low bitrate DTS core, while dts-hd refers to DTS MA (receiver and OS support varies). If both dts and dts-hd are specified, it behaves equivalent to specifying dts-hd only.
可能的编解码器有 ac3 , dts , dts-hd , eac3 , truehd 。可以通过 , 分隔符指定多个编解码器。 dts 指的是低比特率 DTS 核心,而 dts-hd 指的是 DTS MA(接收器和操作系统支持各不相同)。如果同时指定了 dts 和 dts-hd ,则其行为等同于仅指定 dts-hd 。In earlier mpv versions you could use --ad to force the spdif wrapper. This does not work anymore.
在较早的 mpv 版本中,您可以使用 --ad 强制使用 spdif 包装器。这不再有效。Warning 警告
There is not much reason to use this. HDMI supports uncompressed multichannel PCM, and mpv supports lossless DTS-HD decoding via FFmpeg's new DCA decoder (based on libdcadec).
没有太多理由使用这个。HDMI 支持未压缩的多声道 PCM,而 mpv 通过 FFmpeg 的新 DCA 解码器(基于 libdcadec 库)支持无损 DTS-HD 解码。- --ad=<decoder1,decoder2,...[-]>
Specify a priority list of audio decoders to be used, according to their decoder name. When determining which decoder to use, the first decoder that matches the audio format is selected. If that is unavailable, the next decoder is used. Finally, it tries all other decoders that are not explicitly selected or rejected by the option.
指定要使用的音频解码器的优先级列表,根据它们的解码器名称。在确定使用哪个解码器时,首先选择与音频格式匹配的第一个解码器。如果不可用,则使用下一个解码器。最后,它尝试所有其他未明确选择或拒绝的解码器。- at the end of the list suppresses fallback on other available decoders not on the --ad list. This should not normally be used, because they break normal decoder auto-selection! The - mode is deprecated.
- 在列表末尾抑制对 --ad 列表中未列出的其他可用解码器的回退。这通常不应使用,因为它们会破坏正常的解码器自动选择! - 模式已弃用。Examples 示例
Warning 警告
Enabling compressed audio passthrough (AC3 and DTS via SPDIF/HDMI) with this option is not possible. Use --audio-spdif instead.
使用此选项无法启用压缩音频透传(通过 SPDIF/HDMI 的 AC3 和 DTS)。请使用 --audio-spdif 代替。- --volume=<value>
Set the startup volume. 0 means silence, 100 means no volume reduction or amplification. Negative values can be passed for compatibility, but are treated as 0.
设置启动音量。0 表示静音,100 表示无音量减少或放大。为了兼容性可以传递负值,但它们被视为 0。Since mpv 0.18.1, this always controls the internal mixer (aka software volume).
自 mpv 0.18.1 版本起,这始终控制内部混音器(即软件音量)。- --volume-max=<100.0-1000.0>
- Set the maximum amplification level in percent (default: 130). A value of
130 will allow you to adjust the volume up to about double the normal level.
设置最大放大级别(百分比,默认:130)。130 的值将允许您将音量调整到大约正常水平的两倍。 - --volume-gain=<db>
- Set the volume gain in dB. This is applied on top of other volume and gain
settings.
设置音量增益(dB)。这将在其他音量和增益设置之上应用。 - --volume-gain-max=<0.0-150.0>, --volume-gain-min=<-150.0-0.0>
- Set the volume gain range in dB (default: -96 dB min, 12 dB max).
设置音量增益范围(dB)(默认:-96 dB 最小,12 dB 最大)。 - --replaygain=<no|track|album>
- Adjust volume gain according to replaygain values stored in the file
metadata. With --replaygain=no (the default), perform no adjustment.
With --replaygain=track, apply track gain. With --replaygain=album,
apply album gain if present and fall back to track gain otherwise.
根据存储在文件元数据中的 replaygain 值调整音量增益。使用 --replaygain=no (默认),不进行调整。使用 --replaygain=track ,应用曲目增益。使用 --replaygain=album ,如果存在则应用专辑增益,否则回退到曲目增益。 - --replaygain-preamp=<db>
- Pre-amplification gain in dB to apply to the selected replaygain gain
(default: 0).
应用于所选 replaygain 增益的预放大增益(dB)(默认:0)。 - --replaygain-clip=<yes|no>
- Allow the volume gain to clip (default: no). If this option is not
enabled, mpv automatically will prevent clipping by lowering the gain.
允许音量增益失真(默认:否)。如果此选项未启用,mpv 将自动通过降低增益来防止失真。 - --replaygain-fallback=<db>
- Gain in dB to apply if the file has no replay gain tags. This option
is always applied if the replaygain logic is somehow inactive. If this
is applied, no other replaygain options are applied.
如果文件没有重放增益标签,则应用 dB 增益。如果重放增益逻辑以某种方式不活跃,则始终应用此选项。如果应用此选项,则不应用其他重放增益选项。 - --audio-delay=<sec>
- Audio delay in seconds (positive or negative float value). Positive values
delay the audio, and negative values delay the video.
以秒为单位的音频延迟(正数或负数浮点值)。正数延迟音频,负数延迟视频。 - --mute=<yes|no>
Set startup audio mute status (default: no).
设置启动音频静音状态(默认:否)。See also: --volume. 另请参阅: --volume 。
- --audio-demuxer=<[+]name>
- Use this audio demuxer type when using --audio-file. Use a '+' before
the name to force it; this will skip some checks. Give the demuxer name as
printed by --audio-demuxer=help.
使用此音频解复用器类型时使用 --audio-file 。在名称前加 '+' 强制使用;这将跳过一些检查。将解复用器名称作为 --audio-demuxer=help 打印的名称提供。 - --ad-lavc-ac3drc=<level>
Select the Dynamic Range Compression level for AC-3 audio streams. <level> is a float value ranging from 0 to 1, where 0 means no compression (which is the default) and 1 means full compression (make loud passages more silent and vice versa). Values up to 6 are also accepted, but are purely experimental. This option only shows an effect if the AC-3 stream contains the required range compression information.
选择 AC-3 音频流的动态范围压缩级别。 <level> 是一个从 0 到 1 的浮点值,其中 0 表示无压缩(默认值)和 1 表示完全压缩(使响亮的部分更安静,反之亦然)。也接受高达 6 的值,但这些值纯粹是实验性的。此选项仅在 AC-3 流包含所需的范围压缩信息时才显示效果。The standard mandates that DRC is enabled by default, but mpv (and some other players) ignore this for the sake of better audio quality.
标准规定默认启用 DRC,但 mpv(以及一些其他播放器)为了更好的音频质量而忽略这一点。- --ad-lavc-downmix=<yes|no>
- Whether to request audio channel downmixing from the decoder (default: no).
Some decoders, like AC-3, AAC and DTS, can remix audio on decoding. The
requested number of output channels is set with the --audio-channels option.
Useful for playing surround audio on a stereo system.
是否从解码器请求音频通道下混音(默认:否)。一些解码器,如 AC-3、AAC 和 DTS,可以在解码时混音音频。请求的输出通道数由 --audio-channels 选项设置。在立体声系统上播放环绕音频时很有用。 - --ad-lavc-threads=<0-16>
- Number of threads to use for decoding. Whether threading is actually
supported depends on codec. As of this writing, it's supported for some
lossless codecs only. 0 means autodetect number of cores on the
machine and use that, up to the maximum of 16 (default: 1).
用于解码的线程数。是否实际支持取决于编解码器。截至本文撰写时,仅支持某些无损编解码器。0 表示自动检测机器上的核心数并使用该数,最多为 16(默认:1)。 - --ad-lavc-o=<key>=<value>[,<key>=<value>[,...]]
Pass AVOptions to libavcodec decoder. Note, a patch to make the o= unneeded and pass all unknown options through the AVOption system is welcome. A full list of AVOptions can be found in the FFmpeg manual.
将 AVOptions 传递给 libavcodec 解码器。注意,一个使 o=不再需要并通过 AVOption 系统传递所有未知选项的补丁是受欢迎的。AVOptions 的完整列表可以在 FFmpeg 手册中找到。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --ad-spdif-dtshd=<yes|no>, --dtshd=<yes|no>
If DTS is passed through, use DTS-HD.
如果传递 DTS,则使用 DTS-HD。Warning 警告
This and enabling passthrough via --ad are deprecated in favor of using --audio-spdif=dts-hd.
此操作和通过 --ad 启用直通功能已被弃用,建议使用 --audio-spdif=dts-hd 。- --audio-channels=<auto-safe|auto|layouts>
Control which audio channels are output (e.g. surround vs. stereo). There are the following possibilities:
控制输出的音频通道(例如环绕声与立体声)。以下是一些可能性:- --audio-channels=auto-safe
Use the system's preferred channel layout. If there is none (such as when accessing a hardware device instead of the system mixer), force stereo. Some audio outputs might simply accept any layout and do downmixing on their own.
使用系统首选的通道布局。如果没有(例如,访问硬件设备而不是系统混音器时),强制使用立体声。某些音频输出可能简单地接受任何布局并在其自身进行下混音。This is the default.
这是默认设置。
- --audio-channels=layout1,layout2,...
List of ,-separated channel layouts which should be allowed. Technically, this only adjusts the filter chain output to the best matching layout in the list, and passes the result to the audio API. It's possible that the audio API will select a different channel layout.
应允许的 , -分隔的声道布局列表。技术上,这仅调整过滤器链输出到列表中的最佳匹配布局,并将结果传递给音频 API。音频 API 可能会选择不同的声道布局。Using this mode is recommended for direct hardware output, especially over HDMI (see HDMI warning below).
建议在直接硬件输出时使用此模式,尤其是在 HDMI 上(见下方的 HDMI 警告)。
If a list of layouts is given, each item can be either an explicit channel layout name (like 5.1), or a channel number. Channel numbers refer to default layouts, e.g. 2 channels refer to stereo, 6 refers to 5.1.
如果提供了布局列表,则每个项目可以是显式的通道布局名称(如 5.1 ),或通道号。通道号指的是默认布局,例如,2 个通道指的是立体声,6 个通道指的是 5.1。See --audio-channels=help output for defined default layouts. This also lists speaker names, which can be used to express arbitrary channel layouts (e.g. fl-fr-lfe is 2.1).
查看 --audio-channels=help 输出以定义默认布局。此列表还列出了扬声器名称,可用于表示任意通道布局(例如, fl-fr-lfe 是 2.1)。If the list of channel layouts has only 1 item, the decoder is asked to produce according output. This sometimes triggers decoder-downmix, which might be different from the normal mpv downmix. (Only some decoders support remixing audio, like AC-3, AAC or DTS. You can use --ad-lavc-downmix=no to make the decoder always output its native layout.) One consequence is that --audio-channels=stereo triggers decoder downmix, while auto or auto-safe never will, even if they end up selecting stereo. This happens because the decision whether to use decoder downmix happens long before the audio device is opened.
如果通道布局列表中只有 1 个项目,则解码器会被要求产生相应的输出。这有时会触发解码器混音,可能与正常的 mpv 混音不同。(只有一些解码器支持音频重混音,如 AC-3、AAC 或 DTS。您可以使用 --ad-lavc-downmix=no 使解码器始终输出其原生布局。)一个后果是, --audio-channels=stereo 触发解码器混音,而 auto 或 auto-safe 从不会,即使最终选择的是立体声。这是因为是否使用解码器混音的决定是在音频设备打开之前很久就做出的。If the channel layout of the media file (i.e. the decoder) and the AO's channel layout don't match, mpv will attempt to insert a conversion filter. You may need to change the channel layout of the system mixer to achieve your desired output as mpv does not have control over it. Another work-around for this on some AOs is to use --audio-exclusive=yes to circumvent the system mixer entirely.
如果媒体文件(即解码器)的通道布局与 AO 的通道布局不匹配,mpv 将尝试插入转换过滤器。您可能需要更改系统混音器的通道布局以实现所需的输出,因为 mpv 无法控制它。在某些 AO 上,对此的另一种解决方案是使用 --audio-exclusive=yes 来完全绕过系统混音器。Warning 警告
Using auto can cause issues when using audio over HDMI. The OS will typically report all channel layouts that _can_ go over HDMI, even if the receiver does not support them. If a receiver gets an unsupported channel layout, random things can happen, such as dropping the additional channels, or adding noise.
使用 auto 在通过 HDMI 使用音频时可能会引起问题。操作系统通常会报告所有可以通过 HDMI 传输的通道布局,即使接收器不支持它们。如果接收器收到不支持的通道布局,可能会发生随机事件,例如丢弃额外的通道或添加噪声。You are recommended to set an explicit whitelist of the layouts you want. For example, most A/V receivers connected via HDMI and that can do 7.1 would be served by: --audio-channels=7.1,5.1,stereo
建议您设置一个显式的布局白名单。例如,大多数通过 HDMI 连接且可以支持 7.1 的 A/V 接收器将由: --audio-channels=7.1,5.1,stereo 提供服务。- --audio-display=<no|embedded-first|external-first>
Determines whether to display cover art when playing audio files and with what priority. It will display the first image found, and additional images are available as video tracks.
确定在播放音频文件时是否显示封面艺术,以及优先级。它将显示找到的第一张图片,额外的图片作为视频轨道可用。no: no: Disable display of video entirely when playing audio files.
播放音频文件时完全禁用视频显示。embedded-first: Display embedded images and external cover art, giving priority to embedded images (default).
显示嵌入图像和外部封面艺术,优先显示嵌入图像(默认)。external-first: 外部第一个: Display embedded images and external cover art, giving priority to external files.
显示嵌入图像和外部封面艺术,优先显示外部文件。This option has no influence on files with normal video tracks.
此选项对具有正常视频轨道的文件没有影响。- --audio-files=<files>
Play audio from an external file while viewing a video.
在观看视频的同时播放外部文件中的音频。This is a path list option. See List Options for details.
这是一个路径列表选项。有关详细信息,请参阅列表选项。- --audio-file=<file>
- CLI/config file only alias for --audio-files-append. Each use of this
option will add a new audio track. The details are similar to how
--sub-file works.
CLI/配置文件中仅对 --audio-files-append 的别名。每次使用此选项都会添加一个新的音频轨道。其细节与 --sub-file 的操作方式类似。 - --audio-format=<format>
- Select the sample format used for output from the audio filter layer to
the sound card. The values that <format> can adopt are listed below in
the description of the format audio filter.
"选择从音频滤波器层到声卡的输出所使用的样本格式。 <format> 可以采用的值在 format 音频滤波器的描述中列出。 - --audio-samplerate=<Hz>
- Select the output sample rate to be used (of course sound cards have
limits on this). If the sample frequency selected is different from that
of the current media, the internal swresample audio filter will be inserted
into the audio filter layer to compensate for the difference.
选择要使用的输出采样率(当然,声卡在这方面有限制)。如果选择的采样频率与当前媒体不同,内部 swresample 音频滤波器将被插入到音频滤波器层中,以补偿差异。 - --gapless-audio=<no|yes|weak>
Try to play consecutive audio files with no silence or disruption at the point of file change. Default: weak.
尝试播放连续的音频文件,在文件切换点没有静音或中断。默认: weak 。no: no: Disable gapless audio. 禁用无缝音频。 yes: The audio device is opened using parameters chosen for the first file played and is then kept open for gapless playback. This means that if the first file for example has a low sample rate, then the following files may get resampled to the same low sample rate, resulting in reduced sound quality. If you play files with different parameters, consider using options such as --audio-samplerate and --audio-format to explicitly select what the shared output format will be.
音频设备使用为第一个播放的文件选择的参数打开,然后保持打开状态以实现无缝播放。这意味着如果第一个文件例如采样率低,则后续文件可能会被重新采样到相同的低采样率,从而导致音质降低。如果您播放具有不同参数的文件,请考虑使用例如 --audio-samplerate 和 --audio-format 选项来显式选择共享输出格式。weak: "弱: Normally, the audio device is kept open (using the format it was first initialized with). If the audio format the decoder output changes, the audio device is closed and reopened. This means that you will normally get gapless audio with files that were encoded using the same settings, but might not be gapless in other cases. The exact conditions under which the audio device is kept open is an implementation detail, and can change from version to version. Currently, the device is kept even if the sample format changes, but the sample formats are convertible. If video is still going on when there is still audio, trying to use gapless is also explicitly given up.
通常,音频设备会保持打开状态(使用首次初始化的格式)。如果解码器输出的音频格式发生变化,则关闭并重新打开音频设备。这意味着您通常可以从使用相同设置编码的文件中获得无缝音频,但在其他情况下可能不是无缝的。音频设备保持打开的确切条件是实现细节,并且可能会随着版本的不同而变化。目前,即使采样格式发生变化,设备也会保持打开状态,但采样格式是可以转换的。如果视频仍在进行中而音频仍在播放,尝试使用无缝播放也会被明确放弃。Note 注意
This feature is implemented in a simple manner and relies on audio output device buffering to continue playback while moving from one file to another. If playback of the new file starts slowly, for example because it is played from a remote network location or because you have specified cache settings that require time for the initial cache fill, then the buffered audio may run out before playback of the new file can start.
此功能以简单的方式实现,并依赖于音频输出设备缓冲以在从一个文件切换到另一个文件时继续播放。如果新文件的播放开始缓慢,例如因为它来自远程网络位置,或者因为你指定了需要时间进行初始缓存填充的缓存设置,那么缓冲的音频可能在开始播放新文件之前耗尽。- --initial-audio-sync=<yes|no>
- When starting a video file or after events such as seeking, mpv will by
default modify the audio stream to make it start from the same timestamp
as video, by either inserting silence at the start or cutting away the
first samples. Disabling this option makes the player behave like older
mpv versions did: video and audio are both started immediately even if
their start timestamps differ, and then video timing is gradually adjusted
if necessary to reach correct synchronization later.
在启动视频文件或进行如搜索等事件后,mpv 默认会修改音频流,使其从与视频相同的时标开始播放,方法是在开始处插入静音或删除前几个样本。禁用此选项会使播放器表现得像较老的 mpv 版本:即使视频和音频的开始时标不同,它们也会立即同时开始播放,然后如果需要,视频时标会逐渐调整以达到正确的同步。 - --audio-file-auto=<no|exact|fuzzy|all>
Load additional audio files matching the video filename. The parameter specifies how external audio files are matched.
加载与视频文件名匹配的附加音频文件。该参数指定了如何匹配外部音频文件。no: no: Don't automatically load external audio files (default).
不要自动加载外部音频文件(默认)。exact: exact: Load the media filename with audio file extension.
加载带有音频文件扩展名的媒体文件名。fuzzy: Load all audio files containing the media filename.
加载包含媒体文件名的所有音频文件。all: Load all audio files in the current and --audio-file-paths directories.
加载当前目录和 --audio-file-paths 目录中的所有音频文件。- --audio-exts=ext1,ext2,...
Audio file extensions to try to match when using --audio-file-auto, --autocreate-playlist or --directory-filter-types.
当使用 --audio-file-auto , --autocreate-playlist 或 --directory-filter-types 时尝试匹配的音频文件扩展名。This is a string list option. See List Options for details. Use --help=audio-exts to see default extensions.
这是一个字符串列表选项。请参阅列表选项以获取详细信息。使用 --help=audio-exts 查看默认扩展。- --audio-file-paths=<path1:path2:...>
Equivalent to --sub-file-paths option, but for auto-loaded audio files.
等同于 --sub-file-paths 选项,但用于自动加载的音频文件。This is a path list option. See List Options for details.
这是一个路径列表选项。有关详细信息,请参阅列表选项。- --audio-client-name=<name>
- The application name the player reports to the audio API. Can be useful
if you want to force a different audio profile (e.g. with PulseAudio),
or to set your own application name when using libmpv.
应用程序名称,玩家报告给音频 API 的。如果您想强制使用不同的音频配置文件(例如,使用 PulseAudio),或者在使用 libmpv 时设置自己的应用程序名称,这可能很有用。 - --audio-buffer=<seconds>
Set the audio output minimum buffer. The audio device might actually create a larger buffer if it pleases. If the device creates a smaller buffer, additional audio is buffered in an additional software buffer.
设置音频输出最小缓冲区。音频设备可能会根据需要创建更大的缓冲区。如果设备创建较小的缓冲区,则额外的音频将在额外的软件缓冲区中缓冲。Making this larger may make soft-volume and other filters react slower, introduce additional issues on playback speed change, and block the player on audio format changes. A smaller buffer might lead to audio dropouts.
增大此值可能会导致软音量和其他过滤器反应变慢,在播放速度变化时引入额外问题,并在音频格式更改时阻塞播放器。较小的缓冲区可能会导致音频中断。This option should be used for testing only. If a non-default value helps significantly, the mpv developers should be contacted.
此选项仅应用于测试。如果非默认值有助于显著改善,应联系 mpv 开发者。Default: 0.2 (200 ms).
默认:0.2(200 毫秒)。- --audio-stream-silence=<yes|no>
Cash-grab consumer audio hardware (such as A/V receivers) often ignore initial audio sent over HDMI. This can happen every time audio over HDMI is stopped and resumed. In order to compensate for this, you can enable this option to not to stop and restart audio on seeks, and fill the gaps with silence. Likewise, when pausing playback, audio is not stopped, and silence is played while paused. Note that if no audio track is selected, the audio device will still be closed immediately.
现金掠夺型消费级音频硬件(例如 AV 接收器)通常忽略通过 HDMI 发送的初始音频。这可能在每次停止并重新启动 HDMI 音频时发生。为了补偿这一点,您可以启用此选项,在搜索时不要停止和重新启动音频,并用静音填充空白。同样,在暂停播放时,音频不会停止,暂停时播放静音。请注意,如果没有选择音频轨道,音频设备仍会立即关闭。Not all AOs support this.
并非所有 AO 都支持此功能。Warning 警告
This modifies certain subtle player behavior, like A/V-sync and underrun handling. Enabling this option is strongly discouraged.
这会修改某些细微的播放器行为,如 AV 同步和欠载处理。强烈不建议启用此选项。- --audio-wait-open=<secs>
- This makes sense for use with --audio-stream-silence=yes. If this option
is given, the player will wait for the given amount of seconds after opening
the audio device before sending actual audio data to it. Useful if your
expensive hardware discards the first 1 or 2 seconds of audio data sent to
it. If --audio-stream-silence=yes is not set, this option will likely
just waste time.
这对于与 --audio-stream-silence=yes .一起使用是有意义的。如果此选项被提供,玩家将在打开音频设备后等待指定秒数,然后向其发送实际音频数据。如果您的昂贵硬件会丢弃发送给它的前 1 或 2 秒音频数据,则此选项很有用。如果 --audio-stream-silence=yes 未设置,此选项可能会浪费时间。
Subtitles 字幕
Note 注意
Changing styling and position does not work with all subtitles. Image-based
subtitles (DVD, Bluray/PGS, DVB) cannot changed for fundamental reasons.
Subtitles in ASS format are normally not changed intentionally, but
overriding them can be controlled with --sub-ass-override.
更改样式和位置并不适用于所有字幕。基于图像的字幕(DVD、Bluray/PGS、DVB)由于基本原因无法更改。ASS 格式的字幕通常不会有意更改,但可以通过 --sub-ass-override 来控制覆盖它们。
- --sub-demuxer=<[+]name>
- Force subtitle demuxer type for --sub-file. Give the demuxer name as
printed by --sub-demuxer=help.
强制设置 --sub-file 的副标题解复用器类型。请给出由 --sub-demuxer=help 打印的解复用器名称。 - --sub-lavc-o=<key>=<value>[,<key>=<value>[,...]]
Pass AVOptions to libavcodec decoder. Note, a patch to make the o= unneeded and pass all unknown options through the AVOption system is welcome. A full list of AVOptions can be found in the FFmpeg manual.
将 AVOptions 传递给 libavcodec 解码器。注意,一个使 o=不再需要并通过 AVOption 系统传递所有未知选项的补丁是受欢迎的。AVOptions 的完整列表可以在 FFmpeg 手册中找到。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --sub-delay=<sec>
- Delays primary subtitles by <sec> seconds. Can be negative.
延迟主副标题 <sec> 秒。可以是负数。 - --secondary-sub-delay=<sec>
- Delays secondary subtitles by <sec> seconds. Can be negative.
延迟二级字幕 <sec> 秒。可以是负数。 - --sub-files=<file-list>, --sub-file=<filename>
Add a subtitle file to the list of external subtitles.
将字幕文件添加到外部字幕列表中。If you use --sub-file only once, this subtitle file is displayed by default.
如果您只使用 --sub-file 一次,则默认显示此字幕文件。If --sub-file is used multiple times, the subtitle to use can be switched at runtime by cycling subtitle tracks. It's possible to show two subtitles at once: use --sid to select the first subtitle index, and --secondary-sid to select the second index. (The index is printed on the terminal output after the --sid= in the list of streams.)
如果多次使用 --sub-file ,则可以通过循环字幕轨道在运行时切换要使用的字幕。可以同时显示两个字幕:使用 --sid 选择第一个字幕索引,使用 --secondary-sid 选择第二个索引。(索引在流列表中的 --sid= 之后打印在终端输出。)--sub-files is a path list option (see List Options for details), and can take multiple file names separated by : (Unix) or ; (Windows), while --sub-file takes a single filename, but can be used multiple times to add multiple files. Technically, --sub-file is a CLI/config file only alias for --sub-files-append.
--sub-files 是一个路径列表选项(详细信息请参阅列表选项),可以接受由 : (Unix)或 ; (Windows)分隔的多个文件名,而 --sub-file 只接受单个文件名,但可以多次使用以添加多个文件。技术上, --sub-file 是 --sub-files-append 的 CLI/配置文件别名。- --secondary-sid=<ID|auto|no>
Select a secondary subtitle stream. This is similar to --sid. If a secondary subtitle is selected, it will be rendered as toptitle (i.e. on the top of the screen) alongside the normal subtitle by default, and provides a way to render two subtitles at once.
选择一个次要字幕流。这与 --sid 类似。如果选择了次要字幕,它将默认以 toptitle(即在屏幕顶部)的形式渲染,与正常字幕一起显示,并提供了一次渲染两个字幕的方法。There are some caveats associated with this feature. For example, bitmap subtitles will always be rendered in their usual position, so selecting a bitmap subtitle as secondary subtitle will result in overlapping subtitles. Secondary subtitles are never shown on the terminal if video is disabled.
此功能有一些注意事项。例如,位图字幕将始终在其常规位置渲染,因此选择位图字幕作为次要字幕将导致字幕重叠。如果禁用视频,则次要字幕永远不会在终端上显示。Note 注意
Styling and interpretation of any formatting tags is disabled for the secondary subtitle. Internally, the same mechanism as --sub-ass=no is used to strip the styling.
为二级副标题禁用任何格式化标签的样式和解释。内部,与 --sub-ass=no 相同的机制用于去除样式。Note 注意
If the main subtitle stream contains formatting tags which display the subtitle at the top of the screen, it will overlap with the secondary subtitle. To prevent this, you could use --sub-ass=no to disable styling in the main subtitle stream.
如果主副标题流包含显示副标题在屏幕顶部的格式化标签,它将与二级副标题重叠。为了防止这种情况,您可以在主副标题流中使用 --sub-ass=no 禁用样式。- --sub-scale=<0-100>
Factor for the text subtitle font size (default: 1).
文本副标题字体大小因子(默认:1)。Note 注意
This affects ASS subtitles as well, and may lead to incorrect subtitle rendering. Use with care, or use --sub-font-size instead.
这也会影响 ASS 字幕,并可能导致字幕渲染错误。请谨慎使用,或使用 --sub-font-size 代替。- --sub-scale-signs=<yes|no>
- When set to yes, also apply --sub-scale to typesetting (or "signs").
When this is set to no, --sub-scale is only applied to dialogue. The
distinction between dialogue and typesetting is done on a best effort basis
and is not infallible (default: no).
当设置为 yes 时,也将 --sub-scale 应用到排版(或“符号”)。当设置为 no 时, --sub-scale 仅应用于对话。对话和排版的区分是基于最佳努力原则,并不完美(默认:no)。 - --sub-scale-by-window=<yes|no>
Whether to scale subtitles with the window size (default: yes). If this is disabled while --sub-scale-with-window is set to yes, changing the window size won't change the subtitle font size.
是否根据窗口大小缩放字幕(默认:yes)。如果禁用且 --sub-scale-with-window 设置为 yes,则更改窗口大小不会改变字幕字体大小。Affects plain text subtitles only (or ASS if --sub-ass-override is set high enough).
仅影响纯文本字幕(或如果 --sub-ass-override 设置得足够高,则为 ASS)。- --sub-scale-with-window=<yes|no>
Make the subtitle font size relative to the window (default: yes). If this is disabled while --sub-scale-by-window is set to yes, the subtitle font size is scaled relative to the video size instead.
使字幕字体大小相对于窗口(默认:是)。如果禁用此功能且 --sub-scale-by-window 设置为是,则字幕字体大小将相对于视频大小进行缩放。Affects plain text subtitles only (or ASS if --sub-ass-override is set high enough).
仅影响纯文本字幕(或如果 --sub-ass-override 设置得足够高,则为 ASS)。Note 注意
By default, the subtitle font size is scaled with the window size. To make the font size constant, set only --sub-scale-by-window to no. To make the font size scale with video size instead, set only --sub-scale-with-window to no. It's not meaningful to set both options to no.
默认情况下,副标题字体大小与窗口大小成比例缩放。要使字体大小保持不变,只需将 --sub-scale-by-window 设置为否。要使字体大小与视频大小成比例缩放,只需将 --sub-scale-with-window 设置为否。同时将这两个选项设置为否没有意义。- --sub-ass-scale-with-window=<yes|no>
Like --sub-scale-with-window, but affects subtitles in ASS format only. Like --sub-scale, this can break ASS subtitles.
类似于 --sub-scale-with-window ,但仅影响 ASS 格式的字幕。类似于 --sub-scale ,这可能会破坏 ASS 字幕。Default: no. 默认:no。
- --embeddedfonts=<yes|no>
- Use fonts embedded in Matroska container files and ASS scripts (default:
yes). These fonts can be used for SSA/ASS subtitle rendering.
使用 Matroska 容器文件和 ASS 脚本中嵌入的字体(默认:是)。这些字体可用于 SSA/ASS 字幕渲染。 - --sub-pos=<0-150>
Specify the position of subtitles on the screen. The value is the vertical position of the subtitle in % of the screen height. 100 is the original position, which is often not the absolute bottom of the screen, but with some margin between the bottom and the subtitle. Values above 100 move the subtitle further down.
指定字幕在屏幕上的位置。该值是字幕在屏幕高度百分比中的垂直位置。100 是原始位置,通常不是屏幕的绝对底部,而是在底部和字幕之间留有间距。值大于 100 将字幕向下移动。Warning 警告
Text subtitles (as opposed to image subtitles) may be cut off if the value of the option is above 100. This is a libass restriction.
文本字幕(与图像字幕不同)如果选项值超过 100,可能会被截断。这是 libass 的限制。This affects ASS subtitles as well, and may lead to incorrect subtitle rendering in addition to the problem above.
这也会影响 ASS 字幕,除了上述问题外,还可能导致字幕渲染错误。Using --sub-margin-y can achieve this in a better way.
使用 --sub-margin-y 可以达到更好的效果。- --secondary-sub-pos=<0-150>
- Specify the position of secondary subtitles on the screen. This is similar
to --sub-pos but for secondary subtitles.
指定屏幕上副标题的位置。这与 --sub-pos 类似,但用于副标题。 - --sub-speed=<0.1-10.0>
Multiply the subtitle event timestamps with the given value. Can be used to fix the playback speed for frame-based subtitle formats. Affects text subtitles only.
将副标题事件的时间戳乘以给定的值。可用于修复基于帧的副标题格式的播放速度。仅影响文本副标题。Example 示例
--sub-speed=25/23.976 plays frame based subtitles which have been loaded assuming a framerate of 23.976 at 25 FPS.
" --sub-speed=25/23.976 播放已加载的基于帧的副标题,假设帧率为 23.976,在 25 FPS 下。- --sub-ass-style-overrides=<[Style.]Param=Value[,...]>
Override some style or script info parameters.
覆盖一些样式或脚本信息参数。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。Examples 示例
- --sub-ass-style-overrides=FontName=Arial,Default.Bold=1
- --sub-ass-style-overrides=PlayResY=768
Note 注意
Using this option may lead to incorrect subtitle rendering.
使用此选项可能会导致字幕渲染不正确。- --sub-hinting=<none|light|normal|native>
Set font hinting type. <type> can be:
设置字体提示类型。 可以是:none: no hinting (default) 无提示(默认) light: 浅色: FreeType autohinter, light mode
FreeType 自动 hinting,浅色模式normal: 正常: FreeType autohinter, normal mode
FreeType 自动提示,正常模式native: 本地: font native hinter 字体本地后端 Warning 警告
Enabling hinting can lead to mispositioned text (in situations it's supposed to match up video background), or reduce the smoothness of animations with some badly authored ASS scripts. It is recommended to not use this option, unless really needed.
启用提示可能会导致文本位置错误(在应与视频背景匹配的情况下),或者在使用某些编写不良的 ASS 脚本的动画中降低动画的平滑度。建议除非真的需要,否则不要使用此选项。- --sub-line-spacing=<value>
- Set line spacing value for SSA/ASS renderer.
为 SSA/ASS 渲染器设置行间距值。 - --sub-shaper=<simple|complex>
Set the text layout engine used by libass.
设置 libass 使用的文本布局引擎。simple: 简单: uses Fribidi only, fast, doesn't render some languages correctly
仅使用 Fribidi,快速,但无法正确渲染某些语言。complex: 复杂: uses HarfBuzz, slower, wider language support
使用 HarfBuzz,较慢,支持更广泛的语言complex is the default. If libass hasn't been compiled against HarfBuzz, libass silently reverts to simple.
complex 是默认值。如果 libass 没有针对 HarfBuzz 编译,libass 将静默地回退到 simple 。- --sub-ass-prune-delay=<-1|seconds>
Set the delay for automatic pruning of events from memory in libass. When enabled, subtitle events are removed from memory once their end timestamp is older than the specified delay.
设置 libass 中从内存中自动修剪事件的延迟。当启用时,字幕事件一旦它们的结束时间戳超过指定的延迟,就会从内存中移除。-1: disables automatic pruning (default).
禁用自动修剪(默认)。seconds: 秒: specify how many seconds after an event is no longer displayed should the pruning occur. 0 prunes events as soon as they're off screen.
指定事件停止显示后多少秒应进行修剪。 0 一旦事件离开屏幕,就立即修剪事件。Note 注意
This breaks sub-seek and subtitle rendering when changing play-direction from forward to backward during runtime for events that were already "seen" and need to be rendered again, if those events got pruned.
当在运行时从正向切换到反向播放方向时,这会破坏对已“查看”且需要重新渲染的事件的子查找和字幕渲染。- --sub-ass-styles=<filename>
Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles. The syntax of the file is exactly like the [V4 Styles] / [V4+ Styles] section of SSA/ASS.
加载指定文件中找到的所有 SSA/ASS 样式,并使用它们渲染文本字幕。文件的语法与 SSA/ASS 的 [V4 Styles] / [V4+ Styles] 部分完全相同。Note 注意
Using this option may lead to incorrect subtitle rendering.
使用此选项可能会导致字幕渲染不正确。- --sub-ass-override=<no|yes|scale|force|strip>
Control whether user style overrides should be applied. Note that all of these overrides try to be somewhat smart about figuring out whether or not a subtitle is considered a "sign" and try to be as non-destructive as possible.
控制是否应用用户样式覆盖。注意,所有这些覆盖都试图在某种程度上智能地判断是否将字幕视为“标志”,并尽量做到尽可能非破坏性。no: no: Render subtitles as specified by the subtitle scripts, without overrides.
按照字幕脚本指定的方式渲染字幕,不使用覆盖。yes: Apply all the --sub-ass-* style override options. Changing the default for any of these options can lead to incorrect subtitle rendering.
应用所有 --sub-ass-* 样式覆盖选项。更改这些选项中的任何一项可能会导致字幕渲染不正确。scale: 缩放: Like yes, but also apply --sub-scale (default).
类似于 yes ,但同时也应用 --sub-scale (默认)。force: 强制: Like yes, but also force all --sub-* options. Can break rendering easily. Certain options aren't overridden if they can potentially be too destructive.
类似于 yes ,但同时也强制所有 --sub-* 选项。可能会轻易破坏渲染。某些选项如果可能过于破坏性则不会被覆盖。strip: Radically strip all ASS tags and styles from the subtitle. This is equivalent to the old --no-ass / --no-sub-ass options.
彻底删除字幕中的所有 ASS 标签和样式。这与旧的 --no-ass / --no-sub-ass 选项等效。This also controls some bitmap subtitle overrides, as well as HTML tags in formats like SRT, despite the name of the option.
此选项还控制一些位图字幕覆盖以及 SRT 等格式的 HTML 标签,尽管选项名称如此。- --secondary-sub-ass-override=<no|yes|scale|force|strip>
Control whether user secondary substyle overrides should be applied. This works exactly like --sub-ass-override.
控制是否应用用户二级子样式的覆盖。这与 --sub-ass-override .完全相同。Default: strip. 默认:strip。
- --sub-ass-force-margins
Enables placing toptitles and subtitles in black borders when they are available, if the subtitles are in the ASS format.
启用在可用时将标题和副标题放置在黑色边框中,如果副标题是 ASS 格式。Default: no. 默认:no。
- --sub-use-margins
Enables placing toptitles and subtitles in black borders when they are available, if the subtitles are in a plain text format (or ASS if --sub-ass-override is set high enough).
启用在可用时将标题和副标题放置在黑色边框中,如果副标题是纯文本格式(或如果 --sub-ass-override 设置足够高,则为 ASS)。Default: yes. 默认:是。
- --sub-ass-use-video-data=<none|aspect-ratio|all>
Controls which information about the video stream is passed to libass. Any option but all is incompatible with standard ASS as defined by VSFilter, whose behavior most subtitle scripts and renderers target, including libass. Video stream properties are needed to accurately emulate VSFilter semantics and withholding them will likely result in broken subtitle rendering for most files. It's thus recommended to only change this selectively if required on a per-file basis.
控制哪些视频流信息传递给 libass。除 all 之外的所有选项都与 VSFilter 定义的标准 ASS 不兼容,而大多数字幕脚本和渲染器都针对此标准,包括 libass。视频流属性对于准确模拟 VSFilter 语义是必需的,省略它们可能会导致大多数文件的字幕渲染出现错误。因此,建议仅在必要时根据每个文件选择性更改此设置。none: Don't forward any video stream information.
不转发任何视频流信息。aspect-ratio: aspect-ratio: 宽高比 Only forward aspect ratio; fallbacks are used for other properties. This makes behavior consistent across different video resolutions.
仅前向宽高比;其他属性使用回退。这使行为在不同视频分辨率之间保持一致。all: Forward all available information, notably including storage resolution.
转发所有可用信息,特别是包括存储分辨率。For certain kinds of broken ASS files which got repurposed across several video resolutions without either setting LayoutRes headers or adjusting affected effects, it may be desirable to withhold storage resolution information from libass to ensure consistent rendering across resolutions. Among others this affects 3D rotations and blurs. When encountering such files, try setting aspect-ratio.
对于某些类型的损坏的 ASS 文件,这些文件在多个视频分辨率之间被重新用于不同用途,既没有设置 LayoutRes 头信息,也没有调整受影响的效果,可能需要从 libass 中抑制存储分辨率信息,以确保在不同分辨率下的一致渲染。其中,这影响了 3D 旋转和模糊。当遇到此类文件时,尝试设置 aspect-ratio 。Even more broken files on anamorphic video might also exhibit stretching unless aspect ratio information is also faked, in this case you can try using none. This has never an effect on non-anamorphic video.
在变形视频上的更多损坏文件也可能出现拉伸,除非也伪造了纵横比信息,在这种情况下,您可以尝试使用 none 。这永远不会对非变形视频产生影响。Default: all 默认: all
- --sub-ass-video-aspect-override=<no|ratio>
Allows passing any arbitrary aspect ratio to libass instead of the video’s actual aspect ratio. Zero aspect ratio is identical to no.
允许将任何任意纵横比传递给 libass,而不是视频的实际纵横比。零纵横比等同于 no 。This has no effect if sub-ass-use-video-data is set to none.
如果 sub-ass-use-video-data 设置为 none ,则此操作没有效果。- --sub-vsfilter-bidi-compat=<yes|no>
Set implicit bidi detection to ltr instead of auto to match ASS' default. This also disables libass' incompatible extensions. This currently includes bracket pair matching according to the revised Unicode Bidirectional Algorithm introduced in Unicode 6.3, and also affects how BiDi runs are split and processed, as well as soft linewrapping of Unicode text.
将隐式双向检测设置为 ltr 而不是 auto 以匹配 ASS 的默认设置。这还将禁用 libass 的不兼容扩展。这目前包括根据 Unicode 6.3 中引入的修订版 Unicode 双向算法进行的括号匹配,以及如何分割和处理 BiDi 运行,以及 Unicode 文本的软换行。This affects plaintext (non-ASS) subtitles only. Default: no.
这仅影响纯文本(非 ASS)字幕。默认:否。- --sub-ass-vsfilter-color-compat=<basic|full|force-601|no>
Mangle colors like (xy-)vsfilter do (default: basic). Historically, VSFilter was not color space aware. This was no problem as long as the color space used for SD video (BT.601) was used. But when everything switched to HD (BT.709), VSFilter was still converting RGB colors to BT.601, rendered them into the video frame, and handled the frame to the video output, which would use BT.709 for conversion to RGB. The result were mangled subtitle colors. Later on, bad hacks were added on top of the ASS format to control how colors are to be mangled.
像 (xy-)vsfilter 一样混淆颜色(默认:基本)。从历史上看,VSFilter 不具备色彩空间意识。只要使用的色彩空间是 SD 视频的 BT.601,这就没有问题。但当一切切换到 HD(BT.709)时,VSFilter 仍然将 RGB 颜色转换为 BT.601,将其渲染到视频帧中,并将帧处理到视频输出,该输出将使用 BT.709 进行 RGB 转换。结果是混乱的字幕颜色。后来,在 ASS 格式上添加了不良的补丁来控制颜色如何被混淆。basic: 基本: Handle only BT.601->BT.709 mangling, if the subtitles seem to indicate that this is required (default).
仅处理 BT.601->BT.709 乱码,如果字幕似乎表明需要这样做(默认)。full: 完整: Handle the full YCbCr Matrix header with all video color spaces supported by libass and mpv. This might lead to bad breakages in corner cases and is not strictly needed for compatibility (hopefully), which is why this is not default.
处理由 libass 和 mpv 支持的完整 YCbCr Matrix 头文件以及所有视频色彩空间。这可能导致在边缘情况下出现不良的断裂,并且对于兼容性(希望如此)来说并非严格必需,这就是为什么这不是默认设置的原因。force-601: Force BT.601->BT.709 mangling, regardless of subtitle headers or video color space.
强制 BT.601->BT.709 混淆,无论字幕标题或视频色彩空间如何。no: no: Disable color mangling completely. All colors are RGB.
完全禁用色彩混淆。所有颜色均为 RGB。Choosing anything other than no will make the subtitle color depend on the video color space, and it's for example in theory not possible to reuse a subtitle script with another video file. The --sub-ass-override option doesn't affect how this option is interpreted.
选择除 no 之外的内容将使字幕颜色取决于视频色彩空间,例如在理论上不可能重复使用字幕脚本与另一个视频文件。 --sub-ass-override 选项不会影响此选项的解释方式。- --stretch-dvd-subs=<yes|no>
Stretch DVD subtitles when playing anamorphic videos for better looking fonts on badly mastered DVDs. This switch has no effect when the video is stored with square pixels - which for DVD input cannot be the case though.
播放变形视频时拉伸 DVD 字幕,以在制作不佳的 DVD 上获得更好的字体外观。当视频以方形像素存储时,此开关没有效果——尽管对于 DVD 输入来说,这种情况不可能发生。Many studios tend to use bitmap fonts designed for square pixels when authoring DVDs, causing the fonts to look stretched on playback on DVD players. This option fixes them, however at the price of possibly misaligning some subtitles (e.g. sign translations).
许多工作室在制作 DVD 时倾向于使用为方形像素设计的位图字体,导致字体在 DVD 播放器上播放时看起来被拉伸。此选项可以修复它们,然而可能会造成一些字幕(例如标志翻译)对齐错误。Disabled by default. 默认禁用。
- --stretch-image-subs-to-screen=<yes|no>
Stretch DVD and other image subtitles to the screen, ignoring the video margins. This has a similar effect as --sub-use-margins for text subtitles, except that the text itself will be stretched, not only just repositioned. (At least in general it is unavoidable, as an image bitmap can in theory consist of a single bitmap covering the whole screen, and the player won't know where exactly the text parts are located.)
将 DVD 和其他图像字幕拉伸到屏幕上,忽略视频边距。这与 --sub-use-margins 对文本字幕的效果相似,但文本本身将被拉伸,而不仅仅是重新定位。(至少在一般情况下是不可避免的,因为图像位图理论上可以由一个覆盖整个屏幕的单个位图组成,播放器不知道文本部分的确切位置。)This option does not display subtitles correctly. Use with care.
此选项无法正确显示字幕。请谨慎使用。Disabled by default. 默认禁用。
- --image-subs-video-resolution=<yes|no>
- Override the image subtitle resolution with the video resolution
(default: no). Normally, the subtitle canvas is fit into the video canvas
(e.g. letterboxed). Setting this option uses the video size as subtitle
canvas size. Can be useful to test broken subtitles, which often happen
when the video was transcoded, while attempting to keep the old subtitles.
用视频分辨率覆盖图像字幕分辨率(默认:否)。通常,字幕画布会适应视频画布(例如,信封式)。设置此选项使用视频大小作为字幕画布大小。在尝试保留旧字幕的同时测试损坏的字幕可能很有用,这种情况通常发生在视频转码时。 - --sub-ass=<yes|no>
Render ASS subtitles natively (default: yes).
本地渲染 ASS 字幕(默认:是)。Note 注意
This has been deprecated by --sub-ass-override=strip. You also may need --embeddedfonts=no to get the same behavior. Also, using --sub-ass-override=style should give better results without breaking subtitles too much.
此功能已被 --sub-ass-override=strip 弃用。您可能还需要 --embeddedfonts=no 以获得相同的行为。此外,使用 --sub-ass-override=style 应该会提供更好的结果,而不会过多地破坏字幕。If --sub-ass=no is specified, all tags and style declarations are stripped and ignored on display. The subtitle renderer uses the font style as specified by the --sub- options instead.
"如果指定了 --sub-ass=no ,则在显示时将删除所有标签和样式声明并忽略它们。字幕渲染器使用 --sub- 选项中指定的字体样式。Note 注意
Using --sub-ass=no may lead to incorrect or completely broken rendering of ASS/SSA subtitles. It can sometimes be useful to forcibly override the styling of ASS subtitles, but should be avoided in general.
使用 --sub-ass=no 可能会导致 ASS/SSA 字幕渲染错误或完全损坏。有时强制覆盖 ASS 字幕的样式可能有用,但通常应避免使用。- --sub-auto=<no|exact|fuzzy|all>
Load additional subtitle files matching the video filename. The parameter specifies how external subtitle files are matched. exact is enabled by default.
加载与视频文件名匹配的附加字幕文件。该参数指定外部字幕文件如何匹配。 exact 默认启用。no: no: Don't automatically load external subtitle files.
不要自动加载外部字幕文件。exact: exact: Load the media filename with subtitle file extension and possibly language suffixes (default).
加载带有字幕文件扩展名和可能的语言后缀的媒体文件名(默认)。fuzzy: Load all subs containing the media filename.
加载所有包含媒体文件名的子文件。all: Load all subs in the current and --sub-file-paths directories.
加载当前目录和 --sub-file-paths 目录中的所有子文件。- --sub-auto-exts=ext1,ext2,...
Subtitle extensions to try and match when using --sub-auto. Note that modifying this list will also affect what mpv recognizes as subtitles when using drag and drop.
当使用 --sub-auto 时尝试匹配的子标题扩展名。请注意,修改此列表也将影响使用拖放时 mpv 识别为子标题的内容。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。- --sub-codepage=<codepage>
You can use this option to specify the subtitle codepage. uchardet will be used to guess the charset. (If mpv was not compiled with uchardet, then utf-8 is the effective default.)
您可以使用此选项来指定副标题代码页。uchardet 将用于猜测字符集。(如果 mpv 未使用 uchardet 编译,则 utf-8 是有效默认值。)The default value for this option is auto, which enables autodetection.
此选项的默认值为 auto ,启用自动检测。The following steps are taken to determine the final codepage, in order:
以下步骤按顺序用于确定最终代码页:- if the specific codepage has a +, use that codepage
如果特定的代码页有 + ,则使用该代码页 - if the data looks like UTF-8, assume it is UTF-8
如果数据看起来像 UTF-8,则假定它是 UTF-8 - if --sub-codepage is set to a specific codepage, use that
如果 --sub-codepage 设置为特定的代码页,则使用该代码页 - run uchardet, and if successful, use that
运行 uchardet,如果成功,则使用该工具 - otherwise, use UTF-8-BROKEN 否则,使用 UTF-8-BROKEN
Examples 示例
- --sub-codepage=latin2 Use Latin 2 if input is not UTF-8.
--sub-codepage=latin2 使用拉丁 2,如果输入不是 UTF-8。 - --sub-codepage=+cp1250 Always force recoding to cp1250.
--sub-codepage=+cp1250 总是强制重新编码为 cp1250。
The pseudo codepage UTF-8-BROKEN is used internally. If it's set, subtitles are interpreted as UTF-8 with "Latin 1" as fallback for bytes which are not valid UTF-8 sequences. iconv is never involved in this mode.
伪代码页 UTF-8-BROKEN 在内部使用。如果已设置,字幕将被解释为 UTF-8,对于不是有效的 UTF-8 序列的字节,将使用“拉丁 1”作为后备。在此模式下,iconv 从不参与。Note 注意
This works for text subtitle files only. Other types of subtitles (in particular subtitles in mkv files) are always assumed to be UTF-8.
仅适用于文本字幕文件。其他类型的字幕(特别是 mkv 文件中的字幕)始终假定是 UTF-8。- if the specific codepage has a +, use that codepage
- --sub-stretch-durations=<yes|no>
Stretch a subtitle duration so it ends when the next one starts. Should help with subtitles which erroneously have zero durations.
拉伸字幕时长,使其在下一个字幕开始时结束。这有助于解决错误地具有零时长的字幕。Note 注意
Only applies to text subtitles.
仅适用于文本字幕。- --sub-fix-timing=<yes|no>
- Adjust subtitle timing is to remove minor gaps or overlaps between
subtitles (if the difference is smaller than 210 ms, the gap or overlap
is removed).
调整副标题时间是为了消除副标题之间的微小间隔或重叠(如果差异小于 210 毫秒,则间隔或重叠将被消除)。 - --sub-forced-events-only=<yes|no>
- Enabling this displays only forced events within subtitle streams. Only
some bitmap subtitle formats (such as DVD or PGS) are capable of having a
mixture of forced and unforced events within the stream. Enabling this on
text subtitles will cause no subtitles to be displayed (default: no).
启用此功能将仅显示字幕流中的强制事件。只有一些位图字幕格式(如 DVD 或 PGS)能够在流中混合强制和非强制事件。在文本字幕上启用此功能将不会显示任何字幕(默认: no )。 - --sub-fps=<rate>
Specify the framerate of the subtitle file (default: video fps). Affects text subtitles only.
指定字幕文件的帧率(默认:视频帧率)。仅影响文本字幕。Note 注意
<rate> > video fps speeds the subtitles up for frame-based subtitle files and slows them down for time-based ones.
<rate> > 视频帧率调整字幕速度,对于基于帧的字幕文件加快速度,对于基于时间的字幕文件减慢速度。See also: --sub-speed. 另请参阅: --sub-speed 。
- --sub-gauss=<0.0-3.0>
Apply Gaussian blur to image subtitles (default: 0). This can help to make pixelated DVD/Vobsubs look nicer. A value other than 0 also switches to software subtitle scaling. Might be slow.
将高斯模糊应用于图像字幕(默认:0)。这可以帮助使像素化的 DVD/Vobsubs 看起来更美观。非 0 值也会切换到软件字幕缩放。可能会较慢。Note 注意
Never applied to text subtitles.
从未应用于文本字幕。- --sub-gray
Convert image subtitles to grayscale. Can help to make yellow DVD/Vobsubs look nicer.
将图像字幕转换为灰度。有助于使黄色 DVD/Vob 字幕看起来更美观。Note 注意
Never applied to text subtitles.
从未应用于文本字幕。- --sub-file-paths=<path-list>
Specify extra directories to search for subtitles matching the video. Multiple directories can be separated by ":" (";" on Windows). Paths can be relative or absolute. Relative paths are interpreted relative to video file directory. If the file is a URL, only absolute paths and sub configuration subdirectory will be scanned.
指定额外的目录以搜索与视频匹配的字幕。多个目录可以用 ":" (在 Windows 上为 ";") 分隔。路径可以是相对的或绝对的。相对路径相对于视频文件目录进行解释。如果文件是 URL,则仅扫描绝对路径和 sub 配置子目录。Example 示例
Assuming that /path/to/video/video.avi is played and --sub-file-paths=sub:subtitles is specified, mpv searches for subtitle files in these directories:
假设 /path/to/video/video.avi 正在播放且 --sub-file-paths=sub:subtitles 已指定,mpv 将在这些目录中搜索字幕文件:- /path/to/video/
- /path/to/video/sub/
- /path/to/video/subtitles/
- the sub configuration subdirectory (usually ~/.config/mpv/sub/)
的 sub 配置子目录(通常是 ~/.config/mpv/sub/ )
This is a path list option. See List Options for details.
这是一个路径列表选项。有关详细信息,请参阅列表选项。- --sub-visibility=<yes|no>
- Can be used to disable display of subtitles, but still select and decode
them.
可用于禁用显示字幕,但仍然可以选择和解码它们。 - --secondary-sub-visibility=<yes|no>
- Can be used to disable display of secondary subtitles, but still select and
decode them.
可用于禁用显示辅助字幕,但仍然可以选择和解码它们。 - --sub-clear-on-seek
- (Obscure, rarely useful.) Can be used to play broken mkv files with
duplicate ReadOrder fields. ReadOrder is the first field in a
Matroska-style ASS subtitle packets. It should be unique, and libass
uses it for fast elimination of duplicates. This option disables caching
of subtitles across seeks, so after a seek libass can't eliminate subtitle
packets with the same ReadOrder as earlier packets. Note that enabling this
option can result in broken subtitle behavior if you are not actually
playing one of the aforementioned broken mkv files.
(晦涩,很少有用。) 可用于播放具有重复 ReadOrder 字段的损坏的 mkv 文件。ReadOrder 是 Matroska 风格的 ASS 字幕数据包中的第一个字段。它应该是唯一的,libass 使用它来快速消除重复项。此选项禁用跨搜索的标题缓存,因此搜索后 libass 无法消除具有与早期数据包相同 ReadOrder 的标题数据包。请注意,如果您实际上没有播放上述损坏的 mkv 文件,启用此选项可能会导致损坏的字幕行为。 - --teletext-page=<-1-999>
Select a teletext page number to decode.
选择要解码的图文电视页面编号。This works for dvb_teletext subtitle streams, and if FFmpeg has been compiled with support for it.
这对于 dvb_teletext 字幕流有效,并且如果 FFmpeg 已编译支持它的话。Values 1-999 are for individual pages. Special value 0 (default) matches all subtitle pages. Special value -1 matches all pages.
值 1-999 是针对单个页面的。特殊值 0 (默认值)匹配所有字幕页面。特殊值 -1 匹配所有页面。Note that page 100 is the default start page of actual teletext. It is also the former default value of this option.
请注意,页面 100 是实际图文电视的默认起始页面。它也是此选项的旧默认值。See the libzvbi-teletext section in FFmpeg documentation for details.
请参阅 FFmpeg 文档中的 libzvbi-teletext 部分以获取详细信息。Default: 0 默认:0
- --sub-past-video-end
After the last frame of video, if this option is enabled, subtitles will continue to update based on audio timestamps. Otherwise, the subtitles for the last video frame will stay onscreen.
在视频最后一帧之后,如果启用此选项,字幕将根据音频时间戳继续更新。否则,最后一帧的视频字幕将保持在屏幕上。Default: disabled 默认:禁用
- --sub-font=<name>
Specify font to use for subtitles that do not themselves specify a particular font. The default is sans-serif.
指定用于没有指定特定字体的字幕的字体。默认为 sans-serif 。Examples 示例
- --sub-font='Bitstream Vera Sans'
- --sub-font='Comic Sans MS'
Note 注意
The --sub-font option (and many other style related --sub- options) are ignored when ASS-subtitles are rendered, unless --sub-ass=no is specified.
当渲染 ASS 字幕时, --sub-font 选项(以及许多其他与样式相关的 --sub- 选项)将被忽略,除非指定 --sub-ass=no 。This used to support fontconfig patterns. Starting with libass 0.13.0, this stopped working.
这曾经支持 fontconfig 模式。从 libass 0.13.0 版本开始,这不再工作。- --sub-font-size=<size>
Specify the sub font size. The unit is the size in scaled pixels at a window height of 720. The actual pixel size is scaled with the window height: if the window height is larger or smaller than 720, the actual size of the text increases or decreases as well.
指定子字体大小。单位是窗口高度为 720 时的缩放像素大小。实际像素大小会根据窗口高度进行缩放:如果窗口高度大于或小于 720,文本的实际大小也会相应增加或减少。Default: 38 默认:38
- --sub-blur=<0..20.0>
- Gaussian blur factor applied to the sub font border.
0 means no blur applied (default).
应用于子字体边框的高斯模糊因子。0 表示不应用模糊(默认)。 - --sub-bold=<yes|no>
- Format text on bold.
加粗格式化文本。 - --sub-italic=<yes|no>
- Format text on italic.
斜体格式化文本。 - --sub-outline-color=<color>
See --sub-color. Color used for the sub font outline.
查看 --sub-color 。 用于子字体轮廓的颜色。--sub-border-color is an alias for --sub-outline-color.
--sub-border-color 是 --sub-outline-color 的别名。- --sub-back-color=<color>
See --sub-color. Color used for sub text background.
查看 --sub-color 。用于子文本背景的颜色。--sub-shadow-color is an alias for --sub-back-color.
--sub-shadow-color 是 --sub-back-color 的别名。- --sub-outline-size=<size>
Size of the sub font outline in scaled pixels (see --sub-font-size for details). A value of 0 disables outlines.
子字体轮廓的缩放像素大小(详细信息请见 --sub-font-size )。值为 0 禁用轮廓。--sub-border-size is an alias for --sub-outline-size.
--sub-border-size 是 --sub-outline-size 的别名。Default: 1.65 默认:1.65
- --sub-border-style=<outline-and-shadow|opaque-box|background-box>
The style of the border.
边框的样式。- outline-and-shadow: draw outline and shadow.
The size of the outline is determined by --sub-outline-size,
and the offset of the shadow is determined by --sub-shadow-offset.
The outline is colored by --sub-outline-color,
and the shadow is colored by --sub-back-color.
This corresponds to BorderStyle=1 in the ASS spec.
outline-and-shadow : 绘制轮廓和阴影。轮廓的大小由 --sub-outline-size 决定,阴影的偏移由 --sub-shadow-offset 决定。轮廓的颜色由 --sub-outline-color 决定,阴影的颜色由 --sub-back-color 决定。这对应于 ASS 规范中的 BorderStyle=1 。 - opaque-box: draw outline and shadow as opaque boxes that tightly wrap each lines of text.
The margin of the outline opaque box is determined by --sub-outline-size,
and the offset of the shadow opaque box is determined by --sub-shadow-offset.
The outline opaque box is colored by --sub-outline-color,
and the shadow opaque box is colored by --sub-back-color.
Despite its name, the opaque box can be semi-transparent.
This corresponds to BorderStyle=3 in the ASS spec.
opaque-box :绘制不透明边框和阴影作为紧密包裹每行文本的矩形框。边框不透明矩形的边距由 --sub-outline-size 确定,阴影不透明矩形的偏移由 --sub-shadow-offset 确定。边框不透明矩形由 --sub-outline-color 着色,阴影不透明矩形由 --sub-back-color 着色。尽管其名称如此,不透明矩形可以是半透明的。这对应于 ASS 规范中的 BorderStyle=3 。 - background-box: draw a background box that bounds all lines of text.
The background box is colored by --sub-back-color,
and the margin of the background box is determined by --sub-shadow-offset.
The behavior of the outline is the same as the outline-and-shadow style.
This corresponds to BorderStyle=4, which is a libass-specific extension.
background-box : 绘制一个包含所有文本行的背景框。背景框的颜色由 --sub-back-color 决定,背景框的边距由 --sub-shadow-offset 确定。轮廓的行为与 outline-and-shadow 风格相同。这对应于 BorderStyle=4 ,它是 libass 特定的扩展。
Default: outline-and-shadow. 默认值: outline-and-shadow 。
Predefined profiles are available to enable optimized background-box style for OSD and subtitles.
提供预定义配置文件,以启用针对 OSD 和字幕的优化 background-box 风格。Profiles 配置文件
- --profile=sub-box applies the background-box style to subtitles
--profile=sub-box 应用 background-box 样式到字幕 - --profile=osd-box applies the background-box style to the OSD,
including stats and console
--profile=osd-box 应用 background-box 样式到 OSD,包括统计数据和控制台 - --profile=box applies the background-box style to both subtitles and OSD
--profile=box 应用 background-box 样式到字幕和 OSD
- outline-and-shadow: draw outline and shadow.
The size of the outline is determined by --sub-outline-size,
and the offset of the shadow is determined by --sub-shadow-offset.
The outline is colored by --sub-outline-color,
and the shadow is colored by --sub-back-color.
This corresponds to BorderStyle=1 in the ASS spec.
- --sub-color=<color>
Specify the color used for unstyled text subtitles.
指定未应用样式的字幕使用的颜色。The color is specified in the form r/g/b, where each color component is specified as number in the range 0.0 to 1.0. It's also possible to specify the transparency by using r/g/b/a, where the alpha value 0 means fully transparent, and 1.0 means opaque. If the alpha component is not given, the color is 100% opaque.
颜色以 r/g/b 的形式指定,其中每个颜色分量以 0.0 到 1.0 范围内的数字指定。还可以通过使用 r/g/b/a 来指定透明度,其中 alpha 值 0 表示完全透明,1.0 表示不透明。如果未给出 alpha 分量,则颜色为 100% 不透明。Passing a single number to the option sets the sub to gray, and the form gray/a lets you specify alpha additionally.
将单个数字传递给选项将子设置为灰色,并且形式 gray/a 允许您额外指定 alpha。Examples 示例
- --sub-color=1.0/0.0/0.0 set sub to opaque red
--sub-color=1.0/0.0/0.0 将子对象设置为不透明红色 - --sub-color=1.0/0.0/0.0/0.75 set sub to opaque red with 75% alpha
--sub-color=1.0/0.0/0.0/0.75 将子设置为带有 75% 透明度的不透明红色 - --sub-color=0.5/0.75 set sub to 50% gray with 75% alpha
--sub-color=0.5/0.75 将子对象设置为 50%灰色,透明度为 75%
Alternatively, the color can be specified as a RGB hex triplet in the form #RRGGBB, where each 2-digit group expresses a color value in the range 0 (00) to 255 (FF). For example, #FF0000 is red. Alpha is given with #AARRGGBB.
或者,颜色可以指定为 RGB 十六进制三元组的形式 #RRGGBB ,其中每个两位组表示一个颜色值,范围在 0( 00 )到 255( FF )。例如, #FF0000 是红色。透明度用 #AARRGGBB 表示。Examples 示例
- --sub-color='#FF0000' set sub to opaque red
--sub-color='#FF0000' 将子对象设置为不透明红色 - --sub-color='#C0808080' set sub to 50% gray with 75% alpha
--sub-color='#C0808080' 将子对象设置为 50%灰色,透明度为 75%
- --sub-color=1.0/0.0/0.0 set sub to opaque red
- --sub-margin-x=<size>
Left and right screen margin for the subs in scaled pixels (see --sub-font-size for details).
子标题在缩放像素中的左右屏幕边距(见 --sub-font-size 获取详细信息)。This option specifies the distance of the sub to the left, as well as at which distance from the right border long sub text will be broken.
此选项指定子标题到左边的距离,以及长子标题文本将在哪个距离处从右边框断开。Default: 19 默认:19
- --sub-margin-y=<size>
Top and bottom screen margin for the subs in scaled pixels (see --sub-font-size for details).
子标题在缩放像素中的上下屏幕边距(见 --sub-font-size 获取详细信息)。This option specifies the vertical margins of unstyled text subtitles. If you just want to raise the vertical subtitle position, use --sub-pos.
此选项指定未加样式的文本字幕的垂直边距。如果您只想提高垂直字幕位置,请使用 --sub-pos 。Default: 34 默认:34
- --sub-align-x=<left|center|right>
Control to which corner of the screen text subtitles should be aligned to (default: center).
控制文本字幕应对齐到屏幕的哪个角落(默认: center )。Never applied to ASS subtitles, except in --sub-ass=no mode. Likewise, this does not apply to image subtitles.
在 --sub-ass=no 模式下除外,从不应用于 ASS 字幕。同样,这也不适用于图像字幕。- --sub-align-y=<top|center|bottom>
- Vertical position (default: bottom).
Details see --sub-align-x.
垂直位置(默认: bottom )。详细信息请参阅 --sub-align-x 。 - --sub-justify=<auto|left|center|right>
- Control how multi line subs are justified irrespective of where they
are aligned (default: auto which justifies as defined by
--sub-align-x).
Left justification is recommended to make the subs easier to read
as it is easier for the eyes.
控制多行子标题的居中对齐方式,无论它们对齐在哪里(默认: auto 按照定义的 --sub-align-x 居中对齐)。建议使用左对齐,以便使子标题更容易阅读,因为这对眼睛来说更容易。 - --sub-ass-justify=<yes|no>
- Applies justification as defined by --sub-justify on ASS subtitles
if --sub-ass-override is not set to no.
Default: no.
如果 --sub-ass-override 未设置为 no ,则应用由 --sub-justify 定义的对齐方式于 ASS 子标题。默认: no 。 - --sub-shadow-offset=<size>
Displacement of the sub text shadow in scaled pixels (see --sub-font-size for details). A value of 0 disables shadows.
子标题阴影在缩放像素中的位移(详细信息请参阅 --sub-font-size )。值为 0 禁用阴影。Default: 0. 默认值:0。
- --sub-spacing=<size>
Horizontal sub font spacing in scaled pixels (see --sub-font-size for details). This value is added to the normal letter spacing. Negative values are allowed.
缩放像素中的子标题水平字体间距(详细信息请参阅 --sub-font-size )。此值将添加到正常字母间距。允许负值。Default: 0. 默认值:0。
- --sub-filter-sdh=<yes|no>
Applies filter removing subtitle additions for the deaf or hard-of-hearing (SDH). This is intended for English, but may in part work for other languages too. The intention is that it can be always enabled so may not remove all parts added.
应用过滤器以移除为听障或听力受损者添加的字幕(SDH)。此功能旨在用于英语,但部分情况下也可能适用于其他语言。目的是始终启用此功能,因此可能不会移除所有添加的部分。It removes speaker labels (like MAN:) and any text enclosed within symbols like parentheses or brackets as specified by the --sub-filter-sdh-enclosures option. Note that parenthesis (full width parenthesis and the normal variant) are a special case and only upper case text is removed. For more filtering, you can use the --sub-filter-sdh-harder option.
它移除说话人标签(如 MAN:)以及由 --sub-filter-sdh-enclosures 选项指定的括号或方括号内的任何文本。请注意,括号(全角括号和正常变体)是一个特殊情况,仅移除大写文本。为了进行更多过滤,您可以使用 --sub-filter-sdh-harder 选项。Default: no. 默认值: no 。
- --sub-filter-sdh-harder=<yes|no>
Do harder SDH filtering (if enabled by --sub-filter-sdh). Will also remove speaker labels and text within parentheses using both lower and upper case letters.
执行更严格的 SDH 滤波(如果由 --sub-filter-sdh 启用)。还将使用大小写字母同时移除说话者标签和括号内的文本。Default: no. 默认值: no 。
- --sub-filter-sdh-enclosures=<string>
Specify a string of characters that --sub-filter-sdh will use to potentially remove text. Text that is enclosed within characters specified by this string will be removed. Note that bracket characters with known pairs (such as ( or [) will be mapped internally to their matching right hand character, so you only need to specify left hand characters.
指定 --sub-filter-sdh 将用于可能移除文本的字符序列。该序列指定的字符内的文本将被移除。请注意,具有已知配对的括号字符(如 ( 或 [ )将内部映射到其匹配的右字符,因此您只需指定左字符。Default: ([(. 默认值: ([( 。
- --sub-filter-regex-...=...
Set a list of regular expressions to match on text subtitles, and remove any lines that match (default: empty). This is a string list option. See List Options for details. Normally, you should use --sub-filter-regex-append=<regex>, where each option use will append a new regular expression, without having to fight escaping problems.
设置一个用于匹配文本副标题的正则表达式列表,并删除任何匹配的行(默认:空)。这是一个字符串列表选项。有关详细信息,请参阅列表选项。通常,您应该使用 --sub-filter-regex-append=<regex> ,其中每个选项的使用都会追加一个新的正则表达式,无需解决转义问题。List items are matched in order. If a regular expression matches, the process is stopped, and the subtitle line is discarded. The text matched against is, by default, the Text field of ASS events (if the subtitle format is different, it is always converted). This may include formatting tags. Matching is case-insensitive, but how this is done depends on the libc, and most likely works in ASCII only. It does not work on bitmap/image subtitles. Unavailable on inferior OSes (requires POSIX regex support).
列表项按顺序匹配。如果正则表达式匹配,则停止处理,并丢弃字幕行。默认情况下,匹配的文本是 ASS 事件的 Text 字段(如果字幕格式不同,则始终转换)。这可能包括格式化标签。匹配不区分大小写,但这是如何实现的取决于 libc,并且很可能仅在 ASCII 上工作。它不适用于位图/图像字幕。在低级操作系统上不可用(需要 POSIX 正则表达式支持)。Example 示例
--sub-filter-regex-append=opensubtitles\.org filters some ads. --sub-filter-regex-append=opensubtitles\.org 过滤一些广告。
Technically, using a list for matching is redundant, since you could just use a single combined regular expression. But it helps with diagnosis, ease of use, and temporarily disabling or enabling individual filters.
从技术上讲,使用列表进行匹配是多余的,因为你完全可以只用一个组合的正则表达式。但这有助于诊断、使用方便,以及临时禁用或启用单个过滤器。Warning 警告
This is experimental. The semantics most likely will change, and if you use this, you should be prepared to update the option later. Ideas include replacing the regexes with a very primitive and small subset of sed, or some method to control case-sensitivity.
这是实验性的。语义最有可能会改变,如果你使用这个,你应该准备好稍后更新选项。想法包括用一个非常原始且小的 sed 子集替换正则表达式,或者某种控制大小写敏感性的方法。- --sub-filter-jsre-...=...
- Same as --sub-filter-regex but with JavaScript regular expressions.
Shares/affected-by all --sub-filter-regex-* control options (see below),
and also experimental. Requires only JavaScript support.
与 --sub-filter-regex 相同,但使用 JavaScript 正则表达式。共享/受 --sub-filter-regex-* 控制选项的影响(见下文),也是实验性的。只需要 JavaScript 支持。 - --sub-filter-regex-plain=<yes|no>
- Whether to first convert the ASS "Text" field to plain-text (default: no).
This strips ASS tags and applies ASS directives, like \N to new-line.
If the result is multi-line then the regexp anchors ^ and $ match
each line, but still any match discards all lines.
是否首先将 ASS "文本"字段转换为纯文本(默认:否)。这将去除 ASS 标签并应用 ASS 指令,如 \N 到换行。如果结果是多行,则正则表达式锚点 ^ 和 $ 匹配每一行,但任何匹配都将丢弃所有行。 - --sub-filter-regex-warn=<yes|no>
- Log dropped lines with warning log level, instead of verbose (default: no).
Helpful for testing.
以警告日志级别记录丢弃的行,而不是详细(默认:否)。有助于测试。 - --sub-filter-regex-enable=<yes|no>
- Whether to enable regex filtering (default: yes). Note that if no regexes
are added to the --sub-filter-regex list, setting this option to yes
has no effect. It's meant to easily disable or enable filtering
temporarily.
是否启用正则表达式过滤(默认:是)。注意,如果没有将正则表达式添加到 --sub-filter-regex 列表中,将此选项设置为 yes 没有效果。它旨在轻松暂时禁用或启用过滤。 - --sub-create-cc-track=<yes|no>
For every video stream, create a closed captions track (default: no). The only purpose is to make the track available for selection at the start of playback, instead of creating it lazily. This applies only to ATSC A53 Part 4 Closed Captions (displayed by mpv as subtitle tracks using the codec eia_608). The CC track is marked "default" and selected according to the normal subtitle track selection rules. You can then use --sid to explicitly select the correct track too.
为每个视频流创建一个字幕轨道(默认:否)。唯一目的是在播放开始时使轨道可供选择,而不是懒加载创建。这仅适用于 ATSC A53 Part 4 Closed Captions (由 mpv 使用编码器 eia_608 显示为字幕轨道)。CC 轨道被标记为“默认”并按照正常的字幕轨道选择规则进行选择。然后您可以使用 --sid 显式选择正确的轨道。If the video stream contains no closed captions, or if no video is being decoded, the CC track will remain empty and will not show any text.
如果视频流不包含字幕,或者没有视频正在解码,CC 轨道将保持为空,不会显示任何文本。- --sub-font-provider=<auto|none|fontconfig>
Which libass font provider backend to use (default: auto). auto will attempt to use the native font provider: fontconfig on Linux, CoreText on macOS, DirectWrite on Windows. fontconfig forces fontconfig, if libass was built with support (if not, it behaves like none).
要使用哪个 libass 字体提供程序后端(默认:自动)。 auto 将尝试使用本地字体提供程序:Linux 上的 fontconfig,macOS 上的 CoreText,Windows 上的 DirectWrite。 fontconfig 强制使用 fontconfig,如果 libass 构建时支持(如果不支持,则行为类似于 none )。The none font provider effectively disables system fonts. It will still attempt to use embedded fonts (unless --embeddedfonts=no is set; this is the same behavior as with all other font providers), subfont.ttf if provided, and fonts in the fonts sub-directory if provided. (The fallback is more strict than that of other font providers, and if a font name does not match, it may prefer not to render any text that uses the missing font.)
none 字体提供程序有效地禁用了系统字体。它仍然会尝试使用嵌入字体(除非 --embeddedfonts=no 设置;这与所有其他字体提供程序的行为相同),如果提供,则使用 subfont.ttf ,如果提供,则使用 fonts 子目录中的字体。(后备机制比其他字体提供程序更严格,如果字体名称不匹配,它可能不会渲染使用缺失字体的任何文本。)- --sub-fonts-dir=<path>
Font files in this directory are used by mpv/libass for subtitles. Useful if you do not want to install fonts to your system. Note that files in this directory are loaded into memory before being used by mpv. If you have a lot of fonts, consider using fonts.conf (see FILES section) to include additional mpv user settings.
此目录中的字体文件由 mpv/libass 用于字幕。如果您不想在系统上安装字体,则很有用。请注意,在 mpv 使用之前,此目录中的文件将被加载到内存中。如果您有很多字体,请考虑使用 fonts.conf(参见文件部分)以包含额外的 mpv 用户设置。If this option is not specified, ~~/fonts will be used by default.
如果未指定此选项,则默认使用 ~~/fonts 。
Window 窗口
- --title=<string>
Set the window title. This is used for the video window, and if possible, also sets the audio stream title.
设置窗口标题。这用于视频窗口,如果可能,也设置音频流标题。Properties are expanded. (See Property Expansion.)
属性已展开。(见属性展开。)Warning 警告
There is a danger of this causing significant CPU usage, depending on the properties used. Changing the window title is often a slow operation, and if the title changes every frame, playback can be ruined.
这可能会因为使用的属性而引起显著的 CPU 使用风险。更改窗口标题通常是一个耗时的操作,如果每帧都更改标题,播放可能会被破坏。- --screen=<default|0-32>
In multi-monitor configurations (i.e. a single desktop that spans across multiple displays), this option tells mpv which screen to display the video on.
在多显示器配置(即跨越多个显示器的单个桌面)中,此选项告诉 mpv 在哪个屏幕上显示视频。Note (X11) 注意(X11)
This option does not work properly with all window managers. In these cases, you can try to use --geometry to position the window explicitly. It's also possible that the window manager provides native features to control which screens application windows should use.
此选项可能无法与所有窗口管理器正常工作。在这些情况下,您可以尝试使用 --geometry 来显式定位窗口。也有可能窗口管理器提供了原生功能来控制应用程序窗口应使用哪些屏幕。Note (Wayland) 注意(Wayland)
This option does not actually work on wayland since window placement is not allowed. However setting this option does influence mpv's initial guess at finding an output which may be useful for options like --geometry or --autofit which depend on the monitor resolution.
此选项实际上在 wayland 上不起作用,因为不允许窗口放置。然而,设置此选项会影响 mpv 对输出查找的初始猜测,这可能对依赖于显示器分辨率的选项如 --geometry 或 --autofit 很有用。See also --fs-screen. 另请参阅 --fs-screen 。
- --screen-name=<string>
- In multi-monitor configurations, this option tells mpv which screen to
display the video on based on the screen name from the video backend. The
same caveats in the --screen option also apply here. This option is
ignored and does nothing if --screen is explicitly set.
在多显示器配置中,此选项告诉 mpv 根据视频后端的屏幕名称在哪个屏幕上显示视频。 --screen 选项中的相同注意事项也适用于此处。如果显式设置了 --screen ,则此选项将被忽略且不执行任何操作。 - --fullscreen, --fs
- Fullscreen playback. 全屏播放。
- --fs-screen=<all|current|0-32>
In multi-monitor configurations (i.e. a single desktop that spans across multiple displays), this option tells mpv which screen to go fullscreen to. If current is used mpv will fallback on what the user provided with the screen option.
在多显示器配置(即跨越多个显示器的单个桌面)中,此选项告诉 mpv 切换到哪个屏幕全屏。如果使用 current ,mpv 将回退到用户通过 screen 选项提供的设置。Note (X11) 注意(X11)
This option works properly only with window managers which understand the EWMH _NET_WM_FULLSCREEN_MONITORS hint.
此选项仅在理解 EWMH _NET_WM_FULLSCREEN_MONITORS 提示的窗口管理器中正常工作。Note (macOS) 注意(macOS)
all does not work on macOS and will behave like current.
all 在 macOS 上不工作,将表现得像 current 。See also --screen. 另请参阅 --screen 。
- --fs-screen-name=<string>
- In multi-monitor configurations, this option tells mpv which screen to go
fullscreen to based on the screen name from the video backend. The same
caveats in the --fs-screen option also apply here. This option is
ignored and does nothing if --fs-screen is explicitly set.
在多显示器配置中,此选项告诉 mpv 基于视频后端的屏幕名称将哪个屏幕全屏显示。 --fs-screen 选项中的相同注意事项也适用于此处。如果 --fs-screen 被显式设置,则此选项将被忽略,并且不会执行任何操作。当尝试在文件末尾之外进行搜索时,播放器将尝试搜索到最后一个帧。 - --keep-open=<yes|no|always>
Do not terminate when playing or seeking beyond the end of the file, and there is no next file to be played (and --loop is not used). Instead, pause the player. When trying to seek beyond end of the file, the player will attempt to seek to the last frame.
在播放或搜索到文件末尾之外时不要终止,并且没有下一个要播放的文件(并且 --loop 未使用)。相反,暂停播放器。当尝试在文件末尾之外进行搜索时,播放器将尝试搜索到最后一个帧。Normally, this will act like set pause yes on EOF, unless the --keep-open-pause=no option is set.
通常,这将在 EOF 上表现得像 set pause yes ,除非设置了 --keep-open-pause=no 选项。The following arguments can be given:
以下是可以提供的参数:no: no: If the current file ends, go to the next file or terminate. (Default.)
如果当前文件结束,则转到下一个文件或终止。(默认。)yes: Don't terminate if the current file is the last playlist entry. Equivalent to --keep-open without arguments.
如果当前文件是最后一个播放列表条目,则不要终止。等同于 --keep-open 无参数时。always: 始终: Like yes, but also applies to files before the last playlist entry. This means playback will never automatically advance to the next file.
类似于 yes ,但同时也适用于最后一个播放列表条目之前的文件。这意味着播放将永远不会自动跳转到下一个文件。Note 注意
This option is not respected when using --frames. Explicitly skipping to the next file if the binding uses force will terminate playback as well.
当使用 --frames 时,此选项不会被尊重。如果绑定使用 force 明确跳到下一个文件,也会终止播放。Also, if errors or unusual circumstances happen, the player can quit anyway.
此外,如果发生错误或异常情况,播放器仍然可以退出。Since mpv 0.6.0, this doesn't pause if there is a next file in the playlist, or the playlist is looped. Approximately, this will pause when the player would normally exit, but in practice there are corner cases in which this is not the case (e.g. mpv --keep-open file.mkv /dev/null will play file.mkv normally, then fail to open /dev/null, then exit). (In mpv 0.8.0, always was introduced, which restores the old behavior.)
从 mpv 0.6.0 开始,如果播放列表中有下一个文件,或者播放列表是循环的,则不会暂停。大约,这将在播放器通常退出时暂停,但在实践中,有一些特殊情况并不适用(例如, mpv --keep-open file.mkv /dev/null 将正常播放 file.mkv,然后无法打开 /dev/null ,然后退出)。(在 mpv 0.8.0 中,引入了 always ,它恢复了旧的行为。)- --keep-open-pause=<yes|no>
- If set to no, instead of pausing when --keep-open is active, just
stop at end of file and continue playing forward when you seek backwards
until end where it stops again. Default: yes.
如果设置为 no ,则当 --keep-open 激活时不再暂停,而是在文件末尾停止并继续向前播放,直到回退到停止的位置再次停止。默认: yes 。 - --image-display-duration=<seconds|inf>
If the current file is an image, play the image for the given amount of seconds (default: 5). inf means the file is kept open forever (until the user stops playback manually).
如果当前文件是图片,则播放给定秒数的图片(默认:5)。 inf 表示文件将永远保持打开状态(直到用户手动停止播放)。Unlike --keep-open, the player is not paused, but simply continues playback until the time has elapsed. (It should not use any resources during "playback".)
与 --keep-open 不同,播放器不会暂停,而是继续播放直到时间耗尽。(在“播放”期间不应使用任何资源。)This affects image files, which are defined as having only 1 video frame and no audio. The player may recognize certain non-images as images, for example if --length is used to reduce the length to 1 frame, or if you seek to the last frame.
这会影响图像文件,这些文件被定义为只有 1 个视频帧且没有音频。播放器可能会识别某些非图像文件为图像,例如如果使用 --length 来缩短到 1 帧,或者如果尝试跳转到最后一帧时。This option does not affect the framerate used for mf:// or --merge-files. For that, use --mf-fps instead.
此选项不会影响用于 mf:// 或 --merge-files 的帧率。对于这一点,请使用 --mf-fps 。When viewing images, the playback time is not tracked on the command line output, and the image frame is not duplicated when encoding. To force the player into "dumb mode" and actually count out seconds, or to duplicate the image when encoding, you need to use --demuxer=lavf --demuxer-lavf-o=loop=1, and use --length or --frames to stop after a particular time.
在查看图像时,播放时间不会在命令行输出中跟踪,编码时图像帧也不会重复。要强制播放器进入“哑模式”并实际计数秒数,或者编码时重复图像,您需要使用 --demuxer=lavf --demuxer-lavf-o=loop=1 ,并使用 --length 或 --frames 在特定时间后停止。- --force-window=<yes|no|immediate>
Create a video output window even if there is no video. This can be useful when pretending that mpv is a GUI application. Currently, the window always has the size 960x540, and is subject to --geometry, --autofit, and similar options.
即使没有视频,也会创建视频输出窗口。这在假装 mpv 是一个 GUI 应用程序时可能很有用。目前,窗口始终具有 960x540 的大小,并受 --geometry , --autofit 和类似选项的影响。Warning 警告
The window is created only after initialization (to make sure default window placement still works if the video size is different from the --force-window default window size). This can be a problem if initialization doesn't work perfectly, such as when opening URLs with bad network connection, or opening broken video files. The immediate mode can be used to create the window always on program start, but this may cause other issues.
窗口仅在初始化后创建(以确保如果视频大小与默认窗口大小不同,默认窗口位置仍然有效)。如果初始化不完美,可能会出现问题,例如使用不良网络连接打开 URL 或打开损坏的视频文件。可以使用 immediate 模式在程序启动时始终创建窗口,但这可能会引起其他问题。- --taskbar-progress=<yes|no>
(Windows only) Enable/disable playback progress rendering in taskbar (Windows 7 and above).
(仅限 Windows) 启用/禁用任务栏中的播放进度渲染(Windows 7 及以上版本)。Enabled by default. "默认启用。
- --snap-window
- (Windows only) Snap the player window to screen edges.
(仅限 Windows) 将播放器窗口吸附到屏幕边缘。 - --drag-and-drop=<no|auto|replace|append|insert-next>
- Controls the default behavior of drag and drop on platforms that support
this. auto will obey what the underlying os/platform gives mpv.
Typically, holding shift during the drag and drop will append the item to
the playlist. Otherwise, it will completely replace it. replace,
append, and insert-next always force replacing, appending to, and
inserting next into the playlist respectively. no disables all drag and
drop behavior.
控制支持此功能的平台上的拖放默认行为。 auto 将遵循底层操作系统/平台为 mpv 提供的设置。通常,在拖放时按住 shift 键会将项目添加到播放列表中。否则,它将完全替换它。 replace 、 append 和 insert-next 分别强制替换、追加到和插入到播放列表中。 no 禁用所有拖放行为。 - --ontop
Makes the player window stay on top of other windows.
使播放器窗口保持在其他窗口之上。On Windows, if combined with fullscreen mode, this causes mpv to be treated as exclusive fullscreen window that bypasses the Desktop Window Manager.
在 Windows 上,如果与全屏模式结合使用,这将使 mpv 被视为绕过桌面窗口管理器的专用全屏窗口。- --ontop-level=<window|system|desktop|level>
(macOS only) Sets the level of an on-top window (default: window).
(仅限 macOS) 设置最顶层窗口的级别(默认:窗口)。window: On top of all other windows.
位于所有其他窗口之上。system: 系统: On top of system elements like Taskbar, Menubar and Dock.
在任务栏、菜单栏和 Dock 等系统元素之上。desktop: 桌面: On top of the Desktop behind windows and Desktop icons.
在桌面背后,位于窗口和桌面图标之上。level: 级别: A level as integer.
作为整数的级别。- --focus-on=<never|open|all>,
(macOS only) Focus the video window and make it the front most window on specific events (default: open).
(仅限 macOS) 在特定事件中聚焦视频窗口并将其置于最前(默认:打开)。never: never: Never focus the window on open or new file load events.
在打开或新文件加载事件中永不聚焦窗口。open: Focus the window on creation, eg when a vo is initialised.
将窗口聚焦于创建,例如当 vo 初始化时。all: Focus the window on open and new file load event.
将窗口聚焦于打开和新文件加载事件。- --window-corners=<default|donotround|round|roundsmall>
(Windows only) Set the preference for window corner rounding.
(仅限 Windows) 设置窗口角落圆角的首选项。default: 默认: Let the system decide whether or not to round window corners
让系统决定是否圆角窗口角落。donotround: Never round window corners
永不圆角窗口角落round: Round the corners if appropriate
如果适当,则圆化角落。roundsmall: Round the corners if appropriate, with a small radius
如果适当,则将角落圆滑,半径较小- --border=<yes|no>
- Play video with window border and decorations. Since this is on by
default, use --no-border to disable the standard window decorations.
播放带有窗口边框和装饰的视频。由于默认开启,使用 --no-border 来禁用标准窗口装饰。 - --title-bar=<yes|no>
- (Windows and X11 only)
Play video with the window title bar. Since this is on by default,
use --title-bar=no to hide the title bar. The --border option takes
precedence.
(仅限 Windows 和 X11) 播放带有窗口标题栏的视频。由于默认开启,使用 --title-bar=no 来隐藏标题栏。 --border 选项具有优先级。 - --on-all-workspaces
- (X11 and macOS only)
Show the video window on all virtual desktops.
(仅限 X11 和 macOS) 在所有虚拟桌面上显示视频窗口。 - --geometry=<[W[xH]][+-x+-y][/WS]>, --geometry=<x:y>
Adjust the initial window position or size. W and H set the window size in pixels. x and y set the window position, measured in pixels from the top-left corner of the screen to the top-left corner of the image being displayed. If a percentage sign (%) is given after the argument, it turns the value into a percentage of the screen size in that direction. Positions are specified similar to the standard X11 --geometry option format, in which e.g. +10-50 means "place 10 pixels from the left border and 50 pixels from the lower border" and "--20+-10" means "place 20 pixels beyond the right and 10 pixels beyond the top border". A trailing / followed by an integer denotes on which workspace (virtual desktop) the window should appear (X11 only).
调整初始窗口位置或大小。 W 和 H 以像素为单位设置窗口大小。 x 和 y 以像素为单位设置窗口位置,从屏幕左上角到显示图像左上角的位置。如果参数后跟百分号( % ),则将值转换为屏幕大小的百分比。位置指定类似于标准 X11 --geometry 选项格式,例如,+10-50 表示“从左边界起放置 10 像素,从下边界起放置 50 像素”,而 "--20+-10" 表示“从右边界外放置 20 像素,从顶部边界外放置 10 像素”。尾部跟随 / 和整数表示窗口应出现在哪个工作空间(虚拟桌面)上(仅限 X11)。If an external window is specified using the --wid option, this option is ignored.
如果使用 --wid 选项指定了外部窗口,则忽略此选项。The coordinates are relative to the screen given with --screen for the video output drivers that fully support --screen.
坐标相对于使用 --screen 为视频输出驱动程序提供的屏幕给定。这些驱动程序完全支持 --screen 。Note 注意
Generally only supported by GUI VOs. Ignored for encoding.
通常仅由 GUI VOs 支持。在编码时忽略。Note (macOS) 注意(macOS)
On macOS, the origin of the screen coordinate system is located on the bottom-left corner. For instance, 0:0 will place the window at the bottom-left of the screen.
在 macOS 上,屏幕坐标系统的原点位于左下角。例如, 0:0 将窗口放置在屏幕的左下角。Note (X11) 注意(X11)
This option does not work properly with all window managers.
此选项与所有窗口管理器不兼容。Note (Wayland) 注意(Wayland)
Wayland does not allow a client to position itself so this option will only affect the window size.
Wayland 不允许客户端自行定位,因此此选项只会影响窗口大小。Examples 示例
- 50:40
- Places the window at x=50, y=40.
将窗口放置在 x=50, y=40 的位置。 - 50%:50%
- Places the window in the middle of the screen.
将窗口放置在屏幕中间。 - 100%:100%
- Places the window at the bottom right corner of the screen.
将窗口放置在屏幕右下角。 - 50%
- Sets the window width to half the screen width. Window height is set
so that the window has the video aspect ratio.
设置窗口宽度为屏幕宽度的一半。窗口高度设置为窗口具有视频宽高比。 - 50%x50%
- Forces the window width and height to half the screen width and
height. Will show black borders to compensate for the video aspect
ratio (with most VOs and with --keepaspect=yes).
强制窗口宽度和高度为屏幕宽度和高度的一半。将显示黑色边框以补偿视频的宽高比(对于大多数视频对象和 --keepaspect=yes )。 - 50%+10+10/2
- Sets the window to half the screen widths, and positions it 10
pixels below/left of the top left corner of the screen, on the
second workspace.
将窗口设置为屏幕宽度的一半,并将其定位在屏幕左上角下方/左侧 10 像素处,位于第二个工作区。
See also --autofit and --autofit-larger for fitting the window into a given size without changing aspect ratio.
有关将窗口调整到给定大小而不改变宽高比的信息,请参阅 --autofit 和 --autofit-larger 。- --autofit=<[W[xH]]>
Set the initial window size to a maximum size specified by WxH, without changing the window's aspect ratio. The size is measured in pixels, or if a number is followed by a percentage sign (%), in percents of the screen size.
将初始窗口大小设置为由 WxH 指定的最大大小,而不改变窗口的宽高比。大小以像素为单位测量,或者如果数字后面跟有百分号( % ),则表示屏幕大小的百分比。This option never changes the aspect ratio of the window. If the aspect ratio mismatches, the window's size is reduced until it fits into the specified size.
此选项永远不会更改窗口的纵横比。如果纵横比不匹配,窗口的大小将减小,直到适合指定的尺寸。Window position is not taken into account, nor is it modified by this option (the window manager still may place the window differently depending on size). Use --geometry to change the window position. Its effects are applied after this option.
窗口位置不考虑,也不会被此选项修改(窗口管理器仍然可能根据大小放置窗口)。使用 --geometry 来更改窗口位置。其效果将在此选项之后应用。See --geometry for details how this is handled with multi-monitor setups.
有关如何处理多显示器设置的详细信息,请参阅 --geometry 。Use --autofit-larger instead if you just want to limit the maximum size of the window, rather than always forcing a window size.
"如果您只想限制窗口的最大尺寸,而不是始终强制设置窗口大小,请使用 --autofit-larger 。Use --geometry if you want to force both window width and height to a specific size.
使用 --geometry 可以强制将窗口宽度和高度设置为特定大小。Note 注意
Generally only supported by GUI VOs. Ignored for encoding.
通常仅由 GUI VOs 支持。在编码时忽略。Examples 示例
- 70%
- Make the window width 70% of the screen size, keeping aspect ratio.
将窗口宽度设置为屏幕大小的 70%,保持宽高比。 - 1000
- Set the window width to 1000 pixels, keeping aspect ratio.
将窗口宽度设置为 1000 像素,保持纵横比。 - 70%x60%
- Make the window as large as possible, without being wider than 70%
of the screen width, or higher than 60% of the screen height.
使窗口尽可能大,但宽度不超过屏幕宽度的 70%,高度不超过屏幕高度的 60%。
- --autofit-larger=<[W[xH]]>
This option behaves exactly like --autofit, except that it sets the maximum size of the window.
此选项的行为与 --autofit 完全相同,但设置窗口的最大大小。- --autofit-smaller=<[W[xH]]>
This option behaves exactly like --autofit, except that it sets the minimum size of the window (just as --autofit-larger sets the maximum).
此选项的行为与 --autofit 完全相同,但设置窗口的最小大小(就像 --autofit-larger 设置最大大小一样)。- --window-scale=<factor>
Resize the video window to a multiple (or fraction) of the video size. This option is applied before --autofit and other options are applied (so they override this option). Changing this option while the window is maximized can unmaximize the window depending on the OS and window manager. If the window does not unmaximize, the multiplier will be applied if the user unmaximizes the window later.
将视频窗口调整到视频大小的倍数(或分数)。此选项在应用 --autofit 和其他选项之前应用(因此它们会覆盖此选项)。在窗口最大化时更改此选项可能会根据操作系统和窗口管理器取消最大化窗口。如果窗口未取消最大化,则用户稍后取消最大化窗口时将应用乘数。For example, --window-scale=0.5 would show the window at half the video size.
例如, --window-scale=0.5 将显示窗口为视频大小的一半。- --window-minimized=<yes|no>
Whether the video window is minimized or not. Setting this will minimize, or unminimize, the video window if the current VO supports it. Note that some VOs may support minimization while not supporting unminimization (eg: Wayland).
视频窗口是否已最小化。设置此选项将根据当前 VO 是否支持,最小化或取消最小化视频窗口。请注意,某些 VO 可能支持最小化但不支持取消最小化(例如:Wayland)。Whether this option and --window-maximized work on program start or at runtime, and whether they're (at runtime) updated to reflect the actual window state, heavily depends on the VO and the windowing system. Some VOs simply do not implement them or parts of them, while other VOs may be restricted by the windowing systems (especially Wayland).
此选项和 --window-maximized 是否在程序启动时或运行时工作,以及它们是否(在运行时)更新以反映实际窗口状态,很大程度上取决于 VO 和窗口系统。某些 VO 可能根本不实现它们或其部分,而其他 VO 可能受到窗口系统的限制(尤其是 Wayland)。- --window-maximized=<yes|no>
- Whether the video window is maximized or not. Setting this will maximize,
or unmaximize, the video window if the current VO supports it. See
--window-minimized for further remarks.
视频窗口是否已最大化。设置此选项将根据当前 VO 是否支持,最大化或取消最大化视频窗口。有关进一步说明,请参阅 --window-minimized 。 - --cursor-autohide=<number|no|always>
- Make mouse cursor automatically hide after given number of milliseconds
(default: 1000 ms). no will disable cursor autohide. always
means the cursor will stay hidden.
在给定毫秒数后自动隐藏鼠标光标(默认:1000 毫秒)。 no 将禁用光标自动隐藏。 always 表示光标将保持隐藏。 - --cursor-autohide-fs-only
- If this option is given, the cursor is always visible in windowed mode. In
fullscreen mode, the cursor is shown or hidden according to
--cursor-autohide.
如果指定此选项,则在窗口模式下光标始终可见。在全屏模式下,根据 --cursor-autohide 显示或隐藏光标。 - --force-rgba-osd-rendering
- Change how some video outputs render the OSD and text subtitles. This
does not change appearance of the subtitles and only has performance
implications. For VOs which support native ASS rendering (like gpu,
vdpau, direct3d), this can be slightly faster or slower,
depending on GPU drivers and hardware. For other VOs, this just makes
rendering slower.
更改某些视频输出渲染 OSD 和文本字幕的方式。这不会改变字幕的外观,只会影响性能。对于支持原生 ASS 渲染的 VO(如 gpu , vdpau , direct3d ),这可能会稍微快或慢,具体取决于 GPU 驱动程序和硬件。对于其他 VO,这只会使渲染变慢。 - --force-render
- Forces mpv to always render frames regardless of the visibility of the
window. Currently only affects X11 and Wayland VOs since they are the
only ones that have this optimization (i.e. everything else always renders
regardless of visibility).
强制 mpv 始终渲染帧,无论窗口的可见性如何。目前仅影响 X11 和 Wayland VOs,因为它们是唯一具有此优化(即其他所有内容始终渲染,无论可见性如何)的 VO。 - --force-window-position
- Forcefully move mpv's video output window to default location whenever
there is a change in video parameters, video stream or file. This used to
be the default behavior. Currently only affects X11, macvk and SDL VOs.
"在视频参数、视频流或文件发生变化时,强制将 mpv 的视频输出窗口移动到默认位置。这曾经是默认行为。目前仅影响 X11、macvk 和 SDL VOs。 - --auto-window-resize=<yes|no>
- By default, mpv will automatically resize itself if the video's size changes
(i.e. advancing forward in a playlist). Setting this to no disables this
behavior so the window size never changes automatically. This option does
not have any impact on the --autofit or --geometry options.
默认情况下,mpv 会在视频大小改变时(例如在播放列表中向前播放)自动调整自身大小。将此设置为 no 将禁用此行为,使窗口大小永远不会自动更改。此选项对 --autofit 或 --geometry 选项没有任何影响。 - --keepaspect=<yes|no>
- --keepaspect=no will always stretch the video to window size, and will
disable the window manager hints that force the window aspect ratio.
(Ignored in fullscreen mode.)
--keepaspect=no 将始终将视频拉伸到窗口大小,并将禁用强制窗口宽高比的窗口管理器提示。(在全屏模式下忽略。) - --keepaspect-window=<yes|no>
- --keepaspect-window=yes (the default) will lock the window size to the
video aspect. --keepaspect-window=no disables this behavior, and will
instead add black bars if window aspect and video aspect mismatch. Whether
this actually works depends on the VO backend.
(Ignored in fullscreen mode.)
--keepaspect-window=yes (默认)将锁定窗口大小到视频宽高比。 --keepaspect-window=no 禁用此行为,如果窗口宽高比和视频宽高比不匹配,则添加黑色边框。这实际上是否有效取决于 VO 后端。(在全屏模式下忽略。) - --monitoraspect=<ratio>
Set the aspect ratio of your monitor or TV screen. A value of 0 disables a previous setting (e.g. in the config file). Overrides the --monitorpixelaspect setting if enabled.
设置您的显示器或电视屏幕的宽高比。值为 0 将禁用之前的设置(例如在配置文件中)。如果启用,将覆盖 --monitorpixelaspect 设置。See also --monitorpixelaspect and --video-aspect-override.
另请参阅 --monitorpixelaspect 和 --video-aspect-override 。Examples 示例
- --monitoraspect=4:3 or --monitoraspect=1.3333 --monitoraspect=4:3 或 --monitoraspect=1.3333
- --monitoraspect=16:9 or --monitoraspect=1.7777 --monitoraspect=16:9 或 --monitoraspect=1.7777
- --hidpi-window-scale=<yes|no>
- Scale the window size according to the backing DPI scale factor from the OS
(default: no). For example, if the OS DPI scaling is set to 200%, mpv's window
size will be multiplied by 2.
根据操作系统(默认:否)的背景 DPI 缩放因子调整窗口大小。例如,如果操作系统 DPI 缩放设置为 200%,mpv 的窗口大小将乘以 2。 - --native-fs=<yes|no>
- (macOS only)
Uses the native fullscreen mechanism of the OS (default: yes).
(仅限 macOS) 使用操作系统的原生全屏机制(默认:是)。 - --show-in-taskbar=<yes|no>
- (Windows and X11 only)
Show mpv in the taskbar (default: yes). If set to no, mpv will no longer
appear in taskbars and tasklists in supported window managers, and may be
excluded from Alt+Tab window switching.
(仅限 Windows 和 X11) 在任务栏中显示 mpv(默认:是)。如果设置为否,mpv 将不再出现在支持的窗口管理器中的任务栏和任务列表中,并且可能在 Alt+Tab 窗口切换中被排除。 - --monitorpixelaspect=<ratio>
- Set the aspect of a single pixel of your monitor or TV screen (default:
1). A value of 1 means square pixels (correct for (almost?) all LCDs). See
also --monitoraspect and --video-aspect-override.
设置您的显示器或电视屏幕单个像素的纵横比(默认:1)。值为 1 表示正方形像素(适用于(几乎)所有 LCD)。另请参阅 --monitoraspect 和 --video-aspect-override 。 - --stop-screensaver=<yes|no|always>
Turns off the screensaver (or screen blanker and similar mechanisms) at startup and turns it on again on exit (default: yes). When using yes, the screensaver will re-enable when playback is not active. always will always disable the screensaver. Note that stopping the screensaver is only possible if a video output is available (i.e. there is an open mpv window). This is not supported on all video outputs, platforms, or desktop environments.
在启动时关闭屏幕保护程序(或屏幕空白程序和类似机制),在退出时再次打开它(默认:是)。当使用 yes 时,如果播放不活跃,屏幕保护程序将重新启用。 always 将始终禁用屏幕保护程序。请注意,停止屏幕保护程序仅在存在视频输出时才可行(即有一个打开的 mpv 窗口)。这不是所有视频输出、平台或桌面环境所支持的。Before mpv 0.33.0, the X11 backend ran xdg-screensaver reset in 10 second intervals when not paused in order to support screensaver inhibition in some environments. This functionality was removed in 0.33.0, but it is possible to call the xdg-screensaver command line program from a user script instead.
在 mpv 0.33.0 之前,X11 后端在不暂停时以 10 秒间隔运行 xdg-screensaver reset ,以支持某些环境中的屏保抑制。此功能在 0.33.0 中已被移除,但可以通过用户脚本调用 xdg-screensaver 命令行程序来代替。- --wid=<ID>
This tells mpv to attach to an existing window. If a VO is selected that supports this option, it will use that window for video output. mpv will scale the video to the size of this window, and will add black bars to compensate if the aspect ratio of the video is different.
这告诉 mpv 附加到现有窗口。如果选择了支持此选项的 VO,它将使用该窗口进行视频输出。mpv 将视频缩放到窗口大小,如果视频的宽高比不同,将添加黑色边框以补偿。On X11, the ID is interpreted as a Window on X11. Unlike MPlayer/mplayer2, mpv always creates its own window, and sets the wid window as parent. The window will always be resized to cover the parent window fully. The value 0 is interpreted specially, and mpv will draw directly on the root window.
在 X11 上,ID 被解释为 Window 。与 MPlayer/mplayer2 不同,mpv 始终创建自己的窗口,并将 wid 窗口设置为父窗口。窗口将始终调整大小以完全覆盖父窗口。值 0 被特别解释,mpv 将直接在根窗口上绘制。On win32, the ID is interpreted as HWND. Pass it as value cast to uint32_t (all Windows handles are 32-bit), this is important as mpv will not accept negative values. mpv will create its own window and set the wid window as parent, like with X11.
在 win32 上,ID 被解释为 HWND 。将其作为值转换为 uint32_t (所有 Windows 句柄都是 32 位),这很重要,因为 mpv 不接受负值。mpv 将创建自己的窗口并将 wid 窗口设置为父窗口,就像在 X11 上一样。On Android, the ID is interpreted as android.view.Surface. Pass it as a value cast to intptr_t. Use with --vo=mediacodec_embed and --hwdec=mediacodec for direct rendering using MediaCodec, or with --vo=gpu --gpu-context=android (with or without --hwdec=mediacodec).
在 Android 上,ID 被解释为 android.view.Surface 。将其作为值转换为 intptr_t 。与 --vo=mediacodec_embed 和 --hwdec=mediacodec 一起使用,用于通过 MediaCodec 进行直接渲染,或与 --vo=gpu --gpu-context=android (带或不带 --hwdec=mediacodec )一起使用。- --window-dragging=<yes|no>
- Move the window when clicking on it and moving the mouse pointer (default: yes).
点击窗口并移动鼠标指针时移动窗口(默认:是)。 - --x11-name=<string>
- Set the window instance name for X11-based video output methods.
为基于 X11 的视频输出方法设置窗口实例名称。 - --x11-netwm=<yes|no|auto>
(X11 only) Control the use of NetWM protocol features.
(仅限 X11) 控制使用 NetWM 协议功能。This may or may not help with broken window managers. This provides some functionality that was implemented by the now removed --fstype option. Actually, it is not known to the developers to which degree this option was needed, so feedback is welcome.
这可能有助于也可能无助于修复损坏的窗口管理器。这提供了一些现在已删除的 --fstype 选项实现的功能。实际上,开发者并不知道这个选项需要到何种程度,因此欢迎反馈。Specifically, yes will force use of NetWM fullscreen support, even if not advertised by the WM. This can be useful for WMs that are broken on purpose, like XMonad. (XMonad supposedly doesn't advertise fullscreen support, because Flash uses it. Apparently, applications which want to use fullscreen anyway are supposed to either ignore the NetWM support hints, or provide a workaround. Shame on XMonad for deliberately breaking X protocols (as if X isn't bad enough already).
具体来说, yes 将强制使用 NetWM 全屏支持,即使窗口管理器没有宣传。这对于故意损坏的 WMs(如 XMonad)可能很有用。(XMonad 据说没有宣传全屏支持,因为 Flash 使用了它。显然,想要使用全屏的应用程序应该忽略 NetWM 支持提示,或者提供一种解决方案。XMonad 故意破坏 X 协议(就像 X 本身已经够糟糕了)真是令人遗憾。)By default, NetWM support is autodetected (auto).
默认情况下,NetWM 支持自动检测( auto )。This option might be removed in the future.
此选项可能在将来被移除。- --x11-bypass-compositor=<yes|no|fs-only|never>
If set to yes, then ask the compositor to unredirect the mpv window (default: fs-only). This uses the _NET_WM_BYPASS_COMPOSITOR hint.
如果设置为 yes ,则请求合成器取消重定向 mpv 窗口(默认: fs-only )。这使用 _NET_WM_BYPASS_COMPOSITOR 提示。fs-only asks the window manager to disable the compositor only in fullscreen mode.
fs-only 请求窗口管理器仅在全屏模式下禁用合成器。no sets _NET_WM_BYPASS_COMPOSITOR to 0, which is the default value as declared by the EWMH specification, i.e. no change is done.
no 将 _NET_WM_BYPASS_COMPOSITOR 设置为 0,这是由 EWMH 规范声明的默认值,即不进行任何更改。never asks the window manager to never disable the compositor.
never 要求窗口管理器永远不禁用合成器。- --x11-present=<no|auto|yes>
Whether or not to use presentation statistics from X11's presentation extension (default: auto).
是否使用 X11 展示扩展的展示统计信息(默认: auto )。mpv asks X11 for present events which it then may use for more accurate frame presentation. This only has an effect if --video-sync=display-... is being used.
mpv 向 X11 请求展示事件,然后它可能使用这些事件进行更精确的帧展示。这仅在 --video-sync=display-... 被使用时才有效。The auto option enumerates XRandr providers for autodetection. If amd, radeon, intel, or nouveau (the standard x86 Mesa drivers) is found presentation feedback is enabled. Other drivers are not assumed to work, so they are not enabled automatically.
auto 选项列出 XRandr 提供程序以进行自动检测。如果找到 amd、radeon、intel 或 nouveau(标准的 x86 Mesa 驱动程序),则启用演示反馈。其他驱动程序假定无法工作,因此不会自动启用。yes or no can still be passed regardless to enable/disable this mechanism in case there is good/bad behavior with whatever your combination of hardware/drivers/etc. happens to be.
yes 或 no 仍然可以传递,无论是否启用此机制,以防硬件/驱动程序/等组合出现良好/不良行为。- --x11-wid-title=<yes|no>
- Whether or not to set the window title when mpv is embedded on X11 (default:
no).
当 mpv 在 X11 上嵌入时是否设置窗口标题(默认: no )。
Disc Devices 磁盘设备
- --cdda-device=<path>
- Specify the CD device for CDDA playback. The default device path depends on
the OS. See the OPTICAL DRIVES section.
指定用于 CDDA 播放的 CD 设备。默认设备路径取决于操作系统。请参阅“光驱”部分。 - --dvd-device=<path>
Specify the DVD device or .iso filename. You can also specify a directory that contains files previously copied directly from a DVD (with e.g. vobcopy). The default device path depends on the OS. See the OPTICAL DRIVES section.
指定 DVD 设备或.iso 文件名。您还可以指定包含之前直接从 DVD 复制文件(例如使用 vobcopy)的目录。默认设备路径取决于操作系统。请参阅“光驱”部分。Example 示例
mpv dvd:// --dvd-device=/path/to/dvd/
- --bluray-device=<path>
Specify the Blu-ray disc location. Must be a directory with Blu-ray structure. The default device path depends on the OS. See the OPTICAL DRIVES section.
指定蓝光光盘位置。必须是一个包含蓝光结构的目录。默认设备路径取决于操作系统。请参阅“光驱”部分。Example 示例
mpv bd:// --bluray-device=/path/to/bd/
- --cdda-...
- These options can be used to tune the CD Audio reading feature of mpv.
这些选项可以用于调整 mpv 的 CD 音频读取功能。 - --cdda-speed=<value>
- Set CD spin speed.
设置 CD 转速。 - --cdda-paranoia=<0-2>
Set paranoia level. Values other than 0 seem to break playback of anything but the first track.
设置 paranoia 级别。除了 0 以外的值似乎会破坏除了第一轨之外的所有播放。0: disable checking (default)
禁用检查(默认)1: overlap checking only 仅重叠检查 2: full data correction and verification
完整数据校正和验证- --cdda-sector-size=<value>
- Set atomic read size.
设置原子读取大小。 - --cdda-overlap=<value>
- Force minimum overlap search during verification to <value> sectors.
在验证期间强制最小重叠搜索到 扇区。 - --cdda-toc-offset=<value>
- Add <value> sectors to the values reported when addressing tracks.
May be negative.
将 <value> 扇区添加到寻道时报告的值。可能为负数。 - --cdda-skip=<yes|no>
- (Never) accept imperfect data reconstruction.
(永不)接受不完整的数据重建。 - --cdda-cdtext=<yes|no>
- Print CD text. This is disabled by default, because it ruins performance
with CD-ROM drives for unknown reasons.
打印 CD 文本。默认情况下已禁用,因为未知原因,它会降低 CD-ROM 驱动器的性能。 - --dvd-speed=<speed>
Try to limit DVD speed (default: 0, no change). DVD base speed is 1385 kB/s, so an 8x drive can read at speeds up to 11080 kB/s. Slower speeds make the drive more quiet. For watching DVDs, 2700 kB/s should be quiet and fast enough. mpv resets the speed to the drive default value on close. Values of at least 100 mean speed in kB/s. Values less than 100 mean multiples of 1385 kB/s, i.e. --dvd-speed=8 selects 11080 kB/s.
尝试限制 DVD 速度(默认:0,无变化)。DVD 基础速度为 1385 kB/s,因此 8 倍速驱动器可以以高达 11080 kB/s 的速度读取。较慢的速度会使驱动器更安静。观看 DVD 时,2700 kB/s 应该既安静又足够快。mpv 在关闭时将速度重置为驱动器的默认值。至少 100 的值表示 kB/s 的速度。小于 100 的值表示 1385 kB/s 的倍数,即 --dvd-speed=8 选择 11080 kB/s。Note 注意
You need write access to the DVD device to change the speed.
您需要具有 DVD 设备的写入权限才能更改速度。- --dvd-angle=<ID>
- Some DVDs contain scenes that can be viewed from multiple angles.
This option tells mpv which angle to use (default: 1).
一些 DVD 包含可以从多个角度观看的场景。此选项告诉 mpv 使用哪个角度(默认:1)。
Equalizer 均衡器
- --brightness=<-100-100>
- Adjust the brightness of the video signal (default: 0). Not supported by
all video output drivers.
调整视频信号的亮度(默认:0)。并非所有视频输出驱动程序都支持。 - --contrast=<-100-100>
- Adjust the contrast of the video signal (default: 0). Not supported by all
video output drivers.
调整视频信号的对比度(默认:0)。并非所有视频输出驱动程序都支持。 - --saturation=<-100-100>
- Adjust the saturation of the video signal (default: 0). You can get
grayscale output with this option. Not supported by all video output
drivers.
调整视频信号的饱和度(默认:0)。使用此选项可以获取灰度输出。并非所有视频输出驱动程序都支持。 - --gamma=<-100-100>
- Adjust the gamma of the video signal (default: 0). Not supported by all
video output drivers.
调整视频信号的伽玛值(默认:0)。并非所有视频输出驱动程序都支持。 - --hue=<-100-100>
- Adjust the hue of the video signal (default: 0). You can get a colored
negative of the image with this option. Not supported by all video output
drivers.
调整视频信号的色调(默认:0)。使用此选项可以获取图像的彩色负片。并非所有视频输出驱动程序都支持。
Demuxer 解复用器
- --demuxer=<[+]name>
- Force demuxer type. Use a '+' before the name to force it; this will skip
some checks. Give the demuxer name as printed by --demuxer=help.
强制设置解复用器类型。在名称前使用 '+' 强制设置;这将跳过一些检查。请提供由 --demuxer=help 打印出的解复用器名称。 - --demuxer-lavf-analyzeduration=<value>
- Maximum length in seconds to analyze the stream properties.
分析流属性的最大长度(秒)。 - --demuxer-lavf-probe-info=<yes|no|auto|nostreams>
Whether to probe stream information (default: auto). Technically, this controls whether libavformat's avformat_find_stream_info() function is called. Usually it's safer to call it, but it can also make startup slower.
是否探测流信息(默认:自动)。技术上,这控制是否调用 libavformat 的 avformat_find_stream_info() 函数。通常调用它更安全,但这也可能使启动变慢。The auto choice (the default) tries to skip this for a few know-safe whitelisted formats, while calling it for everything else.
选择 auto (默认选项)会尝试跳过一些已知安全的白名单格式,而对于其他所有格式则调用它。The nostreams choice only calls it if and only if the file seems to contain no streams after opening (helpful in cases when calling the function is needed to detect streams at all, such as with FLV files).
选择 nostreams 仅在文件在打开后似乎不包含任何流时才调用它(在需要调用该函数以检测流的情况下很有用,例如 FLV 文件)。- --demuxer-lavf-probescore=<1-100>
- Minimum required libavformat probe score. Lower values will require
less data to be loaded (makes streams start faster), but makes file
format detection less reliable. Can be used to force auto-detected
libavformat demuxers, even if libavformat considers the detection not
reliable enough. (Default: 26.)
所需的最小 libavformat 探测分数。较低的值将需要加载更少的数据(使流启动更快),但会使文件格式检测更不可靠。可以用来强制自动检测的 libavformat 解复用器,即使 libavformat 认为检测不够可靠。(默认:26。) - --demuxer-lavf-allow-mimetype=<yes|no>
Allow deriving the format from the HTTP MIME type (default: yes). Set this to no in case playing things from HTTP mysteriously fails, even though the same files work from local disk.
允许从 HTTP MIME 类型推导格式(默认:是)。如果从 HTTP 播放内容神秘失败,尽管相同文件从本地磁盘工作正常,请将此设置为否。This is default in order to reduce latency when opening HTTP streams.
默认情况下,这是为了在打开 HTTP 流时减少延迟。- --demuxer-lavf-format=<name>
- Force a specific libavformat demuxer.
强制使用特定的 libavformat 解复用器。 - --demuxer-lavf-hacks=<yes|no>
- By default, some formats will be handled differently from other formats
by explicitly checking for them. Most of these compensate for weird or
imperfect behavior from libavformat demuxers. Passing no disables
these. For debugging and testing only.
默认情况下,某些格式将通过显式检查与其它格式不同地处理。其中大部分是为了补偿 libavformat 解复用器的奇怪或不完美行为。传递 no 将禁用这些。仅用于调试和测试。 - --demuxer-lavf-o=<key>=<value>[,<key>=<value>[,...]]
Pass AVOptions to libavformat demuxer.
将 AVOptions 传递给 libavformat 解复用器。Note, a patch to make the o= unneeded and pass all unknown options through the AVOption system is welcome. A full list of AVOptions can be found in the FFmpeg manual. Note that some options may conflict with mpv options.
注意,一个使 o= 无需且将所有未知选项通过 AVOption 系统传递的补丁是受欢迎的。AVOptions 的完整列表可以在 FFmpeg 手册中找到。请注意,某些选项可能与 mpv 选项冲突。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。Example 示例
--demuxer-lavf-o=fflags=+ignidx
- --demuxer-lavf-probesize=<value>
- Maximum amount of data to probe during the detection phase. In the
case of MPEG-TS this value identifies the maximum number of TS packets
to scan.
检测阶段探测数据的最大量。在 MPEG-TS 的情况下,此值表示要扫描的最大 TS 数据包数量。 - --demuxer-lavf-buffersize=<value>
- Size of the stream read buffer allocated for libavformat in bytes
(default: 32768). Lowering the size could lower latency. Note that
libavformat might reallocate the buffer internally, or not fully use all
of it.
"为 libavformat 分配的读取缓冲区大小(以字节为单位,默认:32768)。降低大小可以降低延迟。请注意,libavformat 可能会在内部重新分配缓冲区,或者可能不会完全使用所有缓冲区。 - --demuxer-lavf-linearize-timestamps=<yes|no|auto>
Attempt to linearize timestamp resets in demuxed streams (default: auto). This was tested only for single audio streams. It's unknown whether it works correctly for video (but likely won't). Note that the implementation is slightly incorrect either way, and will introduce a discontinuity by about 1 codec frame size.
尝试在解复用流中线性化时间戳重置(默认:自动)。这仅在单个音频流中进行了测试。对于视频流是否正确工作尚不清楚(但很可能不会)。请注意,无论哪种方式实现都有轻微错误,并且会通过大约 1 个编解码器帧大小引入不连续性。The auto mode enables this for OGG audio stream. This covers the common and annoying case of OGG web radio streams. Some of these will reset timestamps to 0 every time a new song begins. This breaks the mpv seekable cache, which can't deal with timestamp resets. Note that FFmpeg/libavformat's seeking API can't deal with this either; it's likely that if this option breaks this even more, while if it's disabled, you can at least seek within the first song in the stream. Well, you won't get anything useful either way if the seek is outside of mpv's cache.
启用 auto 模式为 OGG 音频流。这涵盖了常见的令人烦恼的 OGG 网络广播流。其中一些会在每首新歌开始时重置时间戳为 0。这会破坏 mpv 可寻址缓存,它无法处理时间戳重置。请注意,FFmpeg/libavformat 的寻址 API 也不能处理这种情况;如果此选项破坏得更严重,而如果禁用,至少可以在流中的第一首歌内进行寻址。好吧,如果寻址在 mpv 的缓存之外,你将无法得到任何有用的信息。- --demuxer-lavf-propagate-opts=<yes|no>
Propagate FFmpeg-level options to recursively opened connections (default: yes). This is needed because FFmpeg will apply these settings to nested AVIO contexts automatically. On the other hand, this could break in certain situations - it's the FFmpeg API, you just can't win.
将 FFmpeg 级别的选项传播到递归打开的连接中(默认:是)。这是因为 FFmpeg 会自动将这些设置应用到嵌套的 AVIO 上下文中。另一方面,这可能在某些情况下导致问题 - 这是 FFmpeg API,你无法总是获胜。This affects in particular the --timeout option and anything passed with --demuxer-lavf-o.
这特别影响 --timeout 选项以及通过 --demuxer-lavf-o 传递的任何内容。If this option is deemed unnecessary at some point in the future, it will be removed without notice.
如果在未来某个时刻认为此选项不再必要,它将无通知地被移除。- --demuxer-mkv-subtitle-preroll=<yes|index|no>
Try harder to show embedded soft subtitles when seeking somewhere. Normally, it can happen that the subtitle at the seek target is not shown due to how some container file formats are designed. The subtitles appear only if seeking before or exactly to the position a subtitle first appears. To make this worse, subtitles are often timed to appear a very small amount before the associated video frame, so that seeking to the video frame typically does not demux the subtitle at that position.
在寻找某个位置时更努力地显示嵌入式软字幕。通常,由于某些容器文件格式的设计,可能会发生寻求目标字幕未显示的情况。只有当在字幕首次出现之前或正好在字幕首次出现的位置进行寻求时,字幕才会出现。更糟糕的是,字幕通常被设置为在相关视频帧出现前非常短的时间内出现,因此通常在视频帧进行寻求时不会解复用该位置的字幕。Enabling this option makes the demuxer start reading data a bit before the seek target, so that subtitles appear correctly. Note that this makes seeking slower, and is not guaranteed to always work. It only works if the subtitle is close enough to the seek target.
启用此选项会使解复用器在目标搜索点之前开始读取数据,以便正确显示字幕。请注意,这会使搜索变慢,并且不能保证始终有效。它仅在字幕足够接近搜索目标时才有效。Works with the internal Matroska demuxer only. Always enabled for absolute and hr-seeks, and this option changes behavior with relative or imprecise seeks only.
仅与内部 Matroska 解复用器兼容。对于绝对和 hr-seeks 总是启用,并且此选项仅更改相对或不精确搜索的行为。You can use the --demuxer-mkv-subtitle-preroll-secs option to specify how much data the demuxer should pre-read at most in order to find subtitle packets that may overlap. Setting this to 0 will effectively disable this preroll mechanism. Setting a very large value can make seeking very slow, and an extremely large value would completely reread the entire file from start to seek target on every seek - seeking can become slower towards the end of the file. The details are messy, and the value is actually rounded down to the cluster with the previous video keyframe.
您可以使用 --demuxer-mkv-subtitle-preroll-secs 选项来指定解复用器最多应预读多少数据以找到可能重叠的字幕数据包。将此设置为 0 将有效地禁用此预卷机制。设置非常大的值可以使搜索非常慢,并且极端大的值会在每次搜索时从头开始重新读取整个文件到搜索目标 - 文件末尾的搜索可能会变慢。细节很混乱,并且该值实际上会被四舍五入到上一个视频关键帧所在的簇。Some files, especially files muxed with newer mkvmerge versions, have information embedded that can be used to determine what subtitle packets overlap with a seek target. In these cases, mpv will reduce the amount of data read to a minimum. (Although it will still read all data between the cluster that contains the first wanted subtitle packet, and the seek target.) If the index choice (which is the default) is specified, then prerolling will be done only if this information is actually available. If this method is used, the maximum amount of data to skip can be additionally controlled by --demuxer-mkv-subtitle-preroll-secs-index (it still uses the value of the option without -index if that is higher).
某些文件,尤其是与较新版本的 mkvmerge 混合的文件,包含可用于确定与搜索目标重叠的字幕数据包的信息。在这些情况下,mpv 将将读取的数据量减少到最小。(尽管它仍然会读取包含第一个所需字幕数据包的簇和搜索目标之间的所有数据。)如果指定了 index 选项(这是默认选项),则只有在实际有此信息的情况下才会进行预卷动。如果使用此方法,可以通过 --demuxer-mkv-subtitle-preroll-secs-index (如果该值更高,则仍然使用不带 -index 的选项的值)进一步控制可以跳过的最大数据量。See also --hr-seek-demuxer-offset option. This option can achieve a similar effect, but only if hr-seek is active. It works with any demuxer, but makes seeking much slower, as it has to decode audio and video data instead of just skipping over it.
参见 --hr-seek-demuxer-offset 选项。此选项可以达到类似的效果,但仅当 hr-seek 激活时。它与任何解复用器一起工作,但会使搜索速度变慢,因为它必须解码音频和视频数据,而不是简单地跳过它们。- --demuxer-mkv-subtitle-preroll-secs=<value>
- See --demuxer-mkv-subtitle-preroll. 参见 --demuxer-mkv-subtitle-preroll 。
- --demuxer-mkv-subtitle-preroll-secs-index=<value>
- See --demuxer-mkv-subtitle-preroll. 参见 --demuxer-mkv-subtitle-preroll 。
- --demuxer-mkv-probe-start-time=<yes|no>
- Check the start time of Matroska files (default: yes). This simply reads the
first cluster timestamps and assumes it is the start time. Technically, this
also reads the first timestamp, which may increase latency by one frame
(which may be relevant for live streams).
检查 Matroska 文件的起始时间(默认:是)。这仅仅读取第一个数据簇的时间戳并假设它是起始时间。技术上,这也读取了第一个时间戳,这可能会导致延迟增加一帧(这对于直播流可能很重要)。 - --demuxer-mkv-probe-video-duration=<yes|no|full>
When opening the file, seek to the end of it, and check what timestamp the last video packet has, and report that as file duration. This is strictly for compatibility with Haali only. In this mode, it's possible that opening will be slower (especially when playing over http), or that behavior with broken files is much worse. So don't use this option.
在打开文件时,将其定位到末尾,并检查最后一个视频数据包的时间戳,并将其报告为文件持续时间。这仅适用于与 Haali 兼容。在此模式下,打开文件可能会变慢(尤其是在通过 http 播放时),或者对于损坏的文件的行为可能会更差。因此,不要使用此选项。The yes mode merely uses the index and reads a small number of blocks from the end of the file. The full mode actually traverses the entire file and can make a reliable estimate even without an index present (such as partial files).
yes 模式仅使用索引并从文件末尾读取少量块。 full 模式实际上遍历整个文件,即使没有索引(例如部分文件)也可以做出可靠的估计。- --demuxer-mkv-crop-compat=<yes|no>
Enable compatibility mode for files that do not fully comply with the Matroska specification. (default: yes)
为不完全符合 Matroska 规范的文件启用兼容模式。(默认:是)Most files containing cropping metadata require this mode to display correctly.
大多数包含裁剪元数据的文件都需要此模式才能正确显示。If this option is enabled, crop metadata will be applied before calculating the video's aspect ratio, ensuring it is cropped accordingly. If this option is disabled, the image will be cropped first and then stretched to match DisplayWidth and DisplayHeight.
如果启用此选项,将在计算视频的宽高比之前应用裁剪元数据,确保按相应方式裁剪。如果禁用此选项,则首先裁剪图像,然后拉伸以匹配 DisplayWidth 和 DisplayHeight。According to the Matroska specification, the Pixel Aspect Ratio (PAR) should be calculated after cropping. However, the majority of files do not adhere to this rule, as it would cause incompatibility with crop-unaware players. Additionally, MKVToolNix does not automatically adjust DisplayWidth and DisplayHeight when cropping metadata is applied, leading to most of files created with it also failing to conform to the specification.
根据 Matroska 规范,像素宽高比(PAR)应在裁剪后计算。然而,大多数文件都不遵循此规则,因为这会导致与不识别裁剪的播放器不兼容。此外,当应用裁剪元数据时,MKVToolNix 不会自动调整 DisplayWidth 和 DisplayHeight,导致使用它创建的大多数文件也未能符合规范。See for more details: https://github.com/ietf-wg-cellar/matroska-specification/pull/947 https://gitlab.com/mbunkus/mkvtoolnix/-/issues/2389 https://github.com/mpv-player/mpv/pull/13446
查看更多详情:https://github.com/ietf-wg-cellar/matroska-specification/pull/947 https://gitlab.com/mbunkus/mkvtoolnix/-/issues/2389 https://github.com/mpv-player/mpv/pull/13446- --demuxer-rawaudio-channels=<value>
- Number of channels (or channel layout) if --demuxer=rawaudio is used
(default: stereo).
如果使用 --demuxer=rawaudio ,则表示通道数量(或通道布局)(默认:立体声)。 - --demuxer-rawaudio-format=<value>
- Sample format for --demuxer=rawaudio (default: s16le).
Use --demuxer-rawaudio-format=help to get a list of all formats.
用于 --demuxer=rawaudio 的样本格式(默认:s16le)。使用 --demuxer-rawaudio-format=help 获取所有格式的列表。 - --demuxer-rawaudio-rate=<value>
- Sample rate for --demuxer=rawaudio (default: 44 kHz).
用于 --demuxer=rawaudio 的采样率(默认:44 kHz)。 - --demuxer-rawvideo-fps=<value>
- Rate in frames per second for --demuxer=rawvideo (default: 25.0).
每秒帧率,用于 --demuxer=rawvideo (默认:25.0)。 - --demuxer-rawvideo-w=<value>, --demuxer-rawvideo-h=<value>
Image dimension in pixels for --demuxer=rawvideo.
用于 --demuxer=rawvideo 的图像尺寸(像素)。Example 示例
Play a raw YUV sample:
播放原始 YUV 样本:mpv sample-720x576.yuv --demuxer=rawvideo \ --demuxer-rawvideo-w=720 --demuxer-rawvideo-h=576
- --demuxer-rawvideo-format=<value>
- Color space (fourcc) in hex or string for --demuxer=rawvideo
(default: YV12).
用于 --demuxer=rawvideo 的颜色空间(fourcc)以十六进制或字符串形式(默认: YV12 )。 - --demuxer-rawvideo-mp-format=<value>
- Color space by internal video format for --demuxer=rawvideo. Use
--demuxer-rawvideo-mp-format=help for a list of possible formats.
内部视频格式下的颜色空间,使用 --demuxer=rawvideo 。使用 --demuxer-rawvideo-mp-format=help 获取可能的格式列表。 - --demuxer-rawvideo-codec=<value>
- Set the video codec instead of selecting the rawvideo codec when using
--demuxer=rawvideo. This uses the same values as codec names in
--vd (but it does not accept decoder names).
使用 --demuxer=rawvideo 时,设置视频编解码器而不是选择 rawvideo 编解码器。这使用与 --vd 中编解码器名称相同的值(但不接受解码器名称)。 - --demuxer-rawvideo-size=<value>
- Frame size in bytes when using --demuxer=rawvideo.
使用 --demuxer=rawvideo 时的帧大小(以字节为单位)。 - --demuxer-max-bytes=<bytesize>
This controls how much the demuxer is allowed to buffer ahead. The demuxer will normally try to read ahead as much as necessary, or as much is requested with --demuxer-readahead-secs. The option can be used to restrict the maximum readahead. This limits excessive readahead in case of broken files or desynced playback. The demuxer will stop reading additional packets as soon as one of the limits is reached. (The limits still can be slightly overstepped due to technical reasons.)
此选项控制解复用器可以预缓冲的最大量。解复用器通常会尝试读取尽可能多的数据,或者根据 --demuxer-readahead-secs 请求的数据量。此选项可用于限制最大预读取量。这限制了由于文件损坏或播放不同步导致的过度预读取。一旦达到任一限制,解复用器将停止读取额外的数据包。(由于技术原因,限制仍可能略有超过。)Set these limits higher if you get a packet queue overflow warning, and you think normal playback would be possible with a larger packet queue.
如果收到数据包队列溢出警告,并且您认为使用更大的数据包队列可以进行正常播放,请将这些限制设置得更高。See --list-options for defaults and value range. <bytesize> options accept suffixes such as KiB and MiB.
查看 --list-options 以获取默认值和值范围。 <bytesize> 选项接受后缀,例如 KiB 和 MiB 。- --demuxer-max-back-bytes=<bytesize>
This controls how much past data the demuxer is allowed to preserve. This is useful only if the cache is enabled.
这控制了解复用器允许保留多少过去的数据。只有当缓存启用时,这才有用。Unlike the forward cache, there is no control how many seconds are actually cached - it will simply use as much memory this option allows. Setting this option to 0 will strictly disable any back buffer, but this will lead to the situation that the forward seek range starts after the current playback position (as it removes past packets that are seek points).
与正向缓存不同,没有控制实际缓存多少秒的选项 - 它将简单地使用此选项允许的尽可能多的内存。将此选项设置为 0 将严格禁用任何后缓冲区,但这会导致正向搜索范围从当前播放位置开始(因为它移除了作为搜索点的过去数据包)。If the end of the file is reached, the remaining unused forward buffer space is "donated" to the backbuffer (unless the backbuffer size is set to 0, or --demuxer-donate-buffer is set to no). This still limits the total cache usage to the sum of the forward and backward cache, and effectively makes better use of the total allowed memory budget. (The opposite does not happen: free backward buffer is never "donated" to the forward buffer.)
如果文件末尾已到达,剩余未使用的向前缓冲区空间将被“捐赠”给后缓冲区(除非后缓冲区大小设置为 0,或者 --demuxer-donate-buffer 设置为 no )。这仍然将总缓存使用量限制在向前和向后缓存的和,并有效地更好地利用总的允许内存预算。(反之亦然:空闲的后向缓冲区永远不会“捐赠”给前向缓冲区。)Keep in mind that other buffers in the player (like decoders) will cause the demuxer to cache "future" frames in the back buffer, which can skew the impression about how much data the backbuffer contains.
请注意,播放器中的其他缓冲区(如解码器)会导致解复用器在后缓冲区中缓存“未来”帧,这可能会歪曲对后缓冲区包含多少数据的印象。See --list-options for defaults and value range.
查看 --list-options 以获取默认值和值范围。- --demuxer-donate-buffer=<yes|no>
Whether to let the back buffer use part of the forward buffer (default: yes). If set to yes, the "donation" behavior described in the option description for --demuxer-max-back-bytes is enabled. This means the back buffer may use up memory up to the sum of the forward and back buffer options, minus the active size of the forward buffer. If set to no, the options strictly limit the forward and back buffer sizes separately.
是否允许后缓冲区使用部分向前缓冲区(默认:是)。如果设置为 yes ,则启用 --demuxer-max-back-bytes 选项描述中的“捐赠”行为。这意味着后缓冲区可能使用的内存量可达向前和向后缓冲区选项之和,减去向前缓冲区的活动大小。如果设置为 no ,则选项严格分别限制向前和向后缓冲区的大小。Note that if the end of the file is reached, the buffered data stays the same, even if you seek back within the cache. This is because the back buffer is only reduced when new data is read.
请注意,如果到达文件末尾,缓冲区中的数据保持不变,即使你在缓存内回退。这是因为只有当读取新数据时,后缓冲区才会减少。- --demuxer-seekable-cache=<yes|no|auto>
Debugging option to control whether seeking can use the demuxer cache (default: auto). Normally you don't ever need to set this; the default auto does the right thing and enables cache seeking it if --cache is set to yes (or is implied yes if --cache=auto).
调试选项,用于控制是否可以使用解复用器缓存进行查找(默认:自动)。通常你不需要设置此选项;默认的 auto 会正确处理,如果 --cache 设置为 yes (或如果 yes 暗示 --cache=auto ),则启用缓存查找。If enabled, short seek offsets will not trigger a low level demuxer seek (which means for example that slow network round trips or FFmpeg seek bugs can be avoided). If a seek cannot happen within the cached range, a low level seek will be triggered. Seeking outside of the cache will start a new cached range, but can discard the old cache range if the demuxer exhibits certain unsupported behavior.
如果启用,短查找偏移量不会触发低级解复用器查找(这意味着例如可以避免缓慢的网络往返或 FFmpeg 查找错误)。如果无法在缓存范围内进行查找,将触发低级查找。在缓存外进行查找将启动新的缓存范围,但如果解复用器表现出某些不受支持的行为,则可以丢弃旧的缓存范围。The special value auto means yes in the same situation as --cache-secs is used (i.e. when the stream appears to be a network stream or the stream cache is enabled).
特殊值 auto 表示在 yes 相同情况下与 --cache-secs 使用相同的意义(即当流看起来是网络流或流缓存已启用时)。- --demuxer-thread=<yes|no>
Run the demuxer in a separate thread, and let it prefetch a certain amount of packets (default: yes). Having this enabled leads to smoother playback, enables features like prefetching, and prevents that stuck network freezes the player. On the other hand, it can add overhead, or the background prefetching can hog CPU resources.
运行解复用器在单独的线程中,并让它预取一定数量的数据包(默认:是)。启用此功能可以使播放更流畅,启用预取等特性,并防止网络冻结导致播放器卡住。另一方面,它可能会增加开销,或者后台预取可能会占用 CPU 资源。Disabling this option is not recommended. Use it for debugging only.
禁用此选项不推荐。仅用于调试。- --demuxer-termination-timeout=<seconds>
Number of seconds the player should wait to shutdown the demuxer (default: 0.1). The player will wait up to this much time before it closes the stream layer forcefully. Forceful closing usually means the network I/O is given no chance to close its connections gracefully (of course the OS can still close TCP connections properly), and might result in annoying messages being logged, and in some cases, confused remote servers.
玩家应等待多少秒来关闭解复用器(默认:0.1)。玩家将在等待这么长时间后,如果还未关闭流层,则会强制关闭。强制关闭通常意味着网络 I/O 没有机会优雅地关闭其连接(当然操作系统仍然可以正确地关闭 TCP 连接),可能会记录令人烦恼的消息,在某些情况下,还可能导致远程服务器混乱。This timeout is usually only applied when loading has finished properly. If loading is aborted by the user, or in some corner cases like removing external tracks sourced from network during playback, forceful closing is always used.
此超时通常仅在加载正确完成后应用。如果加载被用户中断,或在播放期间从网络删除外部轨道等一些边缘情况下,总是使用强制关闭。- --demuxer-readahead-secs=<seconds>
If --demuxer-thread is enabled, this controls how much the demuxer should buffer ahead in seconds (default: 1). As long as no packet has a timestamp difference higher than the readahead amount relative to the last packet returned to the decoder, the demuxer keeps reading.
如果启用了 --demuxer-thread ,则此选项控制解复用器应提前多少秒缓冲(默认:1)。只要没有数据包的时戳差异大于相对于返回给解码器的最后一个数据包的预读量,解复用器就会继续读取。Note that enabling the cache (such as --cache=yes, or if the input is considered a network stream, and --cache=auto is used), this option is mostly ignored. (--cache-secs will override this. Technically, the maximum of both options is used.)
请注意,启用缓存(例如 --cache=yes ,或者如果输入被视为网络流,则使用 --cache=auto ),此选项通常会被忽略。( --cache-secs 将覆盖此设置。技术上,使用这两个选项的最大值。)The main purpose of this option is to limit the readhead for local playback, since a large readahead value is not overly useful in this case.
此选项的主要目的是限制本地回放的读取头,因为在这种情况下,较大的读取头值并不特别有用。(This value tends to be fuzzy, because many file formats don't store linear timestamps.)
(此值往往比较模糊,因为许多文件格式不存储线性时间戳。)- --demuxer-hysteresis-secs=<seconds>
Once the demuxer limit is reached (--demuxer-max-bytes, --demuxer-readahead-secs or --cache-secs), this value can be used to specify a hysteresis before the demuxer will buffer ahead again. This specifies the maximum number of seconds from the current playback position that needs to be remaining in the cache before the demuxer will continue buffering ahead.
一旦达到解复用器限制( --demuxer-max-bytes , --demuxer-readahead-secs 或 --cache-secs ),可以使用此值来指定解复用器再次缓冲前的滞后时间。这指定了在解复用器继续向前缓冲之前,缓存中需要保留的当前播放位置的最大秒数。For example, with a value of 10 seconds specified, the demuxer will buffer ahead up to the demuxer limit and won't start buffering ahead again until there is only 10 seconds of content left in the cache.
例如,指定了 10 秒的值后,解复用器将缓冲到解复用器限制,并且只有在缓存中只剩下 10 秒的内容时才会再次开始缓冲。This can provide significant power savings and reduce load by making the demuxer only buffer ahead in chunks at a time rather than buffering ahead nonstop to keep the cache filled.
这可以提供显著的节能效果,并通过使解复用器每次只缓冲一小部分内容而不是不断缓冲以保持缓存充满来减少负载。If you want to save power and reduce load, configure this to a small number that's much lower than --cache-secs or --demuxer-readahead-secs. If it takes a long time to buffer anything at all for a given stream (like when reading from a very slow disk is involved), then the hysteresis value should be larger to compensate.
如果您想节能并减少负载,请将其配置为比 --cache-secs 或 --demuxer-readahead-secs 小得多的一个较小的数字。如果对于某个流(例如,在涉及从非常慢的磁盘读取时)缓冲任何内容都需要很长时间,那么应该将滞后值设置得更大以补偿。The default value is 0 seconds, which disables the caching hysteresis. A value of 10 seconds probably works well for most usecases.
默认值为 0 秒,这将禁用缓存滞后。10 秒的值可能适用于大多数用例。- --prefetch-playlist=<yes|no>
Prefetch next playlist entry while playback of the current entry is ending (default: yes).
在当前播放项结束时预取下一个播放列表项(默认:是)。This does not prefill the cache with the video data of the next URL. Prefetching video data is supported only for the current playlist entry, and depends on the demuxer cache settings (on by default). This merely opens the URL of the next playlist entry as soon the current URL is fully read.
这不会预先将缓存填充为下一个 URL 的视频数据。仅支持当前播放列表项的视频数据预取,并且取决于解复用器缓存设置(默认开启)。这仅仅是在当前 URL 完全读取后立即打开下一个播放列表项的 URL。This does not work with URLs resolved by the youtube-dl wrapper, and it won't.
这不会与由 youtube-dl 包装器解析的 URL 一起工作,并且不会。This can occasionally make wrong prefetching decisions. For example, it can't predict whether you go backwards in the playlist, and assumes you won't edit the playlist.
这有时会做出错误的预取决策。例如,它无法预测你是否在播放列表中后退,并假设你不会编辑播放列表。- --force-seekable=<yes|no>
- If the player thinks that the media is not seekable (e.g. playing from a
pipe, or it's an http stream with a server that doesn't support range
requests), seeking will be disabled. This option can forcibly enable it.
For seeks within the cache, there's a good chance of success.
如果玩家认为媒体不可寻址(例如从管道播放,或者它是一个不支持范围请求的服务器上的 http 流),则将禁用寻址功能。此选项可以强制启用它。在缓存内的寻址有很高的成功机会。 - --demuxer-cache-wait=<yes|no>
- Before starting playback, read data until either the end of the file was
reached, or the demuxer cache has reached maximum capacity. Only once this
is done, playback starts. This intentionally happens before the initial
seek triggered with --start. This does not change any runtime behavior
after the initial caching. This option is useless if the file cannot be
cached completely.
在开始播放之前,读取数据直到文件末尾或解复用器缓存达到最大容量。只有完成此操作后,播放才会开始。这有意发生在使用 --start 触发的初始寻址之前。这不会改变初始缓存后的任何运行时行为。如果文件无法完全缓存,此选项将毫无用处。 - --rar-list-all-volumes=<yes|no>
When opening multi-volume rar files, open all volumes to create a full list of contained files (default: no). If disabled, only the archive entries whose headers are located within the first volume are listed (and thus played when opening a .rar file with mpv). Doing so speeds up opening, and the typical idiotic use-case of playing uncompressed multi-volume rar files that contain a single media file is made faster.
在打开多卷 rar 文件时,打开所有卷以创建包含文件的全列表(默认:否)。如果禁用,则只列出位于第一卷内的存档条目(并且在打开带有 mpv 的.rar 文件时播放)。这样做可以加快打开速度,并且使播放包含单个媒体文件的不压缩多卷 rar 文件的典型愚蠢用例变得更快。Opening is still slow, because for unknown, idiotic, and unnecessary reasons libarchive opens all volumes anyway when playing the main file, even though mpv iterated no archive entries yet.
打开仍然很慢,因为未知、愚蠢和没有必要的原因,libarchive 在播放主文件时仍然会打开所有卷,即使 mpv 还没有迭代任何存档条目。- --directory-mode=<auto|lazy|recursive|ignore>
- When opening a directory, open subdirectories lazily, recursively or not at
all. The default is auto, which behaves like recursive with
--shuffle, and like lazy otherwise.
在打开目录时,可以懒惰地打开子目录,递归或不打开。默认是 auto ,其行为类似于 recursive 与 --shuffle ,否则类似于 lazy 。 - --directory-filter-types=<video,audio,image,archive,playlist>
Media file types to filter when opening directory. If the list is empty, all files are added to the playlist. (Default: video,audio,image,archive,playlist)
打开目录时需要过滤的媒体文件类型。如果列表为空,则将所有文件添加到播放列表中。(默认: video,audio,image,archive,playlist )This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。- --autocreate-playlist=<no|filter|same>
When opening a local file, act as if the parent directory is opened and create a playlist automatically.
当打开本地文件时,表现得像是打开了父目录并自动创建播放列表。no: no: Load a single file (default).
加载单个文件(默认)。filter: 过滤器: Create a playlist from the parent directory with files matching --directory-filter-types.
从父目录创建匹配 --directory-filter-types 的播放列表。same: 相同: Create a playlist from the parent directory with files matching the same category as the currently loaded file. One of the *-exts is selected based on the input file and only files with matching extensions are added to the playlist. If the input file itself is not matched to any extension list, the playlist is not autogenerated.
从父目录创建与当前加载文件相同类别的播放列表。根据输入文件选择其中一个 *-exts ,仅添加具有匹配扩展名的文件到播放列表。如果输入文件本身没有匹配到任何扩展名列表,则不会自动生成播放列表。
Input 输入
- --native-keyrepeat=<yes|no>
- Use system settings for keyrepeat delay and rate, instead of
--input-ar-delay and --input-ar-rate (default: no).
Whether this applies depends on the VO backend and how it handles
keyboard input. Does not apply to terminal input.
使用系统设置进行按键重复延迟和速率,而不是 --input-ar-delay 和 --input-ar-rate (默认:否)。这适用与否取决于 VO 后端及其处理键盘输入的方式。不适用于终端输入。 - --native-touch=<yes|no>
(Windows only) For platforms which send emulated mouse inputs for touch-unaware clients, such as Windows, use system native touch events, instead of receiving them as emulated mouse events (default: no). This is required for multi-touch support for these platforms.
(仅限 Windows) 对于为触摸不敏感的客户端发送模拟鼠标输入的平台,例如 Windows,请使用系统原生触摸事件,而不是将它们作为模拟鼠标事件接收(默认:否)。这对于这些平台的多点触控支持是必需的。Note that this option has no effect on other platforms: either native touch is not supported by mpv, or the platform does not give an option to receive emulated mouse inputs (so native touch is always enabled, e.g. Wayland).
请注意,此选项对其他平台没有影响:要么 mpv 不支持原生触摸,要么平台没有提供接收模拟鼠标输入的选项(因此原生触摸始终启用,例如 Wayland)。- --input-ar-delay
- Delay in milliseconds before we start to autorepeat a key (default: 200).
Set it to 0 to disable.
在开始自动重复按键之前延迟的毫秒数(默认:200)。设置为 0 以禁用。 - --input-ar-rate
- Number of key presses to generate per second on autorepeat (default: 40).
每秒生成自动重复的按键次数(默认:40)。 - --input-conf=<filename>
- Specify input configuration file other than the default location in the mpv
configuration directory (usually ~/.config/mpv/input.conf).
指定除 mpv 配置目录默认位置以外的输入配置文件(通常为 ~/.config/mpv/input.conf )。 - --input-default-bindings=<yes|no>
- Enable default-level ("weak") key bindings (default: yes). These are bindings
which config files like input.conf can override. It currently affects the
builtin key bindings, and keys which scripts bind using mp.add_key_binding
(but not mp.add_forced_key_binding because this overrides input.conf).
启用默认级别的(弱)按键绑定(默认:是)。这些绑定可以被如 input.conf 之类的配置文件覆盖。它目前影响内置的按键绑定,以及使用 mp.add_key_binding 绑定的脚本中的按键(但不包括 mp.add_forced_key_binding ,因为这将覆盖 input.conf )。 - --input-builtin-bindings=<yes|no>
- Enable loading of built-in key bindings during start-up (default: yes). This
option is applied only during (lib)mpv initialization, and if disabled then it
will not be not possible to enable them later. May be useful to libmpv clients.
在启动时启用加载内置快捷键(默认:是)。此选项仅在(lib)mpv 初始化期间应用,如果禁用,则以后无法启用。可能对 libmpv 客户端有用。 - --input-builtin-dragging=<yes|no>
- Enable the built-in window-dragging behavior (default: yes). Setting it to no
disables the built-in dragging behavior. Note that unlike the window-dragging
option, this option only affects VOs which support the begin-vo-dragging
command, and does not disable window dragging initialized with the command.
启用内置的窗口拖拽行为(默认:是)。将其设置为否将禁用内置拖拽行为。注意,与 window-dragging 选项不同,此选项仅影响支持 begin-vo-dragging 命令的 VOs,并且不会禁用使用命令初始化的窗口拖拽。 - --input-cmdlist
- Prints all commands that can be bound to keys.
打印可以绑定到键的所有命令。 - --input-commands=<cmd1,cmd2,...>
Define a list of commands for mpv to run. The syntax is the same as format as input.conf but without the key binding argument at the beginning. When this option is set at startup, the commands will run after audio and video playback are about to begin if applicable (in idle mode with no file, it will run immediately). When changing values at runtime, the commands will also run as soon as possible.
为 mpv 运行定义命令列表。语法与 input.conf 格式相同,但不需要在开头提供键绑定参数。当在启动时设置此选项时,如果适用(在没有文件的空闲模式下,它将立即运行),命令将在音频和视频播放即将开始后运行。当在运行时更改值时,命令也将尽可能快地运行。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。- --input-doubleclick-time=<milliseconds>
- Time in milliseconds to recognize two consecutive button presses as a
double-click (default: 300).
识别连续两次按钮按下的时间(以毫秒为单位)(默认:300)。 - --input-keylist
- Prints all keys that can be bound to commands.
打印所有可以绑定到命令的键。 - --input-key-fifo-size=<2-65000>
- Specify the size of the FIFO that buffers key events (default: 7). If it
is too small, some events may be lost. The main disadvantage of setting it
to a very large value is that if you hold down a key triggering some
particularly slow command then the player may be unresponsive while it
processes all the queued commands.
指定缓冲键事件的 FIFO 大小(默认:7)。如果太小,可能会丢失一些事件。将值设置得非常大,主要缺点是如果你按下触发某些特别慢的命令的键,那么在处理所有队列中的命令时,玩家可能会无响应。 - --input-test
- Input test mode. Instead of executing commands on key presses, mpv
will show the keys and the bound commands on the OSD. Has to be used
with a dummy video, and the normal ways to quit the player will not
work (key bindings that normally quit will be shown on OSD only, just
like any other binding). See INPUT.CONF.
输入测试模式。在按键时,mpv 不会执行命令,而是在 OSD 上显示按键和绑定的命令。必须与虚拟视频一起使用,并且正常退出玩家的方法将不起作用(通常用于退出的键绑定只会在 OSD 上显示,就像任何其他绑定一样)。参见 INPUT.CONF。 - --input-terminal=<yes|no>
- --input-terminal=no prevents the player from reading key events from
standard input. Useful when reading data from standard input. This is
automatically enabled when - is found on the command line. There are
situations where you have to set it manually, e.g. if you open
/dev/stdin (or the equivalent on your system), use stdin in a playlist
or intend to read from stdin later on via the loadfile or loadlist input
commands.
--input-terminal=no 防止玩家从标准输入读取键事件。当从标准输入读取数据时很有用。当命令行上找到 - 时,会自动启用。有些情况下你必须手动设置它,例如,如果你打开 /dev/stdin (或你系统上的等效项),在播放列表中使用 stdin,或者打算稍后通过 loadfile 或 loadlist 输入命令从 stdin 读取。 - --input-ipc-server=<filename>
Enable the IPC support and create the listening socket at the given path.
启用 IPC 支持并在指定路径创建监听套接字。On Linux and Unix, the given path is a regular filesystem path. On Windows, named pipes are used, so the path refers to the pipe namespace (\\.\pipe\<name>). If the \\.\pipe\ prefix is missing, mpv will add it automatically before creating the pipe, so --input-ipc-server=/tmp/mpv-socket and --input-ipc-server=\\.\pipe\tmp\mpv-socket are equivalent for IPC on Windows.
在 Linux 和 Unix 上,给定的路径是常规文件系统路径。在 Windows 上,使用命名管道,因此路径指的是管道命名空间( \\.\pipe\<name> )。如果缺少 \\.\pipe\ 前缀,mpv 将在创建管道之前自动添加它,因此 --input-ipc-server=/tmp/mpv-socket 和 --input-ipc-server=\\.\pipe\tmp\mpv-socket 在 Windows 上的 IPC 中是等效的。See JSON IPC for details.
有关详细信息,请参阅 JSON IPC。- --input-ipc-client=fd://<N>
Connect a single IPC client to the given FD. This is somewhat similar to --input-ipc-server, except no socket is created, and instead the passed FD is treated like a socket connection received from accept(). In practice, you could pass either a FD created by socketpair(), or a pipe. In both cases, you must make sure that the FD is actually inherited by mpv (do not set the POSIX CLOEXEC flag).
将单个 IPC 客户端连接到给定的 FD。这有点类似于 --input-ipc-server ,除了不创建套接字,而是将传递的 FD 当作从 accept() 收到的套接字连接来处理。在实际应用中,您可以传递由 socketpair() 创建的 FD,或管道。在这两种情况下,您必须确保 FD 实际上被 mpv 继承(不要设置 POSIX CLOEXEC 标志)。The player quits when the connection is closed.
当连接关闭时,播放器退出。This is somewhat similar to the removed --input-file option, except it supports only integer FDs, and cannot open actual paths.
这与已删除的 --input-file 选项有些相似,但仅支持整数 FDs,且无法打开实际路径。Example 示例
--input-ipc-client=fd://123
Note 注意
To use this option on Windows, the fd must refer to a wrapped (created by _open_osfhandle) named pipe server handle with a client already connected. The named pipe must be created duplex with overlapped IO and inheritable handles. The program communicates with mpv through the client handle.
要在 Windows 上使用此选项,fd 必须引用一个已包装(由 _open_osfhandle 创建)的命名管道服务器句柄,并且客户端已经连接。命名管道必须以双工方式创建,具有重叠 I/O 和可继承的句柄。程序通过客户端句柄与 mpv 通信。Warning 警告
Writing to the input-ipc-server option at runtime will start another instance of an IPC client handler for the input-ipc-client option, because initialization is bundled, and this thing is stupid. This is a bug. Writing to input-ipc-client at runtime will start another IPC client handler for the new value, without stopping the old one, even if the FD value is the same (but the string is different e.g. due to whitespace). This is not a bug.
在运行时写入 input-ipc-server 选项将启动另一个 IPC 客户端处理器的 input-ipc-client 选项实例,因为初始化是捆绑的,这东西很愚蠢。这是一个错误。在运行时写入 input-ipc-client 将启动一个新的 IPC 客户端处理器,用于新值,而不会停止旧的处理器,即使 FD 值相同(但字符串不同,例如由于空格)。这不是一个错误。- --input-gamepad=<yes|no>
- Enable/disable SDL2 Gamepad support. Disabled by default.
启用/禁用 SDL2 游戏手柄支持。默认禁用。 - --input-cursor=<yes|no>
- Permit mpv to receive pointer events reported by the video output
driver. Necessary to use the OSC. Support depends on the VO in use.
允许 mpv 接收视频输出驱动程序报告的指针事件。使用 OSC 所必需的。支持取决于所使用的 VO。 - --input-cursor-passthrough=<yes|no>
- Tell the backend windowing system to allow pointer events to passthrough
the mpv window. This allows windows under mpv to instead receive pointer
events as if the mpv window was never there.
告诉后端窗口系统允许指针事件通过 mpv 窗口传递。这允许 mpv 下的窗口接收指针事件,就像 mpv 窗口从未存在过一样。 - --input-media-keys=<yes|no>
On systems where mpv can choose between receiving media keys or letting the system handle them - this option controls whether mpv should receive them.
在 mpv 可以在接收媒体键或让系统处理它们之间进行选择的情况下,此选项控制 mpv 是否应该接收它们。Default: yes (except for libmpv). macOS and Windows only, because elsewhere mpv doesn't have a choice - the system decides whether to send media keys to mpv. For instance, on X11 or Wayland, system-wide media keys are not implemented. Whether media keys work when the mpv window is focused is implementation-defined.
默认:是(除 libmpv 外)。仅限 macOS 和 Windows,因为在其他地方 mpv 没有选择权——系统决定是否将媒体键发送给 mpv。例如,在 X11 或 Wayland 上,系统级媒体键未实现。当 mpv 窗口聚焦时媒体键是否工作由实现定义。- --input-preprocess-wheel=<yes|no>
Preprocess WHEEL_* events so that while scrolling on the horizontal or vertical direction, the events aren't generated for another direction even when the two directions are scrolled together (default: yes).
预处理 WHEEL_* 事件,以便在水平或垂直方向滚动时,即使两个方向同时滚动,也不会为另一个方向生成事件(默认:是)。This preprocessing can be beneficial for preventing accidentally seeking while changing the volume by scrolling on a touchpad with the default keybind. Due to the deadzone mechanism used, disabling the preprocessing allows for diagonal scrolling (such as panning) and potentially reduces input latency.
这种预处理可以防止在通过触摸板滚动来更改音量时意外寻求。由于使用了死区机制,禁用预处理允许进行对角滚动(如平移)并可能减少输入延迟。Note that disabling the preprocessing does not affect any filtering done by the OS/driver before these events are delivered to mpv, if any.
请注意,禁用预处理不会影响在将这些事件传递给 mpv 之前由操作系统/驱动程序执行的任何过滤,如果有。- --input-right-alt-gr=<yes|no>
- (macOS and Windows only)
Use the right Alt key as Alt Gr to produce special characters. If disabled,
count the right Alt as an Alt modifier key. Enabled by default.
(仅限 macOS 和 Windows) 使用右 Alt 键作为 Alt Gr 键来生成特殊字符。如果禁用,则将右 Alt 视为 Alt 修饰键。默认启用。 - --input-vo-keyboard=<yes|no>
Disable all keyboard input on for VOs which can't participate in proper keyboard input dispatching. May not affect all VOs. Generally useful for embedding only.
禁用无法参与正确键盘输入分发的 VOs 的所有键盘输入。可能不会影响所有 VOs。通常仅适用于嵌入式使用。On X11, a sub-window with input enabled grabs all keyboard input as long as it is 1. a child of a focused window, and 2. the mouse is inside of the sub-window. It can steal away all keyboard input from the application embedding the mpv window, and on the other hand, the mpv window will receive no input if the mouse is outside of the mpv window, even though mpv has focus. Modern toolkits work around this weird X11 behavior, but naively embedding foreign windows breaks it.
在 X11 上,一个启用了输入的子窗口只要它是 1. 聚焦窗口的子窗口,并且 2. 鼠标位于子窗口内,就会捕获所有键盘输入。它可以窃取嵌入 mpv 窗口的程序的所有键盘输入,另一方面,如果鼠标位于 mpv 窗口外,即使 mpv 拥有焦点,mpv 窗口也不会接收任何输入。现代工具包可以绕过这种奇怪的 X11 行为,但天真地嵌入外国窗口会破坏它。The only way to handle this reasonably is using the XEmbed protocol, which was designed to solve these problems. GTK provides GtkSocket, which supports XEmbed. Qt doesn't seem to provide anything working in newer versions.
处理此问题的唯一合理方法是使用 XEmbed 协议,该协议旨在解决这些问题。GTK 提供 GtkSocket ,它支持 XEmbed。Qt 似乎在较新版本中不提供任何有效的工作方式。If the embedder supports XEmbed, input should work with default settings and with this option disabled. Note that input-default-bindings is disabled by default in libmpv as well - it should be enabled if you want the mpv default key bindings.
如果嵌入器支持 XEmbed,则输入应使用默认设置和禁用此选项正常工作。请注意, input-default-bindings 在 libmpv 中也默认禁用 - 如果您想启用 mpv 默认键绑定,则应启用它。- --input-touch-emulate-mouse=<yes|no>
- When multi-touch support is enabled (either required by the platform,
or enabled by --native-touch), emulate mouse move and button presses
for the touch events (default: yes). This is useful for compatibility
for mouse key bindings and scripts which read mouse positions for platforms
which do not support --native-touch=no (e.g. Wayland).
当启用多触控支持时(无论是平台要求还是通过 --native-touch 启用),为触控事件模拟鼠标移动和按钮按下(默认:是)。这对于不支持 --native-touch=no (例如 Wayland)平台的鼠标键绑定和读取鼠标位置的脚本兼容性很有用。 - --input-dragging-deadzone=<N>
- Begin the built-in window dragging when the mouse moves outside a deadzone of
N pixels while the mouse button is being held down (default: 3). This only
affects VOs which support the begin-vo-dragging command.
当鼠标在 N 像素死区外移动且鼠标按钮被按下时开始内置窗口拖动(默认:3)。这仅影响支持 begin-vo-dragging 命令的 VOs。 - --input-ime=<yes|no>
Enable keyboard input via an active input method (IME) connected to the VO. (default: no). The input popup window, if there is any, is always positioned at the top left of the window. Whether pre-edit text is drawn depends on the platform. You may need to configure your IME to display the pre-edit inside of the input popup window if you cannot read the pre-edit text in the mpv window.
通过连接到 VO 的活动输入法(IME)启用键盘输入。(默认:否)。如果有的话,输入弹出窗口始终位于窗口的左上角。是否绘制预编辑文本取决于平台。如果您无法在 mpv 窗口中读取预编辑文本,您可能需要配置您的 IME 以在输入弹出窗口中显示预编辑文本。Wayland and Windows only. This option is not applicable to terminal input.
仅适用于 Wayland 和 Windows。此选项不适用于终端输入。Note 注意
Enabling IME can cause problems with key bindings, because mpv cannot detect any key presses when they go into the IME pre-edit area. It is recommended to enable IME on demand only for the duration while text input is expected.
启用输入法可能会影响按键绑定,因为当输入法进入预编辑区域时,mpv 无法检测到任何按键。建议仅在预期文本输入期间按需启用输入法。The builtin console and input selector enable IME for the duration of accepting text input.
内置控制台和输入选择器在接收文本输入期间启用输入法。
OSD
- --osc=<yes|no>
- Whether to load the on-screen-controller (default: yes).
是否加载屏幕控制器(默认:是)。 - --osd-bar=<yes|no>
Enable display of the OSD bar (default: yes).
启用 OSD 栏的显示(默认:是)。You can configure this on a per-command basis in input.conf using osd- prefixes, see Input Command Prefixes. If you want to disable the OSD completely, use --osd-level=0.
您可以在 input.conf 中使用 osd- 前缀按命令配置此功能,参见 Input Command Prefixes 。如果您想完全禁用 OSD,请使用 --osd-level=0 。- --osd-on-seek=<no,bar,msg,msg-bar>
Set what is displayed on the OSD during seeks. The default is bar.
设置搜索时 OSD 上显示的内容。默认是 bar 。You can configure this on a per-command basis in input.conf using osd- prefixes, see Input Command Prefixes.
您可以在 input.conf 中按命令配置此设置,使用 osd- 前缀,参见 Input Command Prefixes 。- --osd-duration=<time>
- Set the duration of the OSD messages in ms (default: 1000).
以毫秒为单位设置 OSD 消息的持续时间(默认:1000)。 - --osd-font=<name>
Specify font to use for OSD. The default is sans-serif.
指定用于 OSD 的字体。默认为 sans-serif 。Examples 示例
- --osd-font='Bitstream Vera Sans'
- --osd-font='Comic Sans MS'
- --osd-font-size=<size>
Specify the OSD font size. See --sub-font-size for details.
指定 OSD 字体大小。详细信息请参见 --sub-font-size 。Default: 30 默认:30
- --osd-msg1=<string>
- Show this string as message on OSD with OSD level 1 (visible by default).
The message will be visible by default, and as long as no other message
covers it, and the OSD level isn't changed (see --osd-level).
Expands properties; see Property Expansion.
在 OSD 上以 OSD 级别 1(默认可见)显示此字符串作为消息。消息默认可见,只要没有其他消息覆盖它,并且 OSD 级别未更改(见 --osd-level )。扩展属性;见属性扩展。 - --osd-msg2=<string>
- Similar to --osd-msg1, but for OSD level 2. If this is an empty string
(default), then the playback time is shown.
类似于 --osd-msg1 ,但用于 OSD 级别 2。如果这是一个空字符串(默认),则显示播放时间。 - --osd-msg3=<string>
Similar to --osd-msg1, but for OSD level 3. If this is an empty string (default), then the playback time, duration, and some more information is shown.
类似于 --osd-msg1 ,但用于 OSD 级别 3。如果这是一个空字符串(默认),则显示播放时间、持续时间以及更多信息。This is used for the show-progress command (by default mapped to P), and when seeking if enabled with --osd-on-seek or by osd- prefixes in input.conf (see Input Command Prefixes).
此用于 show-progress 命令(默认映射到 P ),当在 input.conf 中启用 --osd-on-seek 或通过 osd- 前缀进行搜索时(见 Input Command Prefixes )。--osd-status-msg is a legacy equivalent (but with a minor difference).
--osd-status-msg 是一个遗留的等效项(但存在细微差别)。- --osd-status-msg=<string>
Show a custom string during playback instead of the standard status text. This overrides the status text used for --osd-level=3, when using the show-progress command (by default mapped to P), and when seeking if enabled with --osd-on-seek or osd- prefixes in input.conf (see Input Command Prefixes). Expands properties. See Property Expansion.
在播放期间显示自定义字符串而不是标准状态文本。当使用 --osd-level=3 命令(默认映射到 show-progress )时,这会覆盖该状态文本,当在 input.conf 中启用 P 或通过 --osd-on-seek 或 osd- 前缀进行搜索时(见 Input Command Prefixes )。扩展属性。见属性扩展。This option has been replaced with --osd-msg3. The only difference is that this option implicitly includes ${osd-sym-cc}. This option is ignored if --osd-msg3 is not empty.
此选项已被 --osd-msg3 替代。唯一的不同是此选项隐式包含 ${osd-sym-cc} 。如果 --osd-msg3 不为空,则忽略此选项。- --osd-playing-msg=<string>
Show a message on OSD when playback starts. The string is expanded for properties, e.g. --osd-playing-msg='file: ${filename}' will show the message file: followed by a space and the currently played filename.
在 OSD 播放开始时显示一条消息。字符串会根据属性进行展开,例如 --osd-playing-msg='file: ${filename}' 将显示消息 file: 后跟一个空格和当前播放的文件名。See Property Expansion. 参见属性展开。
- --osd-playing-msg-duration=<time>
- Set the duration of osd-playing-msg in ms. If this is unset,
osd-playing-msg stays on screen for the duration of osd-duration.
设置 osd-playing-msg 的持续时间(毫秒)。如果未设置, osd-playing-msg 将在 osd-duration 的持续时间内在屏幕上显示。 - --osd-playlist-entry=<title|filename|both>
Whether to display the media title, filename, or both. If the media-title is not available, it will display only the filename.
是否显示媒体标题、文件名或两者。如果 media-title 不可用,则只显示 filename 。Default: title. 默认值: title 。
- --osd-bar-align-x=<-1-1>
- Position of the OSD bar. -1 is far left, 0 is centered, 1 is far right.
Fractional values (like 0.5) are allowed.
OSD 栏的位置。-1 表示最左侧,0 表示居中,1 表示最右侧。允许使用分数值(如 0.5)。 - --osd-bar-align-y=<-1-1>
- Position of the OSD bar. -1 is top, 0 is centered, 1 is bottom.
Fractional values (like 0.5) are allowed.
OSD 栏的位置。-1 表示顶部,0 表示居中,1 表示底部。允许使用分数值(如 0.5)。 - --osd-bar-w=<1-100>
- Width of the OSD bar, in percentage of the screen width (default: 75).
A value of 50 means the bar is half the screen wide.
OSD 栏的宽度,以屏幕宽度的百分比表示(默认:75)。值为 50 表示栏宽为屏幕宽度的一半。 - --osd-bar-h=<0.1-50>
- Height of the OSD bar, in percentage of the screen height (default: 3.125).
OSD 栏的高度,以屏幕高度的百分比表示(默认:3.125)。 - --osd-bar-outline-size=<size>
Size of the outline of the OSD bar in scaled pixels (see --sub-font-size for details).
OSD 栏轮廓的尺寸,以缩放像素为单位(详细信息请参阅 --sub-font-size )。--osd-bar-border-size is an alias for --osd-bar-outline-size.
--osd-bar-border-size 是 --osd-bar-outline-size 的别名。Default: 0.5. 默认:0.5
- --osd-bar-marker-scale=<0-100>
Factor for the OSD bar marker size relative to the OSD bar outline size.
OSD 条形标记大小相对于 OSD 条形轮廓大小的系数。Default: 1.3. 默认:1.3
- --osd-bar-marker-min-size=<size>
Minimum OSD bar marker size.
最小 OSD 标记器大小。Default: 1.6. 默认:1.6.
- --osd-bar-marker-style=<none|triangle|line>
Set the OSD bar marker style.
设置 OSD 栏标记样式。none: Don't draw markers. 不绘制标记。 triangle: Draw markers as triangles (default).
以三角形形式绘制标记(默认)。line: Draw markers as lines.
以线条形式绘制标记。- --osd-blur=<0..20.0>
- Gaussian blur factor applied to the OSD font border.
0 means no blur applied (default).
应用于 OSD 字体边框的高斯模糊因子。0 表示不应用模糊(默认)。 - --osd-bold=<yes|no>
- Format text on bold.
加粗格式化文本。 - --osd-italic=<yes|no>
- Format text on italic.
斜体格式化文本。 - --osd-outline-color=<color>
See --sub-color. Color used for the OSD font outline.
参见 --sub-color 。用于 OSD 字体轮廓的颜色。--osd-border-color is an alias for --osd-outline-color.
--osd-border-color 是 --osd-outline-color 的别名。- --osd-back-color=<color>
See --sub-color. Color used for OSD text background.
参见 --sub-color 。用于 OSD 文本背景的颜色。--osd-shadow-color is an alias for --osd-back-color.
--osd-shadow-color 是 --osd-back-color 的别名。- --osd-outline-size=<size>
Size of the OSD font outline in scaled pixels (see --sub-font-size for details). A value of 0 disables outlines.
OSD 字体轮廓的缩放像素大小(见 --sub-font-size 获取详细信息)。值为 0 将禁用轮廓。--osd-border-size is an alias for --osd-outline-size.
--osd-border-size 是 --osd-outline-size 的别名。Default: 1.65 默认:1.65
- --osd-border-style=<outline-and-shadow|opaque-box|background-box>
- See --sub-border-style. Style used for OSD text border.
见 --sub-border-style 。用于 OSD 文本边框的样式。 - --osd-color=<color>
- Specify the color used for OSD.
See --sub-color for details.
指定用于 OSD 的颜色。查看 --sub-color 获取详细信息。 - --osd-selected-color=<color>
- The color of the selected item in lists.
See --sub-color for details.
列表中选中项的颜色。查看 --sub-color 获取详细信息。 - --osd-selected-outline-color=<color>
- The outline color of the selected item in lists.
See --sub-color for details.
列表中选中项的轮廓颜色。查看 --sub-color 获取详细信息。 - --osd-fractions
- Show OSD times with fractions of seconds (in millisecond precision). Useful
to see the exact timestamp of a video frame.
以秒的分数(以毫秒精度)显示 OSD 时间。用于查看视频帧的确切时间戳。 - --osd-level=<0-3>
Specifies which mode the OSD should start in.
指定 OSD 应启动的模式。0: OSD completely disabled (subtitles only)
完全禁用 OSD(仅字幕)1: enabled (shows up only on user interaction)
启用(仅在用户交互时显示)2: enabled + current time visible by default
启用 + 默认显示当前时间3: enabled + --osd-status-msg (current time and status by default)
启用 + --osd-status-msg (默认为当前时间和状态)- --osd-margin-x=<size>
Left and right screen margin for the OSD in scaled pixels (see --sub-font-size for details).
OSD 在缩放像素中的左右屏幕边距(详细信息见 --sub-font-size )。This option specifies the distance of the OSD to the left, as well as at which distance from the right border long OSD text will be broken.
此选项指定 OSD 到左边的距离,以及长 OSD 文本将在哪个距离处从右边框断开。Default: 16 默认:16
- --osd-margin-y=<size>
Top and bottom screen margin for the OSD in scaled pixels (see --sub-font-size for details).
OSD 在缩放像素中的顶部和底部屏幕边距(见 --sub-font-size 获取详细信息)。This option specifies the vertical margins of the OSD.
此选项指定 OSD 的垂直边距。Default: 16 默认:16
- --osd-align-x=<left|center|right>
- Control to which corner of the screen OSD should be
aligned to (default: left).
控制 OSD 应与屏幕哪个角落对齐(默认: left )。 - --osd-align-y=<top|center|bottom>
- Vertical position (default: top).
Details see --osd-align-x.
垂直位置(默认: top )。详细信息请参阅 --osd-align-x 。 - --osd-scale=<factor>
- OSD font size multiplier, multiplied with --osd-font-size value.
OSD 字体大小乘数,乘以 --osd-font-size 值。 - --osd-scale-by-window=<yes|no>
Whether to scale the OSD with the window size (default: yes). If this is disabled, --osd-font-size and other OSD options that use scaled pixels are always in actual pixels. The effect is that changing the window size won't change the OSD font size.
是否根据窗口大小缩放 OSD(默认:是)。如果此选项被禁用, --osd-font-size 和其他使用缩放像素的 OSD 选项始终以实际像素显示。这意味着更改窗口大小不会改变 OSD 字体大小。Note 注意
For scripts which draw user interface elements, it is recommended to respect the value of this option when deciding whether the elements are scaled with window size or not.
对于绘制用户界面元素的脚本,建议在决定元素是否随窗口大小缩放时尊重此选项的值。- --osd-shadow-offset=<size>
Displacement of the OSD shadow in scaled pixels (see --sub-font-size for details). A value of 0 disables shadows.
OSD 阴影在缩放像素中的偏移(详细信息请参阅 --sub-font-size )。值为 0 时禁用阴影。Default: 0. 默认值:0。
- --osd-spacing=<size>
Horizontal OSD/sub font spacing in scaled pixels (see --sub-font-size for details). This value is added to the normal letter spacing. Negative values are allowed.
缩放像素中的水平 OSD/子字体间距(详细信息请参阅 --sub-font-size )。此值将添加到正常字母间距。允许负值。Default: 0. 默认值:0。
- --video-osd=<yes|no>
Enabled OSD rendering on the video window (default: yes). This can be used in situations where terminal OSD is preferred. If you just want to disable all OSD rendering, use --osd-level=0.
在视频窗口中启用 OSD 渲染(默认:是)。在需要终端 OSD 的情况下可以使用此功能。如果您只想禁用所有 OSD 渲染,请使用 --osd-level=0 。It does not affect subtitles or overlays created by scripts (in particular, the OSC needs to be disabled with --osc=no).
它不会影响由脚本创建的字幕或叠加(特别是,需要使用 --osc=no 禁用 OSC)。This option is somewhat experimental and could be replaced by another mechanism in the future.
此选项有些实验性,未来可能会被另一种机制所取代。- --osd-font-provider=<...>
- See --sub-font-provider for details and accepted values. Note that
unlike subtitles, OSD never uses embedded fonts from media files.
详细信息及接受值请参阅 --sub-font-provider 。注意,与字幕不同,OSD 从不使用媒体文件中的嵌入式字体。 - --osd-fonts-dir=<path>
- See --sub-fonts-dir for details. Defaults to ~~/fonts.
详细信息请参阅 --sub-fonts-dir 。默认为 ~~/fonts 。
Screenshot 截图
- --screenshot-format=<type>
Set the image file type used for saving screenshots.
设置用于保存截图的图像文件类型。Available choices: 可用选项:
png: png: PNG jpg: JPEG (default) JPEG (默认) jpeg: JPEG (alias for jpg)
JPEG (jpg 的别名)webp: WebP jxl: JPEG XL avif: AVIF - --screenshot-tag-colorspace=<yes|no>
Tag screenshots with the appropriate colorspace (default: yes).
使用适当的色彩空间标记截图(默认:是)。Note that not all formats support this. When it is unsupported, or when this option is disabled, screenshots will be converted to sRGB before being written.
请注意,并非所有格式都支持此功能。当不支持或此选项被禁用时,截图在写入之前将被转换为 sRGB。- --screenshot-high-bit-depth=<yes|no>
- If possible, write screenshots with a bit depth similar to the source
video (default: yes). This is interesting in particular for PNG, as this
sometimes triggers writing 16 bit PNGs with huge file sizes. This will also
include an unused alpha channel in the resulting files if 16 bit is used.
如果可能,请使用与源视频类似的位深编写截图(默认:是)。这对于 PNG 尤其有趣,因为这有时会触发写入 16 位 PNG,文件大小巨大。如果使用 16 位,这还将包括结果文件中的未使用 alpha 通道。 - --screenshot-template=<template>
Specify the filename template used to save screenshots. The template specifies the filename without file extension, and can contain format specifiers, which will be substituted when taking a screenshot. By default, the template is mpv-shot%n, which results in filenames like mpv-shot0012.png for example.
指定用于保存截图的文件名模板。模板指定文件名(不含文件扩展名),可以包含格式说明符,这些说明符在截图时将被替换。默认模板为 mpv-shot%n ,例如结果为 mpv-shot0012.png 等。The template can start with a relative or absolute path, in order to specify a directory location where screenshots should be saved.
模板可以以相对路径或绝对路径开头,以指定截图应保存的目录位置。If the final screenshot filename points to an already existing file, the file will not be overwritten. The screenshot will either not be saved, or if the template contains %n, saved using different, newly generated filename.
如果最终的截图文件名指向一个已存在的文件,则不会覆盖该文件。截图将不会保存,或者如果模板包含 %n ,则使用不同、新生成的文件名保存。Allowed format specifiers:
允许的格式说明符:- %[#][0X]n
- A sequence number, padded with zeros to length X (default: 04). E.g.
passing the format %04n will yield 0012 on the 12th screenshot.
The number is incremented every time a screenshot is taken or if the
file already exists. The length X must be in the range 0-9. With
the optional # sign, mpv will use the lowest available number. For
example, if you take three screenshots--0001, 0002, 0003--and delete
the first two, the next two screenshots will not be 0004 and 0005, but
0001 and 0002 again.
一个序列号,用零填充至长度 X(默认:04)。例如,传递格式 %04n 将在第 12 张截图上产生 0012 。每次截图或如果文件已存在时,数字都会增加。长度 X 必须在 0-9 的范围内。带有可选的#符号,mpv 将使用可用的最低数字。例如,如果您拍摄三张截图--0001、0002、0003--并删除前两张,下一张和下下一张截图将不会是 0004 和 0005,而是再次是 0001 和 0002。 - %f
- Filename of the currently played video.
当前播放视频的文件名。 - %F
- Same as %f, but strip the file extension, including the dot.
与 %f 相同,但去除文件扩展名,包括点。 - %x
- Directory path of the currently played video. If the video is not on
the filesystem (but e.g. http://), this expand to an empty string.
当前播放视频的目录路径。如果视频不在文件系统上(例如 http:// ),则展开为空字符串。 - %X{fallback}
- Same as %x, but if the video file is not on the filesystem, return
the fallback string inside the {...}.
与 %x 相同,但如果视频文件不在文件系统上,则返回 {...} 中的回退字符串。 - %p
- Current playback time, in the same format as used in the OSD. The
result is a string of the form "HH:MM:SS". For example, if the video is
at the time position 5 minutes and 34 seconds, %p will be replaced
with "00:05:34".
当前播放时间,格式与 OSD 中使用的格式相同。结果是一个形如 "HH:MM:SS" 的字符串。例如,如果视频位于 5 分钟 34 秒的位置, %p 将被替换为 "00:05:34"。 - %P
Similar to %p, but extended with the playback time in milliseconds. It is formatted as "HH:MM:SS.mmm", with "mmm" being the millisecond part of the playback time.
类似于 %p ,但扩展为以毫秒为单位的播放时间。格式为 "HH:MM:SS.mmm",其中 "mmm" 是播放时间的毫秒部分。Note 注意
This is a simple way for getting unique per-frame timestamps. (Frame numbers would be more intuitive, but are not easily implementable because container formats usually use time stamps for identifying frames.)
这是一种获取每帧唯一时间戳的简单方法。(帧编号可能更直观,但不易实现,因为容器格式通常使用时间戳来标识帧。)- %wX
Specify the current playback time using the format string X. %p is like %wH:%wM:%wS, and %P is like %wH:%wM:%wS.%wT.
使用格式字符串 X 指定当前播放时间。 %p 类似于 %wH:%wM:%wS , %P 类似于 %wH:%wM:%wS.%wT 。- Valid format specifiers:
有效的格式说明符: - %wH
- hour (padded with 0 to two digits)
小时(用 0 填充至两位数字) - %wh
- hour (not padded) 小时(不填充)
- %wM
- minutes (00-59) 分钟(00-59)
- %wm
- total minutes (includes hours, unlike %wM)
总分钟数(包括小时,与 %wM 不同) - %wS
- seconds (00-59) 秒(00-59)
- %ws
- total seconds (includes hours and minutes)
总秒数(包括小时和分钟) - %wf
- like %ws, but as float
类似于 %ws ,但为浮点数 - %wT
- milliseconds (000-999) 毫秒(000-999)
- Valid format specifiers:
- %tX
- Specify the current local date/time using the format X. This format
specifier uses the UNIX strftime() function internally, and inserts
the result of passing "%X" to strftime. For example, %tm will
insert the number of the current month as number. You have to use
multiple %tX specifiers to build a full date/time string.
使用格式 X 指定当前本地日期/时间。此格式说明符内部使用 UNIX strftime() 函数,并将 "%X" 传递给 strftime 的结果插入。例如, %tm 将插入当前月份的数字。您必须使用多个 %tX 说明符来构建完整的日期/时间字符串。 - %{prop[:fallback text]}
- Insert the value of the input property 'prop'. E.g. %{filename} is
the same as %f. If the property does not exist or is not available,
an error text is inserted, unless a fallback is specified.
插入输入属性 'prop' 的值。例如, %{filename} 与 %f 相同。如果属性不存在或不可用,除非指定了回退值,否则将插入错误文本。 - %%
- Replaced with the % character itself.
替换为 % 字符本身。
- --screenshot-dir=<path>
Store screenshots in this directory. This path is joined with the filename generated by --screenshot-template. If the template filename is already absolute, the directory is ignored.
将截图存储在此目录中。此路径将与由 --screenshot-template 生成的文件名连接。如果模板文件名已经是绝对路径,则忽略目录。--screenshot-directory is an alias for --screenshot-dir.
--screenshot-directory 是 --screenshot-dir 的别名。If the directory does not exist, it is created on the first screenshot. If it is not a directory, an error is generated when trying to write a screenshot.
如果目录不存在,则在第一次截图时创建。如果它不是一个目录,则在尝试写入截图时将生成错误。This option is not set by default, and thus will write screenshots to the directory from which mpv was started. In pseudo-gui mode (see PSEUDO GUI MODE), this is set to the desktop.
此选项默认未设置,因此将截图写入 mpv 启动的目录。在伪 GUI 模式下(见伪 GUI 模式),此设置为桌面。- --screenshot-jpeg-quality=<0-100>
- Set the JPEG quality level. Higher means better quality. The default is 90.
设置 JPEG 质量级别。数值越高表示质量越好。默认值为 90。 - --screenshot-jpeg-source-chroma=<yes|no>
- Write JPEG files with the same chroma subsampling as the video
(default: yes). If disabled, the libjpeg default is used.
以与视频相同的色度子采样写入 JPEG 文件(默认:是)。如果禁用,则使用 libjpeg 的默认值。 - --screenshot-png-compression=<0-9>
- Set the PNG compression level. Higher means better compression. This will
affect the file size of the written screenshot file and the time it takes
to write a screenshot. Too high compression might occupy enough CPU time to
interrupt playback. The default is 7.
设置 PNG 压缩级别。数值越高表示压缩率越好。这将影响写入的截图文件的大小以及写入截图所需的时间。过高的压缩率可能会占用足够的 CPU 时间,从而中断播放。默认值为 7。 - --screenshot-png-filter=<0-5>
- Set the filter applied prior to PNG compression. 0 is none, 1 is "sub", 2 is
"up", 3 is "average", 4 is "Paeth", and 5 is "mixed". This affects the level
of compression that can be achieved. For most images, "mixed" achieves the
best compression ratio, hence it is the default.
设置在 PNG 压缩之前应用的过滤器。0 表示无,1 表示 "sub",2 表示 "up",3 表示 "average",4 表示 "Paeth",5 表示 "mixed"。这会影响可以达到的压缩级别。对于大多数图像,"mixed" 实现了最佳的压缩比率,因此它是默认设置。 - --screenshot-webp-lossless=<yes|no>
- Write lossless WebP files. --screenshot-webp-quality is ignored if this
is set. The default is no.
写入无损 WebP 文件。如果设置此选项, --screenshot-webp-quality 将被忽略。默认不设置。 - --screenshot-webp-quality=<0-100>
- Set the WebP quality level. Higher means better quality. The default is 75.
设置 WebP 质量级别。数值越高表示质量越好。默认值为 75。 - --screenshot-webp-compression=<0-6>
- Set the WebP compression level. Higher means better compression, but takes
more CPU time. Note that this also affects the screenshot quality when used
with lossy WebP files. The default is 4.
设置 WebP 压缩级别。数值越高表示压缩效果越好,但需要更多的 CPU 时间。注意,当与有损 WebP 文件一起使用时,这也会影响截图质量。默认值为 4。 - --screenshot-jxl-distance=<0-15>
- Set the JPEG XL Butteraugli distance. Lower means better quality. Lossless
is 0.0, and 1.0 is approximately equivalent to JPEG quality 90 for
photographic content. Use 0.1 for "visually lossless" screenshots. The
default is 1.0.
设置 JPEG XL Butteraugli 距离。数值越低表示质量越好。无损为 0.0,1.0 大约相当于摄影内容中 JPEG 质量等级 90。用于“视觉无损”截图时使用 0.1。默认值为 1.0。 - --screenshot-jxl-effort=<1-9>
- Set the JPEG XL compression effort. Higher effort (usually) means better
compression, but takes more CPU time. The default is 4.
设置 JPEG XL 压缩力度。力度越高(通常)表示压缩效果越好,但需要更多的 CPU 时间。默认值为 4。 - --screenshot-avif-encoder=<encoder>
Specify the AV1 encoder to be used by libavcodec for encoding avif screenshots.
指定 libavcodec 用于编码 avif 截图的 AV1 编码器。Default: libaom-av1 默认: libaom-av1
- --screenshot-avif-pixfmt=<format>
- Specify the pixel format for the libavcodec encoder. Defaults to empty,
which lets mpv pick one close to the source format.
指定 libavcodec 编码器的像素格式。默认为空,允许 mpv 选择一个接近源格式的选项。 - --screenshot-avif-opts=key1=value1,key2=value2,...
Specifies libavcodec options for selected encoder. For more information, consult the FFmpeg documentation.
指定所选编码器的 libavcodec 选项。更多信息,请参阅 FFmpeg 文档。Default: usage=allintra,crf=0,cpu-used=8 默认: usage=allintra,crf=0,cpu-used=8
Note: the default is only guaranteed to work with the libaom-av1 encoder. Above options may not be valid and or optimal for other encoders.
注意:默认值仅保证与 libaom-av1 编码器兼容。上述选项可能对其他编码器无效或不最佳。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --screenshot-sw=<yes|no>
Whether to use software rendering for screenshots (default: no).
是否使用软件渲染进行截图(默认:否)。If set to no, the screenshot will be rendered by the current VO (only vo_gpu or vo_gpu_next currently). The advantage is that this will (probably) always show up as in the video window, because the same code is used for rendering. But since the renderer needs to be reinitialized, this can be slow and interrupt playback.
如果设置为否,截图将由当前 VO 渲染(目前仅支持 vo_gpu 或 vo_gpu_next)。优点是这(可能)总是显示在视频窗口中,因为渲染使用的是相同的代码。但由于渲染器需要重新初始化,这可能会很慢并中断播放。If set to yes, the software scaler is used to convert the video to RGB (or whatever the target screenshot requires). In this case, conversion will run in a separate thread and will probably not interrupt playback. The software renderer may lack some capabilities, such as HDR rendering. If window mode is used, the image will also be scaled in software which may not accurately reflect the actual visible result.
如果设置为是,软件缩放器将用于将视频转换为 RGB(或目标截图所需的任何格式)。在这种情况下,转换将在单独的线程中运行,并且可能不会中断播放。软件渲染器可能缺少一些功能,例如 HDR 渲染。如果使用 window 模式,图像也将通过软件进行缩放,这可能无法准确反映实际可见结果。
Software Scaler 软件缩放器
- --sws-scaler=<name>
Specify the software scaler algorithm to be used with --vf=scale. This also affects video output drivers which lack hardware acceleration, e.g. x11. See also --vf=scale.
指定与 --vf=scale 一起使用的软件缩放器算法。这也影响缺乏硬件加速的视频输出驱动程序,例如 x11 。另请参阅 --vf=scale 。To get a list of available scalers, run --sws-scaler=help.
获取可用缩放器的列表,请运行 --sws-scaler=help 。Default: bicubic. 默认值: bicubic 。
- --sws-lgb=<0-100>
- Software scaler Gaussian blur filter (luma). See --sws-scaler.
软件缩放器高斯模糊滤波器(亮度)。参见 --sws-scaler 。 - --sws-cgb=<0-100>
- Software scaler Gaussian blur filter (chroma). See --sws-scaler.
软件缩放器高斯模糊滤镜(色度)。见 --sws-scaler 。 - --sws-ls=<-100-100>
- Software scaler sharpen filter (luma). See --sws-scaler.
软件缩放锐化滤波器(亮度)。参见 --sws-scaler 。 - --sws-cs=<-100-100>
- Software scaler sharpen filter (chroma). See --sws-scaler.
软件缩放器锐化滤波器(色度)。参见 --sws-scaler 。 - --sws-chs=<h>
- Software scaler chroma horizontal shifting. See --sws-scaler.
软件缩放色度水平移动。参见 --sws-scaler 。 - --sws-cvs=<v>
- Software scaler chroma vertical shifting. See --sws-scaler.
软件色度垂直缩放。参见 --sws-scaler 。 - --sws-bitexact=<yes|no>
- Unknown functionality (default: no). Consult libswscale source code. The
primary purpose of this, as far as libswscale API goes), is to produce
exactly the same output for the same input on all platforms (output has the
same "bits" everywhere, thus "bitexact"). Typically disables optimizations.
未知功能(默认:否)。请参考 libswscale 源代码。就 libswscale API 而言,其主要目的是在所有平台上对相同的输入产生完全相同的输出(输出处的“位”相同,因此称为“位精确”)。通常禁用优化。 - --sws-fast=<yes|no>
Allow optimizations that help with performance, but reduce quality (default: no).
允许使用有助于性能但会降低质量的优化(默认:否)。VOs like drm and x11 will benefit a lot from using --sws-fast. You may need to set other options, like --sws-scaler. The builtin sws-fast profile sets this option and some others to gain performance for reduced quality. Also see --sws-allow-zimg.
如 drm 和 x11 这样的 VO 将从使用 --sws-fast 中受益良多。您可能需要设置其他选项,如 --sws-scaler 。内置的 sws-fast 配置文件将此选项和一些其他选项设置为以降低质量来提高性能。另请参阅 --sws-allow-zimg 。- --sws-allow-zimg=<yes|no>
Allow using zimg (if the component using the internal swscale wrapper explicitly allows so) (default: yes). In this case, zimg may be used, if the internal zimg wrapper supports the input and output formats. It will silently or noisily fall back to libswscale if one of these conditions does not apply.
允许使用 zimg(如果使用内部 swscale 包装器的组件明确允许这样做)(默认:是)。在这种情况下,如果内部 zimg 包装器支持输入和输出格式,则可以使用 zimg。如果不符合上述条件之一,它将静默或嘈杂地回退到 libswscale。If zimg is used, the other --sws- options are ignored, and the --zimg- options are used instead.
如果使用 zimg,则忽略其他 --sws- 选项,并使用 --zimg- 选项代替。If the internal component using the swscale wrapper hooks up logging correctly, a verbose priority log message will indicate whether zimg is being used.
如果使用 swscale 包装器钩子正确连接日志记录,则详细优先级日志消息将指示是否正在使用 zimg。Most things which need software conversion can make use of this.
大多数需要软件转换的事物都可以使用此功能。Note 注意
Do note that zimg may be slower than libswscale. Usually, it's faster on x86 platforms, but slower on ARM (due to lack of ARM specific optimizations). The mpv zimg wrapper uses unoptimized repacking for some formats, for which zimg cannot be blamed.
请注意,zimg 可能比 libswscale 慢。通常,它在 x86 平台上更快,但在 ARM 上较慢(由于缺乏 ARM 特定优化)。mpv 的 zimg 包装器对某些格式使用未优化的重打包,对此 zimg 不能承担责任。- --zimg-scaler=<point|bilinear|bicubic|spline16|spline36|lanczos>
- Zimg luma scaler to use (default: lanczos).
Zimg 亮度缩放器使用(默认:Lanczos)。 - --zimg-scaler-param-a=<default|float>, --zimg-scaler-param-b=<default|float>
Set scaler parameters. By default, these are set to the special string default, which maps to a scaler-specific default value. Ignored if the scaler is not tunable.
设置缩放器参数。默认情况下,这些参数设置为特殊字符串 default ,它映射到缩放器特定的默认值。如果缩放器不可调整,则忽略。- --zimg-scaler-chroma=...
- Same as --zimg-scaler, for for chroma interpolation (default: bilinear).
与 --zimg-scaler 相同,用于色度插值(默认:双线性)。 - --zimg-scaler-chroma-param-a, --zimg-scaler-chroma-param-b
- Same as --zimg-scaler-param-a / --zimg-scaler-param-b, for chroma.
与 --zimg-scaler-param-a / --zimg-scaler-param-b 相同,用于色度。 - --zimg-dither=<no|ordered|random|error-diffusion>
- Dithering (default: random).
抖动(默认:随机)。 - --zimg-threads=<auto|integer>
Set the maximum number of threads to use for scaling (default: auto). auto uses the number of logical cores on the current machine. Note that the scaler may use less threads (or even just 1 thread) depending on stuff. Passing a value of 1 disables threading and always scales the image in a single operation. Higher thread counts waste resources, but make it typically faster.
设置用于扩展的最大线程数(默认:自动)。 auto 使用当前机器上的逻辑核心数。请注意,缩放器可能会根据情况使用更少的线程(甚至仅使用 1 个线程)。传递 1 的值将禁用线程,并始终在单个操作中缩放图像。较高的线程数会浪费资源,但通常会使操作更快。Note that some zimg git versions had bugs that will corrupt the output if threads are used.
请注意,某些 zimg git 版本存在使用线程时会导致输出损坏的 bug。- --zimg-fast=<yes|no>
- Allow optimizations that help with performance, but reduce quality (default:
yes). Currently, this may simplify gamma conversion operations.
允许有助于性能但会降低质量的优化(默认:是)。目前,这可能会简化伽玛转换操作。
Audio Resampler 音频重采样器
This controls the default options of any resampling done by mpv (but not within
libavfilter, within the system audio API resampler, or any other places).
此选项控制 mpv(但不在 libavfilter 内部,系统音频 API 重采样器或任何其他位置)进行的任何重采样的默认选项。
- --audio-resample-filter-size=<length>
- Length of the filter with respect to the lower sampling rate. (default:
16)
相对于较低采样率的滤波器长度。(默认:16) - --audio-resample-phase-shift=<count>
- Log2 of the number of polyphase entries. (..., 10->1024, 11->2048,
12->4096, ...) (default: 10->1024)
多相分量的数量对数 2。(..., 10->1024, 11->2048, 12->4096, ...)(默认:10->1024) - --audio-resample-cutoff=<cutoff>
- Cutoff frequency (0.0-1.0), default set depending upon filter length.
截止频率(0.0-1.0),默认值根据滤波器长度设置。 - --audio-resample-linear=<yes|no>
- If set then filters will be linearly interpolated between polyphase
entries. (default: no)
如果设置,则滤波器将在多相条目之间进行线性插值。(默认:否) - --audio-normalize-downmix=<yes|no>
Enable/disable normalization if surround audio is downmixed to stereo (default: no). If this is disabled, downmix can cause clipping. If it's enabled, the output might be too quiet. It depends on the source audio.
如果环绕音频被降混为立体声,启用/禁用归一化(默认:否)。如果禁用,降混可能导致削波。如果启用,输出可能太安静。这取决于源音频。If downmix happens outside of mpv for some reason, or in the decoder (decoder downmixing), or in the audio output (system mixer), this has no effect.
如果由于某些原因在 mpv 外部进行降混,或在解码器(解码器降混)中,或在音频输出(系统混音器)中,则此选项没有效果。- --audio-resample-max-output-size=<length>
Limit maximum size of audio frames filtered at once, in ms (default: 40). The output size size is limited in order to make resample speed changes react faster. This is necessary especially if decoders or filters output very large frame sizes (like some lossless codecs or some DRC filters). This option does not affect the resampling algorithm in any way.
限制一次过滤的最大音频帧大小,以毫秒为单位(默认:40)。输出大小被限制,以便使重采样速度变化反应更快。如果解码器或过滤器输出非常大的帧大小(如某些无损编解码器或某些 DRC 过滤器),则此选项是必要的。此选项不会以任何方式影响重采样算法。For testing/debugging only. Can be removed or changed any time.
仅用于测试/调试。可随时删除或更改。- --audio-swresample-o=<string>
Set AVOptions on the SwrContext or AVAudioResampleContext. These should be documented by FFmpeg.
在 SwrContext 或 AVAudioResampleContext 上设置 AVOptions。这些应由 FFmpeg 进行文档说明。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。
Terminal 终端
- --quiet
Make console output less verbose; in particular, prevents the status line (i.e. AV: 3.4 (00:00:03.37) / 5320.6 ...) from being displayed. Particularly useful on slow terminals or broken ones which do not properly handle carriage return (i.e. \r).
使控制台输出更简洁;特别是防止显示状态行(即 AV: 3.4 (00:00:03.37) / 5320.6 ...)。特别适用于速度慢或损坏的终端,这些终端无法正确处理回车符(即 \r )。See also: --really-quiet and --msg-level.
另请参阅: --really-quiet 和 --msg-level 。- --really-quiet
- Display even less output and status messages than with --quiet.
显示比使用 --quiet 更少的输出和状态消息。 - --terminal=<yes|no>
--terminal=no disables any use of the terminal and stdin/stdout/stderr. This completely silences any message output.
--terminal=no 禁用终端和 stdin/stdout/stderr 的任何使用。这完全静音了任何消息输出。Unlike --really-quiet, this disables input and terminal initialization as well.
与 --really-quiet 不同,这还会禁用输入和终端初始化。- --msg-color=<yes|no>
- Enable colorful console output on terminals (default: yes).
在终端上启用彩色控制台输出(默认:是)。 - --msg-level=<module1=level1,module2=level2,...>
Control verbosity directly for each module. The all module changes the verbosity of all the modules. The verbosity changes from this option are applied in order from left to right, and each item can override a previous one.
直接控制每个模块的详细程度。 all 模块更改所有模块的详细程度。此选项的详细程度更改按从左到右的顺序应用,每个项目可以覆盖前一个项目。Run mpv with --msg-level=all=trace to see all messages mpv outputs. You can use the module names printed in the output (prefixed to each line in [...]) to limit the output to interesting modules.
使用 --msg-level=all=trace 运行 mpv 以查看 mpv 输出的所有消息。您可以使用输出中打印的模块名称(在 [...] 中每行前缀)来限制输出到有趣的模块。This also affects --log-file, and in certain cases libmpv API logging.
这也影响 --log-file ,以及在某些情况下 libmpv API 日志。Note 注意
Some messages are printed before the command line is parsed and are therefore not affected by --msg-level. To control these messages, you have to use the MPV_VERBOSE environment variable; see ENVIRONMENT VARIABLES for details.
一些消息在解析命令行之前打印出来,因此不受 --msg-level 的影响。要控制这些消息,您必须使用 MPV_VERBOSE 环境变量;有关详细信息,请参阅环境变量。Available levels: 可用级别:
no: no: complete silence 完全静音 fatal: 致命错误: fatal messages only 仅致命消息 error: 错误: error messages 错误信息 warn: warning messages 警告信息 info: 信息: informational messages 信息性消息 status: 状态: status messages (default)
状态消息(默认)v: v: verbose messages 详细消息 debug: 调试: debug messages 调试信息 trace: 跟踪: very noisy debug messages
非常嘈杂的调试消息Example 示例
mpv --msg-level=ao/sndio=no
Completely silences the output of ao_sndio, which uses the log prefix [ao/sndio].
完全静音 ao_sndio 的输出,该输出使用日志前缀 [ao/sndio] 。mpv --msg-level=all=warn,ao/alsa=error
Only show warnings or worse, and let the ao_alsa output show errors only.
仅显示警告或更严重的信息,并让 ao_alsa 输出仅显示错误。- --term-osd=<auto|no|force>
Control whether OSD messages are shown on the console when no video output is available (default: auto).
控制当没有视频输出时是否在控制台上显示 OSD 消息(默认:自动)。auto: use terminal OSD if no video output active
如果没有视频输出活动,则使用终端 OSDno: no: disable terminal OSD 禁用终端 OSD force: 强制: use terminal OSD even if video output active
即使视频输出激活也使用终端 OSDThe auto mode also enables terminal OSD if --video-osd=no was set.
auto 模式还启用终端 OSD,如果 --video-osd=no 已设置。- --term-osd-bar=<yes|no>
- Enable printing a progress bar under the status line on the terminal.
(Disabled by default.)
在终端状态行下启用打印进度条。(默认禁用。) - --term-osd-bar-chars=<string>
Customize the --term-osd-bar feature. The string is expected to consist of 5 characters (start, left space, position indicator, right space, end). You can use Unicode characters, but note that double- width characters will not be treated correctly.
自定义 --term-osd-bar 功能。字符串应包含 5 个字符(起始,左空格,位置指示符,右空格,结束)。您可以使用 Unicode 字符,但请注意,双字节字符将无法正确处理。Default: [-+-]. 默认值: [-+-] 。
- --term-playing-msg=<string>
Print out a string after starting playback. The string is expanded for properties, e.g. --term-playing-msg='file: ${filename}' will print the string file: followed by a space and the currently played filename.
在开始播放后打印字符串。字符串会展开属性,例如 --term-playing-msg='file: ${filename}' 将打印字符串 file: ,后面跟一个空格和当前播放的文件名。See Property Expansion. 参见属性展开。
- --term-status-msg=<string>
- Print out a custom string during playback instead of the standard status
line. Expands properties. See Property Expansion.
在播放期间打印自定义字符串而不是标准状态行。展开属性。请参阅属性展开。 - --term-title=<string>
Set the terminal title. Currently, this simply concatenates the escape sequence setting the window title with the provided (property expanded) string. This will mess up if the expanded string contain bytes that end the escape sequence, or if the terminal does not understand the sequence. The latter probably includes the regrettable win32.
设置终端标题。目前,这仅仅是将设置窗口标题的转义序列与提供的(属性展开)字符串连接起来。如果展开的字符串包含结束转义序列的字节,或者如果终端不理解该序列,这可能会出错。后者可能包括令人遗憾的 win32。Expands properties. See Property Expansion.
展开属性。参见属性展开。- --msg-module
- Prepend module name to each console message.
在每个控制台消息前添加模块名称。 - --msg-time
- Prepend timing information to each console message. The time is in
seconds since the player process was started (technically, slightly
later actually), using a monotonic time source depending on the OS. This
is CLOCK_MONOTONIC on sane UNIX variants.
在每个控制台消息前添加时间信息。时间是自玩家进程启动以来的秒数(技术上,实际上稍晚一些),使用依赖于操作系统的单调时间源。这在合理的 UNIX 变体上是 CLOCK_MONOTONIC 。
Cache 缓存
- --cache=<yes|no|auto>
Decide whether to use network cache settings (default: auto).
决定是否使用网络缓存设置(默认:自动)。If enabled, use up to --cache-secs for the cache size (but still limited to --demuxer-max-bytes), and make the cached data seekable (if possible). If disabled, --cache-pause and related are implicitly disabled.
如果启用,则使用最多 --cache-secs 作为缓存大小(但仍然限制为 --demuxer-max-bytes ),并使缓存数据可寻址(如果可能)。如果禁用,则 --cache-pause 和相关功能将隐式禁用。The auto choice enables this depending on whether the stream is thought to involve network accesses or other slow media (this is an imperfect heuristic).
根据是否认为流涉及网络访问或其他慢速媒体, auto 选项启用此功能(这是一个不完美的启发式方法)。Before mpv 0.30.0, this used to accept a number, which specified the size of the cache in kilobytes. Use e.g. --cache --demuxer-max-bytes=123k instead.
在 mpv 0.30.0 之前,这曾经接受一个数字,该数字指定了缓存的大小(以千字节为单位)。例如,使用 --cache --demuxer-max-bytes=123k 代替。- --cache-secs=<seconds>
- How many seconds of audio/video to prefetch if the cache is active. This
overrides the --demuxer-readahead-secs option if and only if the cache
is enabled and the value is larger. The default value is set to something
very high, so the actually achieved readahead will usually be limited by
the value of the --demuxer-max-bytes option. Setting this option is
usually only useful for limiting readahead.
如果缓存处于活动状态,则预取多少秒的音频/视频。如果缓存已启用且值更大,则此选项将覆盖 --demuxer-readahead-secs 选项。默认值设置得非常高,因此实际实现的预读通常会受到 --demuxer-max-bytes 选项值的限制。设置此选项通常仅用于限制预读。 - --cache-on-disk=<yes|no>
Write packet data to a temporary file, instead of keeping them in memory. This makes sense only with --cache. If the normal cache is disabled, this option is ignored.
将数据包数据写入临时文件,而不是将它们保存在内存中。只有与 --cache 一起使用时才有意义。如果正常缓存被禁用,则此选项将被忽略。The cache file is append-only. Even if the player appears to prune data, the file space freed by it is not reused. The cache file is deleted when playback is closed.
缓存文件是追加只读的。即使播放器看起来在修剪数据,由它释放的文件空间也不会被重用。当播放关闭时,缓存文件将被删除。Note that packet metadata is still kept in memory. --demuxer-max-bytes and related options are applied to metadata only. The size of this metadata varies, but 50 MB per hour of media is typical. The cache statistics will report this metadats size, instead of the size of the cache file. If the metadata hits the size limits, the metadata is pruned (but not the cache file).
请注意,数据包元数据仍然保留在内存中。 --demuxer-max-bytes 和相关选项仅应用于元数据。此元数据的大小不一,但每小时的媒体数据通常为 50 MB。缓存统计信息将报告此元数据大小,而不是缓存文件的大小。如果元数据达到大小限制,则将修剪元数据(但不会修剪缓存文件)。When the media is closed, the cache file is deleted. A cache file is generally worthless after the media is closed, and it's hard to retrieve any media data from it (it's not supported by design).
当媒体关闭时,缓存文件将被删除。媒体关闭后,缓存文件通常毫无价值,并且很难从中检索任何媒体数据(它不支持设计)。If the option is enabled at runtime, the cache file is created, but old data will remain in the memory cache. If the option is disabled at runtime, old data remains in the disk cache, and the cache file is not closed until the media is closed. If the option is disabled and enabled again, it will continue to use the cache file that was opened first.
如果在运行时启用此选项,则创建缓存文件,但旧数据将保留在内存缓存中。如果在运行时禁用此选项,则旧数据将保留在磁盘缓存中,并且缓存文件不会关闭,直到媒体关闭。如果禁用并再次启用此选项,它将继续使用首先打开的缓存文件。- --demuxer-cache-dir=<path>
Directory where to create temporary files. Cache is stored in the system's cache directory (usually ~/.cache/mpv) if this is unset.
创建临时文件的目录。如果未设置,则缓存存储在系统的缓存目录中(通常是 ~/.cache/mpv )。Currently, this is used for --cache-on-disk only.
目前,这仅用于 --cache-on-disk 。- --cache-pause=<yes|no>
- Whether the player should automatically pause when the cache runs out of
data and stalls decoding/playback (default: yes). If enabled, it will
pause and unpause once more data is available, aka "buffering".
当缓存数据耗尽并导致解码/播放停滞时,玩家是否应该自动暂停(默认:是)。如果启用,当更多数据可用时,它将暂停和再次暂停,即“缓冲”。 - --cache-pause-wait=<seconds>
- Number of seconds the packet cache should have buffered before starting
playback again if "buffering" was entered (default: 1). This can be used
to control how long the player rebuffers if --cache-pause is enabled,
and the demuxer underruns. If the given time is higher than the maximum
set with --cache-secs or --demuxer-readahead-secs, or prefetching
ends before that for some other reason (like file end or maximum configured
cache size reached), playback resumes earlier.
在输入“缓冲”后再次开始播放前,数据包缓存应缓冲的秒数(默认:1)。这可以用来控制如果启用 --cache-pause ,播放器重新缓冲多长时间,以及解复用器欠载。如果给定时间高于通过 --cache-secs 或 --demuxer-readahead-secs 设置的最大值,或者由于某些原因(如文件结束或达到最大配置的缓存大小)在之前结束预取,播放将提前恢复。 - --cache-pause-initial=<yes|no>
Enter "buffering" mode before starting playback (default: no). This can be used to ensure playback starts smoothly, in exchange for waiting some time to prefetch network data (as controlled by --cache-pause-wait). For example, some common behavior is that playback starts, but network caches immediately underrun when trying to decode more data as playback progresses.
在开始播放前进入“缓冲”模式(默认:否)。这可以用来确保播放平稳开始,但需要等待一段时间以预取网络数据(由 --cache-pause-wait 控制)。例如,一些常见的行为是播放开始,但随着播放的进行,网络缓存立即欠载,当尝试解码更多数据时。Another thing that can happen is that the network prefetching is so CPU demanding (due to demuxing in the background) that playback drops frames at first. In these cases, it helps enabling this option, and setting --cache-secs and --cache-pause-wait to roughly the same value.
另一件可能发生的事情是,网络预取对 CPU 的需求如此之大(由于后台解复用),以至于最初播放会丢帧。在这些情况下,启用此选项并将 --cache-secs 和 --cache-pause-wait 设置为大致相同的值会有所帮助。This option also triggers when playback is restarted after seeking.
此选项还会在搜索后重新启动播放时触发。- --demuxer-cache-unlink-files=<immediate|whendone|no>
Whether or when to unlink cache files (default: immediate). This affects cache files which are inherently temporary, and which make no sense to remain on disk after the player terminates. This is a debugging option.
是否或何时解除缓存文件的链接(默认:立即)。这会影响那些本质上临时且在播放器终止后留在磁盘上没有意义的缓存文件。这是一个调试选项。- immediate
- Unlink cache file after they were created. The cache files won't be
visible anymore, even though they're in use. This ensures they are
guaranteed to be removed from disk when the player terminates, even if
it crashes.
在创建后解除缓存文件的链接。即使它们正在使用中,缓存文件也将不再可见。这确保了在播放器终止时,即使它崩溃,它们也一定会从磁盘上删除。 - whendone
- Delete cache files after they are closed.
删除关闭后的缓存文件。 - no
- Don't delete cache files. They will consume disk space without having a
use.
不要删除缓存文件。它们在没有使用的情况下会消耗磁盘空间。
Currently, this is used for --cache-on-disk only.
目前,这仅用于 --cache-on-disk 。- --stream-buffer-size=<bytesize>
Size of the low level stream byte buffer (default: 128KB). This is used as buffer between demuxer and low level I/O (e.g. sockets). Generally, this can be very small, and the main purpose is similar to the internal buffer FILE in the C standard library will have.
低级流字节缓冲区的大小(默认:128KB)。这用作解复用器和低级 I/O(例如套接字)之间的缓冲区。通常,这可以非常小,主要目的是类似于 C 标准库中的内部缓冲区 FILE。Half of the buffer is always used for guaranteed seek back, which is important for unseekable input.
缓冲区的一半始终用于保证回溯,这对于不可回溯的输入非常重要。There are known cases where this can help performance to set a large buffer:
已知存在一些情况,设置大缓冲区可以有助于提高性能:- mp4 files. libavformat may trigger many small seeks in both
directions, depending on how the file was muxed.
mp4 文件。libavformat 可能会在文件如何复用的情况下,在两个方向上触发许多小范围查找。 - Certain network filesystems, which do not have a cache, and where
small reads can be inefficient.
某些没有缓存的网络文件系统,其中小范围读取可能效率低下。
In other cases, setting this to a large value can reduce performance.
在其他情况下,将此值设置得很大可能会降低性能。Usually, read accesses are at half the buffer size, but it may happen that accesses are done alternating with smaller and larger sizes (this is due to the internal ring buffer wrap-around).
通常,读取访问是缓冲区大小的一半,但可能会发生交替进行大小更小和更大的访问(这是由于内部环形缓冲区回绕造成的)。See --list-options for defaults and value range. <bytesize> options accept suffixes such as KiB and MiB.
查看 --list-options 以获取默认值和值范围。 <bytesize> 选项接受后缀,例如 KiB 和 MiB 。- mp4 files. libavformat may trigger many small seeks in both
directions, depending on how the file was muxed.
- --vd-queue-enable=<yes|no>, --ad-queue-enable
Enable running the video/audio decoder on a separate thread (default: no). If enabled, the decoder is run on a separate thread, and a frame queue is put between decoder and higher level playback logic. The size of the frame queue is defined by the other options below.
启用在单独的线程上运行视频/音频解码器(默认:否)。如果启用,解码器将在单独的线程上运行,并在解码器和高级播放逻辑之间放置一个帧队列。帧队列的大小由下面的其他选项定义。This is probably quite pointless. libavcodec already has multithreaded decoding (enabled by default), which makes this largely unnecessary. It might help in some corner cases with high bandwidth video that is slow to decode (in these cases libavcodec would block the playback logic, while using a decoding thread would distribute the decoding time evenly without affecting the playback logic). In other situations, it will simply make seeking slower and use significantly more memory.
"这可能相当没有意义。libavcodec 已经具有多线程解码功能(默认启用),这使得这基本上没有必要。它可能在某些角落案例中有所帮助,对于解码速度慢的高带宽视频(在这些情况下,libavcodec 会阻塞播放逻辑,而使用解码线程将均匀分配解码时间,而不会影响播放逻辑)。在其他情况下,它将简单地使搜索速度变慢并显著增加内存使用。The queue size is restricted by the other --vd-queue-... options. The final queue size is the minimum as indicated by the option with the lowest limit. Each decoder/track has its own queue that may use the full configured queue size.
队列大小受其他 --vd-queue-... 选项限制。最终队列大小是具有最低限制的选项所指示的最小值。每个解码器/轨道都有自己的队列,可能使用完全配置的队列大小。Most queue options can be changed at runtime. --vd-queue-enable itself (and the audio equivalent) update only if decoding is completely reinitialized. However, setting --vd-queue-max-samples=1 should almost lead to the same behavior as --vd-queue-enable=no, so that value can be used for effectively runtime enabling/disabling the queue.
大多数队列选项可以在运行时更改。 --vd-queue-enable 本身(以及音频等效项)只有在解码完全重新初始化时才会更新。然而,设置 --vd-queue-max-samples=1 应该几乎导致与 --vd-queue-enable=no 相同的行为,因此可以使用该值来有效地在运行时启用/禁用队列。This should not be used with hardware decoding. It is possible to enable this for audio, but it makes even less sense.
不应与硬件解码一起使用。虽然可以为此启用音频,但这几乎没有意义。- --vd-queue-max-bytes=<bytesize>, --ad-queue-max-bytes
Maximum approximate allowed size of the queue. If exceeded, decoding will be stopped. The maximum size can be exceeded by about 1 frame.
队列允许的最大近似大小。如果超过,解码将停止。最大大小可以超过大约 1 帧。See --list-options for defaults and value range. <bytesize> options accept suffixes such as KiB and MiB.
查看 --list-options 以获取默认值和值范围。 <bytesize> 选项接受后缀,例如 KiB 和 MiB 。- --vd-queue-max-samples=<int>, --ad-queue-max-samples
Maximum number of frames (video) or samples (audio) of the queue. The audio size may be exceeded by about 1 frame.
队列中最大帧数(视频)或样本数(音频)。音频大小可能超出约 1 帧。See --list-options for defaults and value range.
查看 --list-options 以获取默认值和值范围。- --vd-queue-max-secs=<seconds>, --ad-queue-max-secs
Maximum number of seconds of media in the queue. The special value 0 means no limit is set. The queue size may be exceeded by about 2 frames. Timestamp resets may lead to random queue size usage.
队列中媒体的最大秒数。特殊值 0 表示未设置限制。队列大小可能超出约 2 帧。时间戳重置可能导致随机使用队列大小。See --list-options for defaults and value range.
查看 --list-options 以获取默认值和值范围。
Network 网络
- --user-agent=<string>
- Use <string> as user agent for HTTP streaming.
使用 <string> 作为 HTTP 流的代理用户。 - --cookies=<yes|no>
- Support cookies when making HTTP requests. Disabled by default.
在发起 HTTP 请求时支持 cookies。默认禁用。 - --cookies-file=<filename>
- Read HTTP cookies from <filename>. The file is assumed to be in Netscape
format.
从读取 HTTP cookies。该文件假定使用 Netscape 格式。 - --http-header-fields=<field1,field2>
Set custom HTTP fields when accessing HTTP stream.
在访问 HTTP 流时设置自定义 HTTP 字段。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。Example 示例
mpv --http-header-fields='Field1: value1','Field2: value2' \ http://localhost:1234
Will generate HTTP request:
将生成 HTTP 请求:GET / HTTP/1.0 Host: localhost:1234 User-Agent: MPlayer Icy-MetaData: 1 Field1: value1 Field2: value2 Connection: close
- --http-proxy=<proxy>
- URL of the HTTP/HTTPS proxy. If this is set, the http_proxy environment
is ignored. The no_proxy environment variable is still respected. This
option is silently ignored if it does not start with http://. Proxies
are not used for https URLs. Setting this option does not try to make the
ytdl script use the proxy.
HTTP/HTTPS 代理的 URL。如果设置了此选项,则忽略 http_proxy 环境变量。仍然尊重 no_proxy 环境变量。如果此选项不以 http:// 开头,则静默忽略。对于 https URL 不使用代理。设置此选项不会尝试让 ytdl 脚本使用代理。 - --tls-ca-file=<filename>
- Certificate authority database file for use with TLS. (Silently fails with
older FFmpeg versions.)
"用于与 TLS 一起使用的证书授权数据库文件。(在较旧的 FFmpeg 版本中静默失败。)" - --tls-verify
- Verify peer certificates when using TLS (e.g. with https://...).
(Silently fails with older FFmpeg versions.)
"使用 TLS 时验证对等证书(例如,使用 https://... )。(在较旧的 FFmpeg 版本中静默失败。)" - --tls-cert-file
- A file containing a certificate to use in the handshake with the
peer.
"包含用于与对等方握手时使用的证书的文件。" - --tls-key-file
- A file containing the private key for the certificate.
"包含证书私钥的文件。" - --referrer=<string>
- Specify a referrer path or URL for HTTP requests.
指定 HTTP 请求的引用路径或 URL。 - --network-timeout=<seconds>
Specify the network timeout in seconds (default: 60 seconds). This affects at least HTTP. The special value 0 uses the FFmpeg defaults. If a protocol is used which does not support timeouts, this option is silently ignored.
指定网络超时时间(默认:60 秒)。这至少影响 HTTP。特殊值 0 使用 FFmpeg 默认值。如果使用不支持超时的协议,此选项将被静默忽略。Warning 警告
This breaks the RTSP protocol, because of inconsistent FFmpeg API regarding its internal timeout option. Not only does the RTSP timeout option accept different units (seconds instead of microseconds, causing mpv to pass it huge values), it will also overflow FFmpeg internal calculations. The worst is that merely setting the option will put RTSP into listening mode, which breaks any client uses. At time of this writing, the fix was not made effective yet. For this reason, this option is ignored (or should be ignored) on RTSP URLs. You can still set the timeout option directly with --demuxer-lavf-o.
这会破坏 RTSP 协议,因为 FFmpeg API 关于其内部超时选项不一致。不仅 RTSP 超时选项接受不同的单位(秒而不是微秒,导致 mpv 传递巨大的值),它还会溢出 FFmpeg 内部计算。最糟糕的是,仅仅设置此选项就会将 RTSP 置于监听模式,这会破坏任何客户端使用。在撰写本文时,修复尚未生效。因此,此选项在 RTSP URL 上被忽略(或应该被忽略)。您仍然可以直接使用 --demuxer-lavf-o 设置超时选项。- --rtsp-transport=<lavf|udp|udp_multicast|tcp|http>
- Select RTSP transport method (default: tcp). This selects the underlying
network transport when playing rtsp://... URLs. The value lavf
leaves the decision to libavformat.
选择 RTSP 传输方法(默认:tcp)。这将在播放 rtsp://... URLs 时选择底层网络传输。值 lavf 将决定权交给 libavformat。 - --hls-bitrate=<no|min|max|<rate>>
If HLS streams are played, this option controls what streams are selected by default. The option allows the following parameters:
如果播放 HLS 流,此选项控制默认选择的流。该选项允许以下参数:no: no: Don't do anything special. Typically, this will simply pick the first audio/video streams it can find.
不执行任何特殊操作。通常,这会简单地选择它找到的第一个音频/视频流。min: 最小值: Pick the streams with the lowest bitrate.
选择比特率最低的流。max: 最大值: Same, but highest bitrate. (Default.)
相同,但最高比特率。(默认。)Additionally, if the option is a number, the stream with the highest rate equal or below the option value is selected.
此外,如果选项是一个数字,则选择速率等于或低于选项值的最高速率的流。The bitrate as used is sent by the server, and there's no guarantee it's actually meaningful.
使用的比特率由服务器发送,无法保证它实际上是有意义的。
DVB
- --dvbin-prog=<string>
- This defines the program to tune to. Usually, you may specify this
by using a stream URI like "dvb://ZDF HD", but you can tune to a
different channel by writing to this property at runtime.
Also see dvbin-channel-switch-offset for more useful channel
switching functionality.
这定义了要调谐的程序。通常,您可以通过使用流 URI 如 "dvb://ZDF HD" 来指定此选项,但您可以在运行时写入此属性以调谐到不同的频道。有关更有用的频道切换功能,请参阅 dvbin-channel-switch-offset 。 - --dvbin-card=<0-15>
- Specifies using card number 0-15 (default: 0).
指定使用卡号 0-15(默认:0)。 - --dvbin-file=<filename>
- Instructs mpv to read the channels list from <filename>. The default is
in the mpv configuration directory (usually ~/.config/mpv) with the
filename channels.conf.{sat,ter,cbl,atsc,isdbt} (based on your card
type) or channels.conf as a last resort.
Please note that using specific file name with card type is recommended,
since the legacy channel format is not fully standardized
so autodetection of the delivery system may fail otherwise.
For DVB-S/2 cards, a VDR 1.7.x format channel list is recommended
as it allows tuning to DVB-S2 channels, enabling subtitles and
decoding the PMT (which largely improves the demuxing).
Classic mplayer format channel lists are still supported (without
these improvements), and for other card types, only limited VDR
format channel list support is implemented (patches welcome).
For channels with dynamic PID switching or incomplete
channels.conf, --dvbin-full-transponder or the magic PID
8192 are recommended.
指示 mpv 从 <filename> 读取通道列表。默认在 mpv 配置目录中(通常为 ~/.config/mpv ),文件名为 channels.conf.{sat,ter,cbl,atsc,isdbt} (根据您的卡类型)或 channels.conf 作为最后的手段。请注意,建议使用带有卡类型的特定文件名,因为传统的通道格式并未完全标准化,否则自动检测传输系统可能会失败。对于 DVB-S/2 卡,建议使用 VDR 1.7.x 格式的通道列表,因为它允许调谐到 DVB-S2 通道,启用字幕并解码 PMT(这大大提高了解复用)。仍然支持经典 mplayer 格式的通道列表(没有这些改进),而对于其他卡类型,仅实现了有限的 VDR 格式通道列表支持(欢迎补丁)。对于具有动态 PID 切换或不完整的 channels.conf 、 --dvbin-full-transponder 或魔法 PID 8192 的通道,建议使用。 - --dvbin-timeout=<seconds>
- Maximum number of seconds to wait when trying to tune a frequency before
giving up (default: 30).
在放弃之前尝试调谐频率的最大秒数(默认:30)。 - --dvbin-full-transponder=<yes|no>
Apply no filters on program PIDs, only tune to frequency and pass full transponder to demuxer. The player frontend selects the streams from the full TS in this case, so the program which is shown initially may not match the chosen channel. Switching between the programs is possible by cycling the program property. This is useful to record multiple programs on a single transponder, or to work around issues in the channels.conf. It is also recommended to use this for channels which switch PIDs on-the-fly, e.g. for regional news.
在程序 PIDs 上不应用任何过滤器,仅调整频率并将完整应答器传递给解复用器。在这种情况下,播放器前端从完整的 TS 中选择流,因此最初显示的程序可能不匹配所选频道。可以通过循环 program 属性在程序之间切换。这对于在单个应答器上记录多个程序或解决 channels.conf 中的问题很有用。还建议用于 PID 在线切换的频道,例如地区新闻。Default: no 默认: no
- --dvbin-channel-switch-offset=<integer>
This value is not meant for setting via configuration, but used in channel switching. An input.conf can cycle this value up and down to perform channel switching. This number effectively gives the offset to the initially tuned to channel in the channel list.
此值不用于通过配置设置,而是在频道切换中使用。一个 input.conf 可以 cycle 此值 up 并 down 以执行频道切换。此数字实际上给出了在频道列表中最初调谐到的频道的偏移量。An example input.conf could contain: H cycle dvbin-channel-switch-offset up, K cycle dvbin-channel-switch-offset down
一个示例 input.conf 可以包含: H cycle dvbin-channel-switch-offset up , K cycle dvbin-channel-switch-offset down
GPU renderer options GPU 渲染器选项
The following video options are currently all specific to --vo=gpu,
--vo=libmpv and --vo=gpu-next, which are the only VOs that implement
them.
以下视频选项目前都特定于 --vo=gpu , --vo=libmpv 和 --vo=gpu-next ,它们是唯一实现这些视频选项的 VOs。
- --scale=<filter>
The filter function to use when upscaling video.
放大视频时使用的过滤器函数。- bilinear
- Bilinear hardware texture filtering (fastest, very low quality). This is
the default when using the fast profile.
双线性硬件纹理过滤(最快,非常低质量)。当使用 fast 配置文件时,这是默认设置。 - lanczos
Lanczos scaling. Provides good balance between quality and performance. This is the default for scale. The number of taps can be controlled with scale-radius, but is best left unchanged.
Lanczos 缩放。在质量和性能之间提供良好的平衡。这是默认值 scale 。可以通过 scale-radius 控制触点数量,但最好保持不变。(This filter is an alias for sinc-windowed sinc)
(此滤波器是 sinc -windowed sinc 的别名)- ewa_lanczos
Elliptic weighted average Lanczos scaling. Also known as Jinc. Relatively slow, but very good quality. The radius can be controlled with scale-radius. Increasing the radius makes the filter sharper but adds more ringing.
椭圆加权平均 Lanczos 缩放。也称为 Jinc。相对较慢,但质量非常好。半径可以通过 scale-radius 控制。增加半径会使滤波器更锐利,但会增加更多的振铃。(This filter is an alias for jinc-windowed jinc)
(此滤波器是 jinc -windowed jinc 的别名)- ewa_lanczossharp
- A slightly sharpened version of ewa_lanczos. This is the default
when using the high-quality profile. Blur value determined by method
originally developed by Nicolas Robidoux for Image Magick, see:
https://www.imagemagick.org/discourse-server/viewtopic.php?p=89068#p89068
对 ewa_lanczos 略微锐化的版本。这是使用 high-quality 配置文件时的默认设置。模糊值由 Nicolas Robidoux 最初为 Image Magick 开发的方法确定,请参阅:https://www.imagemagick.org/discourse-server/viewtopic.php?p=89068#p89068 - ewa_lanczos4sharpest
Very sharp scaler, but also slightly slower than ewa_lanczossharp. Prone to ringing, so it's recommended to combine this with an anti-ringing shader. On --vo=gpu-next, setting this filter enables built-in anti-ringing, so no extra action needs to be taken.
非常锐利的缩放器,但比 ewa_lanczossharp 略慢。容易产生振铃,因此建议与抗振铃着色器结合使用。在 --vo=gpu-next 上,设置此过滤器将启用内置抗振铃,因此无需采取额外操作。For more details, see: https://www.imagemagick.org/discourse-server/viewtopic.php?p=128587#p128587
- mitchell
- Mitchell-Netravali. Piecewise cubic filter with a support of radius 2.0. Provides a balanced compromise of all scaling artifacts. This filter has both B and C set to 1/3. The B and C parameters can be controlled with --scale-param1 and --scale-param2.
- hermite
- Hermite spline. Similar to bicubic but with B set to 0.0. This filter has the special property of having a support of radius 1.0, making it very fast in comparison, but prone to blocking. This is the default for --dscale.
- catmull_rom
- Catmull-Rom spline. Similar to mitchell, but with B and C set to 0.0 and 0.5 respectively. This filter is sharper than mitchell, but prone to ringing.
- oversample
- A version of nearest neighbour that (naively) oversamples pixels, so
that pixels overlapping edges get linearly interpolated instead of
rounded. This essentially removes the small imperfections and judder
artifacts caused by nearest-neighbour interpolation, in exchange for
adding some blur. This can also be used for frame mixing, where it
is commonly known as "smoothmotion" (see --tscale).
一种近邻版本,(天真地)对像素进行过采样,以便重叠边缘的像素进行线性插值而不是舍入。这实际上消除了由最近邻插值引起的小缺陷和抖动伪影,但同时也增加了一些模糊。这也可以用于帧混合,通常被称为“平滑运动”(见 --tscale )。 - linear
- A --tscale filter. 一个 --tscale 过滤器。
There are some more filters, but most are not as useful. For a complete list, pass help as value, e.g.:
有一些更多的过滤器,但大多数都不太有用。要获取完整列表,请将 help 作为值传递,例如:mpv --scale=help
- --cscale=<filter>
- As --scale, but for interpolating chroma information. If the image is
not subsampled, this option is ignored entirely. If this option is unset,
the filter implied by --scale will be applied.
类似于 --scale ,但用于插值色度信息。如果图像没有子采样,则此选项完全忽略。如果此选项未设置,则将应用由 --scale 暗示的过滤器。 - --dscale=<filter>
- Like --scale, but apply these filters on downscaling instead.
类似于 --scale ,但将这些过滤器应用于下采样。 - --tscale=<filter>
The filter used for interpolating the temporal axis (frames). This is only used if --interpolation is enabled. The only valid choices for --tscale are separable convolution filters (use --tscale=help to get a list). The default is oversample.
用于插值时间轴(帧)的过滤器。仅在启用 --interpolation 时使用。对于 --tscale 的唯一有效选择是可分离卷积过滤器(使用 --tscale=help 获取列表)。默认为 oversample 。Common --tscale choices include oversample, linear, catmull_rom, mitchell, gaussian, or bicubic. These are listed in increasing order of smoothness/blurriness, with bicubic being the smoothest/blurriest and oversample being the sharpest/least smooth.
常见的 --tscale 选项包括 oversample 、 linear 、 catmull_rom 、 mitchell 、 gaussian 或 bicubic 。这些选项按照平滑度/模糊度递增排序,其中 bicubic 是最平滑/最模糊的, oversample 是最清晰/最不平滑的。- --scale-param1=<value>, --scale-param2=<value>, --cscale-param1=<value>, --cscale-param2=<value>, --dscale-param1=<value>, --dscale-param2=<value>, --tscale-param1=<value>, --tscale-param2=<value>
Set filter parameters. By default, these are set to the special string default, which maps to a scaler-specific default value. Ignored if the filter is not tunable. Currently, this affects the following filter parameters:
设置过滤器参数。默认情况下,这些参数设置为特殊字符串 default ,它映射到特定缩放器的默认值。如果过滤器不可调整,则忽略。目前,这影响以下过滤器参数:- bicubic 双三次插值
- Spline parameters (B and C). Defaults to B=1 and C=0.
样条参数( B 和 C )。默认值为 B=1 和 C=0。 - gaussian 高斯
- Scale parameter (t). Increasing this makes the result blurrier.
Defaults to 1.
尺度参数( t )。增加此值会使结果更加模糊。默认值为 1。 - oversample 过采样
- Minimum distance to an edge before interpolation is used. Setting this
to 0 will always interpolate edges, whereas setting it to 0.5 will
never interpolate, thus behaving as if the regular nearest neighbour
algorithm was used. Defaults to 0.0.
在插值之前到边缘的最小距离。将此设置为 0 将始终进行边缘插值,而将此设置为 0.5 将永远不会进行插值,因此表现得像常规最近邻算法一样。默认值为 0.0。
- --scale-blur=<value>, --cscale-blur=<value>, --dscale-blur=<value>, --tscale-blur=<value>
- Kernel scaling factor (also known as a blur factor). Decreasing this makes
the result sharper, increasing it makes it blurrier (default 0). If set to
0, the kernel's preferred blur factor is used. Note that setting this too
low (eg. 0.5) leads to bad results. It's generally recommended to stick to
values between 0.8 and 1.2.
内核缩放因子(也称为模糊因子)。减小此值会使结果更清晰,增大此值会使图像更模糊(默认值 0)。如果设置为 0,则使用内核首选的模糊因子。请注意,设置得太低(例如 0.5)会导致不良结果。通常建议保持在 0.8 和 1.2 之间的值。 - --scale-clamp=<0.0-1.0>, --cscale-clamp, --dscale-clamp, --tscale-clamp
- Specifies a weight bias to multiply into negative coefficients. Specifying
--scale-clamp=1 has the effect of removing negative weights completely,
thus effectively clamping the value range to [0-1]. Values between 0.0 and
1.0 can be specified to apply only a moderate diminishment of negative
weights. This is especially useful for --tscale, where it reduces
excessive ringing artifacts in the temporal domain (which typically
manifest themselves as short flashes or fringes of black, mostly around
moving edges) in exchange for potentially adding more blur. The default for
--tscale-clamp is 1.0, the others default to 0.0.
指定一个权重偏差,用于乘以负系数。指定 --scale-clamp=1 的效果是完全移除负权重,从而有效地将值范围限制在 [0-1]。可以指定介于 0.0 和 1.0 之间的值,以仅适度减少负权重。这对于 --tscale 特别有用,因为它可以减少时间域中的过度振铃伪影(通常表现为短暂的闪光或黑色边缘),但可能会增加更多的模糊。 --tscale-clamp 的默认值为 1.0,其他默认值为 0.0。 - --scale-taper=<value>, --scale-wtaper=<value>, --dscale-taper=<value>, --dscale-wtaper=<value>, --cscale-taper=<value>, --cscale-wtaper=<value>, --tscale-taper=<value>, --tscale-wtaper=<value>
- Kernel/window taper factor. Increasing this flattens the filter function.
Value range is 0 to 1. A value of 0 (the default) means no flattening, a
value of 1 makes the filter completely flat (equivalent to a box function).
Values in between mean that some portion will be flat and the actual filter
function will be squeezed into the space in between.
内核/窗口衰减因子。增加此值会使滤波函数变平。值范围是 0 到 1。值为 0(默认值)表示没有变平,值为 1 使滤波器完全变平(相当于箱函数)。中间的值表示部分将变平,实际滤波函数将被挤压到中间的空间。 - --scale-radius=<value>, --cscale-radius=<value>, --dscale-radius=<value>, --tscale-radius=<value>
Set radius for tunable filters, must be a float number between 0.5 and 16.0. Defaults to the filter's preferred radius if not specified. Doesn't work for every scaler and VO combination.
设置可调滤波器的半径,必须是一个介于 0.5 和 16.0 之间的浮点数。如果没有指定,则默认为滤波器首选的半径。对于每个缩放器和 VO 组合可能不起作用。Note that depending on filter implementation details and video scaling ratio, the radius that actually being used might be different (most likely being increased a bit).
请注意,根据滤波器实现细节和视频缩放比例,实际使用的半径可能不同(最可能的情况是略微增加)。- --scale-antiring=<value>, --cscale-antiring=<value>, --dscale-antiring=<value>, --tscale-antiring=<value>
Set the antiringing strength. This tries to eliminate ringing, but can introduce other artifacts in the process. Must be a float number between 0.0 and 1.0. The default value of 0.0 disables antiringing entirely.
设置抗振铃强度。这试图消除振铃,但在过程中可能会引入其他伪影。必须是一个介于 0.0 和 1.0 之间的浮点数。默认值 0.0 完全禁用抗振铃。Note that this doesn't affect the special filters bilinear and bicubic_fast, nor does it affect any polar (EWA) scalers.
请注意,这不会影响特殊过滤器 bilinear 和 bicubic_fast ,也不会影响任何极坐标(EWA)缩放器。On --vo=gpu-next, this also affects polar (EWA) scalers. Certain filter aliases may also implicitly enable antiringing, regardless of this setting (see --scale).
在 --vo=gpu-next 上,这也会影响极坐标(EWA)缩放器。某些过滤器别名也可能隐式启用抗振铃,无论此设置如何(见 --scale )。Note 注意
When downscaling with separable (orthogonal) filters, setting --dscale-antiring to a value other than 0.0 (default) will reduce scaler quality and produce aliasing artifacts. On --vo=gpu-next, --dscale-antiring is disabled for separable (orthogonal) filters.
当使用可分离(正交)过滤器降采样时,将 --dscale-antiring 设置为非 0.0(默认值)的值将降低缩放器质量并产生混叠伪影。在 --vo=gpu-next 上, --dscale-antiring 对于可分离(正交)过滤器被禁用。- --scale-window=<window>, --cscale-window=<window>, --dscale-window=<window>, --tscale-window=<window>
- (Advanced users only) Choose a custom windowing function for the kernel.
Defaults to the filter's preferred window if unset. Use
--scale-window=help to get a list of supported windowing functions.
(仅限高级用户)为内核选择一个自定义窗口函数。如果未设置,则默认为过滤器首选的窗口。使用 --scale-window=help 获取支持的窗口函数列表。 - --scale-wparam=<window>, --cscale-wparam=<window>, --cscale-wparam=<window>, --tscale-wparam=<window>
(Advanced users only) Configure the parameter for the window function given by --scale-window etc. By default, these are set to the special string default, which maps to a window-specific default value. Ignored if the window is not tunable. Currently, this affects the following window parameters:
(仅限高级用户)配置由 --scale-window 等提供的窗口函数参数。默认情况下,这些设置为特殊字符串 default ,它映射到窗口特定的默认值。如果窗口不可调整,则忽略。目前,这影响以下窗口参数:- kaiser
- Window parameter (alpha). Defaults to 6.33.
窗口参数(alpha)。默认值为 6.33。 - blackman
- Window parameter (alpha). Defaults to 0.16.
窗口参数(alpha)。默认值为 0.16。 - gaussian 高斯
- Scale parameter (t). Increasing this makes the window wider. Defaults
to 1.
缩放参数 (t)。增加此值会使窗口更宽。默认值为 1。
- --scaler-resizes-only
- Disable the scaler if the video image is not resized. In that case,
bilinear is used instead of whatever is set with --scale. Bilinear
will reproduce the source image perfectly if no scaling is performed.
Enabled by default. Note that this option never affects --cscale.
如果视频图像未进行缩放,则禁用缩放器。在这种情况下,使用 bilinear 而不是通过 --scale 设置的内容。如果未执行缩放,双线性插值将完美复制源图像。默认启用。请注意,此选项永远不会影响 --cscale 。 - --correct-downscaling
When using convolution based filters, extend the filter size when downscaling. Increases quality, but reduces performance while downscaling. Enabled by default.
当使用基于卷积的过滤器时,在降采样时扩展过滤器大小。提高质量,但降低降采样时的性能。默认启用。This will perform slightly sub-optimally for anamorphic video (but still better than without it) since it will extend the size to match only the milder of the scale factors between the axes.
此操作对于非变形视频将略微次优(但仍然比没有它好),因为它将扩展大小以匹配轴之间的较轻的缩放因子。Note: this option is ignored when using bilinear downscaling with --vo=gpu.
注意:当使用带有 --vo=gpu 的双线性降采样时,此选项将被忽略。- --linear-downscaling
- Scale in linear light when downscaling. It should only be used with a
--fbo-format that has at least 16 bit precision. This option
has no effect on HDR content. Enabled by default.
降采样时以线性光进行缩放。它仅应与至少具有 16 位精度的 --fbo-format 一起使用。此选项对 HDR 内容没有影响。默认启用。 - --linear-upscaling
- Scale in linear light when upscaling. Like --linear-downscaling, it
should only be used with a --fbo-format that has at least 16 bits
precisions. This is not usually recommended except for testing/specific
purposes. Users are advised to either enable --sigmoid-upscaling or
keep both options disabled (i.e. scaling in gamma light).
升采样时以线性光进行缩放。与 --linear-downscaling 类似,它仅应与至少具有 16 位精度的 --fbo-format 一起使用。这通常不推荐,除非用于测试/特定目的。建议用户启用 --sigmoid-upscaling 或保持两个选项都禁用(即以伽玛光进行缩放)。 - --sigmoid-upscaling
When upscaling, use a sigmoidal color transform to avoid emphasizing ringing artifacts. Enabled by default. This is incompatible with and replaces --linear-upscaling. (Note that sigmoidization also requires linearization, so the LINEAR rendering step fires in both cases)
在放大时,使用 S 型颜色转换以避免强调振铃伪影。默认启用。这与 --linear-upscaling 不兼容,并替换它。(注意,S 型化还需要线性化,因此 LINEAR 渲染步骤在两种情况下都会触发)For more information about sigmoidization, see: https://imagemagick.org/Usage/resize/#resize_sigmoidal
有关 S 型化的更多信息,请参阅:https://imagemagick.org/Usage/resize/#resize_sigmoidal- --sigmoid-center
- The center of the sigmoid curve used for --sigmoid-upscaling, must be a
float between 0.0 and 1.0. Defaults to 0.75 if not specified.
用于 --sigmoid-upscaling 的 S 型曲线的中心必须是一个介于 0.0 和 1.0 之间的浮点数。如果未指定,则默认为 0.75。 - --sigmoid-slope
- The slope of the sigmoid curve used for --sigmoid-upscaling, must be a
float between 1.0 and 20.0. Defaults to 6.5 if not specified.
用于 --sigmoid-upscaling 的 S 型曲线的斜率必须是一个介于 1.0 和 20.0 之间的浮点数。如果未指定,则默认为 6.5。 - --interpolation
Reduce stuttering caused by mismatches in the video fps and display refresh rate (also known as judder).
减少由视频 fps 和显示刷新率不匹配(也称为抖动)引起的卡顿。Warning 警告
This requires setting the --video-sync option to one of the display- modes, or it will be silently disabled. This was not required before mpv 0.14.0.
这需要将 --video-sync 选项设置为 display- 模式之一,否则它将被静默禁用。在 mpv 0.14.0 之前,这不是必需的。This essentially attempts to interpolate the missing frames by convoluting the video along the temporal axis. The filter used can be controlled using the --tscale setting.
这本质上尝试通过沿时间轴卷积视频来插值缺失的帧。可以使用 --tscale 设置来控制使用的过滤器。- --interpolation-threshold=<0..1,-1>
Threshold below which frame ratio interpolation gets disabled (default: 0.01). This is calculated as abs(disphz/vfps - 1) < threshold, where vfps is the speed-adjusted video FPS, and disphz the display refresh rate. (The speed-adjusted video FPS is roughly equal to the normal video FPS, but with slowdown and speedup applied. This matters if you use --video-sync=display-resample to make video run synchronously to the display FPS, or if you change the speed property.)
阈值以下帧率插值被禁用(默认: 0.01 )。这被计算为 abs(disphz/vfps - 1) < threshold ,其中 vfps 是速度调整后的视频 FPS, disphz 是显示刷新率。(速度调整后的视频 FPS 大致等于正常视频 FPS,但应用了减速和加速。如果你使用 --video-sync=display-resample 使视频与显示 FPS 同步运行,或者更改 speed 属性,这很重要。)The default is intended to enable interpolation in scenarios where retiming with the --video-sync=display-* cannot adjust the speed of the video sufficiently for smooth playback. For example if a video is 60.00 FPS and your display refresh rate is 59.94 Hz, interpolation will never be activated, since the mismatch is within 1% of the refresh rate. The default also handles the scenario when mpv cannot determine the container FPS, such as during certain live streams, and may dynamically toggle interpolation on and off. In this scenario, the default would be to not use interpolation but rather to allow --video-sync=display-* to retime the video to match display refresh rate. See --video-sync-max-video-change for more information about how mpv will retime video.
默认设置旨在在无法通过 --video-sync=display-* 足够调整视频速度以实现流畅播放的场景中启用插值。例如,如果视频是 60.00 FPS,而你的显示刷新率是 59.94 Hz,由于不匹配在刷新率的 1%以内,插值永远不会被激活。默认设置还处理了 mpv 无法确定容器 FPS 的情况,例如在某些直播中,可能会动态切换插值的开和关。在这种情况下,默认设置将不使用插值,而是允许 --video-sync=display-* 重定时视频以匹配显示刷新率。有关 mpv 如何重定时视频的更多信息,请参阅 --video-sync-max-video-change 。Also note that if you use e.g. --video-sync=display-vdrop, small deviations in the rate can disable interpolation and introduce a discontinuity every other minute.
此外,请注意,如果您使用例如 --video-sync=display-vdrop ,则速率的小幅偏差可能会禁用插值并在每分钟引入一个不连续点。Set this to -1 to disable this logic.
将其设置为 -1 以禁用此逻辑。- --interpolation-preserve
- Preserve the previous frames' interpolated results even when renderer
parameters are changed - with the exception of options related to
cropping and video placement, which always invalidate the cache. Enabling
this option makes dynamic updates of renderer settings slightly smoother at
the cost of slightly higher latency in response to such changes. Defaults
to on. (Only affects --vo=gpu-next, note that --vo=gpu always
invalidates interpolated frames)
即使渲染器参数发生变化,也保留之前帧的插值结果 - 除了与裁剪和视频位置相关的选项,这些选项始终使缓存无效。启用此选项可以使动态更新渲染器设置稍微平滑一些,但会略微增加对这种变化的响应延迟。默认为开启。仅影响 --vo=gpu-next ,请注意 --vo=gpu 总是使插值帧无效。 - --opengl-pbo
- Enable use of PBOs. On some drivers this can be faster, especially if the
source video size is huge (e.g. so called "4K" video). On other drivers it
might be slower or cause latency issues.
启用使用 PBOs。在某些驱动程序上,这可能会更快,特别是如果源视频大小很大(例如所谓的“4K”视频)。在其他驱动程序上,可能会更慢或引起延迟问题。 - --dither-depth=<N|no|auto>
Set dither target depth to N. Default: auto.
设置抖动目标深度为 N。默认:自动。- no 无
- Disable any dithering done by mpv.
禁用 mpv 执行的任何抖动。 - auto 自动
- Automatic selection.
On --vo=gpu: detected depth or 8 bpc otherwise
On --vo=gpu-next: detected depth or 8 bpc (for SDR target)
自动选择。在 --vo=gpu : 检测到的深度或 8 bpc 否则 在 --vo=gpu-next : 检测到的深度或 8 bpc(对于 SDR 目标) - 8
- Dither to 8 bit output.
抖动到 8 位输出。
Note that the on-the-wire bit depth cannot be detected except when using gpu-api=d3d11. Explicitly setting the value to your display's bit depth is recommended, as dithering performed by some LCD panels can be of low quality.
请注意,除非使用 gpu-api=d3d11 ,否则无法检测到线上的位深度。建议显式设置值为您的显示器的位深度,因为某些 LCD 面板执行的抖动可能质量较低。- --dither-size-fruit=<2-8>
Set the size of the dither matrix (default: 6). The actual size of the matrix is (2^N) x (2^N) for an option value of N, so a value of 6 gives a size of 64x64. The matrix is generated at startup time, and a large matrix can take rather long to compute (seconds).
设置抖动矩阵的大小(默认:6)。矩阵的实际大小为 (2^N) x (2^N) ,对于选项值 N ,因此 6 的值为 64x64。矩阵在启动时生成,大型矩阵可能需要较长时间计算(秒)。Used in --dither=fruit mode only.
仅用于 --dither=fruit 模式。- --dither=<fruit|ordered|error-diffusion|no>
Select dithering algorithm (default: fruit). (Normally, the --dither-depth option controls whether dithering is enabled.)
选择抖动算法(默认:fruit)。(通常, --dither-depth 选项控制是否启用抖动。)The error-diffusion option requires compute shader support. It also requires large amount of shared memory to run, the size of which depends on both the kernel (see --error-diffusion option below) and the height of video window. It will fallback to fruit dithering if there is no enough shared memory to run the shader.
error-diffusion 选项需要计算着色器支持。它还需要大量的共享内存来运行,其大小取决于内核(见下面的 --error-diffusion 选项)和视频窗口的高度。如果没有足够的共享内存来运行着色器,它将回退到 fruit 抖动。- --temporal-dither
- Enable temporal dithering. (Only active if dithering is enabled in
general.) This changes between 8 different dithering patterns on each frame
by changing the orientation of the tiled dithering matrix. Unfortunately,
this can lead to flicker on LCD displays, since these have a high reaction
time.
启用时间抖动。 (仅在全局启用抖动时生效。) 这会在每一帧之间改变 8 种不同的抖动模式,通过改变分块抖动矩阵的取向。不幸的是,这可能导致 LCD 显示器上的闪烁,因为这些显示器具有较长的反应时间。 - --temporal-dither-period=<1-128>
- Determines how often the dithering pattern is updated when
--temporal-dither is in use. 1 (the default) will update on every video
frame, 2 on every other frame, etc.
确定当使用 --temporal-dither 时,抖动模式更新的频率。1(默认值)会在每个视频帧更新,2 会在每两个帧更新,等等。 - --error-diffusion=<kernel>
The error diffusion kernel to use when --dither=error-diffusion is set.
当 --dither=error-diffusion 设置时使用的误差扩散内核。- simple
- Propagate error to only two adjacent pixels. Fastest but low quality.
仅将误差传播到两个相邻像素。最快但质量较低。 - sierra-lite
- Fast with reasonable quality. This is the default.
运行速度快,质量合理。这是默认设置。 - floyd-steinberg
- Most notable error diffusion kernel.
最显著的误差扩散核。 - atkinson
- Looks different from other kernels because only fraction of errors will
be propagated during dithering. A typical use case of this kernel is
saving dithered screenshot (in window mode). This kernel produces
slightly smaller file, with still reasonable dithering quality.
与其他核相比看起来不同,因为在抖动过程中只有一部分误差会被传播。此核的典型用途是保存抖动屏幕截图(在窗口模式下)。此核生成的文件略小,抖动质量仍然合理。
There are other kernels (use --error-diffusion=help to list) but most of them are much slower and demanding even larger amount of shared memory. Among these kernels, burkes achieves a good balance between performance and quality, and probably is the one you want to try first.
还有其他核(使用 --error-diffusion=help 列出),但它们大多数运行速度较慢,甚至需要更多的共享内存。在这些核中, burkes 在性能和质量之间取得了良好的平衡,可能也是您首先想要尝试的。- --gpu-debug
- Enables GPU debugging. What this means depends on the API type. For OpenGL,
it calls glGetError(), and requests a debug context. For Vulkan, it
enables validation layers.
启用 GPU 调试。这意味着取决于 API 类型。对于 OpenGL,它调用 glGetError() ,并请求一个调试上下文。对于 Vulkan,它启用验证层。 - --opengl-swapinterval=<n>
Interval in displayed frames between two buffer swaps. 1 is equivalent to enable VSYNC, 0 to disable VSYNC. Defaults to 1 if not specified.
两次缓冲区交换之间显示的帧间隔。1 相当于启用 VSYNC,0 禁用 VSYNC。如果未指定,则默认为 1。Note that this depends on proper OpenGL vsync support. On some platforms and drivers, this only works reliably when in fullscreen mode. It may also require driver-specific hacks if using multiple monitors, to ensure mpv syncs to the right one. Compositing window managers can also lead to bad results, as can missing or incorrect display FPS information (see --display-fps-override).
请注意,这取决于适当的 OpenGL vsync 支持。在某些平台和驱动程序上,这仅在全屏模式下才能可靠地工作。如果使用多个显示器,可能还需要针对特定驱动程序的技巧,以确保 mpv 同步到正确的显示器。合成窗口管理器也可能导致不良结果,以及缺失或不正确的显示 FPS 信息(见 --display-fps-override )。- --egl-config-id=<ID>
- (EGL only)
Select EGLConfig with specific EGL_CONFIG_ID.
Rendering surfaces and contexts will be created using this EGLConfig.
You can use --msg-level=vo=trace to obtain a list of available configs.
(仅 EGL) 使用特定的 EGL_CONFIG_ID 选择 EGLConfig。将使用此 EGLConfig 创建渲染表面和上下文。您可以使用 --msg-level=vo=trace 获取可用配置的列表。 - --egl-output-format=<auto|rgb8|rgba8|rgb10|rgb10_a2|rgb16|rgba16|rgb16f|rgba16f|rgb32f|rgba32f>
(EGL only) Select a specific EGL output format to utilize for OpenGL rendering. This option is mutually exclusive with --egl-config-id. "auto" is the default, which will pick the first usable config based on the order given by the driver.
(EGL 仅限) 选择用于 OpenGL 渲染的特定 EGL 输出格式。此选项与 --egl-config-id 互斥。默认值为"auto",它将根据驱动程序提供的顺序选择第一个可用的配置。All formats are not available. A fatal error is caused if an unavailable format is selected.
并非所有格式都可用。如果选择不可用的格式,将导致致命错误。Note 注意
There is no reliable API to query desktop bit depth in EGL. You can manually set this option according to the bit depth of your display. This option also affects the auto-detection of --dither-depth.
没有可靠的 API 可以查询 EGL 中的桌面位深度。您可以根据显示器的位深度手动设置此选项。此选项还会影响 --dither-depth 的自动检测。Note 注意
Unlike --d3d11-output-format, this option also takes effect with --vo=gpu-next.
与 --d3d11-output-format 不同,此选项在 --vo=gpu-next 中也生效。- --vulkan-device=<device name|UUID>
- The name or UUID of the Vulkan device to use for rendering and presentation. Use
--vulkan-device=help to see the list of available devices and their
names and UUIDs. If left unspecified, the first enumerated hardware Vulkan
device will be used.
用于渲染和展示的 Vulkan 设备的名称或 UUID。使用 --vulkan-device=help 查看可用设备及其名称和 UUID 列表。如果未指定,将使用第一个枚举的硬件 Vulkan 设备。 - --vulkan-swap-mode=<mode>
Controls the presentation mode of the vulkan swapchain. This is similar to the --opengl-swapinterval option.
控制 vulkan swapchain 的展示模式。这与 --opengl-swapinterval 选项类似。- auto 自动
- Use the preferred swapchain mode for the vulkan context. (Default)
使用 vulkan 上下文的推荐 swapchain 模式。(默认) - fifo
- Non-tearing, vsync blocked. Similar to "VSync on".
非撕裂,垂直同步被阻止。类似于“垂直同步开启”。 - fifo-relaxed
- Tearing, vsync blocked. Late frames will tear instead of stuttering.
撕裂,垂直同步被阻塞。延迟帧将撕裂而不是卡顿。 - mailbox 邮箱
- Non-tearing, not vsync blocked. Similar to "triple buffering".
无撕裂,不阻塞 vsync。类似于“三缓冲”。 - immediate 立即
- Tearing, not vsync blocked. Similar to "VSync off".
撕裂,不阻塞 vsync。类似于“VSync 关闭”。
- --vulkan-queue-count=<1..8>
- Controls the number of VkQueues used for rendering (limited by how many
your device supports). In theory, using more queues could enable some
parallelism between frames (when using a --swapchain-depth higher than
1), but it can also slow things down on hardware where there's no true
parallelism between queues. (Default: 1)
控制用于渲染的 VkQueues 数量(受限于您的设备支持的多少)。理论上,使用更多的队列可以在帧之间启用一些并行性(当使用大于 1 的 --swapchain-depth 时),但在没有真正队列之间并行性的硬件上,它也可能减慢速度。(默认:1) - --vulkan-async-transfer
- Enables the use of async transfer queues on supported vulkan devices. Using
them allows transfer operations like texture uploads and blits to happen
concurrently with the actual rendering, thus improving overall throughput
and power consumption. Enabled by default, and should be relatively safe.
启用在支持的 vulkan 设备上使用异步传输队列。使用它们允许传输操作,如纹理上传和 blits,与实际渲染同时发生,从而提高整体吞吐量和功耗。默认启用,相对安全。 - --vulkan-async-compute
- Enables the use of async compute queues on supported vulkan devices. Using
this, in theory, allows out-of-order scheduling of compute shaders with
graphics shaders, thus enabling the hardware to do more effective work while
waiting for pipeline bubbles and memory operations. Not beneficial on all
GPUs. It's worth noting that if async compute is enabled, and the device
supports more compute queues than graphics queues (bound by the restrictions
set by --vulkan-queue-count), mpv will internally try and prefer the
use of compute shaders over fragment shaders wherever possible. Enabled by
default, although Nvidia users may want to disable it.
启用在支持的 vulkan 设备上使用异步计算队列。使用此功能,从理论上讲,允许计算着色器与图形着色器进行无序调度,从而使得硬件在等待管道气泡和内存操作时能更有效地工作。并非所有 GPU 都有益。值得注意的是,如果启用了异步计算,并且设备支持的计算队列比图形队列多(受 --vulkan-queue-count 设置的限制),mpv 将尝试并尽可能优先使用计算着色器而不是片段着色器。默认启用,尽管 Nvidia 用户可能希望禁用它。 - --vulkan-display-display=<n>
- The index of the display, on the selected Vulkan device, to present on when
using the displayvk GPU context. Use --vulkan-display-display=help
to see the list of available displays. If left unspecified, the first
enumerated display will be used.
在选中 Vulkan 设备上使用 displayvk GPU 上下文时,要呈现的显示索引。使用 --vulkan-display-display=help 查看可用显示列表。如果未指定,将使用第一个枚举的显示。 - --vulkan-display-mode=<n>
- The index of the display mode, of the selected Vulkan display, to use when
using the displayvk GPU context. Use --vulkan-display-mode=help
to see the list of available modes. If left unspecified, the first
enumerated mode will be used.
在选中 Vulkan 显示上使用 displayvk GPU 上下文时,要使用的显示模式索引。使用 --vulkan-display-mode=help 查看可用模式列表。如果未指定,将使用第一个枚举的模式。 - --vulkan-display-plane=<n>
- The index of the plane, on the selected Vulkan device, to present on when
using the displayvk GPU context. Use --vulkan-display-plane=help
to see the list of available planes. If left unspecified, the first
enumerated plane will be used.
平面的索引,在选定的 Vulkan 设备上,当使用 displayvk GPU 上下文时用于呈现。使用 --vulkan-display-plane=help 查看可用平面的列表。如果未指定,将使用第一个枚举平面。 - --d3d11-exclusive-fs=<yes|no>
- Switches the D3D11 swap chain fullscreen state to 'fullscreen' when
fullscreen video is requested. Also known as "exclusive fullscreen" or
"D3D fullscreen" in other applications. Gives mpv full control of
rendering on the swap chain's screen. Off by default.
当请求全屏视频时,将 D3D11 交换链的全屏状态切换到'全屏'。在其他应用程序中也称为“独占全屏”或“D3D 全屏”。使 mpv 完全控制交换链屏幕上的渲染。默认关闭。 - --d3d11-warp=<yes|no|auto>
- Use WARP (Windows Advanced Rasterization Platform) with the D3D11 GPU
backend (default: auto). This is a high performance software renderer. By
default, it is only used when the system has no hardware adapters that
support D3D11. While the extended GPU features will work with WARP, they
can be very slow.
使用 WARP(Windows 高级光栅化平台)与 D3D11 GPU 后端(默认:自动)。这是一个高性能的软件渲染器。默认情况下,仅在系统没有支持 D3D11 的硬件适配器时使用。虽然扩展的 GPU 功能可以使用 WARP,但它们可能非常慢。 - --d3d11-feature-level=<12_1|12_0|11_1|11_0|10_1|10_0|9_3|9_2|9_1>
- Select a specific feature level when using the D3D11 GPU backend. By
default, the highest available feature level is used. This option can be
used to select a lower feature level, which is mainly useful for debugging.
Most extended GPU features will not work at 9_x feature levels.
在使用 D3D11 GPU 后端时选择特定的功能级别。默认情况下,使用最高可用的功能级别。此选项可用于选择较低的功能级别,这对于调试非常有用。在 9_x 功能级别下,大多数扩展 GPU 功能将无法工作。 - --d3d11-flip=<yes|no>
Enable flip-model presentation, which avoids unnecessarily copying the backbuffer by sharing surfaces with the DWM (default: yes). This may cause performance issues with older drivers. If flip-model presentation is not supported (for example, on Windows 7 without the platform update), mpv will automatically fall back to the older bitblt presentation model.
启用翻转模型展示,通过与 DWM 共享表面来避免不必要地复制后缓冲区(默认:是)。这可能会导致较旧驱动程序的性能问题。如果翻转模型展示不受支持(例如,在未安装平台更新的 Windows 7 上),mpv 将自动回退到较旧的 bitblt 展示模型。flip-model needs presentation needs to be disabled for background transparency to work.
翻转模型展示需要禁用,以便背景透明度可以工作。- --d3d11-sync-interval=<0..4>
- Schedule each frame to be presented for this number of VBlank intervals.
(default: 1) Setting to 1 will enable VSync, setting to 0 will disable it.
安排每个帧在此数量的 VBlank 间隔内展示。(默认:1)设置为 1 将启用 VSync,设置为 0 将禁用它。 - --d3d11-adapter=<adapter name|help>
Select a specific D3D11 adapter to utilize for D3D11 rendering. Will pick the default adapter if unset. Alternatives are listed when the name "help" is given.
选择用于 D3D11 渲染的特定 D3D11 适配器。如果未设置,将选择默认适配器。当给出“help”名称时,将列出替代选项。Checks for matches based on the start of the string, case insensitive. Thus, if the description of the adapter starts with the vendor name, that can be utilized as the selection parameter.
根据字符串的开头进行匹配检查,不区分大小写。因此,如果适配器的描述以供应商名称开头,则可以使用它作为选择参数。Hardware decoders utilizing the D3D11 rendering abstraction's helper functionality to receive a device, such as D3D11VA or DXVA2's DXGI mode, will be affected by this choice.
使用 D3D11 渲染抽象的辅助功能接收设备(如 D3D11VA 或 DXVA2 的 DXGI 模式)的硬件解码器将受到此选择的影响。- --d3d11-output-format=<auto|rgba8|bgra8|rgb10_a2|rgba16f>
Select a specific D3D11 output format to utilize for D3D11 rendering. "auto" is the default, which will pick either rgba8 or rgb10_a2 depending on the configured desktop bit depth. rgba16f and bgra8 are left out of the autodetection logic, and are available for manual testing.
选择用于 D3D11 渲染的特定 D3D11 输出格式。默认值为“auto”,这将根据配置的桌面位深度选择 rgba8 或 rgb10_a2。rgba16f 和 bgra8 被排除在自动检测逻辑之外,可用于手动测试。Note 注意
Desktop bit depth querying is only available from an API available from Windows 10. Thus on older systems it will only automatically utilize the rgba8 output format.
桌面位深查询仅适用于从 Windows 10 提供的 API 中获取。因此,在较旧的系统上,它将仅自动使用 rgba8 输出格式。Note 注意
For --vo=gpu-next, this is used as a best-effort hint and libplacebo has the last say on which format is utilized.
对于 --vo=gpu-next ,这被用作尽力而为的提示,libplacebo 对使用的格式有最终决定权。- --d3d11-output-csp=<auto|srgb|linear|pq|bt.2020>
Select a specific D3D11 output color space to utilize for D3D11 rendering. "auto" is the default, which will select the color space of the desktop on which the swap chain is located.
选择用于 D3D11 渲染的特定 D3D11 输出颜色空间。默认值为"auto",这将选择 swap chain 所在桌面的颜色空间。Values other than "srgb" and "pq" have had issues in testing, so they are mostly available for manual testing.
除了"srgb"和"pq"之外的其他值在测试中存在问题,因此它们主要用于手动测试。Note 注意
Swap chain color space configuration is only available from an API available from Windows 10. Thus on older systems it will not work.
交换链颜色空间配置仅在 Windows 10 的 API 中可用。因此,在较旧的系统上它将不起作用。- --d3d11va-zero-copy=<yes|no>
By default, when using hardware decoding with --gpu-api=d3d11, the video image will be copied (GPU-to-GPU) from the decoder surface to a shader resource. Set this option to avoid that copy by sampling directly from the decoder image. This may increase performance and reduce power usage, but can cause the image to be sampled incorrectly on the bottom and right edges due to padding, and may invoke driver bugs, since Direct3D 11 technically does not allow sampling from a decoder surface (though most drivers support it.)
默认情况下,当使用硬件解码与 --gpu-api=d3d11 时,视频图像将从解码器表面(GPU-to-GPU)复制到着色器资源。将此选项设置为直接从解码器图像采样以避免复制。这可能会提高性能并降低功耗,但可能会由于填充而导致图像底部和右侧边缘采样不正确,并可能触发驱动程序错误,因为 Direct3D 11 在技术上不允许从解码器表面采样(尽管大多数驱动程序支持它。)Currently only relevant for --gpu-api=d3d11.
目前仅适用于 --gpu-api=d3d11 。- --wayland-app-id=<string>
- Set the client app id for Wayland-based video output methods (default: mpv).
设置基于 Wayland 的视频输出方法的客户端应用程序 ID(默认: mpv )。 - --wayland-configure-bounds=<auto|yes|no>
- Controls whether or not mpv opts into the configure bounds event if sent by the
compositor (default: auto). This restricts the initial size of the mpv window to
a certain maximum size intended by the compositor. In most cases, this simply
just prevents the mpv window from being larger than the size of the monitor when
it first renders. With the default value of auto, configure-bounds will
silently be ignored if any autofit or geometry type option is also set.
控制 mpv 是否选择加入由合成器发送的配置边界事件(默认:自动)。这限制了 mpv 窗口的初始最大尺寸,这是合成器期望的尺寸。在大多数情况下,这仅仅防止 mpv 窗口在首次渲染时比监视器尺寸大。如果设置了任何 autofit 或 geometry 类型选项,则默认情况下将静默忽略 configure-bounds。 - --wayland-content-type=<auto|none|photo|video|game>
- If supported by the compositor, mpv will send a hint using the content-type
protocol telling the compositor what type of content is being displayed. auto
(default) will automatically switch between telling the compositor the content
is a photo, video or possibly none depending on internal heuristics.
如果合成器支持,mpv 将通过内容类型协议发送提示,告诉合成器正在显示的内容类型。 auto (默认)将自动根据内部启发式规则在照片、视频或可能无内容之间切换,告诉合成器内容类型。 - --wayland-edge-pixels-pointer=<value>
- Defines the size of an edge border (default: 16) to initiate client side
resize events in the wayland contexts with the mouse. This is only active if
there are no server side decorations from the compositor.
定义边缘边框的大小(默认:16),在 wayland 上下文中使用鼠标触发客户端调整大小事件。这仅在合成器没有服务器端装饰时生效。 - --wayland-edge-pixels-touch=<value>
- Defines the size of an edge border (default: 32) to initiate client side
resizes events in the wayland contexts with touch events.
定义边缘边框的大小(默认:32),在 wayland 上下文中使用触摸事件触发客户端调整大小事件。 - --wayland-internal-vsync=<no|auto|yes>
- Controls whether to use mpv's internal vsync for Wayland-base video outputs
(default: auto). This is mainly useful for benchmarking wayland VOs when
combined with video-sync=display-desync, --audio=no, and
--untimed=yes. The special auto value will disable the internal
vsync if the compositor supports the fifo protocol and version 2 of the
presentation time protocol when using --gpu-api=vulkan. In any other
situation, it is exactly the same as yes.
控制是否为 Wayland-base 视频输出使用 mpv 的内部 vsync(默认: auto )。这主要用于与 video-sync=display-desync 、 --audio=no 和 --untimed=yes 结合时对 wayland VOs 进行基准测试。特殊值 auto 将在使用 --gpu-api=vulkan 时,如果合成器支持 fifo 协议和显示时间协议的版本 2,则禁用内部 vsync。在其他任何情况下,它与 yes 完全相同。 - --wayland-present=<yes|no>
- Enable the use of wayland's presentation time protocol for more accurate
frame presentation if it is supported by the compositor (default: yes).
This only has an effect if --video-sync=display-... is being used.
如果合成器支持,启用 wayland 的显示时间协议以实现更精确的帧显示(默认: yes )。这仅在 --video-sync=display-... 被使用时才有效。 - --spirv-compiler=<compiler>
Controls which compiler is used to translate GLSL to SPIR-V. This is only relevant for --gpu-api=d3d11 with --vo=gpu. The possible choices are currently:
控制用于将 GLSL 转换为 SPIR-V 的编译器。这仅与 --gpu-api=d3d11 和 --vo=gpu 相关。当前可能的选项有:- auto 自动
- Use the first available compiler. (Default)
使用第一个可用的编译器。(默认) - shaderc
- Use libshaderc, which is an API wrapper around glslang. This is
generally the most preferred, if available.
使用 libshaderc,它是一个围绕 glslang 的 API 包装器。这通常是首选的,如果可用的话。
Note 注意
This option is deprecated, since there is only one usable value. It may be removed in the future.
此选项已弃用,因为只有一个可用的值。它可能在将来被移除。- --glsl-shader=<file>, --glsl-shaders=<file-list>
Custom GLSL hooks. These are a flexible way to add custom fragment shaders, which can be injected at almost arbitrary points in the rendering pipeline, and access all previous intermediate textures.
自定义 GLSL 钩子。这是一种灵活的方式,可以添加自定义片段着色器,可以在渲染管道的几乎任何位置注入,并访问所有之前的中间纹理。Each use of the --glsl-shader option will add another file to the internal list of shaders, while --glsl-shaders takes a list of files, and overwrites the internal list with it. The latter is a path list option (see List Options for details).
每次使用 --glsl-shader 选项都会将另一个文件添加到着色器的内部列表中,而 --glsl-shaders 则接受一个文件列表,并用它覆盖内部列表。后者是路径列表选项(有关详细信息,请参阅列表选项)。Warning 警告
The syntax is not stable yet and may change any time.
语法目前尚不稳定,可能会随时更改。The general syntax of a user shader looks like this:
用户着色器的通用语法如下://!METADATA ARGS... //!METADATA ARGS... vec4 hook() { ... return something; } //!METADATA ARGS... //!METADATA ARGS... ...
Each section of metadata, along with the non-metadata lines after it, defines a single block. There are currently two types of blocks, HOOKs and TEXTUREs.
每个元数据部分及其之后的非元数据行定义了一个单独的块。目前有两种类型的块,即 HOOKs 和 TEXTUREs。A TEXTURE block can set the following options:
一个 TEXTURE 块可以设置以下选项:- TEXTURE <name> (required)
TEXTURE (必需) - The name of this texture. Hooks can then bind the texture under this
name using BIND. This must be the first option of the texture block.
此纹理的名称。然后钩子可以使用 BIND 绑定此名称下的纹理。这必须是纹理块的第一个选项。 - SIZE <width> [<height>] [<depth>] (required)
SIZE <宽度> [<高度>] [<深度>] (必需) - The dimensions of the texture. The height and depth are optional. The
type of texture (1D, 2D or 3D) depends on the number of components
specified.
纹理的尺寸。高度和深度是可选的。纹理的类型(1D、2D 或 3D)取决于指定的组件数量。 - FORMAT <name> (required)
格式 <名称>(必需) The texture format for the samples. Supported texture formats are listed in debug logging when the gpu VO is initialized (look for Texture formats:). Usually, this follows OpenGL naming conventions. For example, rgb16 provides 3 channels with normalized 16 bit components. One oddity are float formats: for example, rgba16f has 16 bit internal precision, but the texture data is provided as 32 bit floats, and the driver converts the data on texture upload.
样本的纹理格式。支持的纹理格式在初始化 gpu VO 时记录在调试日志中(查找 Texture formats: )。通常,这遵循 OpenGL 命名约定。例如, rgb16 提供 3 个通道,具有归一化的 16 位组件。一个特殊之处在于浮点格式:例如, rgba16f 具有 16 位内部精度,但纹理数据以 32 位浮点数提供,驱动程序在纹理上传时转换数据。Although format names follow a common naming convention, not all of them are available on all hardware, drivers, GL versions, and so on.
尽管格式名称遵循通用命名约定,但并非所有格式都可在所有硬件、驱动程序、GL 版本等上使用。- FILTER <LINEAR|NEAREST>
- The min/magnification filter used when sampling from this texture.
从该纹理采样时使用的最小/最大放大滤镜。 - BORDER <CLAMP|REPEAT|MIRROR>
- The border wrapping mode used when sampling from this texture.
从该纹理采样时使用的边界包裹模式。
Following the metadata is a string of bytes in hexadecimal notation that define the raw texture data, corresponding to the format specified by FORMAT, on a single line with no extra whitespace.
在元数据之后是一串以十六进制表示的字节字符串,定义了原始纹理数据,对应于 FORMAT 指定的格式,在一行中,没有额外的空白字符。A HOOK block can set the following options:
一个 HOOK 块可以设置以下选项:- HOOK <name> (required) HOOK <名称> (必需)
- The texture which to hook into. May occur multiple times within a
metadata block, up to a predetermined limit. See below for a list of
hookable textures.
要挂钩的纹理。在元数据块中可能多次出现,最多达到预定的限制。下面是可挂钩纹理的列表。 - DESC <title> DESC <标题>
- User-friendly description of the pass. This is the name used when
representing this shader in the list of passes for property
vo-passes.
友好的通行描述。这是在属性 vo-passes 的通行列表中表示此着色器时使用的名称。 - BIND <name> BIND <名称>
- Loads a texture (either coming from mpv or from a TEXTURE block)
and makes it available to the pass. When binding textures from mpv,
this will also set up macros to facilitate accessing it properly. See
below for a list. By default, no textures are bound. The special name
HOOKED can be used to refer to the texture that triggered this pass.
加载一个纹理(无论是来自 mpv 还是来自 TEXTURE 块)并将其提供给通行。当从 mpv 绑定纹理时,这还将设置宏以方便正确访问。以下为列表。默认情况下,不绑定任何纹理。可以使用特殊名称 HOOKED 来引用触发此通行的纹理。 - SAVE <name> 保存 <名称>
- Gives the name of the texture to save the result of this pass into. By
default, this is set to the special name HOOKED which has the effect of
overwriting the hooked texture.
提供要保存此通道结果纹理的名称。默认情况下,此值设置为特殊名称 HOOKED,其效果是覆盖已连接的纹理。 - WIDTH <szexpr>, HEIGHT <szexpr>
- Specifies the size of the resulting texture for this pass. szexpr
refers to an expression in RPN (reverse polish notation), using the
operators + - * / > < !, floating point literals, and references to
sizes of existing texture (such as MAIN.width or CHROMA.height),
OUTPUT, or NATIVE_CROPPED (size of an input texture cropped after
pan-and-scan, video-align-x/y, video-pan-x/y, etc. and possibly
prescaled). By default, these are set to HOOKED.w and HOOKED.h,
espectively.
指定此通道结果的纹理大小。 szexpr 指的是 RPN(逆波兰表示法)中的表达式,使用运算符 + - * / > < !,浮点字面量,以及引用现有纹理的大小(例如 MAIN.width 或 CHROMA.height),OUTPUT,或 NATIVE_CROPPED(在平移和扫描、视频对齐-x/y、视频平移-x/y 等之后裁剪的输入纹理的大小,可能还有预缩放)。默认情况下,这些值分别设置为 HOOKED.w 和 HOOKED.h。 - WHEN <szexpr>
- Specifies a condition that needs to be true (non-zero) for the shader
stage to be evaluated. If it fails, it will silently be omitted. (Note
that a shader stage like this which has a dependency on an optional
hook point can still cause that hook point to be saved, which has some
minor overhead)
指定一个需要为真(非零)的条件,以便评估着色器阶段。如果失败,它将被静默忽略。(注意,这种具有对可选钩点依赖的着色器阶段仍然可能导致该钩点被保存,这会有一些轻微的开销) - OFFSET <ox oy | ALIGN>
Indicates a pixel shift (offset) introduced by this pass. These pixel offsets will be accumulated and corrected during the next scaling pass (cscale or scale). The default values are 0 0 which correspond to no shift. Note that offsets are ignored when not overwriting the hooked texture.
指示由此步骤引入的像素偏移(偏移量)。这些像素偏移将在下一个缩放步骤( cscale 或 scale )期间累积并校正。默认值是 0 0,表示没有偏移。注意,当不覆盖钩子纹理时,偏移量将被忽略。A special value of ALIGN will attempt to fix existing offset of HOOKED by align it with reference. It requires HOOKED to be resizable (see below). It works transparently with fragment shader. For compute shader, the predefined texmap macro is required to handle coordinate mapping.
特殊值 ALIGN 将尝试通过将其与参考对齐来修复现有的 HOOKED 偏移。这要求 HOOKED 可调整大小(见下文)。它与片段着色器透明地工作。对于计算着色器,需要预定义的 texmap 宏来处理坐标映射。- COMPONENTS <n> 组件
- Specifies how many components of this pass's output are relevant and
should be stored in the texture, up to 4 (rgba). By default, this value
is equal to the number of components in HOOKED.
指定此通行输出中有多少个组件是相关的,并且应该存储在纹理中,最多 4 个(rgba)。默认情况下,此值等于 HOOKED 中的组件数量。 - COMPUTE <bw> <bh> [<tw> <th>]
Specifies that this shader should be treated as a compute shader, with the block size bw and bh. The compute shader will be dispatched with however many blocks are necessary to completely tile over the output. Within each block, there will be tw*th threads, forming a single work group. In other words: tw and th specify the work group size, which can be different from the block size. So for example, a compute shader with bw, bh = 32 and tw, th = 8 running on a 500x500 texture would dispatch 16x16 blocks (rounded up), each with 8x8 threads.
指定此着色器应被视为计算着色器,具有块大小 bw 和 bh。计算着色器将根据需要调度尽可能多的块来完全覆盖输出。在每个块中,将有 tw*th 线程,形成一个工作组。换句话说:tw 和 th 指定工作组大小,这可以与块大小不同。例如,bw, bh = 32 且 tw, th = 8 的计算着色器在 500x500 纹理上运行时将调度 16x16 块(向上取整),每个块包含 8x8 线程。Compute shaders in mpv are treated a bit different from fragment shaders. Instead of defining a vec4 hook that produces an output sample, you directly define void hook which writes to a fixed writeonly image unit named out_image (this is bound by mpv) using imageStore. To help translate texture coordinates in the absence of vertices, mpv provides a special function NAME_map(id) to map from the texel space of the output image to the texture coordinates for all bound textures. In particular, NAME_pos is equivalent to NAME_map(gl_GlobalInvocationID), although using this only really makes sense if (tw,th) == (bw,bh).
mpv 中的计算着色器处理方式与片段着色器略有不同。不是定义一个生成输出样本的 vec4 hook ,而是直接定义 void hook ,它将数据写入一个名为 out_image 的固定写入只读图像单元(由 mpv 绑定)使用 imageStore。为了在缺少顶点的情况下帮助转换纹理坐标,mpv 提供了一个特殊的函数 NAME_map(id) ,用于将输出图像的纹理空间映射到所有绑定纹理的纹理坐标。特别是, NAME_pos 等同于 NAME_map(gl_GlobalInvocationID) ,尽管仅在 (tw,th) == (bw,bh) 时使用此功能才有意义。
Each bound mpv texture (via BIND) will make available the following definitions to that shader pass, where NAME is the name of the bound texture:
每个绑定的 mpv 纹理(通过 BIND )将向该着色器通道提供以下定义,其中 NAME 是绑定的纹理名称:- vec4 NAME_tex(vec2 pos)
- The sampling function to use to access the texture at a certain spot
(in texture coordinate space, range [0,1]). This takes care of any
necessary normalization conversions.
用于访问特定位置(在纹理坐标空间中,范围[0,1])的纹理的采样函数。这处理了任何必要的归一化转换。 - vec4 NAME_texOff(vec2 offset)
- Sample the texture at a certain offset in pixels. This works like
NAME_tex but additionally takes care of necessary rotations, so that
sampling at e.g. vec2(-1,0) is always one pixel to the left.
在像素偏移处采样纹理。这与 NAME_tex 的功能类似,但还额外处理必要的旋转,因此采样 vec2(-1,0) 总是向左一个像素。 - vec2 NAME_pos
- The local texture coordinate of that texture, range [0,1].
该纹理的局部纹理坐标,范围 [0,1]。 - vec2 NAME_size
- The (rotated) size in pixels of the texture.
纹理的(旋转后)像素大小。 - mat2 NAME_rot
- The rotation matrix associated with this texture. (Rotates pixel space
to texture coordinates)
与此纹理关联的旋转矩阵。(将像素空间旋转到纹理坐标) - vec2 NAME_pt
- The (unrotated) size of a single pixel, range [0,1].
单个像素的(未旋转)大小,范围 [0,1]。 - float NAME_mul
- The coefficient that needs to be multiplied into the texture contents
in order to normalize it to the range [0,1].
需要乘以纹理内容以将其归一化到范围 [0,1] 的系数。 - sampler NAME_raw
- The raw bound texture itself. The use of this should be avoided unless
absolutely necessary.
原始绑定纹理本身。除非绝对必要,否则应避免使用此纹理。
Normally, users should use either NAME_tex or NAME_texOff to read from the texture. For some shaders however , it can be better for performance to do custom sampling from NAME_raw, in which case care needs to be taken to respect NAME_mul and NAME_rot.
通常,用户应使用 NAME_tex 或 NAME_texOff 从纹理中读取。然而,对于某些着色器,从 NAME_raw 进行自定义采样可能对性能更有利,在这种情况下,需要注意尊重 NAME_mul 和 NAME_rot。In addition to these parameters, the following uniforms are also globally available:
除了这些参数之外,以下全局可用的 uniform 变量:- float random 浮点随机
- A random number in the range [0-1], different per frame.
一个范围 [0-1] 内的随机数,每帧不同。 - int frame 整型帧
- A simple count of frames rendered, increases by one per frame and never
resets (regardless of seeks).
渲染帧的简单计数,每帧增加一个,永远不会重置(无论是否寻求)。 - vec2 input_size vec2 输入大小
- The size in pixels of the input image (possibly cropped and prescaled).
输入图像的像素大小(可能已裁剪和预缩放)。 - vec2 target_size vec2 目标大小
- The size in pixels of the visible part of the scaled (and possibly
cropped) image.
缩放(和可能裁剪)后可见图像部分的像素大小。 - vec2 tex_offset
- Texture offset introduced by user shaders or options like panscan, video-align-x/y, video-pan-x/y.
由用户着色器或类似 panscan、video-align-x/y、video-pan-x/y 等选项引入的纹理偏移。
Internally, vo_gpu may generate any number of the following textures. Whenever a texture is rendered and saved by vo_gpu, all of the passes that have hooked into it will run, in the order they were added by the user. This is a list of the legal hook points:
内部,vo_gpu 可能会生成以下任何数量的纹理。每当 vo_gpu 渲染并保存纹理时,所有已连接到它的通道都将按用户添加的顺序运行。以下是合法的钩子点列表:- RGB, LUMA, CHROMA, ALPHA, XYZ (resizable)
RGB,LUMA,CHROMA,ALPHA,XYZ(可调整大小) - Source planes (raw). Which of these fire depends on the image format of
the source.
源平面(原始)。这些平面中的哪一个被触发取决于源图像格式。 - CHROMA_SCALED, ALPHA_SCALED (fixed)
CHROMA_SCALED, ALPHA_SCALED (固定) - Source planes (upscaled). These only fire on subsampled content.
源平面(放大)。这些只在子采样内容上触发。 - NATIVE (resizable) NATIVE (可调整大小)
- The combined image, in the source colorspace, before conversion to RGB.
在转换为 RGB 之前,源色彩空间中的合成图像。 - MAINPRESUB (resizable) MAINPRESUB(可调整大小)
- The image, after conversion to RGB, but before
--blend-subtitles=video is applied.
图像在转换为 RGB 后,但在应用 --blend-subtitles=video 之前。 - MAIN (resizable) MAIN(可调整大小)
- The main image, after conversion to RGB but before upscaling.
主图像在转换为 RGB 后,但在放大之前。 - LINEAR (fixed) 线性(固定)
- Linear light image, before scaling. This only fires when
--linear-upscaling, --linear-downscaling or
--sigmoid-upscaling is in effect.
线性光图像,缩放前。仅在 --linear-upscaling 、 --linear-downscaling 或 --sigmoid-upscaling 生效时触发。 - SIGMOID (fixed) SIGMOID(固定)
- Sigmoidized light, before scaling. This only fires when
--sigmoid-upscaling is in effect.
Sigmoid 化光,缩放前。仅在 --sigmoid-upscaling 生效时触发。 - PREKERNEL (fixed) PREKERNEL(已修复)
- The image immediately before the scaler kernel runs.
缩放内核运行之前的图像。 - POSTKERNEL (fixed) POSTKERNEL (固定)
- The image immediately after the scaler kernel runs.
缩放内核运行后的图像。 - SCALED (fixed) SCALED (固定)
- The final upscaled image, before color management.
最终放大后的图像,在颜色管理之前。 - OUTPUT (fixed) OUTPUT (固定)
- The final output image, after color management but before dithering and
drawing to screen.
最终输出图像,在颜色管理之后但在抖动和屏幕绘制之前。
Only the textures labelled with resizable may be transformed by the pass. When overwriting a texture marked fixed, the WIDTH, HEIGHT and OFFSET must be left at their default values.
只有标记为 resizable 的纹理可以通过此通道进行转换。当覆盖标记为 fixed 的纹理时,WIDTH、HEIGHT 和 OFFSET 必须保留其默认值。- TEXTURE <name> (required)
- --glsl-shader=<file>
- CLI/config file only alias for --glsl-shaders-append.
CLI/config 文件中仅对 --glsl-shaders-append 的别名。 - --glsl-shader-opts=param1=value1,param2=value2,...
Specifies the options to use for tunable shader parameters. You can target specific named shaders by prefixing the shader name with a /, e.g. shader/param=value. Without a prefix, parameters affect all shaders. The shader name is the base part of the shader filename, without the extension. (--vo=gpu-next only)
指定用于可调着色器参数的选项。您可以通过在着色器名称前加上 / 来针对特定的命名着色器,例如 shader/param=value 。如果没有前缀,参数将影响所有着色器。着色器名称是着色器文件名的基名部分,不包括扩展名。( --vo=gpu-next 仅限)Some parameters are filled automatically if the shader requests them. Currently following parameters are available:
某些参数如果着色器请求它们,则会自动填充。目前以下参数可用:- PTS
- PTS of the current frame in seconds.
当前帧的 PTS(秒)。 - chroma_offset_x
- chroma offset to the reference plane in x direction.
参考平面的 x 方向上的色度偏移量。 - chroma_offset_y
- chroma offset to the reference plane in y direction.
色度偏移到参考平面的 y 方向。 - min_luma
- Minimum luminance value (in cd/m²).
最小亮度值(单位:cd/m²)。 - max_luma
- Maximum luminance value (in cd/m²).
最大亮度值(单位:cd/m²)。 - max_cll
- Maximum Content Light Level (in cd/m²).
最大内容光亮度(单位:cd/m²)。 - max_fall
- Maximum Frame Average Light Level (in cd/m²).
最大帧平均光亮度(单位:cd/m²)。 - scene_max_r
- Maximum scene light level of the red channel (in cd/m²).
红色通道的最大场景光照级别(单位:cd/m²)。 - scene_max_g
- Maximum scene light level of the green channel (in cd/m²).
绿色通道的最大场景光亮度(单位:cd/m²)。 - scene_max_b
- Maximum scene light level of the blue channel (in cd/m²).
蓝色通道的最大场景光亮度(单位:cd/m²)。 - scene_avg
- Average scene light level (in cd/m²).
平均场景光照级别(单位:cd/m²)。 - max_pq_y
- Maximum PQ luminance (in PQ, 0-1).
最大 PQ 亮度(单位:PQ,范围 0-1)。 - avg_pq_y
- Average PQ luminance (in PQ, 0-1).
平均 PQ 亮度(在 PQ 中,0-1)。
- --deband
- Enable the debanding algorithm. This greatly reduces the amount of visible
banding, blocking and other quantization artifacts, at the expense of
very slightly blurring some of the finest details. In practice, it's
virtually always an improvement - the only reason to disable it would be
for performance.
启用去带算法。这会极大地减少可见的带状、阻塞和其他量化伪影的数量,但会略微模糊一些最细微的细节。在实践中,这几乎总是改进——唯一禁用它的原因可能是为了性能。 - --deband-iterations=<0..16>
- The number of debanding steps to perform per sample. Each step reduces a
bit more banding, but takes time to compute. Note that the strength of each
step falls off very quickly, so high numbers (>4) are practically useless.
(Default 1)
每个样本要执行的去带步骤数量。每一步都会减少更多带状,但计算时间更长。请注意,每一步的强度迅速下降,因此高数值(>4)实际上毫无用处。(默认 1) - --deband-threshold=<0..4096>
- The debanding filter's cut-off threshold. Higher numbers increase the
debanding strength dramatically but progressively diminish image details.
(Default 48)
去带滤波器的截止阈值。数值越高,去带强度增加越明显,但会逐渐减少图像细节。(默认 48) - --deband-range=<1..64>
The debanding filter's initial radius. The radius increases linearly for each iteration. A higher radius will find more gradients, but a lower radius will smooth more aggressively. (Default 16)
去带滤波器的初始半径。半径在每次迭代中线性增加。较大的半径将找到更多的梯度,但较小的半径将更积极地平滑。 (默认 16)If you increase the --deband-iterations, you should probably decrease this to compensate.
如果您增加 --deband-iterations ,您可能需要相应地减少这个值。- --deband-grain=<0..4096>
- Add some extra noise to the image. This significantly helps cover up
remaining quantization artifacts. Higher numbers add more noise. (Default
32)
向图像添加一些额外的噪声。这显著有助于掩盖剩余的量化伪影。较大的数字添加更多的噪声。 (默认 32) - --corner-rounding=<0..1>
- If set to a value above 0.0, the output will be rendered with rounded
corners, as if an alpha transparency mask had been applied. The value
indicates the relative fraction of the side length to round - a value of
1.0 rounds the corners as much as possible. (--vo=gpu-next only)
如果设置为大于 0.0 的值,输出将以圆角渲染,就像应用了 alpha 透明度蒙版一样。该值表示要圆角的一边长度的相对分数 - 1.0 的值尽可能多地圆角。 ( --vo=gpu-next 仅限) - --sharpen=<value>
- If set to a value other than 0, enable an unsharp masking filter. Positive
values will sharpen the image (but add more ringing and aliasing). Negative
values will blur the image. If your GPU is powerful enough, consider
alternatives like the ewa_lanczossharp scale filter, or the
--scale-blur option. (Only for --vo=gpu)
如果设置为非 0 值,则启用锐化蒙版滤镜。正值将锐化图像(但会增加更多振铃和混叠)。负值将模糊图像。如果您的 GPU 足够强大,请考虑替代方案,如 ewa_lanczossharp 缩放滤镜或 --scale-blur 选项。(仅适用于 --vo=gpu ) - --opengl-glfinish
- Call glFinish() before swapping buffers (default: disabled). Slower,
but might improve results when doing framedropping. Can completely ruin
performance. The details depend entirely on the OpenGL driver.
在交换缓冲区之前调用 glFinish() (默认:禁用)。较慢,但在进行帧丢弃时可能会改善结果。可能会完全破坏性能。具体细节完全取决于 OpenGL 驱动程序。 - --opengl-waitvsync
Call glXWaitVideoSyncSGI after each buffer swap (default: disabled). This may or may not help with video timing accuracy and frame drop. It's possible that this makes video output slower, or has no effect at all.
在每次交换缓冲区之后调用 glXWaitVideoSyncSGI (默认:禁用)。这可能有助于或无助于视频时间精度和帧丢弃。有可能这会使视频输出变慢,或者完全没有效果。X11/GLX only. 仅限 X11/GLX。
- --opengl-dwmflush=<no|windowed|yes|auto>
(Windows only) Calls DwmFlush after swapping buffers on Windows (default: auto). It also sets SwapInterval(0) to ignore the OpenGL timing. Values are: no (disabled), windowed (only in windowed mode), yes (also in full screen).
(仅限 Windows) 在 Windows 上交换缓冲区后调用 DwmFlush (默认:自动)。它还将 SwapInterval(0) 设置为忽略 OpenGL 时间。值有:no (禁用),windowed (仅限窗口模式),yes (全屏也适用)。The value auto will try to determine whether the compositor is active, and calls DwmFlush only if it seems to be.
值 auto 将尝试确定合成器是否处于活动状态,并且仅在似乎处于活动状态时调用 DwmFlush 。This may help to get more consistent frame intervals, especially with high-fps clips - which might also reduce dropped frames. Typically, a value of windowed should be enough, since full screen may bypass the DWM.
这有助于获得更一致的帧间隔,尤其是在高帧率剪辑中——这可能会减少丢帧。通常, windowed 的值应该足够,因为全屏可能会绕过 DWM。- --angle-d3d11-feature-level=<11_0|10_1|10_0|9_3>
Selects a specific feature level when using the ANGLE backend with D3D11. By default, the highest available feature level is used. This option can be used to select a lower feature level, which is mainly useful for debugging. Note that OpenGL ES 3.0 is only supported at feature level 10_1 or higher. Most extended OpenGL features will not work at lower feature levels (similar to --gpu-dumb-mode).
在使用 D3D11 后端和 ANGLE 时选择特定的功能级别。默认情况下,使用可用的最高功能级别。此选项可以用于选择较低的功能级别,这对于调试非常有用。请注意,OpenGL ES 3.0 仅在功能级别 10_1 或更高时受支持。大多数扩展的 OpenGL 功能在较低功能级别下将无法工作(类似于 --gpu-dumb-mode )。Windows with ANGLE only.
仅支持 ANGLE 的 Windows。- --angle-d3d11-warp=<yes|no|auto>
Use WARP (Windows Advanced Rasterization Platform) when using the ANGLE backend with D3D11 (default: auto). This is a high performance software renderer. By default, it is used when the Direct3D hardware does not support Direct3D 11 feature level 9_3. While the extended OpenGL features will work with WARP, they can be very slow.
使用 ANGLE 后端与 D3D11 一起使用时,请使用 WARP(Windows 高级光栅化平台)(默认:自动)。这是一个高性能的软件渲染器。默认情况下,当 Direct3D 硬件不支持 Direct3D 11 功能级别 9_3 时,将使用它。虽然扩展的 OpenGL 功能将与 WARP 一起工作,但它们可能会非常慢。Windows with ANGLE only.
仅支持 ANGLE 的 Windows。- --angle-egl-windowing=<yes|no|auto>
Use ANGLE's built in EGL windowing functions to create a swap chain (default: auto). If this is set to no and the D3D11 renderer is in use, ANGLE's built in swap chain will not be used and a custom swap chain that is optimized for video rendering will be created instead. If set to auto, a custom swap chain will be used for D3D11 and the built in swap chain will be used for D3D9. This option is mainly for debugging purposes, in case the custom swap chain has poor performance or does not work.
使用 ANGLE 内置的 EGL 窗口函数创建交换链(默认:自动)。如果设置为 no 并且正在使用 D3D11 渲染器,则不会使用 ANGLE 内置的交换链,而是创建一个针对视频渲染优化的自定义交换链。如果设置为 auto ,则将使用自定义交换链进行 D3D11,并使用内置交换链进行 D3D9。此选项主要用于调试目的,以防自定义交换链性能不佳或无法工作。If set to yes, the --angle-flip option will have no effect.
如果设置为 yes ,则 --angle-flip 选项将不起作用。Windows with ANGLE only.
仅支持 ANGLE 的 Windows。- --angle-flip=<yes|no>
Enable flip-model presentation, which avoids unnecessarily copying the backbuffer by sharing surfaces with the DWM (default: yes). This may cause performance issues with older drivers. If flip-model presentation is not supported (for example, on Windows 7 without the platform update), mpv will automatically fall back to the older bitblt presentation model.
启用翻转模型展示,通过与 DWM 共享表面来避免不必要地复制后缓冲区(默认:是)。这可能会导致较旧驱动程序的性能问题。如果翻转模型展示不受支持(例如,在未安装平台更新的 Windows 7 上),mpv 将自动回退到较旧的 bitblt 展示模型。If set to no, the --angle-swapchain-length option will have no effect.
如果设置为 no ,则 --angle-swapchain-length 选项将不起作用。Windows with ANGLE only.
仅支持 ANGLE 的 Windows。- --angle-renderer=<d3d9|d3d11|auto>
Forces a specific renderer when using the ANGLE backend (default: auto). In auto mode this will pick D3D11 for systems that support Direct3D 11 feature level 9_3 or higher, and D3D9 otherwise. This option is mainly for debugging purposes. Normally there is no reason to force a specific renderer, though --angle-renderer=d3d9 may give slightly better performance on old hardware. Note that the D3D9 renderer only supports OpenGL ES 2.0, so most extended OpenGL features will not work if this renderer is selected (similar to --gpu-dumb-mode).
在 ANGLE 后端使用时强制指定特定渲染器(默认:自动)。在自动模式下,这将选择支持 Direct3D 11 特性级别 9_3 或更高的系统使用 D3D11,否则使用 D3D9。此选项主要用于调试目的。通常没有理由强制使用特定渲染器,尽管 --angle-renderer=d3d9 在旧硬件上可能提供略好的性能。请注意,D3D9 渲染器仅支持 OpenGL ES 2.0,因此如果选择此渲染器,大多数扩展的 OpenGL 功能将无法工作(类似于 --gpu-dumb-mode )。Windows with ANGLE only.
仅支持 ANGLE 的 Windows。- --macos-force-dedicated-gpu=<yes|no>
Deactivates the automatic graphics switching and forces the dedicated GPU. (default: no)
禁用自动图形切换并强制使用专用 GPU。(默认:否)macOS only. 仅限 macOS。
- --cocoa-cb-sw-renderer=<yes|no|auto>
Use the Apple Software Renderer when using cocoa-cb (default: auto). If set to no the software renderer is never used and instead fails when a the usual pixel format could not be created, yes will always only use the software renderer, and auto only falls back to the software renderer when the usual pixel format couldn't be created.
当使用 cocoa-cb 时使用 Apple 软件渲染器(默认:自动)。如果设置为 no ,则软件渲染器永远不会使用,并且当无法创建常规像素格式时将失败, yes 将始终仅使用软件渲染器,而 auto 只有在无法创建常规像素格式时才会回退到软件渲染器。macOS and cocoa-cb only.
仅限 macOS 和 cocoa-cb。- --cocoa-cb-10bit-context=<yes|no>
Creates a 10bit capable pixel format for the context creation (default: yes). Instead of 8bit integer framebuffer a 16bit half-float framebuffer is requested.
为上下文创建创建一个 10 位像素格式(默认:是)。而不是 8 位整数帧缓冲区,请求一个 16 位半浮点帧缓冲区。macOS and cocoa-cb only.
仅限 macOS 和 cocoa-cb。- --cocoa-cb-output-csp=<csp>
This sets the color space of the layer to activate the macOS color transformation. Depending on the color space used the system's EDR (HDR) support will be activated. To get correct results, this needs to be set to the color primaries/transfer characteristics of the VO target. It is recommended to use this switch together with --target-trc and --target-prim.
此操作将层的颜色空间设置为激活 macOS 颜色转换。根据使用的颜色空间,系统将激活 EDR (HDR) 支持。为了获得正确的结果,需要将其设置为 VO 目标的主色/传输特性。建议与 --target-trc 和 --target-prim 一起使用。<csp> can be one of the following:
<csp> 可以是以下之一:auto: Sets the color space to the icc profile of the screen (default).
将颜色空间设置为屏幕的 icc 配置文件(默认)。display-p3: DCI P3 primaries, a D65 white point and the sRGB transfer function.
DCI P3 主色,D65 白点以及 sRGB 转换函数。display-p3-hlg: DCI P3 primaries, a D65 white point and the Hybrid Log-Gamma (HLG) transfer function.
DCI P3 主色,D65 白点和混合对数伽玛(HLG)转换函数。display-p3-pq: DCI P3 primaries, a D65 white point and the Perceptual Quantizer (PQ) transfer function.
DCI P3 主色,D65 白点和感知量化器(PQ)转换函数。display-p3-linear: DCI P3 primaries, a D65 white point and linear transfer function.
DCI P3 P3 主色,D65 白点和线性转换函数。dci-p3: DCI P3 color space.
DCI P3 颜色空间。bt.2020: ITU BT.2020 color space.
ITU BT.2020 颜色空间。bt.2020-linear: ITU BT.2020 color space and linear transfer function.
ITU BT.2020 颜色空间和线性转换函数。bt.2100-hlg: ITU BT.2100 and the Hybrid Log-Gamma (HLG) transfer function.
ITU BT.2100 和混合对数伽马 (HLG) 转换函数。bt.2100-pq: ITU BT.2100 and the Perceptual Quantizer (PQ) transfer function.
国际电信联盟(ITU)BT.2100 和感知量化器(PQ)转换函数。bt.709: ITU BT.709 color space.
国际电信联盟(ITU)BT.709 色彩空间。srgb: sRGB colorimetry and non-linear transfer function.
sRGB 色度学和非线性转换函数。srgb-linear: Same as sRGB but linear transfer function.
与 sRGB 相同,但具有线性转换函数。rgb-linear: RGB and linear transfer function.
RGB 和线性转换函数。adobe: Adobe RGB (1998) color space.
Adobe RGB (1998) 颜色空间。macOS and cocoa-cb only.
仅限 macOS 和 cocoa-cb。- --macos-title-bar-appearance=<appearance>
Sets the appearance of the title bar (default: auto). Not all combinations of appearances and --macos-title-bar-material materials make sense or are unique. Appearances that are not supported by you current macOS version fall back to the default value. macOS only
设置标题栏的外观(默认:自动)。并非所有外观和 --macos-title-bar-material 材料的组合都有意义或独特。不支持您当前 macOS 版本的显示外观将回退到默认值。仅限 macOS<appearance> can be one of the following:
<appearance> 可以是以下之一:auto: Detects the system settings and sets the title bar appearance appropriately. On macOS 10.14 it also detects run time changes.
检测系统设置并适当地设置标题栏外观。在 macOS 10.14 上,它还可以检测运行时变化。aqua: The standard macOS Light appearance.
标准的 macOS 浅色外观。darkAqua: The standard macOS Dark appearance. (macOS 10.14+)
标准的 macOS 深色外观。(macOS 10.14+)vibrantLight: Light vibrancy appearance with.
带有浅色活力的外观。vibrantDark: Dark vibrancy appearance with.
暗色调活力外观。aquaHighContrast: Light Accessibility appearance. (macOS 10.14+)
浅色无障碍外观。 (macOS 10.14+)darkAquaHighContrast: Dark Accessibility appearance. (macOS 10.14+)
深色无障碍外观。 (macOS 10.14+)vibrantLightHighContrast: Light vibrancy Accessibility appearance. (macOS 10.14+)
浅色活力无障碍外观。 (macOS 10.14+)vibrantDarkHighContrast: Dark vibrancy Accessibility appearance. (macOS 10.14+)
深色活力无障碍外观。 (macOS 10.14+)- --macos-title-bar-material=<material>
Sets the material of the title bar (default: titlebar). All deprecated materials should not be used on macOS 10.14+ because their functionality is not guaranteed. Not all combinations of materials and --macos-title-bar-appearance appearances make sense or are unique. Materials that are not supported by you current macOS version fall back to the default value. macOS only
设置标题栏的材质(默认:标题栏)。在 macOS 10.14+ 上,所有已弃用的材质都不应使用,因为它们的功能无法保证。并非所有材质和 --macos-title-bar-appearance 出现的组合都有意义或独特。不支持您当前 macOS 版本的材质将回退到默认值。仅限 macOS 使用<material> can be one of the following:
<material> 可以是以下之一:titlebar: The standard macOS title bar material. selection: 选择: The standard macOS selection material.
标准的 macOS 选择素材。menu: 菜单: The standard macOS menu material. (macOS 10.11+)
标准的 macOS 菜单素材。(macOS 10.11+)popover: The standard macOS popover material. (macOS 10.11+) sidebar: sidebar: The standard macOS sidebar material. (macOS 10.11+)
标准的 macOS 侧边栏材料。(macOS 10.11+)headerView: headerView: The standard macOS header view material. (macOS 10.14+)
标准的 macOS 标题视图素材。 (macOS 10.14+)sheet: sheet: The standard macOS sheet material. (macOS 10.14+)
标准的 macOS 纸张材质。(macOS 10.14+)windowBackground: windowBackground: The standard macOS window background material. (macOS 10.14+)
标准的 macOS 窗口背景材质。 (macOS 10.14+)hudWindow: hudWindow: The standard macOS hudWindow material. (macOS 10.14+)
标准的 macOS hudWindow 材质。(macOS 10.14+)fullScreen: fullScreen: The standard macOS full screen material. (macOS 10.14+)
标准的 macOS 全屏材质。(macOS 10.14+)toolTip: The standard macOS tool tip material. (macOS 10.14+)
标准的 macOS 工具提示材质。 (macOS 10.14+)contentBackground: The standard macOS content background material. (macOS 10.14+)
标准 macOS 内容背景材料。(macOS 10.14+)underWindowBackground: The standard macOS under window background material. (macOS 10.14+)
标准 macOS 窗口下方背景材料。(macOS 10.14+)underPageBackground: The standard macOS under page background material. (deprecated in macOS 10.14+)
标准 macOS 页面背景材料。(自 macOS 10.14+ 已弃用)dark: The standard macOS dark material. (deprecated in macOS 10.14+)
标准 macOS 深色材质。(自 macOS 10.14+ 已弃用)light: 浅色: The standard macOS light material. (macOS 10.14+)
标准的 macOS 亮材质。 (macOS 10.14+)mediumLight: The standard macOS mediumLight material. (macOS 10.11+, deprecated in macOS 10.14+)
标准 macOS 中等亮度材质。 (macOS 10.11+,自 macOS 10.14+ 已弃用)ultraDark: The standard macOS ultraDark material. (macOS 10.11+ deprecated in macOS 10.14+)
标准的 macOS ultraDark 材质。(macOS 10.11+ 在 macOS 10.14+ 中已弃用)- --macos-title-bar-color=<color>
- Sets the color of the title bar (default: completely transparent). Is
influenced by --macos-title-bar-appearance and
--macos-title-bar-material.
See --sub-color for color syntax.
设置标题栏的颜色(默认:完全透明)。受 --macos-title-bar-appearance 和 --macos-title-bar-material 影响。有关颜色语法,请参阅 --sub-color 。 - --macos-fs-animation-duration=<default|0-1000>
- Sets the fullscreen resize animation duration in ms (default: default).
The default value is slightly less than the system's animation duration
(500ms) to prevent some problems when the end of an async animation happens
at the same time as the end of the system wide fullscreen animation. Setting
anything higher than 500ms will only prematurely cancel the resize animation
after the system wide animation ended. The upper limit is still set at
1000ms since it's possible that Apple or the user changes the system
defaults. Anything higher than 1000ms though seems too long and shouldn't be
set anyway.
(macOS)
设置全屏调整大小动画持续时间(毫秒,默认:默认)。默认值略小于系统的动画持续时间(500ms),以防止在异步动画结束时与系统全屏动画结束时同时发生时出现一些问题。将任何值设置为高于 500ms 都只会提前取消调整大小动画,在系统动画结束后。上限仍设置为 1000ms,因为苹果或用户可能会更改系统默认值。然而,任何高于 1000ms 的值似乎太长,因此不应设置。(macOS) - --macos-app-activation-policy=<regular|accessory|prohibited>
Changes the App activation policy. With accessory the mpv icon in the Dock can be hidden. (default: regular)
更改应用激活策略。通过附件,Dock 中的 mpv 图标可以被隐藏。(默认:常规)macOS only. 仅限 macOS。
- --macos-geometry-calculation=<visible|whole>
This changes the rectangle which is used to calculate the screen position and size of the window (default: visible). visible takes the the menu bar and Dock into account and the window is only positioned/sized within the visible screen frame rectangle, whole takes the whole screen frame rectangle and ignores the menu bar and Dock. Other previous restrictions still apply, like the window can't be placed on top of the menu bar etc.
macOS only.
- --macos-render-timer=<timer>
Sets the mode (default: callback) for syncing the rendering of frames to the display's vertical refresh rate. macOS and Vulkan (macvk) only.
设置同步帧渲染到显示器的垂直刷新率的模式(默认:回调)。仅限 macOS 和 Vulkan(macvk)。<timer> can be one of the following:
<timer> 可以是以下之一:callback: 回调: Syncs to the CVDisplayLink callback
同步到 CVDisplayLink 回调precise: 精确: Syncs to the time of the next vertical display refresh reported by the CVDisplayLink callback provided information
同步到 CVDisplayLink 回调提供的下一次垂直显示刷新的时间system: 系统: No manual syncing, depend on the layer mechanic and the next drawable
无需手动同步,依赖于层机制和下一个可绘制内容feedback: 反馈: Same as precise but uses the presentation feedback core mechanism
与精确相同,但使用呈现反馈核心机制- --macos-menu-shortcuts=<yes|no>
- Enables the default menu bar shortcuts (default: yes). The menu bar shortcuts always take
precedence over any other shortcuts, they are not propagated to the mpv core and they can't be
used in config files like input.conf or script bindings.
启用默认菜单栏快捷键(默认:是)。菜单栏快捷键始终优先于任何其他快捷键,它们不会传播到 mpv 核心中,也不能在配置文件如 input.conf 或脚本绑定中使用。 - --macos-bundle-path=path1,path2,...
App Bundles operate in their own shell environment that is different from the one in the terminal. The default PATH variable for all Bundles is /usr/bin:/bin:/usr/sbin:/sbin. Because of that mpv can not find binaries installed by package manager that might be used in scripts for example. This option prepends all given paths to the default Bundle PATH.
应用包在其自己的 shell 环境中运行,与终端中的环境不同。所有包的默认 PATH 变量是 /usr/bin:/bin:/usr/sbin:/sbin 。因此,mpv 无法找到可能用于脚本中的由包管理器安装的二进制文件。此选项将所有给定的路径添加到默认包路径之前。Default value in following order:
以下顺序的默认值:/usr/local/bin: homebrew (Intel) install path
homebrew (Intel) 安装路径/usr/local/sbin: homebrew (Intel) install path
homebrew (Intel) 安装路径/opt/local/bin: MacPorts install path MacPorts 安装路径 /opt/local/sbin: MacPorts install path MacPorts 安装路径 /opt/homebrew/bin: homebrew (ARM) install path
homebrew (ARM) 安装路径/opt/homebrew/sbin: homebrew (ARM) install path
homebrew (ARM) 安装路径- --android-surface-size=<WxH>
Set dimensions of the rendering surface used by the Android gpu context. Needs to be set by the embedding application if the dimensions change during runtime (i.e. if the device is rotated), via the surfaceChanged callback.
设置 Android gpu 上下文使用的渲染表面的尺寸。如果尺寸在运行时发生变化(例如,如果设备旋转),则需要通过 surfaceChanged 回调由嵌入应用程序设置。Android with --gpu-context=android only. Android 使用 --gpu-context=android 只能。
- --gpu-sw
- Continue even if a software renderer is detected. This only works with
OpenGL/Vulkan backends. For d3d11, see --d3d11-warp.
即使检测到软件渲染器也继续。这仅适用于 OpenGL/Vulkan 后端。对于 d3d11,请参阅 --d3d11-warp 。 - --gpu-context=<context1,context2,...[,]>
Specify a priority list of the GPU contexts to be used. The value auto (the default) selects the GPU context with the default autoprobe order. You can also pass help to get a complete list of compiled in backends (sorted by the default autoprobe order).
指定要使用的 GPU 上下文的优先级列表。值 auto (默认值)选择具有默认自动探测顺序的 GPU 上下文。您还可以传递 help 以获取编译在内的后端完整列表(按默认自动探测顺序排序)。Note that the default GPU context is subject to change, and must not be relied upon. If a certain GPU context needs to be used, it must be explicitly specified.
请注意,默认 GPU 上下文可能会更改,不应依赖。如果需要使用某个 GPU 上下文,则必须明确指定。- auto 自动
- auto-select (default). Note that this context must be used alone and
does not participate in the priority list.
自动选择(默认)。请注意,此上下文必须单独使用,并且不参与优先级列表。 - win
- Win32/WGL
- winvk
- VK_KHR_win32_surface
- angle 角度
- Direct3D11 through the OpenGL ES translation layer ANGLE. This supports
almost everything the win backend does (if the ANGLE build is new
enough).
通过 OpenGL ES 翻译层 ANGLE 的 Direct3D11。这几乎支持 win 后端所做的所有功能(如果 ANGLE 构建足够新). - dxinterop (experimental)
dxinterop(实验性) - Win32, using WGL for rendering and Direct3D 9Ex for presentation. Works
on Nvidia and AMD. Newer Intel chips with the latest drivers may also
work.
Win32,使用 WGL 进行渲染和 Direct3D 9Ex 进行展示。在 Nvidia 和 AMD 上运行。较新的 Intel 芯片配合最新驱动也可能工作。 - d3d11
- Win32, with native Direct3D 11 rendering.
Win32,具有本机 Direct3D 11 渲染。 - x11
- X11/GLX (deprecated/legacy, EGL is preferred these days)
X11/GLX(已弃用/过时,现在更倾向于使用 EGL) - x11vk
- VK_KHR_xlib_surface
- wayland
- Wayland/EGL
- waylandvk
- VK_KHR_wayland_surface
- drm
- DRM/EGL
- displayvk
- VK_KHR_display. This backend is roughly the Vulkan equivalent of
DRM/EGL, allowing for direct rendering via Vulkan without a display
manager.
VK_KHR_display. 此后端大致相当于 Vulkan 的 DRM/EGL,允许通过 Vulkan 直接渲染而不需要显示管理器。 - x11egl
- X11/EGL
- android
- Android/EGL. Requires --wid be set to an android.view.Surface.
Android/EGL. 需要将 --wid 设置为 android.view.Surface 。 - macvk
- Vulkan on macOS with a metal surface through a translation layer (experimental)
通过转换层在 macOS 上使用金属表面的 Vulkan(实验性)
This is an object settings list option. See List Options for details.
这是一个对象设置列表选项。有关详细信息,请参阅列表选项。- --gpu-api=<type1,type2,...[,]>
Specify a priority list of accepted graphics APIs.
指定接受的图形 API 的优先级列表。- auto 自动
- Use any available API (default). Note that the default GPU API used for this
value is subject to change, and must not be relied upon. If a certain GPU API
needs to be used, it must be explicitly specified.
使用任何可用的 API(默认)。请注意,用于此值的默认 GPU API 可能会更改,不应依赖。如果需要使用特定的 GPU API,则必须明确指定。 - opengl
- Allow only OpenGL (requires OpenGL 2.1+ or GLES 2.0+)
仅允许 OpenGL(需要 OpenGL 2.1+ 或 GLES 2.0+) - vulkan
- Allow only Vulkan (requires a valid/working --spirv-compiler)
仅允许 Vulkan(需要有效的/正常工作的 --spirv-compiler ) - d3d11
- Allow only --gpu-context=d3d11 仅允许 --gpu-context=d3d11
This is an object settings list option. See List Options for details.
这是一个对象设置列表选项。有关详细信息,请参阅列表选项。- --opengl-es=<mode>
Controls which type of OpenGL context will be accepted:
控制将接受哪种类型的 OpenGL 上下文:- auto 自动
- Allow all types of OpenGL (default)
允许所有类型的 OpenGL(默认) - yes 是
- Only allow GLES 仅允许 GLES
- no 无
- Only allow desktop/core GL
仅允许桌面/core GL
- --fbo-format=<fmt>
Selects the internal format of textures used for FBOs. The format can influence performance and quality of the video output. fmt can be one of: rgb8, rgb10, rgb10_a2, rgb16, rgb16f, rgb32f, rgba12, rgba16, rgba16f, rgba16hf, rgba32f.
选择用于 FBO 的纹理的内部格式。该格式可以影响视频输出的性能和质量。 fmt 可以是以下之一:rgb8, rgb10, rgb10_a2, rgb16, rgb16f, rgb32f, rgba12, rgba16, rgba16f, rgba16hf, rgba32f.Default: auto, which first attempts to utilize 16bit float (rgba16f, rgba16hf), and falls back to rgba16 if those are not available. Finally, attempts to utilize rgb10_a2 or rgba8 if all of the previous formats are not available.
默认: auto ,首先尝试使用 16 位浮点数(rgba16f, rgba16hf),如果这些不可用,则回退到 rgba16。最后,如果所有之前的格式都不可用,则尝试使用 rgb10_a2 或 rgba8。- --gamma-factor=<0.1..2.0>
- Set an additional raw gamma factor (default: 1.0). If gamma is adjusted in
other ways (like with the --gamma option or key bindings and the
gamma property), the value is multiplied with the other gamma value.
设置一个额外的原始伽玛因子(默认:1.0)。如果以其他方式调整伽玛(如使用 --gamma 选项或键绑定和 gamma 属性),则该值将与其他伽玛值相乘。 - --gamma-auto
Automatically corrects the gamma value depending on ambient lighting conditions (adding a gamma boost for bright rooms).
自动根据环境光照条件校正伽玛值(为明亮房间添加伽玛提升)。This option is deprecated and may be removed in the future.
此选项已弃用,未来可能会被移除。NOTE: Only implemented on macOS and --vo=gpu.
注意:仅在 macOS 上实现, --vo=gpu 。- --image-lut=<file>
- Specifies a custom LUT file (in Adobe .cube format) to apply to the colors
during image decoding. The exact interpretation of the LUT depends on
the value of --image-lut-type. (Only for --vo=gpu-next)
指定一个自定义 LUT 文件(Adobe .cube 格式),在图像解码期间应用于颜色。LUT 的确切解释取决于 --image-lut-type 的值。(仅适用于 --vo=gpu-next ) - --image-lut-type=<value>
Controls the interpretation of color values fed to and from the LUT specified as --image-lut. Valid values are:
控制输入到和从 --image-lut 指定的 LUT 中传递的颜色值的解释。有效值包括:- auto 自动
- Chooses the interpretation of the LUT automatically from tagged
metadata, and otherwise falls back to native. (Default)
自动从标记的元数据中选择 LUT 的解释,否则回退到 native 。(默认) - native 本地
- Applied to the raw image contents in its native colorspace, before
decoding to RGB. For example, for a HDR10 image, this would be fed
PQ-encoded YCbCr values in the range 0.0 - 1.0.
应用于原始图像内容的原生色彩空间中,在解码为 RGB 之前。例如,对于 HDR10 图像,这将提供范围在 0.0 - 1.0 之间的 PQ 编码 YCbCr 值。 - normalized 标准化
- Applied to the normalized RGB image contents, after decoding from
its native color encoding, but before linearization.
应用于从其原生色彩编码解码后的归一化 RGB 图像内容,但在线性化之前。 - conversion 转换
- Fully replaces the color decoding. A LUT of this type should ingest the
image's native colorspace and output normalized non-linear RGB.
完全替换颜色解码。此类 LUT 应该接收图像的原始色彩空间并输出归一化的非线性 RGB。
- --target-colorspace-hint=<auto|yes|no>
- Automatically configure the output colorspace of the display to pass
through the input values of the stream (e.g. for HDR passthrough), if
possible. In auto mode, the target colorspace is only set,
if the display signals support for HDR colorspace.
Requires a supporting driver and --vo=gpu-next. (Default: no)
自动配置显示的输出色彩空间以通过流的输入值(例如,用于 HDR 透传),如果可能的话。在 auto 模式下,只有当显示信号支持 HDR 色彩空间时,才会设置目标色彩空间。需要支持驱动程序和 --vo=gpu-next . (默认: no ) - --target-prim=<value>
Specifies the primaries of the display. Video colors will be adapted to this colorspace when ICC color management is not being used. Valid values are:
指定显示的原色。当不使用 ICC 色彩管理时,视频色彩将适配此色彩空间。有效值有:- auto 自动
- Disable any adaptation, except for atypical color spaces. Specifically,
wide/unusual gamuts get automatically adapted to BT.709, while standard
gamut (i.e. BT.601 and BT.709) content is not touched. (default)
禁用任何适配,除非是非典型色彩空间。具体来说,宽/不寻常的色彩范围会自动适配到 BT.709,而标准色彩范围(即 BT.601 和 BT.709)的内容则保持不变。(默认) - bt.470m
- ITU-R BT.470 M
- bt.601-525
- ITU-R BT.601 (525-line SD systems, eg. NTSC), SMPTE 170M/240M
ITU-R BT.601 (525 行 SD 系统,例如 NTSC),SMPTE 170M/240M - bt.601-625
- ITU-R BT.601 (625-line SD systems, eg. PAL/SECAM), ITU-R BT.470 B/G
ITU-R BT.601 (625 行 SD 系统,例如 PAL/SECAM),ITU-R BT.470 B/G - bt.709
- ITU-R BT.709 (HD), IEC 61966-2-4 (sRGB), SMPTE RP177 Annex B
ITU-R BT.709 (高清),IEC 61966-2-4 (sRGB),SMPTE RP177 附录 B - bt.2020
- ITU-R BT.2020 (UHD)
- apple 苹果
- Apple RGB 苹果 RGB
- adobe
- Adobe RGB (1998)
- prophoto 专业照片
- ProPhoto RGB (ROMM)
- cie1931
- CIE 1931 RGB (not to be confused with CIE XYZ)
CIE 1931 RGB(不要与 CIE XYZ 混淆) - dci-p3
- DCI-P3 (Digital Cinema Colorspace), SMPTE RP431-2
DCI-P3 (数字影院色彩空间), SMPTE RP431-2 - v-gamut
- Panasonic V-Gamut (VARICAM) primaries
松下 V-Gamut (VARICAM) 基色 - s-gamut
- Sony S-Gamut (S-Log) primaries
索尼 S-Gamut (S-Log) 主色域
- --target-trc=<value>
Specifies the transfer characteristics (gamma) of the display. Video colors will be adjusted to this curve when ICC color management is not being used. Valid values are:
指定显示的传输特性(伽玛)。当不使用 ICC 颜色管理时,视频颜色将调整到此曲线。有效值包括:- auto 自动
- Disable any adaptation, except for atypical transfers. Specifically,
HDR or linear light source material gets automatically converted to
gamma 2.2, while SDR content is not touched. (default)
禁用任何适配,除了非典型传输。具体来说,HDR 或线性光源材料会自动转换为伽玛 2.2,而 SDR 内容则保持不变。(默认) - bt.1886
- ITU-R BT.1886 curve (assuming infinite contrast)
ITU-R BT.1886 曲线(假设无限对比度) - srgb
- IEC 61966-2-4 (sRGB)
- linear 线性
- Linear light output 线性光输出
- gamma1.8 伽玛 1.8
- Pure power curve (gamma 1.8), also used for Apple RGB
纯功率曲线(gamma 1.8),也用于 Apple RGB - gamma2.0
- Pure power curve (gamma 2.0)
纯功率曲线(gamma 2.0) - gamma2.2
- Pure power curve (gamma 2.2)
纯功率曲线(gamma 2.2) - gamma2.4
- Pure power curve (gamma 2.4)
纯功率曲线(gamma 2.4) - gamma2.6
- Pure power curve (gamma 2.6)
纯功率曲线(gamma 2.6) - gamma2.8
- Pure power curve (gamma 2.8), also used for BT.470-BG
纯功率曲线(伽马 2.8),也用于 BT.470-BG - prophoto 专业照片
- ProPhoto RGB (ROMM)
- pq
- ITU-R BT.2100 PQ (Perceptual quantizer) curve, aka SMPTE ST2084
ITU-R BT.2100 PQ (感知量化器) 曲线,又称 SMPTE ST2084 - hlg
- ITU-R BT.2100 HLG (Hybrid Log-gamma) curve, aka ARIB STD-B67
ITU-R BT.2100 HLG (Hybrid Log-gamma) 曲线,又称 ARIB STD-B67 - v-log
- Panasonic V-Log (VARICAM) curve
松下 V-Log (VARICAM) 曲线 - s-log1
- Sony S-Log1 curve 索尼 S-Log1 曲线
- s-log2
- Sony S-Log2 curve 索尼 S-Log2 曲线
Note 注意
When using HDR output formats, mpv will encode to the specified curve but it will not set any HDMI flags or other signalling that might be required for the target device to correctly display the HDR signal. The user should independently guarantee this before using these signal formats for display.
使用 HDR 输出格式时,mpv 将按照指定曲线进行编码,但它不会设置任何 HDMI 标志或其他可能需要的目标设备正确显示 HDR 信号的信号。用户在使用这些信号格式进行显示之前应独立保证这一点。- --target-peak=<auto|nits>
Specifies the measured peak brightness of the output display, in cd/m^2 (AKA nits). The interpretation of this brightness depends on the configured --target-trc. In all cases, it imposes a limit on the signal values that will be sent to the display. If the source exceeds this brightness level, a tone mapping filter will be inserted. For HLG, it has the additional effect of parametrizing the inverse OOTF, in order to get colorimetrically consistent results with the mastering display. For SDR, or when using an ICC (profile (--icc-profile), setting this to a value above 203 essentially causes the display to be treated as if it were an HDR display in disguise. (See the note below)
指定输出显示的测量峰值亮度,单位为 cd/m^2(又称尼特)。此亮度的解释取决于配置的 --target-trc 。在所有情况下,它都会对发送到显示器的信号值施加限制。如果源亮度超过此亮度级别,将插入色调映射过滤器。对于 HLG,它还具有参数化逆 OOTF 的附加效果,以便与母版显示器获得颜色学上一致的结果。对于 SDR 或使用 ICC(配置文件 --icc-profile ),将此值设置为 203 以上将导致显示器被当作伪装成 HDR 显示器来处理。(见下文注释)In auto mode (the default), the chosen peak is an appropriate value based on the TRC in use. For SDR curves, it uses 203. For HDR curves, it uses 203 * the transfer function's nominal peak. If available, it will use the target display's peak brightness as reported by the display.
在 auto 模式(默认模式)下,选择的峰值是基于所使用的 TRC 的适当值。对于 SDR 曲线,它使用 203。对于 HDR 曲线,它使用传输函数的标称峰值乘以 203。如果可用,它将使用目标显示器的峰值亮度,该亮度由显示器报告。Note 注意
When using an SDR transfer function, this is normally not needed, and setting it may lead to very unexpected results. The one time it is useful is if you want to calibrate a HDR display using traditional transfer functions and calibration equipment. In such cases, you can set your HDR display to a high brightness such as 800 cd/m^2, and then calibrate it to a standard curve like gamma2.8. Setting this value to 800 would then instruct mpv to essentially treat it as an HDR display with the given peak. This may be a good alternative in environments where PQ or HLG input to the display is not possible, and makes it possible to use HDR displays with mpv regardless of operating system support for HDMI HDR metadata.
当使用 SDR 转换函数时,这通常是不必要的,设置它可能会导致非常意外的结果。唯一有用的情况是如果您想使用传统的转换函数和校准设备校准 HDR 显示器。在这种情况下,您可以将 HDR 显示器设置为高亮度,例如 800 cd/m^2,然后将其校准到标准曲线,如 gamma2.8。将此值设置为 800 将指示 mpv 将其视为具有给定峰值的 HDR 显示器。这可能是在 PQ 或 HLG 输入到显示器不可用的情况下的一种良好替代方案,并使得无论操作系统是否支持 HDMI HDR 元数据,都可以使用 HDR 显示器与 mpv 一起使用。In such a configuration, we highly recommend setting --tone-mapping to mobius or even clip.
在这种配置中,我们强烈建议将 --tone-mapping 设置为 mobius ,甚至 clip 。- --target-contrast=<auto|10-1000000|inf>
- Specifies the measured contrast of the output display. --target-contrast
in conjunction with --target-peak value is used to calculate display
black point. Used in black point compensation during HDR tone-mapping.
auto is the default and assumes 1000:1 contrast as a typical SDR display
would have or an infinite contrast when HDR --target-trc is used.
If supported by the API, display contrast will be used as reported.
inf contrast specifies display with perfect black level, in practice OLED.
(Only for --vo=gpu-next)
指定输出显示的测量对比度。 --target-contrast 与 --target-peak 值一起用于计算显示的黑色点。在 HDR 色调映射期间的黑色点补偿中使用。 auto 是默认值,假设为 1000:1 的对比度,类似于典型的 SDR 显示,或者当使用 HDR --target-trc 时为无限对比度。如果 API 支持,则使用报告的显示对比度。 inf 对比度指定具有完美黑色水平的显示,实际上为 OLED。(仅适用于 --vo=gpu-next ) - --target-gamut=<value>
- Constrains the gamut of the display. You can use this option to output e.g.
DCIP3-in-BT.2020. Set --target-prim to the primaries of the containing
colorspace (into which values will be encoded), and --target-gamut to
the gamut you want to limit colors to. Takes the same values as
--target-prim. (Only for --vo=gpu-next)
限制显示的色彩范围。您可以使用此选项输出例如 DCIP3-in-BT.2020。将 --target-prim 设置为包含颜色空间的基色(值将编码到其中),将 --target-gamut 设置为您想要限制颜色的色彩范围。与 --target-prim 具有相同的值。(仅适用于 --vo=gpu-next ) - --target-lut=<file>
- Specifies a custom LUT file (in Adobe .cube format) to apply to the colors
before display on-screen. This LUT is fed values in normalized RGB, after
encoding into the target colorspace, so after the application of
--target-trc. (Only for --vo=gpu-next)
指定一个自定义 LUT 文件(Adobe .cube 格式),在屏幕上显示颜色之前应用于颜色。此 LUT 在编码到目标颜色空间后,以归一化 RGB 值提供值,因此是在应用 --target-trc 之后。(仅适用于 --vo=gpu-next ) - --tone-mapping=<value>
Specifies the algorithm used for tone-mapping images onto the target display. This is relevant for both HDR->SDR conversion as well as gamut reduction (e.g. playing back BT.2020 content on a standard gamut display). Valid values are:
指定将图像映射到目标显示器的算法。这对于 HDR->SDR 转换以及色域缩减(例如在标准色域显示器上播放 BT.2020 内容)都适用。有效值有:- auto 自动
- Maps to bt.2390 when using --vo=gpu, and to spline with
--vo=gpu-next. (Default)
映射到 bt.2390 当使用 --vo=gpu 时,以及使用 --vo=gpu-next 映射到 spline 。(默认) - clip
- Hard-clip any out-of-range values. Use this when you care about
perfect color accuracy for in-range values at the cost of completely
distorting out-of-range values. Not generally recommended.
硬裁剪任何超出范围的值。当您关心范围内值的完美颜色精度,而以完全扭曲超出范围的值为代价时,请使用此功能。通常不推荐使用。 - mobius 莫比乌斯
- Generalization of Reinhard to a Möbius transform with linear section.
Smoothly maps out-of-range values while retaining contrast and colors
for in-range material as much as possible. Use this when you care about
color accuracy more than detail preservation. This is somewhere in
between clip and reinhard, depending on the value of
--tone-mapping-param.
将 Reinhard 推广到带有线性段的 Möbius 变换。平滑映射超出范围的值,尽可能保留在范围内材料的对比度和颜色。当您更关心颜色准确性而不是细节保留时使用此方法。这位于 clip 和 reinhard 之间,具体取决于 --tone-mapping-param 的值。 - reinhard
- Reinhard tone mapping algorithm. Very simple continuous curve.
Preserves overall image brightness but uses nonlinear contrast, which
results in flattening of details and degradation in color accuracy.
Reinhard 色调映射算法。非常简单的连续曲线。保留整体图像亮度,但使用非线性对比度,这会导致细节平坦化并降低颜色准确性。 - hable
- Similar to reinhard but preserves both dark and bright details
better (slightly sigmoidal), at the cost of slightly darkening /
desaturating everything. Developed by John Hable for use in video
games. Use this when you care about detail preservation more than
color/brightness accuracy. This is roughly equivalent to
--tone-mapping=reinhard --tone-mapping-param=0.24. If possible,
you should also enable --hdr-compute-peak for the best results.
类似于 reinhard 但更好地保留了暗部和亮部细节(略微呈 sigmoid 形),代价是稍微变暗/降低饱和度。由 John Hable 为视频游戏开发。当您更关心细节保留而不是颜色/亮度准确性时使用此功能。这大致相当于 --tone-mapping=reinhard --tone-mapping-param=0.24 。如果可能的话,您还应该启用 --hdr-compute-peak 以获得最佳效果。 - bt.2390
- Perceptual tone mapping curve (EETF) specified in ITU-R Report BT.2390.
ITU-R 报告 BT.2390 中指定的感知色调映射曲线(EETF)。 - gamma 伽马
- Fits a logarithmic transfer between the tone curves.
在音调曲线之间拟合对数传输。 - linear 线性
- Linearly stretches the entire reference gamut to (a linear multiple of)
the display.
线性拉伸整个参考色域到(显示的线性倍数)。 - spline
- Perceptually linear single-pivot polynomial. (--vo=gpu-next only)
感知线性单枢轴多项式。( --vo=gpu-next 仅) - bt.2446a
- HDR<->SDR mapping specified in ITU-R Report BT.2446, method A. This is
the recommended curve for well-mastered content. (--vo=gpu-next
only)
HDR<->SDR 映射指定在 ITU-R 报告 BT.2446 中,方法 A。这是高质量内容的推荐曲线。( --vo=gpu-next 仅限) - st2094-40
- Dynamic HDR10+ tone-mapping method specified in SMPTE ST2094-40 Annex
B. In the absence of metadata, falls back to a fixed spline matched to
the input/output average brightness characteristics. (--vo=gpu-next
only)
在 SMPTE ST2094-40 附件 B 中指定的动态 HDR10+色调映射方法。在没有元数据的情况下,回退到与输入/输出平均亮度特性匹配的固定样条。( --vo=gpu-next 仅限) - st2094-10
- Dynamic tone-mapping method specified in SMPTE ST2094-10 Annex B.2.
Conceptually simpler than ST2094-40, and generally produces worse
results.
在 SMPTE ST2094-10 附件 B.2 中指定的动态色调映射方法。概念上比 ST2094-40 简单,但通常产生更差的结果。
- --tone-mapping-param=<value>
Set tone mapping parameters. By default, this is set to the special string default, which maps to an algorithm-specific default value. Ignored if the tone mapping algorithm is not tunable. This affects the following tone mapping algorithms:
设置色调映射参数。默认情况下,这设置为特殊字符串 default ,它映射到算法特定的默认值。如果色调映射算法不可调整,则忽略。这影响以下色调映射算法:- clip 裁剪
- Specifies an extra linear coefficient to multiply into the signal
before clipping. Defaults to 1.0.
指定一个额外的线性系数,用于在裁剪信号之前将其乘以。默认为 1.0。 - mobius 莫比乌斯
- Specifies the transition point from linear to mobius transform. Every
value below this point is guaranteed to be mapped 1:1. The higher the
value, the more accurate the result will be, at the cost of losing
bright details. Defaults to 0.3, which due to the steep initial slope
still preserves in-range colors fairly accurately.
指定从线性到莫比乌斯变换的过渡点。此点以下的所有值都保证按 1:1 映射。值越高,结果越准确,但会损失亮部细节。默认为 0.3,由于初始斜率陡峭,因此仍然可以相当准确地保留范围内的颜色。 - reinhard
- Specifies the local contrast coefficient at the display peak. Defaults
to 0.5, which means that in-gamut values will be about half as bright
as when clipping.
指定显示峰值处的局部对比度系数。默认值为 0.5,这意味着在色域内的值将比裁剪时大约暗一半。 - bt.2390
- Specifies the offset for the knee point. Defaults to 1.0, which is
higher than the value from the original ITU-R specification (0.5).
(--vo=gpu-next only)
指定膝关节点的偏移量。默认为 1.0,高于原始 ITU-R 规范中的值(0.5)。( --vo=gpu-next 仅限) - gamma 伽马
- Specifies the exponent of the function. Defaults to 1.8.
指定函数的指数。默认为 1.8。 - linear 线性
- Specifies the scale factor to use while stretching. Defaults to 1.0.
指定拉伸时使用的缩放因子。默认为 1.0。 - spline
- Specifies the knee point (in PQ space). Defaults to 0.30.
指定膝点(在 PQ 空间中)。默认为 0.30。 - st2094-10
- Specifies the contrast (slope) at the knee point. Defaults to 1.0.
指定膝点的对比度(斜率)。默认为 1.0。
- --inverse-tone-mapping
- If set, allows inverse tone mapping (expanding SDR to HDR). Not supported
by all tone mapping curves. Use with caution. (--vo=gpu-next only)
如果设置,允许逆色调映射(将 SDR 扩展到 HDR)。并非所有色调映射曲线都支持。请谨慎使用。(仅 --vo=gpu-next ) - --tone-mapping-max-boost=<1.0..10.0>
- Upper limit for how much the tone mapping algorithm is allowed to boost
the average brightness by over-exposing the image. The default value of 1.0
allows no additional brightness boost. A value of 2.0 would allow
over-exposing by a factor of 2, and so on. Raising this setting can help
reveal details that would otherwise be hidden in dark scenes, but raising
it too high will make dark scenes appear unnaturally bright. (--vo=gpu
only)
色调映射算法允许通过过度曝光图像来提高平均亮度的上限。默认值 1.0 不允许额外的亮度提升。2.0 的值将允许过度曝光因子为 2,依此类推。提高此设置可以帮助揭示在暗场景中否则会被隐藏的细节,但设置得太高会使暗场景看起来不自然地明亮。(仅 --vo=gpu ) - --tone-mapping-visualize
- Display a (PQ-PQ) graph of the active tone-mapping LUT. Intended only for
debugging purposes. The X axis shows PQ input values, the Y axis shows PQ
output values. The tone-mapping curve is shown in green/yellow. Yellow
means the brightness has been boosted from the source, dark blue regions
show where the brightness has been reduced. The extra colored regions and
lines indicate various monitor limits, as well a reference diagonal
(neutral tone-mapping) and source scene average brightness information (if
available). (--vo=gpu-next only)
"显示活动色调映射 LUT 的 (PQ-PQ) 图形。仅用于调试目的。X 轴显示 PQ 输入值,Y 轴显示 PQ 输出值。色调映射曲线以绿色/黄色显示。黄色表示亮度已从源增强,深蓝色区域表示亮度已降低。额外的彩色区域和线条表示各种监视器限制,以及参考对角线(中性色调映射)和源场景平均亮度信息(如有)。( --vo=gpu-next 仅限)” - --gamut-mapping-mode
Specifies the algorithm used for reducing the gamut of images for the target display, after any tone mapping is done.
指定用于在完成色调映射后减少目标显示图像色域的算法。- auto 自动
- Choose the best mode automatically. (Default)
自动选择最佳模式。(默认) - clip
- Hard-clip to the gamut (per-channel). Very low quality, but free.
硬裁剪到色域(每通道)。非常低质量,但免费。 - perceptual 感知的
- Performs a perceptually balanced gamut mapping using a soft knee
function to roll-off clipped regions, and a hue shifting function to
preserve saturation. (--vo=gpu-next only)
使用软膝函数进行感知平衡的色域映射,以衰减裁剪区域,并使用色调偏移函数以保留饱和度。(仅 --vo=gpu-next ) - relative 相对的
- Performs relative colorimetric clipping, while maintaining an
exponential relationship between brightness and chromaticity.
(--vo=gpu-next only)
执行相对色度测光裁剪,同时保持亮度和色度之间的指数关系。(仅 --vo=gpu-next ) - saturation 饱和度
- Performs simple RGB->RGB saturation mapping. The input R/G/B channels
are mapped directly onto the output R/G/B channels. Will never clip,
but will distort all hues and/or result in a faded look.
(--vo=gpu-next only)
执行简单的 RGB->RGB 饱和度映射。输入的 R/G/B 通道直接映射到输出的 R/G/B 通道。永远不会裁剪,但会扭曲所有色调和/或导致颜色变淡的外观。(仅 --vo=gpu-next ) - absolute 绝对
- Performs absolute colorimetric clipping. Like relative, but does
not adapt the white point. (--vo=gpu-next only)
执行绝对色度测量的裁剪。类似于 relative ,但不会调整白点。(仅 --vo=gpu-next ) - desaturate 去饱和
- Performs constant-luminance colorimetric clipping, desaturing colors
towards white until they're in-range.
执行恒亮度色度测量的裁剪,将颜色向白色去饱和,直到它们在范围内。 - darken 变暗
- Uniformly darkens the input slightly to prevent clipping on blown-out
highlights, then clamps colorimetrically to the input gamut boundary,
biased slightly to preserve chromaticity over luminance.
(--vo=gpu-next only)
均匀地轻微加深输入,以防止过曝高光裁剪,然后按色彩计量学限制到输入色域边界,略微偏向以保持色相相对于亮度。( --vo=gpu-next 仅限) - warn 警告
- Performs no gamut mapping, but simply highlights out-of-gamut pixels.
不执行色域映射,仅突出显示超出色域的像素。 - linear 线性
- Linearly/uniformly desaturates the image in order to bring the entire
image into the target gamut. (--vo=gpu-next only)
线性/均匀地降低图像的饱和度,以便将整个图像带入目标色域。(仅 --vo=gpu-next )
- --hdr-compute-peak=<auto|yes|no>
- Compute the HDR peak and frame average brightness per-frame instead of
relying on tagged metadata. These values are averaged over local regions as
well as over several frames to prevent the value from jittering around too
much. This option basically gives you dynamic, per-scene tone mapping.
Requires compute shaders, which is a fairly recent OpenGL feature, and will
probably also perform horribly on some drivers, so enable at your own risk.
The special value auto (default) will enable HDR peak computation
automatically if compute shaders and SSBOs are supported.
计算每帧的 HDR 峰值和帧平均亮度,而不是依赖于标记的元数据。这些值在局部区域以及多个帧上平均,以防止值抖动过大。此选项基本上为您提供动态、每场景的色调映射。需要计算着色器,这是一个相对较新的 OpenGL 功能,并且可能在某些驱动程序上表现极差,因此请自行承担风险。特殊值 auto (默认)将自动启用 HDR 峰值计算,如果支持计算着色器和 SSBO。 - --allow-delayed-peak-detect
- When using --hdr-compute-peak, allow delaying the detected peak by a
frame when beneficial for performance. In particular, this is required to
avoid an unnecessary FBO indirection when no advanced rendering is required
otherwise. Has no effect if there already is an indirect pass, such as when
advanced scaling is enabled. Defaults to no. (Only affects
--vo=gpu-next, note that --vo=gpu always delays the peak.)
当使用 --hdr-compute-peak 时,如果对性能有益,允许延迟检测到的峰值一帧。特别是,当不需要高级渲染时,这可以避免不必要的 FBO 间接操作。如果已经存在间接传递,例如启用高级缩放时,则没有效果。默认为否。(仅影响 --vo=gpu-next ,请注意 --vo=gpu 总是延迟峰值。) - --hdr-peak-percentile=<0.0..100.0>
- Which percentile of the input image brightness histogram to consider as the
true peak of the scene. If this is set to 100 (default), the
brightest pixel is measured. Otherwise, the top of the frequency
distribution is progressively cut off. Setting this too low will cause
clipping of very bright details, but can improve the dynamic brightness
range of scenes with very bright isolated highlights. Values other than 100
come with a small performance penalty. (Only for --vo=gpu-next)
考虑输入图像亮度直方图的哪个百分位数作为场景真实峰值的依据。如果设置为 100(默认值),则测量最亮的像素。否则,将逐步截断频率分布的顶部。设置得太低会导致非常亮细节的裁剪,但可以改善具有非常亮孤立高光的场景的动态亮度范围。除了 100 以外的值会带来轻微的性能损失。(仅适用于 --vo=gpu-next ) - --hdr-peak-decay-rate=<0.0..1000.0>
- The decay rate used for the HDR peak detection algorithm (default: 20.0).
This is only relevant when --hdr-compute-peak is enabled. Higher values
make the peak decay more slowly, leading to more stable values at the cost
of more "eye adaptation"-like effects (although this is mitigated somewhat
by --hdr-scene-threshold). A value of 0.0 (the lowest possible) disables
all averaging, meaning each frame's value is used directly as measured,
but doing this is not recommended for "noisy" sources since it may lead
to excessive flicker. (In signal theory terms, this controls the time
constant "tau" of an IIR low pass filter)
HDR 峰值检测算法使用的衰减率(默认:20.0)。这仅在启用 --hdr-compute-peak 时相关。更高的值会使峰值衰减得更慢,从而以牺牲更多“眼睛适应”效果为代价获得更稳定的值(尽管这通过 --hdr-scene-threshold 多少得到了缓解)。0.0 的值(最低可能值)禁用所有平均,意味着直接使用每帧的值进行测量,但出于“噪声”源可能导致过度闪烁的原因,不建议这样做。(在信号理论术语中,这控制了 IIR 低通滤波器的“tau”时间常数) - --hdr-scene-threshold-low=<0.0..100.0>, --hdr-scene-threshold-high=<0.0..100.0>
- The lower and upper thresholds (in dB) for a brightness difference
to be considered a scene change (default: 1.0 low, 3.0 high). This is only
relevant when --hdr-compute-peak is enabled. Normally, small
fluctuations in the frame brightness are compensated for by the peak
averaging mechanism, but for large jumps in the brightness this can result
in the frame remaining too bright or too dark for up to several seconds,
depending on the value of --hdr-peak-decay-rate. To counteract this,
when the brightness between the running average and the current frame
exceeds the low threshold, mpv will make the averaging filter more
aggressive, up to the limit of the high threshold (at which point the
filter becomes instant).
亮度差异的下限和上限(以 dB 为单位)用于判断场景变化(默认:1.0 低,3.0 高)。这仅在启用 --hdr-compute-peak 时相关。通常,通过峰值平均机制补偿帧亮度的小幅波动,但对于亮度的大幅跳跃,这可能导致帧亮度过高或过低,持续几秒钟,具体取决于 --hdr-peak-decay-rate 的值。为了对抗这种情况,当运行平均亮度与当前帧之间的亮度超过低阈值时,mpv 将使平均滤波器更加激进,直到达到高阈值(此时滤波器变为即时)。 - --hdr-contrast-recovery=<0.0..2.0>, --hdr-contrast-smoothness=<1.0..100.0>
- Enables the HDR contrast recovery algorithm, which is to designed to
enhance contrast of HDR video after tone mapping. The strength (default:
0.0) indicates the degree of contrast recovery, with 0.0 being completely
disabled and 1.0 being 100% strength. Values higher than 1.0 are allowed,
but may result in excessive sharpening. The smoothness (default: 3.5)
indicates the degree to which the HDR source is low-passed in order to
obtain contrast information - a value of 2.0 corresponds to 2x downscaling.
Users on low DPI displays (<= 100) may want to lower this value, while
users on very high DPI displays ("retina") may want to increase it. (Only
for vo=gpu-next)
启用 HDR 对比度恢复算法,该算法旨在增强色调映射后的 HDR 视频的对比度。强度(默认:0.0)表示对比度恢复的程度,0.0 表示完全禁用,1.0 表示 100%强度。允许值高于 1.0,但可能会导致过度锐化。平滑度(默认:3.5)表示 HDR 源低通滤波的程度,以获取对比度信息 - 2.0 的值相当于 2 倍下采样。在低 DPI 显示器(<= 100)上的用户可能希望降低此值,而在非常高的 DPI 显示器(“视网膜”)上的用户可能希望增加它。(仅适用于 vo=gpu-next ) - --use-embedded-icc-profile
- Load the embedded ICC profile contained in media files such as PNG images.
(Default: yes). Note that this option only works when also using a display
ICC profile (--icc-profile or --icc-profile-auto), and also
requires LittleCMS 2 support.
加载媒体文件(如 PNG 图像)中包含的嵌入式 ICC 配置文件。(默认:是)。请注意,此选项仅在同时使用显示 ICC 配置文件( --icc-profile 或 --icc-profile-auto )时才有效,并且还需要 LittleCMS 2 支持。 - --icc-profile=<file>
- Load an ICC profile and use it to transform video RGB to screen output.
Needs LittleCMS 2 support compiled in. This option overrides the
--target-prim, --target-trc and --icc-profile-auto options.
加载 ICC 配置文件并使用它将视频 RGB 转换为屏幕输出。需要编译进 LittleCMS 2 支持。此选项覆盖 --target-prim 、 --target-trc 和 --icc-profile-auto 选项。 - --icc-profile-auto
Automatically select the ICC display profile currently specified by the display settings of the operating system.
自动选择操作系统显示设置当前指定的 ICC 显示配置文件。NOTE: On Windows, the default profile must be an ICC profile. WCS profiles are not supported.
注意:在 Windows 上,默认配置文件必须是一个 ICC 配置文件。WCS 配置文件不受支持。Applications using libmpv with the render API need to provide the ICC profile via MPV_RENDER_PARAM_ICC_PROFILE.
使用带有渲染 API 的 libmpv 的应用程序需要通过 MPV_RENDER_PARAM_ICC_PROFILE 提供 ICC 配置文件。- --icc-cache
Store and load 3DLUTs created from the ICC profile on disk in the cache directory (Default: yes). This can be used to speed up loading, since LittleCMS 2 can take a while to create a 3D LUT. Note that these files contain uncompressed LUTs. Their size depends on the --icc-3dlut-size, and can be very big.
将使用 ICC 配置文件创建的 3DLUT 存储和加载到磁盘上的缓存目录中(默认: yes )。这可以用来加速加载,因为 LittleCMS 2 创建 3D LUT 可能需要一段时间。请注意,这些文件包含未压缩的 LUT。它们的大小取决于 --icc-3dlut-size ,可能非常大。On --vo=gpu-next, files that have not been accessed in the last 24 hours may be cleared if the cache limit (1.5 GiB) is exceeded.
在 --vo=gpu-next 上,如果缓存限制(1.5 GiB)超过,过去 24 小时未访问的文件可能会被清除。On --vo=gpu, this is not cleaned automatically, so old, unused cache files may stick around indefinitely.
在 --vo=gpu ,这不会自动清理,因此旧的、未使用的缓存文件可能会无限期地保留。- --icc-cache-dir
- The directory where icc cache is stored. Cache is stored in the system's
cache directory (usually ~/.cache/mpv) if this is unset.
存储 icc 缓存的目录。如果未设置,缓存将存储在系统的缓存目录中(通常为 ~/.cache/mpv )。 - --icc-intent=<value>
Specifies the ICC intent used for the color transformation (when using --icc-profile).
指定用于颜色转换的 ICC 意图(当使用 --icc-profile 时)。- 0
- perceptual 感知的
- 1
- relative colorimetric (default)
相对色度学(默认) - 2
- saturation 饱和度
- 3
- absolute colorimetric 绝对色度学
- --icc-3dlut-size=<auto|RxGxB>
Size of the 3D LUT generated from the ICC profile in each dimension. The default of auto means to pick the size automatically based on the profile characteristics. Sizes may range from 2 to 512.
从 ICC 配置文件生成的 3D LUT 在每个维度的大小。默认的 auto 表示根据配置文件特性自动选择大小。大小可能在 2 到 512 之间。NOTE: Setting this option to anything other than auto is strongly discouraged, except for testing.
注意:强烈不建议将此选项设置为 auto 之外的内容,除非进行测试。- --icc-force-contrast=<no|0-1000000|inf>
- Override the target device's detected contrast ratio by a specific value.
This is detected automatically from the profile if possible, but for some
profiles it might be missing, causing the contrast to be assumed as
infinite. As a result, video may appear darker than intended. If this is
the case, setting this option might help. This only affects BT.1886
content. The default of no means to use the profile values. The special
value inf causes the BT.1886 curve to be treated as a pure power gamma
2.4 function.
通过特定值覆盖目标设备检测到的对比度比率。如果可能,此值会自动从配置文件中检测到,但对于某些配置文件可能缺失,导致对比度被假设为无限。因此,视频可能比预期更暗。如果出现这种情况,设置此选项可能有所帮助。这仅影响 BT.1886 内容。默认的 no 表示使用配置文件值。特殊值 inf 表示将 BT.1886 曲线视为纯功率伽玛 2.4 函数。 - --icc-use-luma
- Use ICC profile luminance value. (Only for --vo=gpu-next)
使用 ICC 配置文件亮度值。(仅适用于 --vo=gpu-next ) - --lut=<file>
- Specifies a custom LUT (in Adobe .cube format) to apply to the colors
as part of color conversion. The exact interpretation depends on the value
of --lut-type. (Only for --vo=gpu-next)
指定一个自定义的 LUT(Adobe .cube 格式),作为颜色转换的一部分应用于颜色。确切的解释取决于 --lut-type 的值。(仅适用于 --vo=gpu-next ) - --lut-type=<value>
Controls the interpretation of color values fed to and from the LUT specified as --lut. Valid values are:
控制输入到和从 --lut 指定的 LUT 中传递的颜色值的解释。有效值包括:- auto 自动
- Chooses the interpretation of the LUT automatically from tagged
metadata, and otherwise falls back to native. (Default)
自动从标记的元数据中选择 LUT 的解释,否则回退到 native 。(默认) - native 本地
- Applied to raw image contents in its native RGB colorspace (non-linear
light), before conversion to the output color space.
应用于原始图像内容在其本机 RGB 色彩空间(非线性光)中,在转换为输出色彩空间之前。 - normalized 标准化
- Applied to the normalized RGB image contents, in linear light, before
conversion to the output color space.
应用于标准化 RGB 图像内容,在线性光下,转换到输出色彩空间之前。 - conversion 转换
- Fully replaces the conversion from the image color space to the output
color space. If such a LUT is present, it has the highest priority, and
overrides any ICC profiles, as well as options related to tone mapping
and output colorimetry (--target-prim, --target-trc etc.).
完全替换图像色彩空间到输出色彩空间的转换。如果存在这样的 LUT,则具有最高优先级,并覆盖任何 ICC 配置文件,以及与色调映射和输出色彩度相关的选项( --target-prim , --target-trc 等)。
- --blend-subtitles=<yes|video|no>
Blend subtitles directly onto upscaled video frames, before interpolation and/or color management (default: no). Enabling this causes subtitles to be affected by --icc-profile, --target-prim, --target-trc, --interpolation, --gamma-factor and --glsl-shaders. It also increases subtitle performance when using --interpolation.
在插值和/或色彩管理之前,将字幕直接混合到放大后的视频帧上(默认:否)。启用此功能会导致字幕受 --icc-profile , --target-prim , --target-trc , --interpolation , --gamma-factor 和 --glsl-shaders 影响。同时,当使用 --interpolation 时,它还会提高字幕性能。The downside of enabling this is that it restricts subtitles to the visible portion of the video, so you can't have subtitles exist in the black margins below a video (for example).
启用此功能的缺点是它会限制字幕仅显示在视频的可视部分,因此您无法在视频下方的黑色边框中显示字幕(例如)。If video is selected, the behavior is similar to yes, but subs are drawn at the video's native resolution, and scaled along with the video.
如果选择 video ,则行为类似于 yes ,但子图将在视频的原始分辨率下绘制,并随视频缩放。Warning 警告
This changes the way subtitle colors are handled. Normally, subtitle colors are assumed to be in sRGB and color managed as such. Enabling this makes them treated as being in the video's color space instead. This is good if you want things like softsubbed ASS signs to match the video colors, but may cause SRT subtitles or similar to look slightly off.
这更改了处理字幕颜色的方式。通常,字幕颜色被认为是 sRGB 格式,并按此进行颜色管理。启用此选项会使它们被视为在视频的颜色空间中。如果您想使软字幕 ASS 标志与视频颜色匹配,这将是有益的,但可能会导致 SRT 字幕或类似内容看起来略有不同。- --background=<none|color|tiles>
If the frame has an alpha component, decide what kind of background, if any, to blend it with. This does nothing if there is no alpha component.
如果帧具有 alpha 通道,决定将其与哪种背景(如果有)混合。如果没有 alpha 通道,则此操作不起作用。- color 颜色
- Blend the frame against the background color (--background-color,
normally black).
将框架与背景颜色( --background-color ,通常是黑色)混合。 - tiles 瓦片
- Blend the frame against a 16x16 gray/white tiles background (default).
将框架与 16x16 灰/白瓦片背景混合(默认)。 - none 无
- Do not blend the frame and leave the alpha as is.
不要混合框架,并保持 alpha 值不变。
Background transparency on d3d11 requires --d3d11-flip=no.
在 d3d11 上设置背景透明度需要使用 --d3d11-flip=no 。Before mpv 0.38.0, this option used to accept a color value specifying the background color. This is now done by the --background-color option. Use that instead.
在 mpv 0.38.0 之前,此选项曾接受一个指定背景颜色的颜色值。现在这通过 --background-color 选项来完成。请使用该选项代替。- --background-color=<color>
- Color used to draw parts of the mpv window not covered by video. See the
--sub-color option for how colors are defined.
用于绘制 mpv 窗口中未被视频覆盖的部分的颜色。有关颜色定义的详细信息,请参阅 --sub-color 选项。 - --border-background=<none|color|tiles>
- Same as --background but only applies to the black bar/border area of
the window. vo=gpu-next only. Defaults to color.
与 --background 相同,但仅适用于窗口的黑色栏/边框区域。仅 vo=gpu-next 。默认为 color 。 - --opengl-rectangle-textures
- Force use of rectangle textures (default: no). Normally this shouldn't have
any advantages over normal textures. Note that hardware decoding overrides
this flag. Could be removed any time.
强制使用矩形纹理(默认:否)。通常这不会比普通纹理有任何优势。注意硬件解码会覆盖此标志。可能随时被移除。 - --gpu-tex-pad-x, --gpu-tex-pad-y
- Enlarge the video source textures by this many pixels. For debugging only
(normally textures are sized exactly, but due to hardware decoding interop
we may have to deal with additional padding, which can be tested with these
options). Could be removed any time.
将视频源纹理放大这么多像素。仅用于调试(通常纹理大小精确,但由于硬件解码互操作,我们可能必须处理额外的填充,这可以通过这些选项进行测试)。可能随时被移除。 - --opengl-early-flush=<yes|no|auto>
Call glFlush() after rendering a frame and before attempting to display it (default: auto). Can fix stuttering in some cases, in other cases probably causes it. The auto mode will call glFlush() only if the renderer is going to wait for a while after rendering, instead of flipping GL front and backbuffers immediately (i.e. it doesn't call it in display-sync mode).
在渲染帧后和尝试显示之前调用 glFlush() (默认:自动)。在某些情况下可以修复卡顿,在其他情况下可能引起问题。 auto 模式仅在渲染器在渲染后需要等待一段时间时才会调用 glFlush() ,而不是立即翻转 GL 前后缓冲区(即不在显示同步模式下调用它)。On macOS this is always deactivated because it only causes performance problems and other regressions.
在 macOS 上这始终是禁用的,因为它只会引起性能问题和其他回归。- --gpu-dumb-mode=<yes|no|auto>
This mode is extremely restricted, and will disable most extended features. That includes high quality scalers and custom shaders!
此模式非常受限,并将禁用大多数扩展功能。这包括高质量缩放器和自定义着色器!It is intended for hardware that does not support FBOs (including GLES, which supports it insufficiently), or to get some more performance out of bad or old hardware.
它适用于不支持 FBO 的硬件(包括 GLES,它对 FBO 的支持不足),或者为了从不良或旧硬件中获得更多性能。This mode is forced automatically if needed, and this option is mostly useful for debugging. The default of auto will enable it automatically if nothing uses features which require FBOs.
此模式在需要时自动强制启用,此选项主要用于调试。默认的 auto 将在没有任何使用需要 FBOs 的功能时自动启用。This option might be silently removed in the future.
此选项可能在将来被静默移除。- --gpu-shader-cache
Store and load compiled GLSL shaders in the cache directory (Default: yes). Normally, shader compilation is very fast, so this is not usually needed. It mostly matters for anything involving GLSL to SPIR-V conversion, that is: D3D11, ANGLE or Vulkan, as well as on some other proprietary drivers. Enabling this can improve startup performance on these platforms.
在缓存目录中存储和加载编译后的 GLSL 着色器(默认: yes )。通常,着色器编译非常快,因此通常不需要这样做。这主要涉及涉及 GLSL 到 SPIR-V 转换的内容,即:D3D11、ANGLE 或 Vulkan,以及一些其他专有驱动程序。在这些平台上启用此功能可以提高启动性能。On --vo=gpu-next, files that have not been accessed in the last 24 hours may be cleared if the cache limit (128 MiB) is exceeded.
在 --vo=gpu-next 的情况下,如果缓存限制(128 MiB)超过,则过去 24 小时未访问的文件可能会被清除。On --vo=gpu, this is not cleaned automatically, so old, unused cache files may stick around indefinitely.
在 --vo=gpu ,这不会自动清理,因此旧的、未使用的缓存文件可能会无限期地保留。- --gpu-shader-cache-dir
- The directory where gpu shader cache is stored. Cache is stored in the system's
cache directory (usually ~/.cache/mpv) if this is unset.
存储 gpu 着色器缓存的目录。如果未设置,缓存将存储在系统的缓存目录中(通常为 ~/.cache/mpv )。 - --libplacebo-opts=<key>=<value>[,<key>=<value>[,...]]
Passes extra raw option to the libplacebo rendering backend (used by --vo=gpu-next). May override the effects of any other options set using the normal options system. Requires libplacebo v6.309 or higher. Included for debugging purposes only. For more information, see:
将额外的原始选项传递给 libplacebo 渲染后端(由 --vo=gpu-next 使用)。可能覆盖使用正常选项系统设置的任何其他选项的效果。需要 libplacebo v6.309 或更高版本。仅用于调试目的。更多信息,请参阅:
Video Sync 视频同步
- --mc=<seconds/frame>
- Maximum A-V sync correction per frame (in seconds)
每帧最大 A-V 同步校正(以秒为单位) - --autosync=<factor>
- Gradually adjusts the A/V sync based on audio delay measurements.
Specifying --autosync=0, the default, will cause frame timing to be
based entirely on audio delay measurements. Specifying --autosync=1
will do the same, but will subtly change the A/V correction algorithm. An
uneven video framerate in a video which plays fine with --audio=no can
often be helped by setting this to an integer value greater than 1. The
higher the value, the closer the timing will be to --audio=no. Try
--autosync=30 to smooth out problems with sound drivers which do not
implement a perfect audio delay measurement. With this value, if large A/V
sync offsets occur, they will only take about 1 or 2 seconds to settle
out. This delay in reaction time to sudden A/V offsets should be the only
side effect of turning this option on, for all sound drivers.
根据音频延迟测量值逐渐调整 A/V 同步。指定 --autosync=0 ,默认值,将使帧时间完全基于音频延迟测量值。指定 --autosync=1 将执行相同操作,但会微妙地改变 A/V 校正算法。对于使用 --audio=no 播放良好的视频,如果视频帧率不均匀,通常可以通过将此值设置为大于 1 的整数来得到改善。值越高,时间越接近 --audio=no 。尝试 --autosync=30 以平滑处理不实现完美音频延迟测量的声音驱动程序的问题。使用此值,如果出现大的 A/V 同步偏移,它们只需大约 1 或 2 秒即可稳定下来。打开此选项对突然的 A/V 偏移的反应时间延迟应该是唯一的副作用,对所有声音驱动程序都适用。 - --video-timing-offset=<seconds>
Control how long before video display target time the frame should be rendered (default: 0.050). If a video frame should be displayed at a certain time, the VO will start rendering the frame earlier, and then will perform a blocking wait until the display time, and only then "swap" the frame to display. The rendering cannot start before the previous frame is displayed, so this value is implicitly limited by the video framerate. With normal video frame rates, the default value will ensure that rendering is always immediately started after the previous frame was displayed. On the other hand, setting a too high value can reduce responsiveness with low FPS value.
控制视频显示目标时间前多少帧应该渲染(默认:0.050)。如果视频帧应该在特定时间显示,VO 将提前开始渲染帧,然后将在显示时间进行阻塞等待,并且只有在那时才“交换”帧以显示。渲染不能在上一帧显示之前开始,因此此值隐式地受视频帧率的限制。在正常视频帧率下,默认值将确保渲染总是在上一帧显示后立即开始。另一方面,设置过高的值可能会降低低 FPS 值时的响应速度。This option is interesting for client API users using the render API because you can stop it from limiting your FPS (see mpv_render_context_render() documentation).
此选项对使用渲染 API 的客户端 API 用户很有趣,因为您可以从限制您的 FPS 中停止它(参见 mpv_render_context_render() 文档)。This applies only to audio timing modes (e.g. --video-sync=audio). In other modes (--video-sync=display-...), video timing relies on vsync blocking, and this option is not used.
此选项仅适用于音频定时模式(例如 --video-sync=audio )。在其他模式( --video-sync=display-... )中,视频定时依赖于 vsync 阻塞,此选项不使用。- --video-sync=<audio|...>
How the player synchronizes audio and video.
播放器如何同步音频和视频。If you use this option, you usually want to set it to display-resample to enable a timing mode that tries to not skip or repeat frames when for example playing 24fps video on a 24Hz screen.
如果您使用此选项,通常希望将其设置为 display-resample 以启用一种尝试在播放 24fps 视频到 24Hz 屏幕时不会跳过或重复帧的时间模式。The modes starting with display- try to output video frames completely synchronously to the display, using the detected display vertical refresh rate as a hint how fast frames will be displayed on average. These modes change video speed slightly to match the display. See --video-sync-... options for fine tuning. The robustness of this mode is further reduced by making a some idealized assumptions, which may not always apply in reality. Behavior can depend on the VO and the system's video and audio drivers. Media files must use constant framerate. Section-wise VFR might work as well with some container formats (but not e.g. mkv).
Under some circumstances, the player automatically reverts to audio mode for some time or permanently. This can happen on very low framerate video, or if the framerate cannot be detected.
在某些情况下,播放器会自动暂时或永久地回退到 audio 模式。这可能在非常低的帧率视频或无法检测到帧率时发生。Also in display-sync modes it can happen that interruptions to video playback (such as toggling fullscreen mode, or simply resizing the window) will skip the video frames that should have been displayed, while audio mode will display them after the renderer has resumed (typically resulting in a short A/V desync and the video "catching up").
即使在显示同步模式下,也可能发生视频播放中断(如切换全屏模式或简单地调整窗口大小)会跳过应该显示的视频帧,而 audio 模式将在渲染器恢复后显示它们(通常导致短暂的 A/V 不同步和视频“追赶”)。Before mpv 0.30.0, there was a fallback to audio mode on severe A/V desync. This was changed for the sake of not sporadically stopping. Now, display-desync does what it promises and may desync with audio by an arbitrary amount, until it is manually fixed with a seek.
在 mpv 0.30.0 之前,在严重的音视频不同步时会回退到 audio 模式。为了防止偶尔停止,这一改动被实施。现在, display-desync 会按照承诺执行,并且可能会以任意量与音频不同步,直到手动通过 seek 修复。These modes also require a vsync blocked presentation mode. For OpenGL, this translates to --opengl-swapinterval=1. For Vulkan, it translates to --vulkan-swap-mode=fifo (or fifo-relaxed).
这些模式还需要一个 vsync 阻塞的显示模式。对于 OpenGL,这对应于 --opengl-swapinterval=1 。对于 Vulkan,这对应于 --vulkan-swap-mode=fifo (或 fifo-relaxed )。The modes with desync in their names do not attempt to keep audio/video in sync. They will slowly (or quickly) desync, until e.g. the next seek happens. These modes are meant for testing, not serious use.
名称中包含 desync 的模式不会尝试保持音频/视频同步。它们会逐渐(或迅速)不同步,直到例如下一个 seek 发生。这些模式是为了测试,而不是用于正式使用。audio: Time video frames to audio. This is the most robust mode, because the player doesn't have to assume anything about how the display behaves. The disadvantage is that it can lead to occasional frame drops or repeats. If audio is disabled, this uses the system clock. This is the default mode.
将视频帧计时为音频。这是最稳健的模式,因为播放器不需要假设显示如何行为。缺点是偶尔可能会导致帧丢失或重复。如果禁用音频,则使用系统时钟。这是默认模式。display-resample: Resample audio to match the video. This mode will also try to adjust audio speed to compensate for other drift. (This means it will play the audio at a different speed every once in a while to reduce the A/V difference.)
将音频重采样以匹配视频。此模式还将尝试调整音频速度以补偿其他漂移。(这意味着它有时会以不同的速度播放音频以减少音画差异。)display-resample-vdrop: Resample audio to match the video. Drop video frames to compensate for drift.
将音频重采样以匹配视频。丢弃视频帧以补偿漂移。display-resample-desync: Like the previous mode, but no A/V compensation.
与上一个模式类似,但没有音视频补偿。display-tempo: 显示节拍: Same as display-resample, but apply audio speed changes to audio filters instead of resampling to avoid the change in pitch. Beware that some audio filters don't do well with a speed close to 1. It is recommend to use a conditional profile to automatically switch to display-resample when speed gets too close to 1 for your filter setup. Use (speed * video_speed_correction) to get the actual playback speed in the condition. See Conditional auto profiles for details.
与 display-resample 相同,但将音频速度变化应用于音频过滤器而不是重采样,以避免音调变化。请注意,一些音频过滤器在接近 1 的速度下表现不佳。建议使用条件配置文件,当速度接近 1 时自动切换到 display-resample ,以适应您的过滤器设置。使用(speed * video_speed_correction)获取条件下的实际播放速度。有关详细信息,请参阅条件自动配置文件。display-vdrop: 显示垂直降格: Drop or repeat video frames to compensate desyncing video. (Although it should have the same effects as audio, the implementation is very different.)
丢弃或重复视频帧以补偿视频不同步。 (尽管它应该与 audio 有相同的效果,但实现方式非常不同。)display-adrop: Drop or repeat audio data to compensate desyncing video. This mode will cause severe audio artifacts if the real monitor refresh rate is too different from the reported or forced rate. Since mpv 0.33.0, this acts on entire audio frames, instead of single samples.
丢弃或重复音频数据以补偿视频不同步。此模式如果实际监视器刷新率与报告或强制刷新率差异太大,将导致严重的音频伪影。自 mpv 0.33.0 以来,此功能作用于整个音频帧,而不是单个样本。display-desync: Sync video to display, and let audio play on its own.
同步视频以显示,并让音频自行播放。desync: Sync video according to system clock, and let audio play on its own.
根据系统时钟同步视频,并让音频自行播放。- --video-sync-max-factor=<value>
Maximum multiple for which to try to fit the video's FPS to the display's FPS (default: 5).
尝试将视频的 FPS 适配到显示器的 FPS 的最大倍数(默认:5)。For example, if this is set to 1, the video FPS is forced to an integer multiple of the display FPS, as long as the speed change does not exceed the value set by --video-sync-max-video-change.
例如,如果将其设置为 1,则视频 FPS 将被强制设置为显示 FPS 的整数倍,只要速度变化不超过 --video-sync-max-video-change 设置的值。See --interpolation-threshold for how this option affects interpolation.
查看 --interpolation-threshold 了解此选项如何影响插值。- --video-sync-max-video-change=<value>
Maximum speed difference in percent that is applied to video with --video-sync=display-... (default: 1). Display sync mode will be disabled if the monitor and video refresh way do not match within the given range. It tries multiples as well: playing 30 fps video on a 60 Hz screen will duplicate every second frame. Playing 24 fps video on a 60 Hz screen will play video in a 2-3-2-3-... pattern.
应用于 --video-sync=display-... 视频的最大速度差异百分比(默认:1)。如果监视器和视频刷新率在给定范围内不匹配,则将禁用显示同步模式。它还尝试倍数:在 60 Hz 屏幕上播放 30 fps 视频将每秒重复每一帧。在 60 Hz 屏幕上播放 24 fps 视频将以 2-3-2-3-... 的模式播放视频。The default settings are not loose enough to speed up 23.976 fps video to 25 fps. We consider the pitch change too extreme to allow this behavior by default. Set this option to a value of 5 to enable it.
默认设置不足以将 23.976 fps 视频加速到 25 fps。我们认为音调变化过于极端,不允许默认行为。将此选项设置为 5 的值以启用它。Note that --video-sync=display-tempo avoids this pitch change.
请注意, --video-sync=display-tempo 避免这种音调变化。Also note that in the --video-sync=display-resample or --video-sync=display-tempo mode, audio speed will additionally be changed by a small amount if necessary for A/V sync. See --video-sync-max-audio-change.
此外,请注意,在 --video-sync=display-resample 或 --video-sync=display-tempo 模式下,如果需要,音频速度将根据 A/V 同步额外改变一小部分。参见 --video-sync-max-audio-change 。- --video-sync-max-audio-change=<value>
- Maximum additional speed difference in percent that is applied to audio
with --video-sync=display-... (default: 0.125). Normally, the player
plays the audio at the speed of the video. But if the difference between
audio and video position is too high, e.g. due to drift or other timing
errors, it will attempt to speed up or slow down audio by this additional
factor. Too low values could lead to video frame dropping or repeating if
the A/V desync cannot be compensated, too high values could lead to chaotic
frame dropping due to the audio "overshooting" and skipping multiple video
frames before the sync logic can react.
应用于 --video-sync=display-... 的最大额外速度差异百分比(默认:0.125)。通常,播放器以视频的速度播放音频。但如果音频和视频位置之间的差异太大,例如由于漂移或其他时间错误,它将尝试通过这个额外因素加快或减慢音频。如果 A/V 不同步无法补偿,太低的值可能导致视频帧丢失或重复,太高的值可能导致由于音频“超出”和在同步逻辑反应之前跳过多个视频帧而出现混乱的帧丢失。
Miscellaneous 杂项
- --display-tags=tag1,tags2,...
Set the list of tags that should be displayed on the terminal and stats. Tags that are in the list, but are not present in the played file, will not be shown. If a value ends with *, all tags are matched by prefix (though there is no general globbing). Just passing * essentially filtering.
设置应在终端和统计中显示的标签列表。列表中的标签,但不在播放文件中存在的标签将不会显示。如果值以 * 结尾,则通过前缀匹配所有标签(尽管没有通用的 globbing)。仅传递 * 实质上相当于过滤。The default includes a common list of tags, call mpv with --list-options to see it.
默认包含一个常见的标签列表,使用 --list-options 调用 mpv 查看它。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。- --mf-fps=<value>
- Framerate used when decoding from multiple PNG or JPEG files with mf://
(default: 1).
使用 mf:// 从多个 PNG 或 JPEG 文件解码时使用的帧率(默认:1)。 - --mf-type=<value>
- Input file type for mf:// (available: jpeg, png, tga, sgi). By default,
this is guessed from the file extension.
用于 mf:// 的输入文件类型(可用:jpeg、png、tga、sgi)。默认情况下,这将从文件扩展名中猜测。 - --stream-dump=<destination-filename>
- Instead of playing a file, read its byte stream and write it to the given
destination file. The destination is overwritten. Can be useful to test
network-related behavior.
而不是播放文件,读取其字节流并将其写入指定的目标文件。目标文件将被覆盖。可用于测试与网络相关的行为。 - --stream-lavf-o=opt1=value1,opt2=value2,...
Set AVOptions on streams opened with libavformat. Unknown or misspelled options are silently ignored. (They are mentioned in the terminal output in verbose mode, i.e. --v. In general we can't print errors, because other options such as e.g. user agent are not available with all protocols, and printing errors for unknown options would end up being too noisy.)
在 libavformat 打开的流上设置 AVOptions。未知或拼写错误的选项将被静默忽略。(在详细模式下,它们会在终端输出中提及,即 --v 。通常我们无法打印错误,因为并非所有协议都提供例如用户代理等选项,打印未知选项的错误会导致输出过于嘈杂。)This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --backdrop-type=<auto|none|mica|acrylic|mica-alt>
(Windows only) Controls the backdrop/border style.
(仅限 Windows)控制背景/边框样式。auto: Default Windows behavior
默认 Windows 行为none: The backdrop will be black or white depending on the system's theme settings.
背景颜色将根据系统的主题设置而定,为黑色或白色。mica: Enables the Mica style, which is the default on Windows 11.
启用 Mica 风格,这是 Windows 11 的默认风格。acrylic: Enables the Acrylic style (frosted glass look).
启用 Acrylic 风格(磨砂玻璃外观)。mica-alt: Same as Mica, except reversed.
与 Mica 相同,但顺序相反。- --window-affinity=<default|excludefromcmcapture|monitor>
(Windows only) Controls the window affinity behavior of mpv.
(仅限 Windows) 控制 mpv 的窗口亲和力行为。default: 默认: Default Windows behavior
默认 Windows 行为excludefromcapture: mpv's window will be completely excluded from capture by external applications or screen recording software.
mpv 的窗口将完全被外部应用程序或屏幕录制软件排除在捕获之外。monitor: 监控: Blacks out the mpv window
黑屏 mpv 窗口- --vo-mmcss-profile=<name>
- (Windows only)
Set the MMCSS profile for the video renderer thread (default: Playback).
(仅限 Windows) 设置视频渲染线程的 MMCSS 配置文件(默认: Playback )。 - --priority=<prio>
(Windows only) Set process priority for mpv according to the predefined priorities available under Windows.
(仅限 Windows) 根据在 Windows 下可用的预定义优先级设置 mpv 的进程优先级。Possible values of <prio>: idle|belownormal|normal|abovenormal|high|realtime
可能的值 <prio> : 空闲|低于正常|正常|高于正常|高|实时Warning 警告
Using realtime priority can cause system lockup.
使用实时优先级可能导致系统锁定。- --media-controls=<yes|no>
- (Windows only)
Enable integration of media control interface SystemMediaTransportControls.
Default: yes (except for libmpv)
(仅限 Windows) 启用媒体控制界面 SystemMediaTransportControls 的集成。默认:是(除 libmpv 外) - --force-media-title=<string>
- Force the contents of the media-title property to this value. Useful
for scripts which want to set a title, without overriding the user's
setting in --title.
强制将 media-title 属性的内容设置为该值。对于想要设置标题而不覆盖用户在 --title 中的设置的脚本很有用。 - --external-files=<file-list>
Load a file and add all of its tracks. This is useful to play different files together (for example audio from one file, video from another), or for advanced --lavfi-complex used (like playing two video files at the same time).
加载一个文件并添加其所有轨道。这对于一起播放不同的文件很有用(例如,一个文件中的音频,另一个文件中的视频),或者用于高级 --lavfi-complex 使用(如同时播放两个视频文件)。Unlike --sub-files and --audio-files, this includes all tracks, and does not cause default stream selection over the "proper" file. This makes it slightly less intrusive. (In mpv 0.28.0 and before, this was not quite strictly enforced.)
与 --sub-files 和 --audio-files 不同,这包括所有轨道,并且不会在“正确”的文件上引起默认流选择。这使得它稍微不那么侵入性。(在 mpv 0.28.0 及之前版本中,这并不完全强制执行。)This is a path list option. See List Options for details.
这是一个路径列表选项。有关详细信息,请参阅列表选项。- --external-file=<file>
- CLI/config file only alias for --external-files-append. Each use of this
option will add a new external file.
CLI/配置文件中 --external-files-append 的仅别名。每次使用此选项都会添加一个新的外部文件。 - --cover-art-files=<file-list>
Use an external file as cover art while playing audio. This makes it appear on the track list and subject to automatic track selection. Options like --audio-display control whether such tracks are supposed to be selected.
(The difference to loading a file with --external-files is that video tracks will be marked as being pictures, which affects the auto-selection method. If the passed file is a video, only the first frame will be decoded and displayed. Enabling the cover art track during playback may show a random frame if the source file is a video. Normally you're not supposed to pass videos to this option, so this paragraph describes the behavior coincidentally resulting from implementation details.)
This is a path list option. See List Options for details.
- --cover-art-file=<file>
- CLI/config file only alias for --cover-art-files-append. Each use of this
option will add a new external file.
CLI/配置文件中 --cover-art-files-append 的仅别名。每次使用此选项都会添加一个新的外部文件。 - --cover-art-auto=<no|exact|fuzzy|all>
Whether to load _external_ cover art automatically. Similar to --sub-auto and --audio-file-auto. If a video already has tracks (which are not marked as cover art), external cover art will not be loaded.
是否自动加载 _外部_ 封面艺术。类似于 --sub-auto 和 --audio-file-auto 。如果视频已经有轨道(未标记为封面艺术),则不会加载外部封面艺术。no: no: Don't automatically load cover art.
不要自动加载封面艺术。exact: exact: Load the media filename with an image file extension (default).
加载带有图像文件扩展名的媒体文件名(默认)。fuzzy: Load all cover art containing the media filename.
加载包含媒体文件名的所有封面艺术。all: Load all images in the current directory.
加载当前目录中的所有图片。See --cover-art-files for details about what constitutes cover art.
查看 --cover-art-files 以了解构成封面艺术的内容。See --audio-display how to control display of cover art (this can be used to disable cover art that is part of the file).
查看 --audio-display 如何控制封面艺术的显示(这可以用来禁用文件中的封面艺术)。- --image-exts=ext1,ext2,...
Image file extensions to try to match when using --cover-art-auto, --autocreate-playlist or --directory-filter-types.
尝试匹配的图像文件扩展名,当使用 --cover-art-auto , --autocreate-playlist 或 --directory-filter-types 时 。This is a string list option. See List Options for details. Use --help=image-exts to see default extensions.
这是一个字符串列表选项。请参阅列表选项以获取详细信息。使用 --help=image-exts 查看默认扩展。- --cover-art-whitelist=filename1,filename2,...
Filenames to load as cover art, sorted by descending priority. They are combined with the extensions in --image-exts. This has no effect if cover-art-auto is no.
按降序优先级排序的文件名,用于加载封面艺术。它们与 --image-exts 中的扩展名组合。如果 cover-art-auto 等于 no ,则此设置无效。Default: AlbumArt,Album,cover,front,AlbumArtSmall,Folder,.folder,thumb 默认: AlbumArt,Album,cover,front,AlbumArtSmall,Folder,.folder,thumb
This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。- --video-exts=ext1,ext2,...
Video file extensions to try to match when using --autocreate-playlist or --directory-filter-types.
当使用 --autocreate-playlist 或 --directory-filter-types 时,尝试匹配的视频文件扩展名。This is a string list option. See List Options for details. Use --help=video-exts to see default extensions.
这是一个字符串列表选项。请参阅列表选项以获取详细信息。使用 --help=video-exts 查看默认扩展。- --archive-exts=ext1,ext2,...
Archive file extensions to try to match when using --autocreate-playlist or --directory-filter-types.
在使用 --autocreate-playlist 或 --directory-filter-types 时尝试匹配的存档文件扩展名。This is a string list option. See List Options for details. Use --help=archive-exts to see the default extensions.
这是一个字符串列表选项。请参阅列表选项以获取详细信息。使用 --help=archive-exts 查看默认扩展名。- --playlist-exts=ext1,ext2,...
Playlist file extensions to try to match when using --autocreate-playlist or --directory-filter-types.
在使用 --autocreate-playlist 或 --directory-filter-types 时尝试匹配的播放列表文件扩展名。This is a string list option. See List Options for details. Use --help=playlist-exts to see the default extensions.
这是一个字符串列表选项。请参阅列表选项以获取详细信息。使用 --help=playlist-exts 查看默认扩展名。- --autoload-files=<yes|no>
Automatically load/select external files (default: yes).
自动加载/选择外部文件(默认:是)。If set to no, then do not automatically load external files as specified by --sub-auto, --audio-file-auto and --cover-art-auto. If external files are forcibly added (like with --sub-files), they will not be auto-selected.
如果设置为 no ,则不会自动加载由 --sub-auto , --audio-file-auto 和 --cover-art-auto 指定的外部文件。如果强制添加外部文件(如使用 --sub-files ),则不会自动选择。This does not affect playlist expansion, redirection, or other loading of referenced files like with ordered chapters.
这不会影响播放列表扩展、重定向或其他加载引用文件,如有序章节。- --stream-record=<file>
Write received/read data from the demuxer to the given output file. The output file will always be overwritten without asking. The output format is determined by the extension of the output file.
将接收/读取的数据从解复用器写入指定的输出文件。输出文件将始终被覆盖而不会询问。输出格式由输出文件的扩展名决定。Switching streams or seeking during recording might result in recording being stopped and/or broken files. Use with care.
在录制过程中切换流或搜索可能会导致录制停止和/或文件损坏。请谨慎使用。Seeking outside of the demuxer cache will result in "skips" in the output file, but seeking within the demuxer cache should not affect recording. One exception is when you seek back far enough to exceed the forward buffering size, in which case the cache stops actively reading. This will return in dropped data if it's a live stream.
在解复用器缓存外进行搜索会导致输出文件中出现“跳过”,但在解复用器缓存内进行搜索不应影响录制。一个例外是当你搜索回的距离足够远以至于超过了正向缓冲区大小,在这种情况下,缓存将停止主动读取。如果是直播流,这将会导致数据丢失。If this is set at runtime, the old file is closed, and the new file is opened. Note that this will write only data that is appended at the end of the cache, and the already cached data cannot be written. You can try the dump-cache command as an alternative.
如果在运行时设置,则关闭旧文件,并打开新文件。请注意,这只会写入缓存末尾附加的数据,已缓存的数据无法写入。您可以尝试使用 dump-cache 命令作为替代。External files (--audio-file etc.) are ignored by this, it works on the "main" file only. Using this with files using ordered chapters or EDL files will also not work correctly in general.
外部文件(例如 --audio-file 等)在此处被忽略,它只对“main”文件有效。使用此功能与使用有序章节或 EDL 文件的电影文件通常也不会正确工作。There are some glitches with this because it uses FFmpeg's libavformat for writing the output file. For example, it's typical that it will only work if the output format is the same as the input format. This is the case even if it works with the ffmpeg tool. One reason for this is that ffmpeg and its libraries contain certain hacks and workarounds for these issues, that are unavailable to outside users.
由于它使用 FFmpeg 的 libavformat 来写入输出文件,因此存在一些问题。例如,它通常只在输出格式与输入格式相同的情况下才能正常工作。即使它与 ffmpeg 工具一起工作也是如此。其中一个原因是 ffmpeg 及其库包含针对这些问题的某些 hack 和 workaround,这些对于外部用户是不可用的。- --lavfi-complex=<string>
Set a "complex" libavfilter filter, which means a single filter graph can take input from multiple source audio and video tracks. The graph can result in a single audio or video output (or both).
设置一个“复杂”的 libavfilter 过滤器,这意味着单个过滤器图可以接收多个源音频和视频轨道的输入。该图可以生成单个音频或视频输出(或两者都有)。Currently, the filter graph labels are used to select the participating input tracks and audio/video output. The following rules apply:
目前,过滤器图标签用于选择参与输入轨道和音频/视频输出的轨道。以下规则适用:- A label of the form aidN selects audio track N as input (e.g.
aid1).
形式为 aidN 的标签选择音频轨道 N 作为输入(例如 aid1 )。 - A label of the form vidN selects video track N as input.
形式为 vidN 的标签选择视频轨道 N 作为输入。 - A label named ao will be connected to the audio output.
名为 ao 的标签将被连接到音频输出。 - A label named vo will be connected to the video output.
名为 vo 的标签将被连接到视频输出。
Each label can be used only once. If you want to use e.g. an audio stream for multiple filters, you need to use the asplit filter. Multiple video or audio outputs are not possible, but you can use filters to merge them into one.
每个标签只能使用一次。如果您想为多个过滤器使用例如音频流,则需要使用 asplit 过滤器。无法实现多个视频或音频输出,但您可以使用过滤器将它们合并为一个。It's not possible to change the tracks connected to the filter at runtime, unless you explicitly change the lavfi-complex property and set new track assignments. When the graph is changed, the track selection is changed according to the used labels as well.
在运行时无法更改连接到过滤器的音轨,除非您明确更改 lavfi-complex 属性并设置新的音轨分配。当图发生变化时,音轨选择也会根据使用的标签进行更改。Other tracks, as long as they're not connected to the filter, and the corresponding output is not connected to the filter, can still be freely changed with the normal methods.
其他音轨,只要它们没有连接到过滤器,并且相应的输出没有连接到过滤器,仍然可以使用常规方法自由更改。Note that the normal filter chains (--af, --vf) are applied between the complex graphs (e.g. ao label) and the actual output.
请注意,正常的过滤器链( --af , --vf )应用于复杂图(例如 ao 标签)和实际输出之间。Examples 示例
- --lavfi-complex='[aid1] [aid2] amix [ao]'
Play audio track 1 and 2 at the same time.
--lavfi-complex='[aid1] [aid2] amix [ao]' 同时播放音频轨道 1 和 2。 - --lavfi-complex='[vid1] [vid2] vstack [vo]'
Stack video track 1 and 2 and play them at the same time. Note that
both tracks need to have the same width, or filter initialization
will fail (you can add scale filters before the vstack filter
to fix the size).
To load a video track from another file, you can use
--external-file=other.mkv.
--lavfi-complex='[vid1] [vid2] vstack [vo]' 将视频轨道 1 和 2 堆叠并同时播放。请注意,两个轨道需要具有相同的宽度,否则过滤器初始化将失败(您可以在 vstack 过滤器之前添加 scale 过滤器来修复大小)。要从另一个文件加载视频轨道,您可以使用 --external-file=other.mkv 。 - --lavfi-complex='[vid1] [vid2] [vid3] hstack=inputs=3 [vo]'
Use the inputs option to stack more than 2 tracks.
--lavfi-complex='[vid1] [vid2] [vid3] hstack=inputs=3 [vo]' 使用输入选项来堆叠超过 2 个轨道。 - --lavfi-complex='[aid1] asplit [t1] [ao] ; [t1] showvolume [t2] ; [vid1] [t2] overlay [vo]'
Play audio track 1, and overlay the measured volume for each speaker
over video track 1.
--lavfi-complex='[aid1] asplit [t1] [ao] ; [t1] showvolume [t2] ; [vid1] [t2] overlay [vo]' 播放音频轨道 1,并将每个扬声器的测量音量叠加到视频轨道 1 上。
See the FFmpeg libavfilter documentation for details on the available filters.
请参阅 FFmpeg libavfilter 文档以获取有关可用过滤器的详细信息。- A label of the form aidN selects audio track N as input (e.g.
aid1).
- --metadata-codepage=<codepage>
Codepage for various input metadata (default: auto). This affects how file tags, chapter titles, etc. are interpreted. In most cases, this merely evaluates to UTF-8 as non-UTF-8 codepages are obscure.
各种输入元数据的代码页(默认: auto )。这会影响文件标签、章节标题等的解释。在大多数情况下,这仅评估为 UTF-8,因为非 UTF-8 代码页是晦涩的。See --sub-codepage option on how codepages are specified and further details regarding autodetection and codepage conversion. (The underlying code is the same.)
请参阅如何指定代码页的 --sub-codepage 选项以及有关自动检测和代码页转换的更多详细信息。(底层代码是相同的。)Conversion is not applied to metadata that is updated at runtime.
运行时更新的元数据不应用转换。- --clipboard-backends=<backend1,backend2,...[,]>
Specify a priority list of the clipboard backends to be used. You can also pass help to get a complete list of compiled in backends.
指定要使用的剪贴板后端的优先级列表。您还可以传递 help 以获取编译在内的后端完整列表。If the list is not empty, it enables native clipboard support for the specified backends. This allows reading and writing to the clipboard property to get and set clipboard contents.
如果列表不为空,则启用指定后端的本地剪贴板支持。这允许通过读取和写入 clipboard 属性来获取和设置剪贴板内容。Native clipboard support is enabled by default. To disable this, remove all backends in this list with --clipboard-backends-clr.
默认情况下启用本地剪贴板支持。要禁用此功能,请使用 --clipboard-backends-clr 从此列表中移除所有后端。Note that the default clipboard backends are subject to change, and must not be relied upon.
请注意,默认剪贴板后端可能会更改,不应依赖。The following clipboard backends are implemented:
以下实现了以下剪贴板后端:- win32
- Windows backend. Windows 后端。
- mac
- macOS backend. macOS 后端。
- wayland
- Wayland backend. This backend is only available if the compositor
supports the ext-data-control-v1 protocol.
Wayland 后端。此后端仅在合成器支持 ext-data-control-v1 协议的情况下可用。 - vo
- VO backend. Requires an active VO window, and support differs across
platforms. Currently, this is used as a fallback for Wayland
compositors without support for the ext-data-control-v1
protocol, or if the wayland backend is disabled.
VO 后端。需要活动 VO 窗口,并且在不同平台上的支持不同。目前,这被用作对 Wayland 合成器不支持 ext-data-control-v1 协议或 wayland 后端被禁用时的一种后备方案。
This is an object settings list option. See List Options for details.
这是一个对象设置列表选项。有关详细信息,请参阅列表选项。- --clipboard-monitor=<yes|no>
(Windows, Wayland and macOS only)
(仅限 Windows、Wayland 和 macOS)Enable clipboard monitoring so that the clipboard property can be observed for content changes (default: no). This only affects clipboard implementations which use polling to monitor clipboard updates. Other platforms currently ignore this option and always/never notify changes.
启用剪贴板监控以便观察 clipboard 属性以检测内容变化(默认:否)。这仅影响使用轮询监控剪贴板更新的剪贴板实现。其他平台目前忽略此选项,始终/从不通知变化。On Wayland, this option only has effect on the wayland backend, and not for the vo backend. See current-clipboard-backend property for more details.
在 Wayland 上,此选项仅对 wayland 后端有效,不对 vo 后端有效。有关更多详细信息,请参阅 current-clipboard-backend 属性。
AUDIO OUTPUT DRIVERS 音频输出驱动程序
Audio output drivers are interfaces to different audio output facilities. The
syntax is:
音频输出驱动程序是不同音频输出设施的接口。语法为:
- --ao=<driver1,driver2,...[,]>
- Specify a priority list of audio output drivers to be used.
指定要使用的音频输出驱动程序的优先级列表。
If the list has a trailing ',', mpv will fall back on drivers not contained
in the list.
如果列表以逗号结尾,mpv 将回退到列表中未包含的驱动程序。
This is an object settings list option. See List Options for details.
这是一个对象设置列表选项。有关详细信息,请参阅列表选项。
Note 注意
See --ao=help for a list of compiled-in audio output drivers sorted by
autoprobe order.
请参阅 --ao=help 以获取按自动探测顺序排序的内置音频输出驱动程序列表。
Note that the default audio output driver is subject to change, and must
not be relied upon. If a certain AO needs to be used, it must be
explicitly specified.
请注意,默认音频输出驱动可能会更改,不应依赖。如果需要使用特定的 AO,必须明确指定。
Available audio output drivers are:
可用的音频输出驱动包括:
- alsa
ALSA audio output driver.
ALSA 音频输出驱动程序。The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --alsa-resample=yes
- Enable ALSA resampling plugin. (This is disabled by default, because
some drivers report incorrect audio delay in some cases.)
启用 ALSA 重采样插件。(默认情况下已禁用,因为某些驱动程序在某些情况下报告音频延迟不正确。) - --alsa-mixer-device=<device>
- Set the mixer device used with ao-volume (default: default).
设置与 ao-volume 一起使用的混音设备(默认: default )。 - --alsa-mixer-name=<name>
- Set the name of the mixer element (default: Master). This is for
example PCM or Master.
设置混音元素的名称(默认: Master )。例如,这是 PCM 或 Master 。 - --alsa-mixer-index=<number>
- Set the index of the mixer channel (default: 0). Consider the output of
"amixer scontrols", then the index is the number that follows the
name of the element.
设置混音通道的索引(默认:0)。考虑“ amixer scontrols ”的输出,然后索引是元素名称后的数字。 - --alsa-non-interleaved
- Allow output of non-interleaved formats (if the audio decoder uses
this format). Currently disabled by default, because some popular
ALSA plugins are utterly broken with non-interleaved formats.
允许输出非交错格式(如果音频解码器使用此格式)。默认情况下已禁用,因为一些流行的 ALSA 插件与非交错格式完全损坏。 - --alsa-ignore-chmap
- Don't read or set the channel map of the ALSA device - only request the
required number of channels, and then pass the audio as-is to it. This
option most likely should not be used. It can be useful for debugging,
or for static setups with a specially engineered ALSA configuration (in
this case you should always force the same layout with --audio-channels,
or it will work only for files which use the layout implicit to your
ALSA device).
不要读取或设置 ALSA 设备的通道映射 - 只请求所需数量的通道,然后将音频原样传递给它。此选项很可能不应使用。它可能对调试或具有特别设计的 ALSA 配置的静态设置(在这种情况下,您应始终强制使用 --audio-channels 布局,否则它将仅适用于使用您的 ALSA 设备隐含布局的文件)很有用。 - --alsa-buffer-time=<microseconds>
Set the requested buffer time in microseconds. A value of 0 skips requesting anything from the ALSA API. This and the --alsa-periods option uses the ALSA near functions to set the requested parameters. If doing so results in an empty configuration set, setting these parameters is skipped.
设置请求的缓冲区时间(以微秒为单位)。值为 0 时,将跳过从 ALSA API 请求任何内容。此选项和 --alsa-periods 选项使用 ALSA near 函数设置请求的参数。如果这样做导致配置集为空,则跳过设置这些参数。Both options control the buffer size. A low buffer size can lead to higher CPU usage and audio dropouts, while a high buffer size can lead to higher latency in volume changes and other filtering.
这两个选项都控制缓冲区大小。缓冲区大小低可能导致 CPU 使用率更高和音频中断,而缓冲区大小高可能导致音量变化和其他过滤的延迟更高。- --alsa-periods=<number>
- Number of periods requested from the ALSA API. See --alsa-buffer-time
for further remarks.
从 ALSA API 请求的周期数。参见 --alsa-buffer-time 了解更多备注。
Warning 警告
To get multichannel/surround audio, use --audio-channels=auto. The default for this option is auto-safe, which makes this audio output explicitly reject multichannel output, as there is no way to detect whether a certain channel layout is actually supported.
要获取多声道/环绕音频,请使用 --audio-channels=auto 。此选项的默认值为 auto-safe ,这将使此音频输出明确拒绝多声道输出,因为没有方法检测某个声道布局是否实际上受支持。You can also try using the upmix plugin. This setup enables multichannel audio on the default device with automatic upmixing with shared access, so playing stereo and multichannel audio at the same time will work as expected.
您还可以尝试使用上混插件。此设置在 default 设备上启用多声道音频,并具有共享访问的自动上混,因此同时播放立体声和多声道音频将按预期工作。- oss
- OSS audio output driver
开源音频输出驱动程序 - jack
JACK (Jack Audio Connection Kit) audio output driver.
JACK (Jack 音频连接套件)音频输出驱动程序。The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --jack-port=<name>
- Connects to the ports with the given name (default: physical ports).
连接到给定名称的端口(默认:物理端口)。 - --jack-name=<client>
- Client name that is passed to JACK (default: mpv). Useful
if you want to have certain connections established automatically.
传递给 JACK 的客户端名称(默认: mpv )。如果您希望自动建立某些连接,则非常有用。 - --jack-autostart=<yes|no>
- Automatically start jackd if necessary (default: disabled). Note that
this tends to be unreliable and will flood stdout with server messages.
如有必要自动启动 jackd(默认:禁用)。请注意,这通常不可靠,并且会将服务器消息填充到 stdout 中。 - --jack-connect=<yes|no>
- Automatically create connections to output ports (default: enabled).
When enabled, the maximum number of output channels will be limited to
the number of available output ports.
自动创建到输出端口的连接(默认:启用)。当启用时,输出通道的最大数量将限制为可用输出端口的数量。 - --jack-std-channel-layout=<waveext|any>
- Select the standard channel layout (default: waveext). JACK itself has no
notion of channel layouts (i.e. assigning which speaker a given
channel is supposed to map to) - it just takes whatever the application
outputs, and reroutes it to whatever the user defines. This means the
user and the application are in charge of dealing with the channel
layout. waveext uses WAVE_FORMAT_EXTENSIBLE order, which, even
though it was defined by Microsoft, is the standard on many systems.
The value any makes JACK accept whatever comes from the audio
filter chain, regardless of channel layout and without reordering. This
mode is probably not very useful, other than for debugging or when used
with fixed setups.
选择标准通道布局(默认:waveext)。JACK 本身没有通道布局的概念(即分配给哪个扬声器给定的通道应该映射到) - 它只接受应用程序输出的任何内容,并将其重新路由到用户定义的位置。这意味着用户和应用程序负责处理通道布局。 waveext 使用 WAVE_FORMAT_EXTENSIBLE 顺序,尽管它是由 Microsoft 定义的,但在许多系统中是标准。 any 的值使 JACK 接受来自音频滤波器链的任何内容,无论通道布局如何,也不进行重新排序。这种模式可能除了调试或与固定设置一起使用外,不太有用。
- coreaudio (macOS only) coreaudio (仅限 macOS)
Native macOS audio output driver using AudioUnits and the CoreAudio sound server.
使用 AudioUnits 和 CoreAudio 音频服务器实现的本地 macOS 音频输出驱动程序。Automatically redirects to coreaudio_exclusive when playing compressed formats.
播放压缩格式时自动重定向到 coreaudio_exclusive 。The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --coreaudio-change-physical-format=<yes|no>
- Change the physical format to one similar to the requested audio format
(default: no). This has the advantage that multichannel audio output
will actually work. The disadvantage is that it will change the
system-wide audio settings. This is equivalent to changing the Format
setting in the Audio Devices dialog in the Audio MIDI Setup
utility. Note that this does not affect the selected speaker setup.
将物理格式更改为与请求的音频格式相似的格式(默认:否)。这的优点是,多声道音频输出实际上可以工作。缺点是它会更改系统范围内的音频设置。这相当于在 Audio MIDI Setup 实用工具中的 Audio Devices 对话框中更改 Format 设置。请注意,这不会影响所选的扬声器设置。 - --coreaudio-spdif-hack=<yes|no>
- Try to pass through AC3/DTS data as PCM. This is useful for drivers
which do not report AC3 support. It converts the AC3 data to float,
and assumes the driver will do the inverse conversion, which means
a typical A/V receiver will pick it up as compressed IEC framed AC3
stream, ignoring that it's marked as PCM. This disables normal AC3
passthrough (even if the device reports it as supported). Use with
extreme care.
尝试将 AC3/DTS 数据作为 PCM 传递。这对于不报告 AC3 支持的驱动程序很有用。它将 AC3 数据转换为浮点数,并假设驱动程序将进行逆转换,这意味着典型的 AV 接收器会将其识别为压缩的 IEC 帧 AC3 流,而忽略其标记为 PCM。这将禁用正常的 AC3 透传(即使设备报告支持)。请谨慎使用。
- coreaudio_exclusive (macOS only) coreaudio_exclusive (仅限 macOS)
- Native macOS audio output driver using direct device access and
exclusive mode (bypasses the sound server).
使用直接设备访问和独占模式(绕过声音服务器)的本地 macOS 音频输出驱动程序。 - avfoundation (macOS only) avfoundation (仅限 macOS)
Native macOS audio output driver using AVSampleBufferAudioRenderer in AVFoundation, which supports spatial audio.
使用 AVFoundation 中的 AVSampleBufferAudioRenderer 的本地 macOS 音频输出驱动程序,支持空间音频。Warning 警告
Turning on spatial audio may hang the playback if mpv is not started out of the bundle, though playback with spatial audio off always works.
开启空间音频可能会导致播放器挂起,如果 mpv 不是从包中启动的话,尽管关闭空间音频的播放总是可以正常工作。- audiounit (iOS only) audiounit (仅限 iOS)
- Native iOS audio output driver using AudioUnits and AudioToolbox.
使用 AudioUnits 和 AudioToolbox 的本地 iOS 音频输出驱动程序。 - openal
OpenAL audio output driver.
OpenAL 音频输出驱动程序。- --openal-num-buffers=<2-128>
- Specify the number of audio buffers to use. Lower values are better for
lower CPU usage. Default: 4.
指定要使用的音频缓冲区数量。值越低,CPU 使用率越低。默认:4。 - --openal-num-samples=<256-32768>
- Specify the number of complete samples to use for each buffer. Higher
values are better for lower CPU usage. Default: 8192.
指定每个缓冲区要使用的完整样本数量。值越高,CPU 使用率越低。默认:8192。 - --openal-direct-channels=<yes|no>
- Enable OpenAL Soft's direct channel extension when available to avoid
tinting the sound with ambisonics or HRTF. Default: yes.
当可用时,启用 OpenAL Soft 的直接通道扩展,以避免使用环绕声或 HRTF 对声音进行着色。默认:是。
- pulse
PulseAudio audio output driver
PulseAudio 音频输出驱动程序The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --pulse-host=<host>
- Specify the host to use. An empty <host> string uses a local connection,
"localhost" uses network transfer (most likely not what you want).
指定要使用的宿主。一个空的 字符串使用本地连接,"localhost" 使用网络传输(这很可能不是你想要的)。 - --pulse-buffer=<1-2000|native>
- Set the audio buffer size in milliseconds. A higher value buffers
more data, and has a lower probability of buffer underruns. A smaller
value makes the audio stream react faster, e.g. to playback speed
changes. "native" lets the sound server determine buffers.
设置音频缓冲区大小(毫秒)。值越大,缓冲的数据越多,缓冲不足的概率越低。值越小,音频流反应越快,例如对播放速度变化的反应。 "native" 允许声音服务器确定缓冲区。 - --pulse-latency-hacks=<yes|no>
- Enable hacks to workaround PulseAudio timing bugs (default: yes). If
enabled, mpv will do elaborate latency calculations on its own. If
disabled, it will use PulseAudio automatically updated timing
information. Disabling this might help with e.g. networked audio or
some plugins, while enabling it might help in some unknown situations
(it is currently enabled due to known bugs with PulseAudio 16.0).
启用绕过 PulseAudio 定时错误的技巧(默认:是)。如果启用,mpv 将自行进行复杂的延迟计算。如果禁用,它将使用 PulseAudio 自动更新的定时信息。禁用此选项可能有助于例如网络音频或某些插件,而启用它可能在某些未知情况下有所帮助(由于已知 PulseAudio 16.0 的错误,目前是启用的)。 - --pulse-allow-suspended=<yes|no>
- Allow mpv to use PulseAudio even if the sink is suspended (default: no).
Can be useful if PulseAudio is running as a bridge to jack and mpv has its sink-input set to the one jack is using.
允许 mpv 在即使 sink 处于挂起状态时使用 PulseAudio(默认:否)。如果 PulseAudio 作为连接 jack 和 mpv 的桥梁运行,并且 mpv 的 sink-input 设置为 jack 使用的那个,这可能很有用。
- pipewire
PipeWire audio output driver
PipeWire 音频输出驱动程序The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --pipewire-buffer=<1-2000|native>
- Set the audio buffer size in milliseconds. A higher value buffers
more data, and has a lower probability of buffer underruns. A smaller
value makes the audio stream react faster, e.g. to playback speed
changes. "native" lets the sound server determine buffers.
设置音频缓冲区大小(毫秒)。值越大,缓冲的数据越多,缓冲不足的概率越低。值越小,音频流反应越快,例如对播放速度变化的反应。 "native" 允许声音服务器确定缓冲区。 - --pipewire-remote=<remote>
- Specify the PipeWire remote daemon name to connect to via local UNIX
sockets.
An empty <remote> string uses the default remote named pipewire-0.
指定通过本地 UNIX 套接字连接到 PipeWire 远程守护进程的名称。空字符串使用默认远程名称 pipewire-0 。 - --pipewire-volume-mode=<channel|global>
- Specify if the ao-volume property should apply to the channel
volumes or the global volume.
By default the channel volumes are used.
指定 ao-volume 属性是否应用于通道音量或全局音量。默认情况下,使用通道音量。
- sdl
SDL 2.0+ audio output driver. Should work on any platform supported by SDL 2.0, but may require the SDL_AUDIODRIVER environment variable to be set appropriately for your system.
SDL 2.0+音频输出驱动程序。应在 SDL 2.0 支持的任何平台上工作,但可能需要设置适当的 SDL_AUDIODRIVER 环境变量以适应您的系统。Note 注意
This driver is for compatibility with extremely foreign environments, such as systems where none of the other drivers are available.
此驱动程序用于与极端陌生的环境兼容,例如在其他驱动程序均不可用的系统。The following global options are supported by this audio output:
此音频输出支持以下全局选项:- null
Produces no audio output but maintains video playback speed. You can use --ao=null --ao-null-untimed for benchmarking.
不产生音频输出但保持视频播放速度。您可以使用 --ao=null --ao-null-untimed 进行基准测试。The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --ao-null-untimed
- Do not simulate timing of a perfect audio device. This means audio
decoding will go as fast as possible, instead of timing it to the
system clock.
不要模拟完美音频设备的时序。这意味着音频解码将尽可能快地执行,而不是根据系统时钟进行时序。 - --ao-null-buffer
- Simulated buffer length in seconds.
模拟缓冲区长度(秒)。 - --ao-null-outburst
- Simulated chunk size in samples.
模拟数据块大小(样本)。 - --ao-null-speed
- Simulated audio playback speed as a multiplier. Usually, a real audio
device will not go exactly as fast as the system clock. It will deviate
just a little, and this option helps to simulate this.
模拟音频播放速度作为乘数。通常,真实的音频设备不会完全按照系统时钟的速度播放。它会有一点偏差,此选项有助于模拟这一点。 - --ao-null-latency
- Simulated device latency. This is additional to EOF.
模拟设备延迟。这是 EOF 之外的额外延迟。 - --ao-null-broken-eof
- Simulate broken audio drivers, which always add the fixed device
latency to the reported audio playback position.
模拟损坏的音频驱动程序,它总是将固定的设备延迟添加到报告的音频播放位置。 - --ao-null-broken-delay
- Simulate broken audio drivers, which don't report latency correctly.
模拟损坏的音频驱动程序,它无法正确报告延迟。 - --ao-null-channel-layouts
- If not empty, this is a , separated list of channel layouts the
AO allows. This can be used to test channel layout selection.
如果非空,这是一个由 , 分隔的通道布局列表,AO 允许使用。这可以用来测试通道布局选择。 - --ao-null-format
- Force the audio output format the AO will accept. If unset accepts any.
强制 AO 接受的音频输出格式。如果未设置,则接受任何格式。
- pcm
Raw PCM/WAVE file writer audio output
原始 PCM/WAVE 文件写入器音频输出The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --ao-pcm-waveheader=<yes|no>
- Include or do not include the WAVE header (default: included). When
not included, raw PCM will be generated.
是否包含 WAVE 头部(默认:包含)。如果不包含,将生成原始 PCM 数据。 - --ao-pcm-file=<filename>
- Write the sound to <filename> instead of the default
audiodump.wav. If no-waveheader is specified, the default is
audiodump.pcm.
将声音写入 <filename> 而不是默认的 audiodump.wav 。如果指定了 no-waveheader ,则默认为 audiodump.pcm 。 - --ao-pcm-append=<yes|no>
- Append to the file, instead of overwriting it. Always use this with the
no-waveheader option - with waveheader it's broken, because
it will write a WAVE header every time the file is opened.
追加到文件中,而不是覆盖它。始终与 no-waveheader 选项一起使用 - 使用 waveheader 会导致错误,因为每次打开文件时都会写入 WAVE 头部。
- sndio
Audio output to the OpenBSD sndio sound system
音频输出到 OpenBSD sndio 声音系统(Note: only supports mono, stereo, 4.0, 5.1 and 7.1 channel layouts.)
(注意:仅支持单声道、立体声、4.0、5.1 和 7.1 声道布局。)- wasapi
Audio output to the Windows Audio Session API.
音频输出到 Windows 音频会话 API。The following global options are supported by this audio output:
此音频输出支持以下全局选项:- --wasapi-exclusive-buffer=<default|min|1-2000000>
Set buffer duration in exclusive mode (i.e., with --audio-exclusive=yes). default and min use the default and minimum device period reported by WASAPI, respectively. You can also directly specify the buffer duration in microseconds, in which case a duration shorter than the minimum device period will be rounded up to the minimum period.
在独占模式下设置缓冲区持续时间(即,使用 --audio-exclusive=yes )。 default 和 min 分别使用 WASAPI 报告的默认和最小设备周期。您还可以直接指定微秒为单位的缓冲区持续时间,在这种情况下,持续时间短于最小设备周期将向上取整到最小周期。The default buffer duration should provide robust playback in most cases, but reportedly on some devices there are glitches following stream resets under the default setting. In such cases, specifying a shorter duration might help.
默认缓冲区持续时间在大多数情况下应提供稳健的播放,但据报道,在某些设备上,默认设置下流重置后会出现故障。在这种情况下,指定较短的持续时间可能会有所帮助。
VIDEO OUTPUT DRIVERS 视频输出驱动程序
Video output drivers are interfaces to different video output facilities. The
syntax is:
视频输出驱动程序是不同视频输出设施的接口。语法如下:
- --vo=<driver1,driver2,...[,]>
- Specify a priority list of video output drivers to be used.
指定要使用的视频输出驱动程序的优先级列表。
If the list has a trailing ,, mpv will fall back on drivers not contained
in the list.
如果列表中有尾随的 , ,mpv 将回退到列表中不包含的驱动程序。
This is an object settings list option. See List Options for details.
这是一个对象设置列表选项。有关详细信息,请参阅列表选项。
Note 注意
See --vo=help for a list of compiled-in video output drivers.
请参阅 --vo=help 以获取内置视频输出驱动程序的列表。
The recommended output driver is --vo=gpu, which is the default. All
other drivers are for compatibility or special purposes. If the default
does not work, it will fallback to other drivers (in the same order as
listed by --vo=help).
推荐输出驱动程序是 --vo=gpu ,这是默认设置。所有其他驱动程序都是为了兼容性或特殊用途。如果默认设置不起作用,它将回退到其他驱动程序(顺序与 --vo=help 列出的顺序相同)。
Note that the default video output driver is subject to change, and must
not be relied upon. If a certain VO needs to be used (e.g. for libmpv
rendering API), it must be explicitly specified.
请注意,默认的视频输出驱动程序可能会更改,不应依赖。如果需要使用特定的 VO(例如,用于 libmpv 渲染 API),则必须明确指定。
Available video output drivers are:
可用的视频输出驱动程序有:
- gpu
General purpose, customizable, GPU-accelerated video output driver. It supports extended scaling methods, dithering, color management, custom shaders, HDR, and more.
通用、可定制、GPU 加速的视频输出驱动程序。它支持扩展缩放方法、抖动、色彩管理、自定义着色器、HDR 等功能。See GPU renderer options for options specific to this VO.
请参阅 GPU 渲染器选项,以获取此 VO 的特定选项。By default, mpv utilizes settings that balance quality and performance. Additionally, two predefined profiles are available: fast for maximum performance and high-quality for superior rendering quality. You can apply a specific profile using the --profile=<name> option and inspect its contents using --show-profile=<name>.
默认情况下,mpv 使用平衡质量和性能的设置。此外,还提供了两个预定义的配置文件: fast 用于最大性能和 high-quality 用于高级渲染质量。您可以使用 --profile=<name> 选项应用特定配置文件,并使用 --show-profile=<name> 检查其内容。This VO abstracts over several possible graphics APIs and windowing contexts, which can be influenced using the --gpu-api and --gpu-context options.
此 VO 抽象了多个可能的图形 API 和窗口上下文,可以使用 --gpu-api 和 --gpu-context 选项来影响它们。Hardware decoding over OpenGL-interop is supported to some degree. Note that in this mode, some corner case might not be gracefully handled, and color space conversion and chroma upsampling is generally in the hand of the hardware decoder APIs.
在某种程度上支持通过 OpenGL-interop 的硬件解码。请注意,在此模式下,某些边缘情况可能无法优雅地处理,并且颜色空间转换和色度上采样通常由硬件解码器 API 处理。gpu makes use of FBOs by default. Sometimes you can achieve better quality or performance by changing the --fbo-format option to rgb16f, rgb32f or rgb. Known problems include Mesa/Intel not accepting rgb16, Mesa sometimes not being compiled with float texture support, and some macOS setups being very slow with rgb16 but fast with rgb32f. If you have problems, you can also try enabling the --gpu-dumb-mode=yes option.
gpu 默认使用 FBO。有时通过将 --fbo-format 选项更改为 rgb16f 、 rgb32f 或 rgb 可以实现更好的质量或性能。已知问题包括 Mesa/Intel 不接受 rgb16 ,Mesa 有时没有编译浮点纹理支持,以及某些 macOS 设置使用 rgb16 时非常慢,而使用 rgb32f 时则很快。如果您遇到问题,也可以尝试启用 --gpu-dumb-mode=yes 选项。- gpu-next
Experimental video renderer based on libplacebo. This supports almost the same set of features as --vo=gpu. See GPU renderer options for a list.
基于 libplacebo 的实验性视频渲染器。这几乎支持与 --vo=gpu 相同的功能集。查看 GPU 渲染器选项以获取列表。Should generally be faster and higher quality, but some features may still be missing or misbehave. Expect (and report!) bugs. See here for a list of known differences and bugs:
通常应该更快且质量更高,但某些功能可能仍然缺失或表现不佳。请期待(并报告!)错误。在此处查看已知差异和错误的列表:- xv (X11 only) xv (仅限 X11)
Uses the XVideo extension to enable hardware-accelerated display. This is the most compatible VO on X, but may be low-quality, and has issues with OSD and subtitle display.
使用 XVideo 扩展来启用硬件加速显示。这是 X 上的最兼容 VO,但可能质量较低,并且与 OSD 和字幕显示存在问题。Note 注意
This driver is for compatibility with old systems.
此驱动程序用于与旧系统兼容。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- --xv-adaptor=<number>
- Select a specific XVideo adapter (check xvinfo results).
选择特定的 XVideo 适配器(检查 xvinfo 结果)。 - --xv-port=<number>
- Select a specific XVideo port.
选择特定的 XVideo 端口。 - --xv-ck=<cur|use|set>
Select the source from which the color key is taken (default: cur).
选择获取颜色键的源(默认:cur)。- cur
- The default takes the color key currently set in Xv.
默认情况下,从 Xv 中获取当前设置的颜色键。 - use
- Use but do not set the color key from mpv (use the --colorkey
option to change it).
使用但不设置 mpv 的颜色键(使用 --colorkey 选项来更改它)。 - set 设置
- Same as use but also sets the supplied color key.
与 use 相同,但还设置提供的颜色键。
- --xv-ck-method=<none|man|bg|auto>
Sets the color key drawing method (default: man).
设置颜色键绘图方法(默认:man)。- none 无
- Disables color-keying. 禁用颜色键控。
- man 人
- Draw the color key manually (reduces flicker in some cases).
手动绘制颜色键(在某些情况下可减少闪烁)。 - bg 背景
- Set the color key as window background.
设置颜色键为窗口背景。 - auto 自动
- Let Xv draw the color key.
让 Xv 绘制颜色键。
- --xv-colorkey=<number>
- Changes the color key to an RGB value of your choice. 0x000000 is
black and 0xffffff is white.
将颜色键更改为您选择的 RGB 值。 0x000000 是黑色, 0xffffff 是白色。 - --xv-buffers=<number>
- Number of image buffers to use for the internal ringbuffer (default: 2).
Increasing this will use more memory, but might help with the X server
not responding quickly enough if video FPS is close to or higher than
the display refresh rate.
用于内部环形缓冲区的图像缓冲区数量(默认:2)。增加此值将使用更多内存,但如果视频 FPS 接近或高于显示刷新率,可能会帮助 X 服务器更快地响应。
- x11 (X11 only) x11 (仅限 X11)
Shared memory video output driver without hardware acceleration that works whenever X11 is present.
无硬件加速的共享内存视频输出驱动程序,只要存在 X11 即可工作。Since mpv 0.30.0, you may need to use --profile=sw-fast to get decent performance.
从 mpv 0.30.0 版本开始,您可能需要使用 --profile=sw-fast 来获得良好的性能。Note 注意
This is a fallback only, and should not be normally used.
这仅作为后备选项,不应正常使用。- vdpau (X11 only) vdpau (仅限 X11)
Uses the VDPAU interface to display and optionally also decode video. Hardware decoding is used with --hwdec=vdpau. Note that there is absolutely no reason to use this, other than compatibility. We strongly recommend that you use --vo=gpu with --hwdec=nvdec instead.
使用 VDPAU 接口显示视频,并可选项地解码视频。使用 --hwdec=vdpau 进行硬件解码。请注意,除了兼容性之外,绝对没有使用此功能的原因。我们强烈建议您使用 --vo=gpu 与 --hwdec=nvdec 代替。Note 注意
Earlier versions of mpv (and MPlayer, mplayer2) provided sub-options to tune vdpau post-processing, like deint, sharpen, denoise, chroma-deint, pullup, hqscaling. These sub-options are deprecated, and you should use the vdpaupp video filter instead.
mpv(以及 MPlayer、mplayer2)的早期版本提供了调整 vdpau 后处理的子选项,如 deint 、 sharpen 、 denoise 、 chroma-deint 、 pullup 、 hqscaling 。这些子选项已被弃用,您应使用 vdpaupp 视频过滤器代替。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- --vo-vdpau-sharpen=<-1-1>
(Deprecated. See note about vdpaupp.)
(已弃用。参见关于 vdpaupp 的说明。)For positive values, apply a sharpening algorithm to the video, for negative values a blurring algorithm (default: 0).
对于正值,对视频应用锐化算法,对于负值应用模糊算法(默认:0)。- --vo-vdpau-denoise=<0-1>
(Deprecated. See note about vdpaupp.)
(已弃用。参见关于 vdpaupp 的说明。)Apply a noise reduction algorithm to the video (default: 0; no noise reduction).
将噪声消除算法应用于视频(默认:0;无噪声消除)。- --vo-vdpau-chroma-deint
(Deprecated. See note about vdpaupp.)
(已弃用。参见关于 vdpaupp 的说明。)Makes temporal deinterlacers operate both on luma and chroma (default). Use no-chroma-deint to solely use luma and speed up advanced deinterlacing. Useful with slow video memory.
使时序去隔行扫描器在亮度(默认)和色度上同时工作。使用 no-chroma-deint 仅使用亮度并加快高级去隔行扫描。适用于慢速视频内存。- --vo-vdpau-pullup
(Deprecated. See note about vdpaupp.)
(已弃用。参见关于 vdpaupp 的说明。)Try to apply inverse telecine, needs motion adaptive temporal deinterlacing.
尝试应用逆电视扫描,需要运动自适应时间去隔行。- --vo-vdpau-hqscaling=<0-9>
(Deprecated. See note about vdpaupp.)
(已弃用。参见关于 vdpaupp 的说明。)- 0
- Use default VDPAU scaling (default).
使用默认 VDPAU 缩放(默认)。 - 1-9
- Apply high quality VDPAU scaling (needs capable hardware).
应用高质量的 VDPAU 缩放(需要具备能力的硬件)。
- --vo-vdpau-fps=<number>
- Override autodetected display refresh rate value (the value is needed
for framedrop to allow video playback rates higher than display
refresh rate, and for vsync-aware frame timing adjustments). Default 0
means use autodetected value. A positive value is interpreted as a
refresh rate in Hz and overrides the autodetected value. A negative
value disables all timing adjustment and framedrop logic.
覆盖自动检测的显示刷新率值(此值对于允许视频播放速率高于显示刷新率的 framedrop 以及进行 vsync 感知的帧时间调整是必需的)。默认 0 表示使用自动检测的值。正值表示 Hz 刷新率并覆盖自动检测的值。负值禁用所有时间调整和 framedrop 逻辑。 - --vo-vdpau-composite-detect
- NVIDIA's current VDPAU implementation behaves somewhat differently
under a compositing window manager and does not give accurate frame
timing information. With this option enabled, the player tries to
detect whether a compositing window manager is active. If one is
detected, the player disables timing adjustments as if the user had
specified fps=-1 (as they would be based on incorrect input). This
means timing is somewhat less accurate than without compositing, but
with the composited mode behavior of the NVIDIA driver, there is no
hard playback speed limit even without the disabled logic. Enabled by
default, use --vo-vdpau-composite-detect=no to disable.
NVIDIA 当前的 VDPAU 实现在不同合成窗口管理器下表现略有不同,并且不提供准确的帧时间信息。启用此选项后,播放器尝试检测是否存在合成窗口管理器。如果检测到,播放器将禁用时间调整,就像用户指定了 fps=-1 (因为它们将基于错误输入)一样。这意味着时间精度略低于无合成时,但与 NVIDIA 驱动程序的合成模式行为相比,即使没有禁用逻辑,也没有硬播放速度限制。默认启用,使用 --vo-vdpau-composite-detect=no 禁用。 - --vo-vdpau-queuetime-windowed=<number> and queuetime-fs=<number> --vo-vdpau-queuetime-windowed=<number> 和 queuetime-fs=<number>
- Use VDPAU's presentation queue functionality to queue future video
frame changes at most this many milliseconds in advance (default: 50).
See below for additional information.
使用 VDPAU 的演示队列功能,最多提前这么多毫秒排队未来的视频帧更改(默认:50)。有关更多信息,请参阅下文。 - --vo-vdpau-output-surfaces=<2-15>
- Allocate this many output surfaces to display video frames (default:
3). See below for additional information.
分配这么多输出表面以显示视频帧(默认:3)。有关更多信息,请参阅下文。 - --vo-vdpau-colorkey=<#RRGGBB|#AARRGGBB>
- Set the VDPAU presentation queue background color, which in practice
is the colorkey used if VDPAU operates in overlay mode (default:
#020507, some shade of black). If the alpha component of this value
is 0, the default VDPAU colorkey will be used instead (which is usually
green).
设置 VDPAU 演示队列的背景颜色,实际上是在 VDPAU 以叠加模式运行时使用的颜色键(默认: #020507 ,某种黑色的色调)。如果此值的 alpha 组件为 0,则将使用默认的 VDPAU 颜色键(通常是绿色)。 - --vo-vdpau-force-yuv
- Never accept RGBA input. This means mpv will insert a filter to convert
to a YUV format before the VO. Sometimes useful to force availability
of certain YUV-only features, like video equalizer or deinterlacing.
永不接受 RGBA 输入。这意味着 mpv 将在 VO 之前插入一个过滤器以转换为 YUV 格式。有时强制使用某些仅 YUV 的功能很有用,例如视频均衡器或去隔行。
Using the VDPAU frame queuing functionality controlled by the queuetime options makes mpv's frame flip timing less sensitive to system CPU load and allows mpv to start decoding the next frame(s) slightly earlier, which can reduce jitter caused by individual slow-to-decode frames. However, the NVIDIA graphics drivers can make other window behavior such as window moves choppy if VDPAU is using the blit queue (mainly happens if you have the composite extension enabled) and this feature is active. If this happens on your system and it bothers you then you can set the queuetime value to 0 to disable this feature. The settings to use in windowed and fullscreen mode are separate because there should be no reason to disable this for fullscreen mode (as the driver issue should not affect the video itself).
使用由 queuetime 选项控制的 VDPAU 帧排队功能可以使 mpv 的帧翻转时间对系统 CPU 负载不那么敏感,并允许 mpv 稍微提前开始解码下一帧(几帧),这可以减少由单个解码缓慢的帧引起的抖动。然而,如果 VDPAU 正在使用 blit 队列(主要发生在您启用了复合扩展的情况下)并且此功能处于活动状态,NVIDIA 显卡驱动程序可能会使其他窗口行为(如窗口移动)变得不流畅。如果您的系统出现这种情况并且让您感到烦恼,则可以将 queuetime 值设置为 0 以禁用此功能。窗口模式和全屏模式使用的设置是分开的,因为不应该有理由禁用全屏模式(因为驱动程序问题不应该影响视频本身)。You can queue more frames ahead by increasing the queuetime values and the output_surfaces count (to ensure enough surfaces to buffer video for a certain time ahead you need at least as many surfaces as the video has frames during that time, plus two). This could help make video smoother in some cases. The main downsides are increased video RAM requirements for the surfaces and laggier display response to user commands (display changes only become visible some time after they're queued). The graphics driver implementation may also have limits on the length of maximum queuing time or number of queued surfaces that work well or at all.
您可以通过增加 queuetime 值和 output_surfaces 计数(为确保有足够的表面来缓冲一定时间内的视频,您至少需要与该时间内的视频帧数一样多的表面,再加两个)来提前排队更多帧。在某些情况下,这有助于使视频更平滑。主要的缺点是增加了表面的视频 RAM 需求和对用户命令(显示更改仅在排队后一段时间才可见)的响应延迟。图形驱动程序的实现也可能对最大排队时间长度或有效排队表面的数量有限制。- direct3d (Windows only) direct3d (仅限 Windows)
Video output driver that uses the Direct3D interface.
使用 Direct3D 接口的视频输出驱动程序。Note 注意
This driver is for compatibility with systems that don't provide proper OpenGL drivers, and where ANGLE does not perform well.
此驱动程序用于与不提供适当 OpenGL 驱动程序的系统兼容,以及 ANGLE 表现不佳的情况。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- --vo-direct3d-disable-texture-align
- Normally texture sizes are always aligned to 16. With this option
enabled, the video texture will always have exactly the same size as
the video itself.
通常情况下,纹理大小总是对齐到 16。启用此选项后,视频纹理将始终与视频本身具有完全相同的尺寸。
Debug options. These might be incorrect, might be removed in the future, might crash, might cause slow downs, etc. Contact the developers if you actually need any of these for performance or proper operation.
调试选项。这些可能是不正确的,可能在将来被移除,可能引发崩溃,可能造成速度降低等。如果您确实需要这些选项以实现性能或正常操作,请联系开发者。- --vo-direct3d-force-power-of-2
- Always force textures to power of 2, even if the device reports
non-power-of-2 texture sizes as supported.
始终强制纹理大小为 2 的幂,即使设备报告支持非 2 的幂纹理大小。 - --vo-direct3d-texture-memory=<mode>
Only affects operation with shaders/texturing enabled, and (E)OSD. Possible values:
仅影响启用着色器/纹理和(E)OSD 的操作。可能值:- default (default) default (默认)
- Use D3DPOOL_DEFAULT, with a D3DPOOL_SYSTEMMEM texture for
locking. If the driver supports D3DDEVCAPS_TEXTURESYSTEMMEMORY,
D3DPOOL_SYSTEMMEM is used directly.
使用 D3DPOOL_DEFAULT ,使用 D3DPOOL_SYSTEMMEM 纹理进行锁定。如果驱动程序支持 D3DDEVCAPS_TEXTURESYSTEMMEMORY ,则直接使用 D3DPOOL_SYSTEMMEM 。 - default-pool
- Use D3DPOOL_DEFAULT. (Like default, but never use a
shadow-texture.)
使用 D3DPOOL_DEFAULT 。(类似于 default ,但从不使用阴影纹理。) - default-pool-shadow
- Use D3DPOOL_DEFAULT, with a D3DPOOL_SYSTEMMEM texture for
locking. (Like default, but always force the shadow-texture.)
使用 D3DPOOL_DEFAULT ,使用 D3DPOOL_SYSTEMMEM 纹理进行锁定。 (类似于 default ,但总是强制使用阴影纹理。) - managed
- Use D3DPOOL_MANAGED. 使用 D3DPOOL_MANAGED 。
- scratch
- Use D3DPOOL_SCRATCH, with a D3DPOOL_SYSTEMMEM texture for
locking.
使用 D3DPOOL_SCRATCH ,使用 D3DPOOL_SYSTEMMEM 纹理进行锁定。
- --vo-direct3d-swap-discard
- Use D3DSWAPEFFECT_DISCARD, which might be faster.
Might be slower too, as it must(?) clear every frame.
使用 D3DSWAPEFFECT_DISCARD ,可能更快。也可能更慢,因为它必须(?)每帧清除。 - --vo-direct3d-exact-backbuffer
- Always resize the backbuffer to window size.
始终将后缓冲区调整到窗口大小。
- sdl
SDL 2.0+ Render video output driver, depending on system with or without hardware acceleration. Should work on all platforms supported by SDL 2.0. For tuning, refer to your copy of the file SDL_hints.h.
SDL 2.0+ 渲染视频输出驱动程序,根据系统是否具有硬件加速而有所不同。应在所有由 SDL 2.0 支持的平台上都可正常工作。调整设置,请参考文件 SDL_hints.h 的副本。Note 注意
This driver is for compatibility with systems that don't provide proper graphics drivers.
此驱动程序用于与不提供适当图形驱动程序的系统兼容。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- dmabuf-wayland
Experimental Wayland output driver designed for use with either drm stateless or VA API hardware decoding. The driver is designed to avoid any GPU to CPU copies, and to perform scaling and color space conversion using fixed-function hardware, if available, rather than GPU shaders. This frees up GPU resources for other tasks. It is highly recommended to use this VO with the appropriate --hwdec option such as auto-safe. It can still work in some circumstances without --hwdec due to mpv's internal conversion filters, but this is not recommended as it's a needless extra step. Correct output depends on support from your GPU, drivers, and compositor. This requires the compositor and mpv to support color-management-v1 to accurately display colorspaces that are different from the compositor default (bt.601 in most cases).
为使用 drm 无状态或 VA API 硬件解码而设计的实验性 Wayland 输出驱动程序。该驱动程序旨在避免任何 GPU 到 CPU 的复制,并在可用的情况下使用固定功能硬件进行缩放和色彩空间转换,而不是 GPU 着色器。这将为其他任务释放 GPU 资源。强烈建议使用此 VO 与适当的 --hwdec 选项,例如 auto-safe 。在没有 --hwdec 的情况下,由于 mpv 的内部转换过滤器,它仍然可以在某些情况下工作,但这不是推荐的,因为它是一个不必要的额外步骤。正确的输出取决于您的 GPU、驱动程序和合成器的支持。这需要合成器和 mpv 支持 color-management-v1 以准确显示与合成器默认值(大多数情况下为 bt.601)不同的色彩空间。Warning 警告
This driver is not required for mpv to work on Wayland. vo=gpu and vo=gpu-next will switch to the appropriate Wayland context automatically. This driver is experimental and generally lower quality than gpu/gpu-next.
此驱动程序对于 mpv 在 Wayland 上工作不是必需的。 vo=gpu 和 vo=gpu-next 将自动切换到适当的 Wayland 上下文。此驱动程序是实验性的,通常比 gpu / gpu-next 的质量低。- vaapi
Intel VA API video output driver with support for hardware decoding. Note that there is absolutely no reason to use this, other than compatibility. This is low quality, and has issues with OSD. We strongly recommend that you use --vo=gpu with --hwdec=vaapi instead.
Intel VA API 视频输出驱动程序,支持硬件解码。请注意,除了兼容性之外,绝对没有使用它的理由。这质量较低,存在 OSD 问题。我们强烈建议您使用 --vo=gpu 替代 --hwdec=vaapi 。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- --vo-vaapi-scaling=<algorithm>
- default 默认
- Driver default (mpv default as well).
驱动程序默认(mpv 也默认)。 - fast 快速
- Fast, but low quality.
快速,但质量低。 - hq 高清
- Unspecified driver dependent high-quality scaling, slow.
未指定,驱动程序依赖的高质量缩放,慢。 - nla
- non-linear anamorphic scaling
- --vo-vaapi-scaled-osd=<yes|no>
- If enabled, then the OSD is rendered at video resolution and scaled to
display resolution. By default, this is disabled, and the OSD is
rendered at display resolution if the driver supports it.
如果启用,则 OSD 将在视频分辨率下渲染并缩放到显示分辨率。默认情况下,此功能是禁用的,如果驱动程序支持,则 OSD 将在显示分辨率下渲染。
- null
Produces no video output. Useful for benchmarking.
不产生视频输出。适用于基准测试。Usually, it's better to disable video with --video=no instead.
通常,使用 --video=no 禁用视频会更好。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- caca
Color ASCII art video output driver that works on a text console.
适用于文本控制台的彩色 ASCII 艺术视频输出驱动程序。This driver reserves some keys for runtime configuration. These keys are hardcoded and cannot be bound:
此驱动程序为运行时配置保留了一些键。这些键是硬编码的,无法绑定:- d and D d 和 D
- Toggle dithering algorithm.
切换抖动算法。 - a and A a 和 A
- Toggle antialiasing method.
切换抗锯齿方法。 - h and H h 和 H
- Toggle charset method. 切换字符集方法。
- c and C c 和 C
- Toggle color method. 切换颜色方法。
Note 注意
This driver is a joke.
这个驱动器是个玩笑。- tct
Color Unicode art video output driver that works on a text console. By default depends on support of true color by modern terminals to display the images at full color range, but 256-colors output is also supported (see below). On Windows it requires an ansi terminal such as mintty.
彩色 Unicode 艺术视频输出驱动程序,可在文本控制台上运行。默认情况下,依赖于现代终端对真彩色的支持以显示全彩色范围的图像,但也支持 256 色输出(见下文)。在 Windows 上需要类似于 mintty 的 ansi 终端。Since mpv 0.30.0, you may need to use --profile=sw-fast to get decent performance.
从 mpv 0.30.0 版本开始,您可能需要使用 --profile=sw-fast 来获得良好的性能。Note: the TCT image output is not synchronized with other terminal output from mpv, which can lead to broken images. The options --terminal=no or --really-quiet can help with that.
注意:TCT 图像输出与 mpv 的其他终端输出不同步,这可能导致图像损坏。选项 --terminal=no 或 --really-quiet 可以帮助解决这个问题。- --vo-tct-algo=<algo>
Select how to write the pixels to the terminal.
选择如何将像素写入终端。- half-blocks 半块
- Uses Unicode LOWER HALF BLOCK character to achieve higher vertical
resolution. (Default.)
使用 Unicode 下半块字符以实现更高的垂直分辨率。(默认。) - plain 纯文本
- Uses spaces. Causes vertical resolution to drop twofolds, but in
theory works in more places.
使用空格。导致垂直分辨率降低两倍,但在理论上可以在更多地方工作。
- --vo-tct-buffering=<pixel|line|frame>
Specifies the size of data batches buffered before being sent to the terminal.
指定在发送到终端之前缓存的批次数据的大小。TCT image output is not synchronized with other terminal output from mpv, which can lead to broken images. Sending data to the terminal in small batches may improve parallelism between terminal processing and mpv processing but incurs a static overhead of generating tens of thousands of small writes. Also, depending on the terminal used, sending frames in one chunk might help with tearing of the output, especially if not used with --really-quiet and other logs interrupt the data stream.
TCT 图像输出与 mpv 的其他终端输出不同步,可能导致图像损坏。以小批量向终端发送数据可能会提高终端处理和 mpv 处理之间的并行性,但会产生生成数万次小写入的静态开销。此外,根据使用的终端,一次性发送帧可能有助于输出撕裂,尤其是如果不与 --really-quiet 和其他日志中断数据流一起使用时。- pixel 像素
- Send data to terminal for each pixel.
将数据发送到每个像素的终端。 - line 行
- Send data to terminal for each line. (Default)
将数据发送到每行的终端。(默认) - frame
- Send data to terminal for each frame.
将数据发送到每个帧的终端。
- --vo-tct-width=<width> --vo-tct-height=<height>
- Assume the terminal has the specified character width and/or height.
These default to 80x25 if the terminal size cannot be determined.
假设终端具有指定的字符宽度和/或高度。如果无法确定终端大小,则默认为 80x25。 - --vo-tct-256=<yes|no> (default: no) --vo-tct-256=<yes|no> (默认:否)
- Use 256 colors - for terminals which don't support true color.
使用 256 种颜色 - 用于不支持真彩色的终端。
- kitty
Graphical output for the terminal, using the kitty graphics protocol. Tested with kitty and Konsole.
终端图形输出,使用 kitty 图形协议。已与 kitty 和 Konsole 进行测试。You may need to use --profile=sw-fast to get decent performance.
您可能需要使用 --profile=sw-fast 来获得良好的性能。Kitty size and alignment options:
Kitty 尺寸和对齐选项:- --vo-kitty-cols=<columns>, --vo-kitty-rows=<rows> (default: 0)
--vo-kitty-cols=<columns> , --vo-kitty-rows=<rows> (默认: 0) - Specify the terminal size in character cells, otherwise (0) read it
from the terminal, or fall back to 80x25.
指定终端的字符单元格大小,否则(0)从终端读取,或者回退到 80x25。 - --vo-kitty-width=<width>, --vo-kitty-height=<height> (default: 0)
--vo-kitty-width=<width> , --vo-kitty-height=<height> (默认: 0) - Specify the available size in pixels, otherwise (0) read it from the
terminal, or fall back to 320x240.
指定像素大小的可用大小,否则(0)从终端读取,或回退到 320x240。 - --vo-kitty-left=<col>, --vo-kitty-top=<row> (default: 0)
--vo-kitty-left=<col> , --vo-kitty-top=<row> (默认: 0) - Specify the position in character cells where the image starts (1 is
the first column or row). If 0 (default) then try to automatically
determine it according to the other values and the image aspect ratio
and zoom.
指定图像开始的字符单元格位置(1 是第一列或行)。如果为 0(默认)则尝试根据其他值和图像宽高比以及缩放自动确定。 - --vo-kitty-config-clear=<yes|no> (default: yes) --vo-kitty-config-clear=<yes|no> (默认:是)
- Whether or not to clear the terminal whenever the output is
reconfigured (e.g. when video size changes).
是否在重新配置输出时清除终端(例如,当视频大小改变时)。 - --vo-kitty-alt-screen=<yes|no> (default: yes) --vo-kitty-alt-screen=<yes|no> (默认:是)
- Whether or not to use the alternate screen buffer and return the
terminal to its previous state on exit. When set to no, the last
kitty image stays on screen after quit, with the cursor following it.
是否使用备用屏幕缓冲区并在退出时将终端恢复到其之前的状态。当设置为否时,退出后最后一个 kitty 图像将停留在屏幕上,光标跟随其后。 - --vo-kitty-use-shm=<yes|no> (default: no) --vo-kitty-use-shm=<yes|no> (默认: 否)
Use shared memory objects to transfer image data to the terminal. This is much faster than sending the data as escape codes, but is not supported by as many terminals. It also only works on the local machine and not via e.g. SSH connections.
使用共享内存对象将图像数据传输到终端。这比发送转义码的数据要快得多,但不是所有终端都支持。它也仅在本地机器上工作,不通过例如 SSH 连接。This option is not implemented on Windows.
此选项在 Windows 上未实现。
- --vo-kitty-cols=<columns>, --vo-kitty-rows=<rows> (default: 0)
- sixel
Graphical output for the terminal, using sixels. Tested with mlterm and xterm.
使用六像素的终端图形输出。与 mlterm 和 xterm 进行了测试。Note: the Sixel image output is not synchronized with other terminal output from mpv, which can lead to broken images. The option --really-quiet can help with that, and is recommended. On some platforms, using the --vo-sixel-buffered option may work as well.
注意:Sixel 图像输出与 mpv 的其他终端输出不同步,可能导致图像损坏。选项 --really-quiet 可以帮助解决这个问题,并建议使用。在某些平台上,使用 --vo-sixel-buffered 选项也可能有效。You may need to use --profile=sw-fast to get decent performance.
您可能需要使用 --profile=sw-fast 来获得良好的性能。Note: at the time of writing, xterm does not enable sixel by default - launching it as xterm -ti 340 is one way to enable it. Also, xterm does not display images bigger than 1000x1000 pixels by default.
注意:在撰写本文时, xterm 默认不启用 sixel - 以 xterm -ti 340 的方式启动它是启用它的方法之一。此外, xterm 默认不显示大于 1000x1000 像素的图像。To render and align sixel images correctly, mpv needs to know the terminal size both in cells and in pixels. By default it tries to use values which the terminal reports, however, due to differences between terminals this is an error-prone process which cannot be automated with certainty - some terminals report the size in pixels including the padding - e.g. xterm, while others report the actual usable number of pixels - like mlterm. Additionally, they may behave differently when maximized or in fullscreen, and mpv cannot detect this state using standard methods.
为了正确渲染和对齐 sixel 图像,mpv 需要知道终端的大小,包括单元格和像素。默认情况下,它尝试使用终端报告的值,然而,由于终端之间的差异,这是一个容易出错的进程,无法通过确定性自动化 - 一些终端报告包括填充的像素大小 - 例如 xterm ,而其他终端报告实际可用的像素数量 - 如 mlterm 。此外,它们在最大化或全屏时可能表现不同,而 mpv 无法使用标准方法检测此状态。Sixel size and alignment options:
Sixel 大小和对齐选项:- --vo-sixel-cols=<columns>, --vo-sixel-rows=<rows> (default: 0)
--vo-sixel-cols=<columns> , --vo-sixel-rows=<rows> (默认: 0) - Specify the terminal size in character cells, otherwise (0) read it
from the terminal, or fall back to 80x25. Note that mpv doesn't use the
the last row with sixel because this seems to result in scrolling.
指定终端的字符单元格大小,否则(0)从终端读取,或回退到 80x25。请注意,mpv 不使用带有六色的最后一行,因为这似乎会导致滚动。 - --vo-sixel-width=<width>, --vo-sixel-height=<height> (default: 0)
--vo-sixel-width=<width> , --vo-sixel-height=<height> (默认: 0) - Specify the available size in pixels, otherwise (0) read it from the
terminal, or fall back to 320x240. Other than excluding the last line,
the height is also further rounded down to a multiple of 6 (sixel unit
height) to avoid overflowing below the designated size.
指定像素大小的可用大小,否则(0)从终端读取,或回退到 320x240。除了排除最后一行外,高度还进一步向下取 6 的倍数(sixel 单位高度),以避免超出指定的尺寸。 - --vo-sixel-left=<col>, --vo-sixel-top=<row> (default: 0)
--vo-sixel-left=<col> , --vo-sixel-top=<row> (默认: 0) - Specify the position in character cells where the image starts (1 is
the first column or row). If 0 (default) then try to automatically
determine it according to the other values and the image aspect ratio
and zoom.
指定图像开始的字符单元格位置(1 是第一列或行)。如果为 0(默认)则尝试根据其他值和图像宽高比以及缩放自动确定。 - --vo-sixel-pad-x=<pad_x>, --vo-sixel-pad-y=<pad_y> (default: -1)
--vo-sixel-pad-x=<pad_x> , --vo-sixel-pad-y=<pad_y> (默认: -1) - Used only when mpv reads the size in pixels from the terminal.
Specify the number of padding pixels (on one side) which are included
at the size which the terminal reports. If -1 (default) then the number
of pixels is rounded down to a multiple of number of cells (per axis),
to take into account padding at the report - this only works correctly
when the overall padding per axis is smaller than the number of cells.
仅当 mpv 从终端读取像素大小时使用。指定包含在终端报告的大小中的填充像素数(单侧)。如果为-1(默认),则像素数向下取到单元格数(每轴)的倍数,以考虑报告中的填充 - 这仅在每轴的总填充数小于单元格数时才正确。 - --vo-sixel-config-clear=<yes|no> (default: yes) --vo-sixel-config-clear=<yes|no> (默认:是)
- Whether or not to clear the terminal whenever the output is
reconfigured (e.g. when video size changes).
是否在重新配置输出时清除终端(例如,当视频大小改变时)。 - --vo-sixel-alt-screen=<yes|no> (default: yes) --vo-sixel-alt-screen=<yes|no> (默认:是)
Whether or not to use the alternate screen buffer and return the terminal to its previous state on exit. When set to no, the last sixel image stays on screen after quit, with the cursor following it.
是否使用备用屏幕缓冲区,并在退出时将终端恢复到其之前的状态。当设置为 no 时,退出后最后六个像素的图像将留在屏幕上,光标跟随其后。--vo-sixel-exit-clear is a deprecated alias for this option and may be removed in the future.
--vo-sixel-exit-clear 是此选项的已弃用别名,未来可能会被移除。- --vo-sixel-buffered=<yes|no> (default: no) --vo-sixel-buffered=<yes|no> (默认: 否)
- Buffers the full output sequence before writing it to the terminal.
On POSIX platforms, this can help prevent interruption (including from
other applications) and thus broken images, but may come at a
performance cost with some terminals and is subject to implementation
details.
在将完整输出序列写入终端之前进行缓冲。在 POSIX 平台上,这可以帮助防止中断(包括来自其他应用程序的中断)以及因此损坏的图像,但可能会在一些终端上带来性能成本,并且受实现细节的影响。
Sixel image quality options:
Sixel 图像质量选项:- --vo-sixel-dither=<algo>
Selects the dither algorithm which libsixel should apply. Can be one of the below list as per libsixel's documentation.
选择 libsixel 应应用的抖动算法。根据 libsixel 的文档,可以是以下列表中的任何一个。- auto (Default) auto (默认)
- Let libsixel choose the dithering method.
让 libsixel 选择抖动方法。 - none 无
- Don't diffuse 不要扩散
- atkinson
- Diffuse with Bill Atkinson's method.
使用 Bill Atkinson 的方法进行扩散。 - fs
- Diffuse with Floyd-Steinberg method
使用 Floyd-Steinberg 方法进行扩散 - jajuni
- Diffuse with Jarvis, Judice & Ninke method
使用 Jarvis, Judice & Ninke 方法进行扩散 - stucki
- Diffuse with Stucki's method
使用 Stucki 方法进行扩散 - burkes
- Diffuse with Burkes' method
使用 Burkes 方法进行扩散 - arithmetic 算术
- Positionally stable arithmetic dither
位置稳定的算术抖动 - xor 异或
- Positionally stable arithmetic xor based dither
基于位置稳定的算术异或抖动
- --vo-sixel-fixedpalette=<yes|no> (default: yes) --vo-sixel-fixedpalette=<yes|no> (默认:是)
- Use libsixel's built-in static palette using the XTERM256 profile
for dither. Fixed palette uses 256 colors for dithering. Note that
using no (at the time of writing) will slow down xterm.
使用 libsixel 内置的静态调色板,通过 XTERM256 配置文件进行抖动。固定调色板使用 256 种颜色进行抖动。请注意,使用 no (截至编写时)将减慢 xterm 的速度。 - --vo-sixel-reqcolors=<colors> (default: 256) --vo-sixel-reqcolors=<colors> (默认值: 256)
- Has no effect with fixed palette. Set up libsixel to use required
number of colors for dynamic palette. This value depends on the
terminal emulator as well. Xterm supports 256 colors. Can set this to
a lower value for faster performance.
与固定调色板无关。设置 libsixel 使用动态调色板所需的颜色数量。此值还取决于终端模拟器。Xterm 支持 256 种颜色。可以将其设置为较低的值以获得更快的性能。 - --vo-sixel-threshold=<threshold> (default: -1) --vo-sixel-threshold=<threshold> (默认:-1)
- Has no effect with fixed palette. Defines the threshold to change the
palette - as percentage of the number of colors, e.g. 20 will change
the palette when the number of colors changed by 20%. It's a simple
measure to reduce the number of palette changes, because it can be slow
in some terminals (xterm). The default (-1) will choose a palette
on every frame and will have better quality.
无固定调色板时无效果。定义更改调色板的阈值 - 以颜色数量的百分比表示,例如 20 将在颜色数量变化 20%时更改调色板。这是一种简单的减少调色板更改次数的措施,因为在某些终端中可能会很慢( xterm )。默认值(-1)将在每一帧选择调色板,并将具有更好的质量。
- --vo-sixel-cols=<columns>, --vo-sixel-rows=<rows> (default: 0)
- image
Output each frame into an image file in the current directory. Each file takes the frame number padded with leading zeros as name.
将每一帧输出为当前目录下的图像文件。每个文件以帧编号(前面补零)作为名称。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- --vo-image-format=<format>
Select the image file format.
选择图像文件格式。- jpg
- JPEG files, extension .jpg. (Default.)
JPEG 文件,扩展名 .jpg。(默认。) - jpeg
- JPEG files, extension .jpeg.
JPEG 文件,扩展名 .jpeg。 - png
- PNG files. PNG 文件。
- webp
- WebP files. WebP 文件。
- --vo-image-png-compression=<0-9>
- PNG compression factor (speed vs. file size tradeoff) (default: 7)
PNG 压缩因子(速度与文件大小权衡)(默认:7) - --vo-image-png-filter=<0-5>
- Filter applied prior to PNG compression (0 = none; 1 = sub; 2 = up;
3 = average; 4 = Paeth; 5 = mixed) (default: 5)
在 PNG 压缩之前应用的过滤器(0 = 无;1 = 子;2 = 上;3 = 平均;4 = Paeth;5 = 混合)(默认:5) - --vo-image-jpeg-quality=<0-100>
- JPEG quality factor (default: 90)
JPEG 质量因子(默认:90) - --vo-image-jpeg-optimize=<0-100>
- JPEG optimization factor (default: 100)
JPEG 优化因子(默认:100) - --vo-image-webp-lossless=<yes|no>
- Enable writing lossless WebP files (default: no)
启用写入无损 WebP 文件(默认:否) - --vo-image-webp-quality=<0-100>
- WebP quality (default: 75)
WebP 质量(默认:75) - --vo-image-webp-compression=<0-6>
- WebP compression factor (default: 4)
WebP 压缩因子(默认:4) - --vo-image-outdir=<dirname>
- Specify the directory to save the image files to (default: ./).
指定保存图像文件的目录(默认: ./ )
- libmpv
For use with libmpv direct embedding. As a special case, on macOS it is used like a normal VO within mpv (cocoa-cb). Otherwise useless in any other contexts. (See <mpv/render.h>.)
用于与 libmpv 直接嵌入。作为一个特殊情况,在 macOS 上它就像 mpv(cocoa-cb)中的正常 VO 一样使用。在其他任何上下文中都无用了。(见 <mpv/render.h> 。)This also supports many of the options the gpu VO has, depending on the backend.
这也支持 gpu VO 的许多选项,具体取决于后端。- drm (Direct Rendering Manager)
drm (直接渲染管理器) Video output driver using Kernel Mode Setting / Direct Rendering Manager. Should be used when one doesn't want to install full-blown graphical environment (e.g. no X). Does not support hardware acceleration (if you need this, check the drm backend for gpu VO).
使用内核模式设置/直接渲染管理器的视频输出驱动程序。当不想安装完整的图形环境(例如,没有 X)时应该使用。不支持硬件加速(如果您需要此功能,请检查 drm 后端的 gpu VO)。Since mpv 0.30.0, you may need to use --profile=sw-fast to get decent performance.
从 mpv 0.30.0 版本开始,您可能需要使用 --profile=sw-fast 来获得良好的性能。The following global options are supported by this video output:
以下全局选项由本视频输出支持:- --drm-connector=<name>
- Select the connector to use (usually this is a monitor.) If <name>
is empty or auto, mpv renders the output on the first available
connector. Use --drm-connector=help to get a list of available
connectors. (default: empty)
选择要使用的连接器(通常这是一个显示器。)如果 <name> 为空或 auto ,mpv 将在第一个可用的连接器上渲染输出。使用 --drm-connector=help 获取可用连接器的列表。(默认:空) - --drm-device=<path>
- Select the DRM device file to use. If specified this overrides automatic
card selection. (default: empty)
选择要使用的 DRM 设备文件。如果指定,则覆盖自动卡选择。(默认:空) - --drm-mode=<preferred|highest|N|WxH[@R]>
Mode to use (resolution and frame rate). Possible values:
要使用的模式(分辨率和帧率)。可能的值:preferred: 首选: Use the preferred mode for the screen on the selected connector. (default)
使用所选连接器上屏幕的首选模式。(默认)highest: 最高: Use the mode with the highest resolution available on the selected connector.
使用所选连接器上可用的最高分辨率模式。N: N: Select mode by index.
通过索引选择模式。WxH[@R]: WxH[@R]: Specify mode by width, height, and optionally refresh rate. In case several modes match, selects the mode that comes first in the EDID list of modes.
通过宽度、高度和可选的刷新率指定模式。如果多个模式匹配,则选择在 EDID 模式列表中排在第一位的模式。Use --drm-mode=help to get a list of available modes for all active connectors.
使用 --drm-mode=help 获取所有活动连接器的可用模式列表。- --drm-draw-plane=<primary|overlay|N>
Select the DRM plane to which video and OSD is drawn to, under normal circumstances. The plane can be specified as primary, which will pick the first applicable primary plane; overlay, which will pick the first applicable overlay plane; or by index. The index is zero based, and related to the CRTC. (default: primary)
选择视频和 OSD 绘制到的 DRM 平面,在正常情况下。平面可以指定为 primary ,这将选择第一个适用的主平面; overlay ,这将选择第一个适用的叠加平面;或通过索引。索引从零开始,与 CRTC 相关。(默认:主平面)When using this option with the drmprime-overlay hwdec interop, only the OSD is rendered to this plane.
在使用此选项与 drmprime-overlay 硬件解码器互操作时,只有 OSD 被渲染到这个平面上。- --drm-drmprime-video-plane=<primary|overlay|N>
Select the DRM plane to use for video with the drmprime-overlay hwdec interop (used by e.g. the rkmpp hwdec on RockChip SoCs, and v4l2 hwdec:s on various other SoC:s). The plane is unused otherwise. This option accepts the same values as --drm-draw-plane. (default: overlay)
选择用于视频的 DRM 平面,用于 drmprime-overlay hwdec 互操作(例如,RockChip SoC 上的 rkmpp hwdec 和 v4l2 hwdec:s 在各个其他 SoC:s 上)。否则平面未使用。此选项接受与 --drm-draw-plane 相同的值。(默认:overlay)To be able to successfully play 4K video on various SoCs you might need to set --drm-draw-plane=overlay --drm-drmprime-video-plane=primary and setting --drm-draw-surface-size=1920x1080, to render the OSD at a lower resolution (the video when handled by the hwdec will be on the drmprime-video plane and at full 4K resolution)
要能够在各种 SoC 上成功播放 4K 视频,您可能需要设置 --drm-draw-plane=overlay --drm-drmprime-video-plane=primary 和设置 --drm-draw-surface-size=1920x1080 ,以在较低分辨率下渲染 OSD(当由 hwdec 处理时,视频将在 drmprime-video 平面以全 4K 分辨率显示)- --drm-format=<xrgb8888|xbgr8888|xrgb2101010|xbgr2101010|yuyv>
Select the DRM format to use (default: xrgb8888). This allows you to choose the bit depth and color type of the DRM mode.
选择要使用的 DRM 格式(默认:xrgb8888)。这允许您选择 DRM 模式的位深度和颜色类型。xrgb8888 is your usual 24bpp packed RGB format with 8 bits of padding. xrgb2101010 is a 30bpp packed RGB format with 2 bits of padding. yuyv is a 32bpp packed YUV 4:2:2 format. No planar formats are currently supported.
xrgb8888 是您常用的 24bpp 打包 RGB 格式,带有 8 位填充。xrgb2101010 是一种 30bpp 打包 RGB 格式,带有 2 位填充。yuyv 是一种 32bpp 打包 YUV 4:2:2 格式。目前不支持平面格式。There are cases when xrgb2101010 will work with the drm VO, but not with the drm backend for the gpu VO. This is because with the gpu VO, in addition to requiring support in your DRM driver, requires support for xrgb2101010 in your EGL driver. yuyv only ever works with the drm VO.
在某些情况下,xrgb2101010 将与 drm VO 一起工作,但不会与 drm 后端一起工作,因为 gpu VO 需要除了在您的 DRM 驱动程序中支持外,还需要在您的 EGL 驱动程序中支持 xrgb2101010。yuyv 始终只与 drm VO 一起工作。- --drm-draw-surface-size=<[WxH]>
Sets the size of the surface used on the draw plane. The surface will then be upscaled to the current screen resolution. This option can be useful when used together with the drmprime-overlay hwdec interop at high resolutions, as it allows scaling the draw plane (which in this case only handles the OSD) down to a size the GPU can handle.
设置用于绘制平面的表面的尺寸。然后该表面将被放大到当前屏幕分辨率。当与高分辨率的 drmprime-overlay hwdec 互操作一起使用时,此选项非常有用,因为它允许将绘制平面(在这种情况下仅处理 OSD)的尺寸缩小到 GPU 可以处理的尺寸。When used without the drmprime-overlay hwdec interop this option will just cause the video to get rendered at a different resolution and then scaled to screen size.
当不使用 drmprime-overlay hwdec 互操作时,此选项只会导致视频以不同的分辨率渲染,然后缩放到屏幕大小。(default: display resolution)
(默认:显示分辨率)- --drm-vrr-enabled=<no|yes|auto>
Toggle use of Variable Refresh Rate (VRR), aka Freesync or Adaptive Sync on compatible systems. VRR allows for the display to be refreshed at any rate within a range (usually ~40Hz-60Hz for 60Hz displays). This can help with playback of 24/25/50fps content. Support depends on the use of a compatible monitor, GPU, and a sufficiently new kernel with drivers that support the feature.
切换使用可变刷新率(VRR),即兼容系统上的 Freesync 或自适应同步。VRR 允许显示在任何速率范围内刷新(通常为 60Hz 显示器的 40Hz-60Hz)。这有助于播放 24/25/50fps 内容。支持取决于兼容的显示器、GPU 以及足够新的内核和具有支持该功能的驱动程序的驱动程序。no: no: Do not attempt to enable VRR. (default)
请勿尝试启用 VRR。(默认)yes: Attempt to enable VRR, whether the capability is reported or not.
尝试启用 VRR,无论是否报告该功能。auto: Attempt to enable VRR if support is reported.
尝试启用 VRR,如果报告支持。
- mediacodec_embed (Android)
Renders IMGFMT_MEDIACODEC frames directly to an android.view.Surface. Requires --hwdec=mediacodec for hardware decoding, along with --vo=mediacodec_embed and --wid=(intptr_t)(*android.view.Surface).
直接将 IMGFMT_MEDIACODEC 帧渲染到 android.view.Surface . 需要 --hwdec=mediacodec 进行硬件解码,以及 --vo=mediacodec_embed 和 --wid=(intptr_t)(*android.view.Surface) 。Since this video output driver uses native decoding and rendering routines, many of mpv's features (subtitle rendering, OSD/OSC, video filters, etc) are not available with this driver.
由于此视频输出驱动程序使用原生解码和渲染例程,因此 mpv 的许多功能(字幕渲染、OSD/OSC、视频过滤器等)在此驱动程序下不可用。To use hardware decoding with --vo=gpu instead, use --hwdec=mediacodec or mediacodec-copy along with --gpu-context=android.
要使用硬件解码,请使用 --vo=gpu ,而不是 --hwdec=mediacodec 或 mediacodec-copy ,同时使用 --gpu-context=android 。- wlshm (Wayland only) wlshm (仅限 Wayland)
Shared memory video output driver without hardware acceleration that works whenever Wayland is present.
在没有硬件加速的情况下,只要存在 Wayland,即可工作的共享内存视频输出驱动程序。Since mpv 0.30.0, you may need to use --profile=sw-fast to get decent performance.
从 mpv 0.30.0 版本开始,您可能需要使用 --profile=sw-fast 来获得良好的性能。Note 注意
This is a fallback only, and should not be normally used.
这仅作为后备选项,不应正常使用。
AUDIO FILTERS 音频过滤器
Audio filters allow you to modify the audio stream and its properties. The
syntax is:
音频过滤器允许您修改音频流及其属性。语法如下:
- --af=...
Setup a chain of audio filters. See --vf (VIDEO FILTERS) for the full syntax.
设置音频过滤器链。有关完整语法,请参阅 --vf (视频过滤器)。This is an object settings list option. See List Options for details.
这是一个对象设置列表选项。有关详细信息,请参阅列表选项。
Note 注意
To get a full list of available audio filters, see --af=help.
要获取可用音频滤镜的完整列表,请参阅 --af=help 。
Also, keep in mind that most actual filters are available via the lavfi
wrapper, which gives you access to most of libavfilter's filters. This
includes all filters that have been ported from MPlayer to libavfilter.
此外,请注意,大多数实际过滤器都可通过 lavfi 包装器获取,这为您提供了访问 libavfilter 的大部分过滤器。这包括所有从 MPlayer 移植到 libavfilter 的过滤器。
The --vf description describes how libavfilter can be used and how to
workaround deprecated mpv filters.
该 --vf 描述了如何使用 libavfilter 以及如何绕过已弃用的 mpv 滤镜。
See --vf group of options for info on how --af-add, --af-pre,
--af-clr, and possibly others work.
查看 --vf 选项组以获取有关 --af-add , --af-pre , --af-clr 和可能的其他选项如何工作的信息。
Available filters are: 可用的过滤器包括:
- lavcac3enc[=options]
Encode multi-channel audio to AC-3 at runtime using libavcodec. Supports 16-bit native-endian input format, maximum 6 channels. The output is big-endian when outputting a raw AC-3 stream, native-endian when outputting to S/PDIF. If the input sample rate is not 48 kHz, 44.1 kHz or 32 kHz, it will be resampled to 48 kHz.
使用 libavcodec 在运行时将多通道音频编码为 AC-3。支持 16 位原生字节序输入格式,最大 6 个通道。输出原始 AC-3 流时为大端字节序,输出到 S/PDIF 时为原生字节序。如果输入采样率不是 48 kHz、44.1 kHz 或 32 kHz,则将其重采样到 48 kHz。- tospdif=<yes|no>
- Output raw AC-3 stream if no, output to S/PDIF for
pass-through if yes (default).
如果 no 则输出原始 AC-3 流,如果 yes 则输出到 S/PDIF 以进行透传(默认)。 - bitrate=<rate>
The bitrate use for the AC-3 stream. Set it to 384 to get 384 kbps.
用于 AC-3 流的比特率。将其设置为 384 以获得 384 kbps。The default is 640. Some receivers might not be able to handle this.
默认值为 640。某些接收器可能无法处理此值。Valid values: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640.
有效值:32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640。The special value auto selects a default bitrate based on the input channel number:
特殊值 auto 根据输入通道数选择默认比特率:1ch: 1ch: 96 2ch: 2ch: 192 3ch: 3ch: 224 4ch: 4ch: 384 5ch: 5ch: 448 6ch: 6ch: 448 - minch=<n>
- If the input channel number is less than <minch>, the filter will
detach itself (default: 3).
如果输入通道号小于 <minch> ,则过滤器将自行断开连接(默认:3)。 - encoder=<name>
- Select the libavcodec encoder used. Currently, this should be an AC-3
encoder, and using another codec will fail horribly.
选择使用的 libavcodec 编码器。目前,这应该是一个 AC-3 编码器,使用其他编解码器将失败得很惨。
- format=format:srate:channels:out-srate:out-channels
Does not do any format conversion itself. Rather, it may cause the filter system to insert necessary conversion filters before or after this filter if needed. It is primarily useful for controlling the audio format going into other filters. To specify the format for audio output, see --audio-format, --audio-samplerate, and --audio-channels. This filter is able to force a particular format, whereas --audio-* may be overridden by the ao based on output compatibility.
本身不执行任何格式转换。相反,它可能会在需要时在过滤器系统之前或之后插入必要的转换过滤器。它主要用于控制输入其他过滤器的音频格式。要指定音频输出的格式,请参阅 --audio-format , --audio-samplerate ,和 --audio-channels 。此过滤器可以强制使用特定格式,而 --audio-* 可能会根据输出兼容性被 ao 覆盖。All parameters are optional. The first 3 parameters restrict what the filter accepts as input. They will therefore cause conversion filters to be inserted before this one. The out- parameters tell the filters or audio outputs following this filter how to interpret the data without actually doing a conversion. Setting these will probably just break things unless you really know you want this for some reason, such as testing or dealing with broken media.
所有参数都是可选的。前三个参数限制了过滤器可以接受哪些输入。因此,它们将在此过滤器之前插入转换过滤器。 out- 参数告诉后续的过滤器或音频输出如何解释数据,而无需实际进行转换。除非你真的知道出于某种原因需要这样做,例如测试或处理损坏的媒体,否则设置这些参数可能会破坏某些功能。- <format>
- Force conversion to this format. Use --af=format=format=help to get
a list of valid formats.
强制转换为该格式。使用 --af=format=format=help 获取有效格式的列表。 - <srate>
- Force conversion to a specific sample rate. The rate is an integer,
48000 for example.
强制转换为特定的采样率。该值是一个整数,例如 48000。 - <channels>
- Force mixing to a specific channel layout. See --audio-channels option
for possible values.
强制混合到特定的声道布局。查看 --audio-channels 选项以获取可能的值。
<out-srate>
<out-channels>
NOTE: this filter used to be named force. The old format filter used to do conversion itself, unlike this one which lets the filter system handle the conversion.
注意:此过滤器以前被称为 force 。旧的 format 过滤器曾经自行执行转换,而与此不同,它允许过滤器系统处理转换。- scaletempo[=option1:option2:...]
Scales audio tempo without altering pitch, optionally synced to playback speed.
在不改变音调的情况下缩放音频节奏,可选地与播放速度同步。This works by playing 'stride' ms of audio at normal speed then consuming 'stride*scale' ms of input audio. It pieces the strides together by blending 'overlap'% of stride with audio following the previous stride. It optionally performs a short statistical analysis on the next 'search' ms of audio to determine the best overlap position.
这是通过以正常速度播放 'stride' 毫秒的音频然后消耗 'stride*scale' 毫秒的输入音频来工作的。它通过混合 'overlap'% 的步长与上一个步长之后的音频来拼接步长。它可选地对下一个 'search' 毫秒的音频进行简短统计分析,以确定最佳重叠位置。- scale=<amount>
- Nominal amount to scale tempo. Scales this amount in addition to
speed. (default: 1.0)
用于调整节奏的基准量。除速度外,还会按此量进行缩放。(默认:1.0) - stride=<amount>
- Length in milliseconds to output each stride. Too high of a value will
cause noticeable skips at high scale amounts and an echo at low scale
amounts. Very low values will alter pitch. Increasing improves
performance. (default: 60)
输出每个步长的时间长度(毫秒)。值过高会在高缩放量时出现明显的跳过,在低缩放量时产生回声。值过低会改变音调。增加可以提高性能。(默认:60) - overlap=<factor>
- Factor of stride to overlap. Decreasing improves performance.
(default: .20)
步长重叠的系数。减小可以提高性能。(默认:.20) - search=<amount>
- Length in milliseconds to search for best overlap position. Decreasing
improves performance greatly. On slow systems, you will probably want
to set this very low. (default: 14)
搜索最佳重叠位置的时间长度(毫秒)。减小可以极大地提高性能。在较慢的系统上,您可能希望将其设置得非常低。(默认:14) - speed=<tempo|pitch|both|none>
Set response to speed change.
设置响应速度变化。- tempo
- Scale tempo in sync with speed (default).
与速度同步调整节拍(默认)。 - pitch 音高
Reverses effect of filter. Scales pitch without altering tempo. Add this to your input.conf to step by musical semi-tones:
反转过滤器效果。在不改变节奏的情况下调整音调。将此添加到您的 input.conf 以通过音乐半音阶进行步进:[ multiply speed 0.9438743126816935 ] multiply speed 1.059463094352953
Warning 警告
Loses sync with video.
与视频失去同步。- both 两者
- Scale both tempo and pitch.
调整节奏和音调。 - none 无
- Ignore speed changes. 忽略速度变化。
Examples 示例
- mpv --af=scaletempo --speed=1.2 media.ogg
- Would play media at 1.2x normal speed, with audio at normal
pitch. Changing playback speed would change audio tempo to match.
将以 1.2 倍正常速度播放媒体,音频音调正常。更改播放速度将调整音频节拍以匹配。 - mpv --af=scaletempo=scale=1.2:speed=none --speed=1.2 media.ogg
- Would play media at 1.2x normal speed, with audio at normal
pitch, but changing playback speed would have no effect on audio
tempo.
将媒体以 1.2 倍正常速度播放,音频音调正常,但更改播放速度不会对音频节奏产生影响。 - mpv --af=scaletempo=stride=30:overlap=.50:search=10 media.ogg
- Would tweak the quality and performance parameters.
会调整质量和性能参数。 - mpv --af=scaletempo=scale=1.2:speed=pitch audio.ogg
- Would play media at 1.2x normal speed, with audio at normal pitch.
Changing playback speed would change pitch, leaving audio tempo at
1.2x.
将以 1.2 倍正常速度播放媒体,音频音调正常。更改播放速度会改变音调,但音频节奏保持在 1.2 倍。
- scaletempo2[=option1:option2:...]
Scales audio tempo without altering pitch. The algorithm is ported from chromium and uses the Waveform Similarity Overlap-and-add (WSOLA) method. It seems to achieves higher audio quality than scaletempo, and rubberband R2 engine, or engine=faster. This filter is inserted automatically if audio-pitch-correction option is used (on by default) when the playback speed is changed.
在不改变音高的同时调整音频节奏。该算法从 chromium 移植而来,并使用波形相似度重叠添加(WSOLA)方法。似乎比 scaletempo、rubberband R2 引擎或 engine=faster .的音频质量更高。当改变播放速度时,如果使用 audio-pitch-correction 选项(默认开启),则会自动插入此过滤器。By default, the search-interval and window-size parameters have the same values as in chromium.
默认情况下, search-interval 和 window-size 参数的值与 chromium 中相同。- min-speed=<speed>
- Mute audio if the playback speed is below <speed>. (default: 0.25)
如果播放速度低于 <speed> ,则静音音频。(默认:0.25) - max-speed=<speed>
- Mute audio if the playback speed is above <speed>
and <speed> != 0. (default: 8.0)
如果播放速度高于 <speed> 和 <speed> != 0 ,则静音音频。(默认:8.0) - search-interval=<amount>
- Length in milliseconds to search for best overlap position. (default: 40)
以毫秒为单位的搜索最佳重叠位置的时间长度。(默认:40) - window-size=<amount>
- Length in milliseconds of the overlap-and-add window. (default: 12)
重叠加法窗口的长度(以毫秒为单位)。(默认:12)
- rubberband
High quality pitch correction with librubberband. This can be used in place of scaletempo and scaletempo2, and will be used to adjust audio pitch when playing at speed different from normal. It can also be used to adjust audio pitch without changing playback speed.
使用 librubberband 进行高质量音调校正。这可以替代 scaletempo 和 scaletempo2 ,并在以不同于正常速度播放时调整音频音调。它还可以在不改变播放速度的情况下调整音频音调。- pitch-scale=<amount>
- Sets the pitch scaling factor. Frequencies are multiplied by this value.
(default: 1.0)
设置音调缩放因子。频率乘以此值。(默认:1.0) - engine=<faster|finer>
Select the core Rubberband engine to be used. There are two available:
选择要使用的核心 Rubberband 引擎。有两个可供选择:Faster: 更快: This is the Rubberband R2 engine. It uses significantly less CPU than the Finer (R3) engine.
这是 Rubberband R2 引擎。它比 Finer(R3)引擎显著减少 CPU 使用。Finer: 更精细: This is the Rubberband R3 engine. This engine is only available with librubberband version 3 or newer. This produces significantly higher quality output, at the cost of higher CPU usage. (Default if available)
这是 Rubberband R3 引擎。此引擎仅在 librubberband 版本 3 或更高版本中可用。这会产生显著更高的输出质量,但代价是更高的 CPU 使用率。(如果可用,则为默认值)
This filter has a number of additional sub-options. You can list them with mpv --af=rubberband=help. This will also show the default values for each option. The options are not documented here, because they are merely passed to librubberband. Look at the librubberband documentation to learn what each option does: https://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html Do note that certain options are only applicable to one of R2 (faster) and R3 (finer) engines. (The mapping of the mpv rubberband filter sub-option names and values to those of librubberband follows a simple pattern: "Option" + Name + Value.)
此过滤器具有多个附加子选项。您可以使用 mpv --af=rubberband=help 列出它们。这还将显示每个选项的默认值。这些选项在此处未进行文档记录,因为它们只是传递给 librubberband。请查看 librubberband 文档以了解每个选项的作用:https://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html 请注意,某些选项仅适用于 R2(更快)和 R3(更精细)引擎之一。(mpv rubberband 过滤器子选项名称和值与 librubberband 的映射遵循一个简单的模式: "Option" + Name + Value 。)This filter supports the following af-command commands:
此过滤器支持以下 af-command 命令:- set-pitch
- Set the <pitch-scale> argument dynamically. This can be used to
change the playback pitch at runtime. Note that speed is controlled
using the standard speed property, not af-command.
动态设置 <pitch-scale> 参数。这可以用于在运行时更改播放音调。注意,速度是通过标准 speed 属性控制的,而不是 af-command 。 - multiply-pitch <factor>
- Multiply the current value of <pitch-scale> dynamically.
动态乘以 <pitch-scale> 的当前值。
- lavfi=graph
Filter audio using FFmpeg's libavfilter.
使用 FFmpeg 的 libavfilter 过滤音频。- <graph>
Libavfilter graph. See lavfi video filter for details - the graph syntax is the same.
Libavfilter 图。查看 lavfi 视频过滤器以获取详细信息 - 图的语法相同。Warning 警告
Don't forget to quote libavfilter graphs as described in the lavfi video filter section.
不要忘记按照 lavfi 视频过滤器部分所述引用 libavfilter 图形。- o=<string>
- AVOptions. AVOptions。
- fix-pts=<yes|no>
- Determine PTS based on sample count (default: no). If this is enabled,
the player won't rely on libavfilter passing through PTS accurately.
Instead, it pass a sample count as PTS to libavfilter, and compute the
PTS used by mpv based on that and the input PTS. This helps with filters
which output a recomputed PTS instead of the original PTS (including
filters which require the PTS to start at 0). mpv normally expects
filters to not touch the PTS (or only to the extent of changing frame
boundaries), so this is not the default, but it will be needed to use
broken filters. In practice, these broken filters will either cause slow
A/V desync over time (with some files), or break playback completely if
you seek or start playback from the middle of a file.
根据样本计数确定 PTS(默认:否)。如果启用此功能,播放器不会依赖于 libavfilter 准确传递 PTS。相反,它将样本计数作为 PTS 传递给 libavfilter,并根据该样本计数和输入 PTS 计算 mpv 使用的 PTS。这有助于输出重新计算的 PTS 而不是原始 PTS 的过滤器(包括需要 PTS 从 0 开始的过滤器)。mpv 通常期望过滤器不要触摸 PTS(或仅改变帧边界),因此这不是默认设置,但使用损坏的过滤器时需要它。实际上,这些损坏的过滤器可能会导致某些文件随时间出现慢速的 A/V 不同步,或者如果您从文件的中间搜索或开始播放,则完全破坏播放。
- drop
- This filter drops or repeats audio frames to adapt to playback speed. It
always operates on full audio frames, because it was made to handle SPDIF
(compressed audio passthrough). This is used automatically if the
--video-sync=display-adrop option is used. Do not use this filter (or
the given option); they are extremely low quality.
此过滤器通过丢弃或重复音频帧来适应播放速度。它始终在完整的音频帧上操作,因为它被设计来处理 SPDIF(压缩音频透传)。如果使用 --video-sync=display-adrop 选项,则自动使用此过滤器。不要使用此过滤器(或提供的选项);它们的质量极低。
VIDEO FILTERS 视频过滤器
Video filters allow you to modify the video stream and its properties. All of
the information described in this section applies to audio filters as well
(generally using the prefix --af instead of --vf).
视频过滤器允许您修改视频流及其属性。本节中描述的所有信息也适用于音频过滤器(通常使用前缀 --af 而不是 --vf )。
The exact syntax is:
确切语法是:
- --vf=<filter1[=parameter1:parameter2:...],filter2,...>
Setup a chain of video filters. This consists on the filter name, and an option list of parameters after =. The parameters are separated by : (not ,, as that starts a new filter entry).
设置视频过滤器链。这包括过滤器名称,以及 = 后的参数选项列表。参数由 : 分隔(不是 , ,因为那将开始一个新的过滤器条目)。Before the filter name, a label can be specified with @name:, where name is an arbitrary user-given name, which identifies the filter. This is only needed if you want to toggle the filter at runtime.
在过滤器名称之前,可以使用 @name: 指定一个标签,其中 name 是用户任意指定的名称,用于标识过滤器。如果需要在运行时切换过滤器,则需要此操作。A ! before the filter name means the filter is disabled by default. It will be skipped on filter creation. This is also useful for runtime filter toggling.
过滤器名称前的 ! 表示默认禁用过滤器。在创建过滤器时将跳过。这也有助于在运行时切换过滤器。See the vf command (and toggle sub-command) for further explanations and examples.
请参阅 vf 命令(以及 toggle 子命令)以获取更多解释和示例。This is an object settings list option. See List Options for details.
这是一个对象设置列表选项。有关详细信息,请参阅列表选项。The general filter entry syntax is:
通用过滤器条目语法如下:["@"<label-name>":"] ["!"] <filter-name> [ "=" <filter-parameter-list> ]
or for the special "toggle" syntax (see vf command):
或者对于特殊的“切换”语法(参见 vf 命令):"@"<label-name>
and the filter-parameter-list: 以及 filter-parameter-list :
<filter-parameter> | <filter-parameter> "," <filter-parameter-list>
and filter-parameter: 以及 filter-parameter :
( <param-name> "=" <param-value> ) | <param-value>
param-value can further be quoted in [ / ] in case the value contains characters like , or =. This is used in particular with the lavfi filter, which uses a very similar syntax as mpv (MPlayer historically) to specify filters and their parameters.
param-value 可以在 [ / ] 中进一步引用,如果值包含类似 , 或 = 的字符。这特别用于 lavfi 过滤器,它使用与 mpv(MPlayer 历史版本)非常相似的语法来指定过滤器和它们的参数。
Note 注意
--vf can only take a single track as input, even if the filter supports
dynamic input. Filters that require multiple inputs can't be used.
Use --lavfi-complex for such a use case. This also applies for --af.
--vf 只能接受单个轨道作为输入,即使过滤器支持动态输入。需要多个输入的过滤器不能使用。对于此类用例,请使用 --lavfi-complex 。这也适用于 --af 。
Filters can be manipulated at run time. You can use @ labels as described
above in combination with the vf command (see COMMAND INTERFACE) to get
more control over this. Initially disabled filters with ! are useful for
this as well.
过滤器可以在运行时进行操作。您可以使用上面描述的 @ 标签与 vf 命令(见命令接口)结合使用,以获得更多控制。最初使用 ! 禁用的过滤器对此也很有用。
Note 注意
To get a full list of available video filters, see --vf=help and
https://ffmpeg.org/ffmpeg-filters.html .
要获取可用视频过滤器的完整列表,请参阅 --vf=help 和 https://ffmpeg.org/ffmpeg-filters.html 。
Also, keep in mind that most actual filters are available via the lavfi
wrapper, which gives you access to most of libavfilter's filters. This
includes all filters that have been ported from MPlayer to libavfilter.
此外,请注意,大多数实际过滤器都可通过 lavfi 包装器获取,这为您提供了访问 libavfilter 的大部分过滤器。这包括所有从 MPlayer 移植到 libavfilter 的过滤器。
Most builtin filters are deprecated in some ways, unless they're only available
in mpv (such as filters which deal with mpv specifics, or which are
implemented in mpv only).
大多数内置过滤器在某些方面已被弃用,除非它们仅在 mpv 中可用(例如处理 mpv 特定功能的过滤器,或仅在 mpv 中实现的过滤器)。
If a filter is not builtin, the lavfi-bridge will be automatically
tried. This bridge does not support help output, and does not verify
parameters before the filter is actually used. Although the mpv syntax
is rather similar to libavfilter's, it's not the same. (Which means not
everything accepted by vf_lavfi's graph option will be accepted by
--vf.)
如果过滤器不是内置的,将自动尝试 lavfi-bridge 。此桥不支持帮助输出,并且在过滤器实际使用之前不会验证参数。尽管 mpv 的语法与 libavfilter 的相当相似,但并不相同。(这意味着 vf_lavfi 的 graph 选项接受的所有内容,并不一定会被 --vf 接受。)
You can also prefix the filter name with lavfi- to force the wrapper.
This is helpful if the filter name collides with a deprecated mpv builtin
filter. For example --vf=lavfi-scale=args would use libavfilter's
scale filter over mpv's deprecated builtin one.
您还可以使用 lavfi- 作为过滤器名称的前缀来强制使用包装器。如果过滤器名称与已弃用的 mpv 内置过滤器冲突,这很有帮助。例如, --vf=lavfi-scale=args 将使用 libavfilter 的 scale 过滤器,而不是 mpv 的已弃用内置过滤器。
Video filters are managed in lists. There are a few commands to manage the
filter list.
视频过滤器在列表中管理。有一些命令用于管理过滤器列表。
- --vf-append=filter
- Appends the filter given as arguments to the filter list.
将给定的过滤器追加到过滤器列表中。 - --vf-add=filter
- Appends the filter given as arguments to the filter list. (Passing multiple
filters is currently still possible, but deprecated.)
将给定的过滤器追加到过滤器列表中。 (目前仍然可以传递多个过滤器,但已弃用。) - --vf-pre=filter
- Prepends the filters given as arguments to the filter list. (Passing
multiple filters is currently still possible, but deprecated.)
将给定的过滤器预置于过滤器列表中。 (目前仍然可以传递多个过滤器,但已弃用。) - --vf-remove=filter
- Deletes the filter from the list. The filter can be either given the way it
was added (filter name and its full argument list), or by label (prefixed
with @). Matching of filters works as follows: if either of the compared
filters has a label set, only the labels are compared. If none of the
filters have a label, the filter name, arguments, and argument order are
compared. (Passing multiple filters is currently still possible, but
deprecated.)
从列表中删除过滤器。过滤器可以是以添加时的方式给出(过滤器名称及其完整参数列表),或通过标签(以 @ 前缀)。过滤器匹配的工作方式如下:如果比较的任一过滤器设置了标签,则仅比较标签。如果没有过滤器设置标签,则比较过滤器名称、参数和参数顺序。 (目前仍然可以传递多个过滤器,但已弃用。) - --vf-toggle=filter
- Add the given filter to the list if it was not present yet, or remove it
from the list if it was present. Matching of filters works as described in
--vf-remove.
如果该过滤器尚未存在于列表中,则将其添加到列表中;如果已存在,则从列表中移除。过滤器的匹配方式如 --vf-remove 中所述。 - --vf-clr
- Completely empties the filter list.
完全清空过滤器列表。
With filters that support it, you can access parameters by their name.
对于支持该功能的过滤器,您可以通过名称访问参数。
- --vf=<filter>=help
- Prints the parameter names and parameter value ranges for a particular
filter.
打印特定过滤器的参数名称和参数值范围。
Available mpv-only filters are:
可用的 mpv 专用过滤器包括:
- format=fmt=<value>:colormatrix=<value>:...
Applies video parameter overrides, with optional conversion. By default, this overrides the video's parameters without conversion (except for the fmt parameter), but can be made to perform an appropriate conversion with convert=yes for parameters for which conversion is supported.
应用视频参数覆盖,可选转换。默认情况下,此操作会覆盖视频参数而不进行转换(除了 fmt 参数),但可以通过 convert=yes 为支持转换的参数执行适当的转换。- <fmt>
Image format name, e.g. rgb15, bgr24, 420p, etc. (default: don't change).
图像格式名称,例如 rgb15、bgr24、420p 等。(默认:不更改)。This filter always performs conversion to the given format.
此过滤器始终执行到指定格式的转换。Note 注意
For a list of available formats, use --vf=format=fmt=help.
要获取可用格式的列表,请使用 --vf=format=fmt=help 。Note 注意
Conversion between hardware formats is supported in some cases. eg: cuda to vulkan, or vaapi to vulkan.
在某些情况下支持硬件格式之间的转换。例如: cuda 到 vulkan ,或 vaapi 到 vulkan 。- <convert=yes|no>
Force conversion of color parameters (default: no).
强制转换颜色参数(默认:否)。If this is disabled (the default), the only conversion that is possibly performed is format conversion if <fmt> is set. All other parameters (like <colormatrix>) are forced without conversion. This mode is typically useful when files have been incorrectly tagged.
如果此功能被禁用(默认设置),唯一可能执行的转换是格式转换,前提是设置了 <fmt> 。所有其他参数(如 <colormatrix> )都将强制转换而不进行转换。此模式通常在文件被错误标记时很有用。If this is enabled, libswscale or zimg is used if any of the parameters mismatch. zimg is used of the input/output image formats are supported by mpv's zimg wrapper, and if --sws-allow-zimg=yes is used. Both libraries may not support all kinds of conversions. This typically results in silent incorrect conversion. zimg has in many cases a better chance of performing the conversion correctly.
如果此功能被启用,如果任何参数不匹配,将使用 libswscale 或 zimg。如果输入/输出图像格式由 mpv 的 zimg 包装器支持,并且使用了 --sws-allow-zimg=yes ,则使用 zimg。这两个库可能不支持所有类型的转换。这通常会导致静默的错误转换。在许多情况下,zimg 有更高的概率正确执行转换。In both cases, the color parameters are set on the output stage of the image format conversion (if fmt was set). The difference is that with convert=no, the color parameters are not passed on to the converter.
在这两种情况下,颜色参数都设置在图像格式转换的输出阶段(如果设置了 fmt )。区别在于,使用 convert=no 时,颜色参数不会传递给转换器。If input and output video parameters are the same, conversion is always skipped.
如果输入和输出视频参数相同,则始终跳过转换。When converting between hardware formats, this parameter has no effect, and the only conversion that is done is the format conversion.
当在硬件格式之间转换时,此参数无影响,唯一进行的转换是格式转换。Examples 示例
- mpv test.mkv --vf=format:colormatrix=ycgco
- Results in incorrect colors (if test.mkv was tagged correctly).
导致颜色不正确(如果 test.mkv 被正确标记)。 - mpv test.mkv --vf=format:colormatrix=ycgco:convert=yes --sws-allow-zimg
Results in true conversion to ycgco, assuming the renderer supports it (--vo=gpu normally does). You can add --vo=xv to force a VO which definitely does not support it, which should show incorrect colors as confirmation.
在渲染器支持的情况下,将真正转换为 ycgco ( --vo=gpu 通常支持)。您可以添加 --vo=xv 强制使用一个肯定不支持它的 VO,这将显示不正确的颜色作为确认。Using --sws-allow-zimg=no (or disabling zimg at build time) will use libswscale, which cannot perform this conversion as of this writing.
使用 --sws-allow-zimg=no (或在构建时禁用 zimg)将使用 libswscale,截至本文撰写时,它无法执行此转换。
- <colormatrix>
Controls the YUV to RGB color space conversion when playing video. There are various standards. Normally, BT.601 should be used for SD video, and BT.709 for HD video. (This is done by default.) Using incorrect color space results in slightly under or over saturated and shifted colors.
控制播放视频时 YUV 到 RGB 颜色空间的转换。有多种标准。通常,SD 视频应使用 BT.601,HD 视频应使用 BT.709。(默认情况下执行此操作。)使用错误颜色空间会导致颜色略微饱和度过高或过低,并发生偏移。These options are not always supported. Different video outputs provide varying degrees of support. The gpu and vdpau video output drivers usually offer full support. The xv output can set the color space if the system video driver supports it, but not input and output levels. The scale video filter can configure color space and input levels, but only if the output format is RGB (if the video output driver supports RGB output, you can force this with --vf=scale,format=rgba).
这些选项并不总是被支持。不同的视频输出提供不同程度的支持。 gpu 和 vdpau 视频输出驱动程序通常提供全面支持。 xv 输出可以在系统视频驱动程序支持的情况下设置颜色空间,但不能设置输入和输出级别。 scale 视频过滤器可以配置颜色空间和输入级别,但仅当输出格式为 RGB(如果视频输出驱动程序支持 RGB 输出,您可以使用 --vf=scale,format=rgba 强制执行此操作)时。If this option is set to auto (which is the default), the video's color space flag will be used. If that flag is unset, the color space will be selected automatically. This is done using a simple heuristic that attempts to distinguish SD and HD video. If the video is larger than 1279x576 pixels, BT.709 (HD) will be used; otherwise BT.601 (SD) is selected.
如果此选项设置为 auto (这是默认值),则将使用视频的颜色空间标志。如果该标志未设置,颜色空间将自动选择。这是通过一个简单的启发式方法来完成的,该方法试图区分 SD 和 HD 视频。如果视频大于 1279x576 像素,则使用 BT.709(HD);否则选择 BT.601(SD)。Available color spaces are:
可用的颜色空间有:auto: automatic selection (default)
自动选择(默认)bt.601: ITU-R Rec. BT.601 (SD) bt.709: ITU-R Rec. BT.709 (HD) bt.2020-ncl: ITU-R Rec. BT.2020 (non-constant luminance)
ITU-R Rec. BT.2020 (非恒定亮度)bt.2020-cl: ITU-R Rec. BT.2020 (constant luminance)
ITU-R Rec. BT.2020 (恒定亮度)bt.2100-pq: ITU-R Rec. BT.2100 ICtCp PQ variant
ITU-R Rec. BT.2100 ICtCp PQ 变体bt.2100-hlg: ITU-R Rec. BT.2100 ICtCp HLG variant
ITU-R Rec. BT.2100 ICtCp HLG 变体dolbyvision: Dolby Vision smpte-240m: SMPTE-240M - <colorlevels>
YUV color levels used with YUV to RGB conversion. This option is only necessary when playing broken files which do not follow standard color levels or which are flagged wrong. If the video does not specify its color range, it is assumed to be limited range.
使用 YUV 到 RGB 转换时使用的 YUV 颜色级别。此选项仅在播放不符合标准颜色级别或标记错误的损坏文件时才需要。如果视频未指定其颜色范围,则假定其为有限范围。The same limitations as with <colormatrix> apply.
与 <colormatrix> 相同的限制。Available color ranges are:
可用的颜色范围包括:auto: automatic selection (normally limited range) (default)
自动选择(通常为有限范围)(默认)limited: 有限: limited range (16-235 for luma, 16-240 for chroma)
有限范围(亮度为 16-235,色度为 16-240)full: 完整: full range (0-255 for both luma and chroma)
全范围(亮度为 0-255,色度为 0-255)- <primaries>
RGB primaries the source file was encoded with. Normally this should be set in the file header, but when playing broken or mistagged files this can be used to override the setting.
RGB 主色源文件编码所使用的。通常这应该在文件头中设置,但在播放损坏或错误标记的文件时,可以使用此选项来覆盖设置。This option only affects video output drivers that perform color management, for example gpu with the target-prim or icc-profile suboptions set.
此选项仅影响执行颜色管理的视频输出驱动程序,例如使用 target-prim 或 icc-profile 子选项设置的 gpu 。If this option is set to auto (which is the default), the video's primaries flag will be used. If that flag is unset, the color space will be selected automatically, using the following heuristics: If the <colormatrix> is set or determined as BT.2020 or BT.709, the corresponding primaries are used. Otherwise, if the video height is exactly 576 (PAL), BT.601-625 is used. If it's exactly 480 or 486 (NTSC), BT.601-525 is used. If the video resolution is anything else, BT.709 is used.
如果此选项设置为 auto (默认值),则将使用视频的主色旗。如果该标志未设置,将自动选择色彩空间,使用以下启发式方法:如果 <colormatrix> 设置为 BT.2020 或 BT.709,则使用相应的基色。否则,如果视频高度正好为 576(PAL),则使用 BT.601-625。如果正好为 480 或 486(NTSC),则使用 BT.601-525。如果视频分辨率是其他任何值,则使用 BT.709。Available primaries are:
可用的初选包括:auto: automatic selection (default)
自动选择(默认)bt.601-525: ITU-R BT.601 (SD) 525-line systems (NTSC, SMPTE-C)
ITU-R BT.601 (SD) 525 行系统(NTSC,SMPTE-C)bt.601-625: ITU-R BT.601 (SD) 625-line systems (PAL, SECAM)
ITU-R BT.601 (SD) 625 行系统(PAL、SECAM)bt.709: ITU-R BT.709 (HD) (same primaries as sRGB)
ITU-R BT.709 (HD)(与 sRGB 相同的原色)bt.2020: ITU-R BT.2020 (UHD) apple: Apple RGB 苹果 RGB adobe: Adobe RGB (1998) prophoto: ProPhoto RGB (ROMM) cie1931: CIE 1931 RGB dci-p3: DCI-P3 (Digital Cinema) DCI-P3 (数字影院) v-gamut: Panasonic V-Gamut primaries
松下 V-Gamut 基色- <gamma>
Gamma function the source file was encoded with. Normally this should be set in the file header, but when playing broken or mistagged files this can be used to override the setting.
伽马函数的源文件编码方式。通常这应该在文件头部设置,但在播放损坏或错误标记的文件时,可以使用此设置来覆盖。This option only affects video output drivers that perform color management.
此选项仅影响执行颜色管理的视频输出驱动程序。If this option is set to auto (which is the default), the gamma will be set to BT.1886 for YCbCr content, sRGB for RGB content and Linear for XYZ content.
如果此选项设置为 auto (默认值),则对于 YCbCr 内容 gamma 将设置为 BT.1886,对于 RGB 内容设置为 sRGB,对于 XYZ 内容设置为 Linear。Available gamma functions are:
可用的 gamma 函数有:auto: automatic selection (default)
自动选择(默认)bt.1886: ITU-R BT.1886 (EOTF corresponding to BT.601/BT.709/BT.2020)
ITU-R BT.1886(对应 BT.601/BT.709/BT.2020 的 EOTF)srgb: IEC 61966-2-4 (sRGB) linear: 线性: Linear light 线性光 gamma1.8: gamma1.8: Pure power curve (gamma 1.8)
纯功率曲线(gamma 1.8)gamma2.0: Pure power curve (gamma 2.0)
纯功率曲线(gamma 2.0)gamma2.2: Pure power curve (gamma 2.2)
纯功率曲线(gamma 2.2)gamma2.4: Pure power curve (gamma 2.4)
纯功率曲线(gamma 2.4)gamma2.6: Pure power curve (gamma 2.6)
纯功率曲线(gamma 2.6)gamma2.8: Pure power curve (gamma 2.8)
纯功率曲线(gamma 2.8)prophoto: ProPhoto RGB (ROMM) curve
ProPhoto RGB (ROMM) 曲线pq: ITU-R BT.2100 PQ (Perceptual quantizer) curve
ITU-R BT.2100 PQ (感知量化器) 曲线hlg: hlg: ITU-R BT.2100 HLG (Hybrid Log-gamma) curve
ITU-R BT.2100 HLG (混合对数伽马) 曲线v-log: Panasonic V-Log transfer curve
松下 V-Log 转换曲线s-log1: Sony S-Log1 transfer curve
索尼 S-Log1 转换曲线s-log2: Sony S-Log2 transfer curve
索尼 S-Log2 转换曲线- <sig-peak>
Reference peak illumination for the video file, relative to the signal's reference white level. This is mostly interesting for HDR, but it can also be used tone map SDR content to simulate a different exposure. Normally inferred from tags such as MaxCLL or mastering metadata.
视频文件的参考峰值亮度,相对于信号的参考白色水平。这主要对 HDR 有意义,但也可以用于色调映射 SDR 内容以模拟不同的曝光。通常从 MaxCLL 或母带元数据等标签中推断。The default of 0.0 will default to the source's nominal peak luminance.
默认值为 0.0 将默认为源的名义峰值亮度。- <light>
Light type of the scene. This is mostly correctly inferred based on the gamma function, but it can be useful to override this when viewing raw camera footage (e.g. V-Log), which is normally scene-referred instead of display-referred.
场景的亮度类型。这通常基于伽玛函数正确推断,但在查看原始相机素材(例如 V-Log)时可能很有用,因为这些素材通常是场景相关而非显示相关。Available light types are:
可用的亮度类型有:auto: Automatic selection (default)
自动选择(默认)display: 显示: Display-referred light (most content)
显示参考光(大多数内容)hlg: hlg: Scene-referred using the HLG OOTF (e.g. HLG content)
使用 HLG OOTF 进行场景引用(例如 HLG 内容)709-1886: Scene-referred using the BT709+BT1886 interaction
使用 BT709+BT1886 交互进行场景参照gamma1.2: Scene-referred using a pure power OOTF (gamma=1.2)
场景参考,使用纯功率 OOTF(gamma=1.2)- <dolbyvision=yes|no>
- Whether or not to include Dolby Vision metadata (default: yes). If
disabled, any Dolby Vision metadata will be stripped from frames.
是否包含 Dolby Vision 元数据(默认:是)。如果禁用,任何 Dolby Vision 元数据都将从帧中移除。 - <hdr10plus=yes|no>
- Whether or not to include HDR10+ metadata (default: yes). If
disabled, any HDR10+ metadata will be stripped from frames.
是否包含 HDR10+元数据(默认:是)。如果禁用,任何 HDR10+元数据都将从帧中删除。 - <film-grain=yes|no>
- Whether or not to include film grain metadata (default: yes). If
disabled, any film grain metadata will be stripped from frames.
是否包含电影颗粒元数据(默认:是)。如果禁用,任何电影颗粒元数据都将从帧中删除。 - <chroma-location>
- Set the chroma loc of the video. Use
--vf=format:chroma-location=help to list all available modes.
设置视频的色度位置。使用 --vf=format:chroma-location=help 列出所有可用模式。 - <stereo-in>
- Set the stereo mode the video is assumed to be encoded in. Use
--vf=format:stereo-in=help to list all available modes. Check with
the stereo3d filter documentation to see what the names mean.
设置视频假定编码的立体声模式。使用 --vf=format:stereo-in=help 列出所有可用模式。查看 stereo3d 过滤器文档以了解名称的含义。 - <rotate>
- Set the rotation the video is assumed to be encoded with in degrees.
The special value -1 uses the input format.
设置视频假定编码的旋转角度(以度为单位)。特殊值 -1 使用输入格式。 - <w>, <h>
- If not 0, perform conversion to the given size. Ignored if
convert=yes is not set.
如果非 0,则执行转换为指定大小。如果 convert=yes 未设置,则忽略。 - <dw>, <dh>
- Set the display size. Note that setting the display size such that
the video is scaled in both directions instead of just changing the
aspect ratio is an implementation detail, and might change later.
设置显示大小。请注意,将显示大小设置为视频在两个方向上缩放而不是仅更改宽高比是一个实现细节,可能会在以后更改。 - <dar>
- Set the display aspect ratio of the video frame. This is a float,
but values such as [16:9] can be passed too ([...] for quoting
to prevent the option parser from interpreting the : character).
设置视频帧的显示宽高比。这是一个浮点数,但也可以传递类似 [16:9] 的值(使用 [...] 进行引号以防止选项解析器解释 : 字符)。 - <force-scaler=auto|zimg|sws>
- Force a specific scaler backend, if applicable. This is a debug option
and could go away any time.
如果适用,强制使用特定的缩放器后端。这是一个调试选项,可能会随时取消。 - <alpha=auto|straight|premul>
- Set the kind of alpha the video uses. Undefined effect if the image
format has no alpha channel (could be ignored or cause an error,
depending on how mpv internals evolve). Setting this may or may not
cause downstream image processing to treat alpha differently, depending
on support. With convert and zimg used, this will convert the alpha.
libswscale and other FFmpeg components completely ignore this.
设置视频使用的 alpha 类型。如果图像格式没有 alpha 通道(可能被忽略或导致错误,具体取决于 mpv 内部如何发展),则效果未定义。设置此选项可能会导致下游图像处理以不同的方式处理 alpha,具体取决于支持情况。使用 convert 和 zimg 时,这将转换 alpha。libswscale 和其他 FFmpeg 组件完全忽略此设置。
- lavfi=graph[:sws-flags[:o=opts]]
Filter video using FFmpeg's libavfilter.
使用 FFmpeg 的 libavfilter 过滤视频。- <graph>
The libavfilter graph string. The filter must have a single video input pad and a single video output pad.
libavfilter 图字符串。过滤器必须有一个视频输入垫和一个视频输出垫。See https://ffmpeg.org/ffmpeg-filters.html for syntax and available filters.
请参阅 https://ffmpeg.org/ffmpeg-filters.html 了解语法和可用过滤器。Warning 警告
If you want to use the full filter syntax with this option, you have to quote the filter graph in order to prevent mpv's syntax and the filter graph syntax from clashing. To prevent a quoting and escaping mess, consider using --lavfi-complex if you know which video track you want to use from the input file. (There is only one video track for nearly all video files anyway.)
如果您想使用此选项的完整过滤器语法,您必须引用过滤器图以防止 mpv 的语法和过滤器图语法冲突。为了避免引用和转义混乱,如果您知道要从输入文件中使用哪个视频轨道,请考虑使用 --lavfi-complex 。 (实际上几乎所有视频文件只有一个视频轨道。)Examples 示例
- --vf=lavfi=[gradfun=20:30,vflip]
- gradfun filter with nonsense parameters, followed by a
vflip filter. (This demonstrates how libavfilter takes a
graph and not just a single filter.) The filter graph string is
quoted with [ and ]. This requires no additional quoting
or escaping with some shells (like bash), while others (like
zsh) require additional " quotes around the option string.
使用无意义的参数的 gradfun 过滤器,后面跟着一个 vflip 过滤器。(这演示了 libavfilter 如何接受一个图而不是单个过滤器。)过滤器图字符串用 [ 和 ] 引用。在某些外壳(如 bash)中,这不需要额外的引用或转义,而其他外壳(如 zsh)则需要额外的 " 引用包围选项字符串。 - '--vf=lavfi="gradfun=20:30,vflip"'
- Same as before, but uses quoting that should be safe with all
shells. The outer ' quotes make sure that the shell does not
remove the " quotes needed by mpv.
与之前相同,但使用的是所有外壳都应安全的引用。外部的 ' 引用确保外壳不会移除 mpv 所需要的 " 引用。 - '--vf=lavfi=graph="gradfun=radius=30:strength=20,vflip"'
- Same as before, but uses named parameters for everything.
与之前相同,但为所有内容使用命名参数。
- <sws-flags>
If libavfilter inserts filters for pixel format conversion, this option gives the flags which should be passed to libswscale. This option is numeric and takes a bit-wise combination of SWS_ flags.
如果 libavfilter 插入用于像素格式转换的过滤器,此选项给出应传递给 libswscale 的标志。此选项是数字的,并接受 SWS_ 标志的位组合。See https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libswscale/swscale.h. 参见 https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libswscale/swscale.h 。
- <o>
Set AVFilterGraph options. These should be documented by FFmpeg.
设置 AVFilterGraph 选项。这些应由 FFmpeg 进行文档说明。
- sub=[=bottom-margin:top-margin]
Moves subtitle rendering to an arbitrary point in the filter chain, or force subtitle rendering in the video filter as opposed to using video output OSD support.
将字幕渲染移动到过滤器链中的任意位置,或者强制在视频过滤器中渲染字幕,而不是使用视频输出 OSD 支持。- <bottom-margin>
- Adds a black band at the bottom of the frame. The SSA/ASS renderer can
place subtitles there (with --sub-use-margins).
在帧底部添加黑色条带。SSA/ASS 渲染器可以将字幕放置在那里(使用 --sub-use-margins )。 - <top-margin>
- Black band on the top for toptitles (with --sub-use-margins).
顶部条带上的黑色条带用于 toptitles(使用 --sub-use-margins )。
- vapoursynth=file:buffered-frames:concurrent-frames:user-data
Loads a VapourSynth filter script. This is intended for streamed processing: mpv actually provides a source filter, instead of using a native VapourSynth video source. The mpv source will answer frame requests only within a small window of frames (the size of this window is controlled with the buffered-frames parameter), and requests outside of that will return errors. As such, you can't use the full power of VapourSynth, but you can use certain filters.
加载 VapourSynth 过滤器脚本。这旨在进行流处理:mpv 实际上提供了一个源过滤器,而不是使用本地的 VapourSynth 视频源。mpv 源将仅在很小的帧窗口内响应帧请求(此窗口的大小由 buffered-frames 参数控制),而在此之外的请求将返回错误。因此,您不能完全使用 VapourSynth 的功能,但可以使用某些过滤器。Warning 警告
Do not use this filter, unless you have expert knowledge in VapourSynth, and know how to fix bugs in the mpv VapourSynth wrapper code.
请勿使用此过滤器,除非您精通 VapourSynth,并且知道如何修复 mpv VapourSynth 包装代码中的错误。If you just want to play video generated by VapourSynth (i.e. using a native VapourSynth video source), it's better to use vspipe and a pipe or FIFO to feed the video to mpv. The same applies if the filter script requires random frame access (see buffered-frames parameter).
如果您只想播放由 VapourSynth 生成的视频(即使用本机 VapourSynth 视频源),最好使用 vspipe 和管道或 FIFO 将视频馈送到 mpv。如果过滤器脚本需要随机帧访问(请参阅 buffered-frames 参数),也适用同样的方法。- file
Filename of the script source. Currently, this is always a python script (.vpy in VapourSynth convention).
脚本的源文件名。目前,这始终是一个 Python 脚本( .vpy 在 VapourSynth 中的约定)。The variable video_in is set to the mpv video source, and it is expected that the script reads video from it. (Otherwise, mpv will decode no video, and the video packet queue will overflow, eventually leading to only audio playing, or worse.)
变量 video_in 被设置为 mpv 视频源,并预期脚本从它读取视频。(否则,mpv 将不解码视频,视频数据包队列将溢出,最终导致只有音频播放,或者更糟。)The filter graph created by the script is also expected to pass through timestamps using the _DurationNum and _DurationDen frame properties.
脚本创建的过滤器图也预期会通过 _DurationNum 和 _DurationDen 帧属性传递时间戳。See the end of the option list for a full list of script variables defined by mpv.
请查看选项列表的末尾,以获取由 mpv 定义的脚本变量的完整列表。Example: 示例:
import vapoursynth as vs from vapoursynth import core core.std.AddBorders(video_in, 10, 10, 20, 20).set_output()
Warning 警告
The script will be reloaded on every seek. This is done to reset the filter properly on discontinuities.
脚本将在每次搜索时重新加载。这样做是为了在不连续处正确重置过滤器。- buffered-frames
Maximum number of decoded video frames that should be buffered before the filter (default: 4). This specifies the maximum number of frames the script can request in backward direction.
在过滤器之前应缓冲的最大解码视频帧数(默认:4)。这指定了脚本可以请求的最大帧数,用于向后方向。E.g. if buffered-frames=5, and the script just requested frame 15, it can still request frame 10, but frame 9 is not available anymore. If it requests frame 30, mpv will decode 15 more frames, and keep only frames 25-30.
例如,如果 buffered-frames=5 ,并且脚本刚刚请求了帧 15,它仍然可以请求帧 10,但帧 9 已不再可用。如果它请求帧 30,mpv 将解码 15 帧更多,并保留帧 25-30。The only reason why this buffer exists is to serve the random access requests the VapourSynth filter can make.
仅有的原因就是让这个缓冲区存在,以服务于 VapourSynth 过滤器可以发起的随机访问请求。The VapourSynth API has a getFrameAsync function, which takes an absolute frame number. Source filters must respond to all requests. For example, a source filter can request frame 2432, and then frame 3. Source filters typically implement this by pre-indexing the entire file.
VapourSynth API 具有一个 getFrameAsync 函数,该函数接受一个绝对帧号。源过滤器必须响应所有请求。例如,源过滤器可以请求帧 2432,然后是帧 3。源过滤器通常通过预先索引整个文件来实现这一点。mpv on the other hand is stream oriented, and does not allow filters to seek. (And it would not make sense to allow it, because it would ruin performance.) Filters get frames sequentially in playback direction, and cannot request them out of order.
另一方面,mpv 是面向流的,不允许过滤器进行搜索。(允许它也没有意义,因为它会破坏性能。)过滤器以播放方向顺序获取帧,不能按顺序请求它们。To compensate for this mismatch, mpv allows the filter to access frames within a certain window. buffered-frames controls the size of this window. Most VapourSynth filters happen to work with this, because mpv requests frames sequentially increasing from it, and most filters only require frames "close" to the requested frame.
为了补偿这种不匹配,mpv 允许过滤器访问一定窗口内的帧。 buffered-frames 控制这个窗口的大小。大多数 VapourSynth 过滤器恰好可以与这个窗口一起工作,因为 mpv 请求从它开始的顺序递增的帧,而大多数过滤器只需要“接近”请求帧的帧。If the filter requests a frame that has a higher frame number than the highest buffered frame, new frames will be decoded until the requested frame number is reached. Excessive frames will be flushed out in a FIFO manner (there are only at most buffered-frames in this buffer).
如果过滤器请求的帧号高于最高缓冲帧号,将解码新的帧,直到达到请求的帧号。过量的帧将以 FIFO 方式刷新(在这个缓冲区中最多只有 buffered-frames )。If the filter requests a frame that has a lower frame number than the lowest buffered frame, the request cannot be satisfied, and an error is returned to the filter. This kind of error is not supposed to happen in a "proper" VapourSynth environment. What exactly happens depends on the filters involved.
如果过滤器请求的帧编号低于最低缓冲帧编号,则请求无法满足,并将错误返回给过滤器。这种错误在“正确”的 VapourSynth 环境中不应该发生。具体发生什么取决于涉及的过滤器。Increasing this buffer will not improve performance. Rather, it will waste memory, and slow down seeks (when enough frames to fill the buffer need to be decoded at once). It is only needed to prevent the error described in the previous paragraph.
增加此缓冲区不会提高性能。相反,它将浪费内存,并减慢搜索速度(当需要一次性解码足够帧来填充缓冲区时)。它仅用于防止前一段中描述的错误。How many frames a filter requires depends on filter implementation details, and mpv has no way of knowing. A scale filter might need only 1 frame, an interpolation filter may require a small number of frames, and the Reverse filter will require an infinite number of frames.
一个过滤器需要多少帧取决于过滤器实现细节,mpv 无法知道。一个缩放过滤器可能只需要 1 帧,一个插值过滤器可能需要少量帧,而 Reverse 过滤器将需要无限数量的帧。If you want reliable operation to the full extend VapourSynth is capable, use vspipe.
如果您想使用 VapourSynth 的全部功能进行可靠的操作,请使用 vspipe 。The actual number of buffered frames also depends on the value of the concurrent-frames option. Currently, both option values are multiplied to get the final buffer size.
实际缓冲帧数还取决于 concurrent-frames 选项的值。目前,这两个选项的值相乘以获得最终的缓冲区大小。- concurrent-frames
Number of frames that should be requested in parallel. The level of concurrency depends on the filter and how quickly mpv can decode video to feed the filter. This value should probably be proportional to the number of cores on your machine. Most time, making it higher than the number of cores can actually make it slower.
应并行请求的帧数。并发级别取决于过滤器以及 mpv 解码视频以馈送过滤器的速度。此值可能应该与您机器上的核心数成比例。大多数情况下,将其设置为高于核心数实际上可能会使其变慢。Technically, mpv will call the VapourSynth getFrameAsync function in a loop, until there are concurrent-frames frames that have not been returned by the filter yet. This also assumes that the rest of the mpv filter chain reads the output of the vapoursynth filter quickly enough. (For example, if you pause the player, filtering will stop very soon, because the filtered frames are waiting in a queue.)
技术上,mpv 将在循环中调用 VapourSynth 的 getFrameAsync 函数,直到有 concurrent-frames 帧尚未由过滤器返回。这也假设 mpv 过滤器链的其余部分能够快速读取 vapoursynth 过滤器的输出。(例如,如果您暂停播放器,过滤将很快停止,因为过滤帧正等待在队列中。)Actual concurrency depends on many other factors.
实际并发取决于许多其他因素。By default, this uses the special value auto, which sets the option to the number of detected logical CPU cores.
默认情况下,这使用特殊的值 auto ,将选项设置为检测到的逻辑 CPU 核心数。- user-data
- Optional arbitrary string that is passed to the script. Default to empty
string if not set.
可选的任意字符串,传递给脚本。如果未设置,则默认为空字符串。
The following .vpy script variables are defined by mpv:
以下由 mpv 定义的 .vpy 脚本变量:- video_in
- The mpv video source as vapoursynth clip. Note that this has an
incorrect (very high) length set, which confuses many filters. This is
necessary, because the true number of frames is unknown. You can use the
Trim filter on the clip to reduce the length.
mpv 视频源作为 vapoursynth 剪辑。请注意,这设置了不正确(非常高的)长度,这会混淆许多过滤器。这是必要的,因为帧的真实数量是未知的。您可以使用 Trim 过滤器在剪辑上减少长度。 - video_in_dw, video_in_dh
- Display size of the video. Can be different from video size if the
video does not use square pixels (e.g. DVD).
显示视频的尺寸。如果视频不使用正方形像素(例如 DVD),则可能与此尺寸不同。 - container_fps
FPS value as reported by file headers. This value can be wrong or completely broken (e.g. 0 or NaN). Even if the value is correct, if another filter changes the real FPS (by dropping or inserting frames), the value of this variable will not be useful. Note that the --container-fps-override command line option overrides this value.
文件头中报告的 FPS 值。此值可能错误或完全损坏(例如 0 或 NaN)。即使值正确,如果另一个过滤器通过删除或插入帧来更改实际 FPS,此变量的值也将没有用处。请注意, --container-fps-override 命令行选项会覆盖此值。Useful for some filters which insist on having a FPS.
对于一些坚持要求有 FPS 的过滤器很有用。- display_fps
- Refresh rate of the current display. Note that this value can be 0.
当前显示的刷新率。请注意,此值可能为 0。 - display_res
- Resolution of the current display. This is an integer array with the
first entry corresponding to the width and the second entry corresponding
to the height. These values can be 0. Note that this will not respond to
monitor changes and may not work on all platforms.
当前显示的分辨率。这是一个整数数组,第一个条目对应宽度,第二个条目对应高度。这些值可能为 0。请注意,这不会响应显示器变化,并且可能不在所有平台上工作。 - user_data
- User data passed from the filter. This variable always exists, and defaults
to empty string.
用户数据从过滤器传递过来。此变量始终存在,默认为空字符串。
- vavpp
VA-API video post processing. Requires the system to support VA-API, i.e. Linux/BSD only. Works with --vo=vaapi and --vo=gpu only. Currently deinterlaces. This filter is automatically inserted if deinterlacing is requested (either using the d key, by default mapped to the command cycle deinterlace, or the --deinterlace option).
VA-API 视频后处理。需要系统支持 VA-API,即仅限 Linux/BSD。仅与 --vo=vaapi 和 --vo=gpu 兼容。目前仅进行去隔行处理。如果请求去隔行(无论是使用默认映射到命令 cycle deinterlace 的 d 键,还是使用 --deinterlace 选项),则此过滤器将自动插入。- deint=<method>
Select the deinterlacing algorithm.
选择去隔行算法。- no 无
- Don't perform deinterlacing.
不要执行去隔行扫描。 - auto 自动
- Select the best quality deinterlacing algorithm (default). This
goes by the order of the options as documented, with
motion-compensated being considered best quality.
选择最佳质量的反交错算法(默认)。这按照文档中选项的顺序进行,其中 motion-compensated 被认为是最佳质量。 - first-field
- Show only first field.
仅显示第一个字段。 - bob
- bob deinterlacing. bob 去隔行扫描。
- weave, motion-adaptive, motion-compensated
weave, 动态自适应,运动补偿 - Advanced deinterlacing algorithms. Whether these actually work
depends on the GPU hardware, the GPU drivers, driver bugs, and
mpv bugs.
高级去隔行算法。这些是否真正有效取决于 GPU 硬件、GPU 驱动程序、驱动程序错误和 mpv 错误。
- <interlaced-only>
no: no: Deinterlace all frames (default).
去交错所有帧(默认)。yes: Only deinterlace frames marked as interlaced.
仅对标记为隔行的帧进行去隔行。- reversal-bug=<yes|no>
no: no: Use the API as it was interpreted by older Mesa drivers. While this interpretation was more obvious and intuitive, it was apparently wrong, and not shared by Intel driver developers.
使用 API,就像较旧的 Mesa 驱动程序所解释的那样。虽然这种解释更明显、更直观,但它显然是错误的,并且不被 Intel 驱动程序开发者所接受。yes: Use Intel interpretation of surface forward and backwards references (default). This is what Intel drivers and newer Mesa drivers expect. Matters only for the advanced deinterlacing algorithms.
使用英特尔对表面正向和反向引用的解释(默认)。这是英特尔驱动程序和较新版本的 Mesa 驱动程序所期望的。仅对高级去隔行算法有影响。
- vdpaupp
VDPAU video post processing. Works with --vo=vdpau and --vo=gpu only. This filter is automatically inserted if deinterlacing is requested (either using the d key, by default mapped to the command cycle deinterlace, or the --deinterlace option). When enabling deinterlacing, it is always preferred over software deinterlacer filters if the vdpau VO is used, and also if gpu is used and hardware decoding was activated at least once (i.e. vdpau was loaded).
VDPAU 视频后处理。仅与 --vo=vdpau 和 --vo=gpu 兼容。如果请求去隔行(无论是使用 d 键,默认映射到命令 cycle deinterlace ,还是使用 --deinterlace 选项),则会自动插入此过滤器。当启用去隔行时,如果使用 vdpau VO,则始终优先于软件去隔行过滤器,并且如果使用 gpu 并且至少激活过一次硬件解码(即 vdpau 已加载),也是如此。- sharpen=<-1-1>
- For positive values, apply a sharpening algorithm to the video, for
negative values a blurring algorithm (default: 0).
对于正值,对视频应用锐化算法,对于负值应用模糊算法(默认:0)。 - denoise=<0-1>
- Apply a noise reduction algorithm to the video (default: 0; no noise
reduction).
将噪声消除算法应用于视频(默认:0;无噪声消除)。 - deint=<yes|no>
- Whether deinterlacing is enabled (default: no). If enabled, it will use
the mode selected with deint-mode.
是否启用去隔行(默认:否)。如果启用,它将使用通过 deint-mode 选择的模式。 - deint-mode=<first-field|bob|temporal|temporal-spatial>
Select deinterlacing mode (default: temporal).
选择去隔行模式(默认:时间)。Note that there's currently a mechanism that allows the vdpau VO to change the deint-mode of auto-inserted vdpaupp filters. To avoid confusion, it's recommended not to use the --vo=vdpau suboptions related to filtering.
请注意,目前有一个机制允许 vdpau VO 更改自动插入的 deint-mode vdpaupp 过滤器的 --vo=vdpau 。为了避免混淆,建议不要使用与过滤相关的 --vo=vdpau 子选项。- first-field
- Show only first field.
仅显示第一个字段。 - bob
- Bob deinterlacing. Bob 去隔行扫描。
- temporal 时间
- Motion-adaptive temporal deinterlacing. May lead to A/V desync
with slow video hardware and/or high resolution.
运动自适应时间去隔行。可能会导致慢速视频硬件和/或高分辨率下的 A/V 不同步。 - temporal-spatial 时空
- Motion-adaptive temporal deinterlacing with edge-guided spatial
interpolation. Needs fast video hardware.
基于运动自适应的时域去隔行扫描,带有边缘引导的空间插值。需要快速的视频硬件。
- chroma-deint
- Makes temporal deinterlacers operate both on luma and chroma (default).
Use no-chroma-deint to solely use luma and speed up advanced
deinterlacing. Useful with slow video memory.
使时序去隔行扫描器在亮度(默认)和色度上同时工作。使用 no-chroma-deint 仅使用亮度并加快高级去隔行扫描。适用于慢速视频内存。 - pullup
- Try to apply inverse telecine, needs motion adaptive temporal
deinterlacing.
尝试应用逆电视扫描,需要运动自适应时间去隔行。 - interlaced-only=<yes|no>
- If yes, only deinterlace frames marked as interlaced (default: no).
如果 yes ,则仅去隔行标记为隔行扫描的帧(默认:否)。 - hqscaling=<0-9>
- 0
- Use default VDPAU scaling (default).
使用默认 VDPAU 缩放(默认)。 - 1-9
- Apply high quality VDPAU scaling (needs capable hardware).
应用高质量的 VDPAU 缩放(需要具备能力的硬件)。
- d3d11vpp
Direct3D 11 video post-processing. Requires a D3D11 context and works best with hardware decoding. Software frames are automatically uploaded to hardware for processing.
Direct3D 11 视频后处理。需要 D3D11 上下文,并且与硬件解码配合最佳。软件帧会自动上传到硬件进行处理。- format
- Convert to the selected image format, e.g., nv12, p010, etc. (default: don't change).
Format names can be queried with --vf=d3d11vpp=format=help.
Note that only a limited subset is supported, and actual support depends
on your hardware. Normally, this shouldn't be changed unless some
processing only works with a specific format, in which case it can be
selected here.
转换为选定的图像格式,例如 nv12、p010 等。(默认:不更改)。可以使用 --vf=d3d11vpp=format=help 查询格式名称。请注意,仅支持有限子集,实际支持取决于您的硬件。通常情况下,除非某些处理仅适用于特定格式,否则不应更改,在这种情况下,可以在此处选择。 - deint=<yes|no>
- Whether deinterlacing is enabled (default: no).
是否启用去隔行(默认:否)。 - scale
- Scaling factor for the video frames (default: 1.0).
视频帧的缩放系数(默认:1.0)。 - scaling-mode=<standard,intel,nvidia>
Select the scaling mode to be used. Note that this only enables the appropriate processing extensions; whether it actually works or not depends on your hardware and the settings in your GPU driver's control panel (default: standard).
选择要使用的缩放模式。请注意,这仅启用适当的处理扩展;它是否真正工作取决于您的硬件以及 GPU 驱动程序控制面板中的设置(默认:标准)。- standard 标准
- Default scaling mode as decided by d3d11vpp implementation.
由 d3d11vpp 实现决定的默认缩放模式。 - intel 英特尔
- Intel Video Super Resolution.
英特尔视频超级分辨率。 - nvidia 英伟达
- NVIDIA RTX Super Resolution.
NVIDIA RTX 超级分辨率。
- interlaced-only=<yes|no>
- If yes, only deinterlace frames marked as interlaced (default: no).
如果 yes ,则仅去隔行标记为隔行扫描的帧(默认:否)。 - mode=<blend|bob|adaptive|mocomp|ivctc|none>
- Tries to select a video processor with the given processing capability.
If a video processor supports multiple capabilities, it is not clear
which algorithm is actually selected. none always falls back. On
most if not all hardware, this option will probably do nothing, because
a video processor usually supports all modes or none.
尝试选择具有给定处理能力的视频处理器。如果视频处理器支持多种能力,则无法确定实际选择了哪种算法。 none 总是回退。在大多数硬件上,此选项可能不会做任何事情,因为视频处理器通常支持所有模式或都不支持。 - nvidia-true-hdr
- Enable NVIDIA RTX Video HDR processing.
启用 NVIDIA RTX 视频 HDR 处理。
- fingerprint=...
Compute video frame fingerprints and provide them as metadata. Actually, it currently barely deserved to be called fingerprint, because it does not compute "proper" fingerprints, only tiny downscaled images (but which can be used to compute image hashes or for similarity matching).
计算视频帧指纹并将其作为元数据提供。实际上,目前几乎不配被称为 fingerprint ,因为它不计算“正确”的指纹,只计算微小的缩放图像(但可以用于计算图像哈希或用于相似度匹配)。The main purpose of this filter is to support the skip-logo.lua script. If this script is dropped, or mpv ever gains a way to load user-defined filters (other than VapourSynth), this filter will be removed. Due to the "special" nature of this filter, it will be removed without warning.
此过滤器的主要目的是支持 skip-logo.lua 脚本。如果此脚本被删除,或者 mpv 今后能够加载用户定义的过滤器(除了 VapourSynth 以外),则此过滤器将被移除。由于此过滤器的“特殊”性质,它将在没有任何警告的情况下被移除。The intended way to read from the filter is using vf-metadata (also see clear-on-query filter parameter). The property will return a list of key/value pairs as follows:
从过滤器中读取的预期方式是使用 vf-metadata (也可参见 clear-on-query 过滤器参数)。该属性将返回以下形式的键/值对列表:fp0.pts = 1.2345 fp0.hex = 1234abcdef...bcde fp1.pts = 1.4567 fp1.hex = abcdef1234...6789 ... fpN.pts = ... fpN.hex = ... type = gray-hex-16x16
Each fp<N> entry is for a frame. The pts entry specifies the timestamp of the frame (within the filter chain; in simple cases this is the same as the display timestamp). The hex field is the hex encoded fingerprint, whose size and meaning depend on the type filter option. The type field has the same value as the option the filter was created with.
每个 fp<N> 条目对应一个帧。 pts 条目指定帧的时间戳(在过滤器链中;在简单情况下,这与显示时间戳相同)。 hex 字段是十六进制编码的指纹,其大小和含义取决于 type 过滤器选项。 type 字段与创建过滤器时使用的选项具有相同的值。This returns the frames that were filtered since the last query of the property. If clear-on-query=no was set, a query doesn't reset the list of frames. In both cases, a maximum of 10 frames is returned. If there are more frames, the oldest frames are discarded. Frames are returned in filter order.
这返回自上次查询属性以来被过滤的帧。如果设置了 clear-on-query=no ,则查询不会重置帧列表。在两种情况下,都返回最多 10 帧。如果有更多帧,则丢弃最旧的帧。帧按过滤顺序返回。(This doesn't return a structured list for the per-frame details because the internals of the vf-metadata mechanism suck. The returned format may change in the future.)
(由于 vf-metadata 机制的内部结构很糟糕,因此不返回针对每帧细节的结构化列表。返回的格式可能在将来发生变化。)This filter uses zimg for speed and profit. However, it will fallback to libswscale in a number of situations: lesser pixel formats, unaligned data pointers or strides, or if zimg fails to initialize for unknown reasons. In these cases, the filter will use more CPU. Also, it will output different fingerprints, because libswscale cannot perform the full range expansion we normally request from zimg. As a consequence, the filter may be slower and not work correctly in random situations.
此过滤器使用 zimg 以提高速度和效率。然而,在许多情况下,它将回退到 libswscale:较小的像素格式、未对齐的数据指针或步长,或者如果 zimg 由于未知原因无法初始化。在这些情况下,过滤器将使用更多的 CPU。此外,它将输出不同的指纹,因为 libswscale 无法执行我们通常从 zimg 请求的全范围扩展。因此,过滤器可能较慢,并且在随机情况下可能无法正确工作。- type=...
What fingerprint to compute. Available types are:
要计算哪个指纹。可用类型有:gray-hex-8x8: grayscale, 8 bit, 8x8 size
灰度,8 位,8x8 尺寸gray-hex-16x16: grayscale, 8 bit, 16x16 size (default)
灰度,8 位,16x16 尺寸(默认)Both types simply remove all colors, downscale the image, concatenate all pixel values to a byte array, and convert the array to a hex string.
两种类型简单地移除所有颜色,降低图像分辨率,将所有像素值连接到一个字节数组中,并将数组转换为十六进制字符串。- clear-on-query=yes|no
- Clear the list of frame fingerprints if the vf-metadata property for
this filter is queried (default: yes). This requires some care by the
user. Some types of accesses might query the filter multiple times,
which leads to lost frames.
如果查询此过滤器的 vf-metadata 属性,则清除帧指纹列表(默认:是)。这需要用户小心处理。某些类型的访问可能会多次查询过滤器,从而导致丢失帧。 - print=yes|no
- Print computed fingerprints to the terminal (default: no). This is
mostly for testing and such. Scripts should use vf-metadata to
read information from this filter instead.
将计算出的指纹打印到终端(默认:否)。这主要用于测试等。脚本应使用 vf-metadata 读取此过滤器的信息。
- gpu=...
Convert video to RGB using the Vulkan or OpenGL renderer normally used with --vo=gpu. In case of OpenGL, this requires that the EGL implementation supports off-screen rendering on the default display. (This is the case with Mesa.)
使用与 --vo=gpu 通常一起使用的 Vulkan 或 OpenGL 渲染器将视频转换为 RGB。在 OpenGL 的情况下,这要求 EGL 实现支持在默认显示上的离屏渲染。(这是 Mesa 的情况。)Sub-options: 子选项:
- api=<type>
The value type selects the rendering API. You can also pass help to get a complete list of compiled in backends.
值 type 选择渲染 API。您还可以传递 help 以获取编译后后端的完整列表。- egl
- EGL (default if available)
EGL(如果可用则为默认) - vulkan
- Vulkan
- w=<pixels>, h=<pixels>
- Size of the output in pixels (default: 0). If not positive, this will
use the size of the first filtered input frame.
输出像素大小(默认:0)。如果不是正数,将使用第一个过滤输入帧的大小。
Warning 警告
This is highly experimental. Performance is bad, and it will not work everywhere in the first place. Some features are not supported.
这是一个高度实验性的。性能很差,而且一开始可能根本无法在所有地方工作。一些功能不支持。Warning 警告
This does not do OSD rendering. If you see OSD, then it has been rendered by the VO backend. (Subtitles are rendered by the gpu filter, if possible.)
这不会进行 OSD 渲染。如果您看到 OSD,那么它已经被 VO 后端渲染了。(如果可能,字幕是通过 gpu 过滤器渲染的。)Warning 警告
If you use this with encoding mode, keep in mind that encoding mode will convert the RGB filter's output back to yuv420p in software, using the configured software scaler. Using zimg might improve this, but in any case it might go against your goals when using this filter.
如果您使用此功能与编码模式,请注意编码模式会将 RGB 过滤器的输出在软件中转换回 yuv420p,使用配置的软件缩放器。使用 zimg 可能会改善这一点,但在任何情况下,它可能都会与您使用此过滤器时的目标相冲突。Warning 警告
Do not use this with --vo=gpu. It will apply filtering twice, since most --vo=gpu options are unconditionally applied to the gpu filter. There is no mechanism in mpv to prevent this.
不要与 --vo=gpu 一起使用。由于大多数 --vo=gpu 选项都会无条件地应用于 gpu 过滤器,因此它将应用两次过滤。mpv 中没有机制来防止这种情况。
ENCODING 编码
You can encode files from one format/codec to another using this facility.
您可以使用此功能将文件从一种格式/编解码器编码到另一种格式。
- --o=<filename>
- Enables encoding mode and specifies the output file name.
启用编码模式并指定输出文件名。 - --of=<format>
- Specifies the output format (overrides autodetection by the file name
extension of the file specified by --o). See --of=help for a full
list of supported formats.
指定输出格式(覆盖由 --o 指定的文件的文件名扩展名自动检测)。有关支持格式的完整列表,请参阅 --of=help 。 - --ofopts=<options>
Specifies the output format options for libavformat. See --ofopts=help for a full list of supported options.
指定 libavformat 的输出格式选项。有关支持选项的完整列表,请参阅 --ofopts=help 。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --oac=<codec>
- Specifies the output audio codec. See --oac=help for a full list of
supported codecs.
指定输出音频编解码器。查看 --oac=help 以获取支持的编解码器完整列表。 - --oacopts=<options>
Specifies the output audio codec options for libavcodec. See --oacopts=help for a full list of supported options.
指定 libavcodec 的输出音频编解码器选项。查看 --oacopts=help 以获取支持的选项完整列表。Example 示例
This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --ovc=<codec>
- Specifies the output video codec. See --ovc=help for a full list of
supported codecs.
指定输出视频编解码器。查看 --ovc=help 获取支持的编解码器完整列表。 - --ovcopts=<options>
Specifies the output video codec options for libavcodec. See --ovcopts=help for a full list of supported options.
指定 libavcodec 的输出视频编解码器选项。查看 --ovcopts=help 获取支持的选项完整列表。Examples 示例
This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --orawts
- Copies input pts to the output video (not supported by some output
container formats, e.g. AVI). In this mode, discontinuities are not fixed
and all pts are passed through as-is. Never seek backwards or use multiple
input files in this mode!
将输入点复制到输出视频(某些输出容器格式不支持,例如 AVI)。在此模式下,不会修复不连续性,所有 pts 都按原样传递。在此模式下切勿向后搜索或使用多个输入文件! - --ocopy-metadata=<yes|no>
- Copy metadata from input files to output files when encoding (default: yes).
在编码时从输入文件复制元数据到输出文件(默认:是)。 - --oset-metadata=<metadata-tag[,metadata-tag,...]>
Specifies metadata to include in the output file. Supported keys vary between output formats. For example, Matroska (MKV) and FLAC allow almost arbitrary keys, while support in MP4 and MP3 is more limited.
指定要包含在输出文件中的元数据。支持的键在不同输出格式之间有所不同。例如,Matroska (MKV) 和 FLAC 允许几乎任意的键,而 MP4 和 MP3 的支持则更为有限。This is a key/value list option. See List Options for details.
这是一个键/值列表选项。请参阅列表选项以获取详细信息。- --oremove-metadata=<metadata-tag[,metadata-tag,...]>
Specifies metadata to exclude from the output file when copying from the input file.
指定在从输入文件复制时排除的元数据。This is a string list option. See List Options for details.
这是一个字符串列表选项。有关详细信息,请参阅列表选项。
COMMAND INTERFACE 命令接口
The mpv core can be controlled with commands and properties. A number of ways
to interact with the player use them: key bindings (input.conf), OSD
(showing information with properties), JSON IPC, the client API (libmpv),
and the classic slave mode.
mpv 核心可以通过命令和属性进行控制。与播放器交互的多种方式使用它们:键绑定( input.conf ),OSD(使用属性显示信息),JSON IPC,客户端 API( libmpv ),以及经典从模式。
input.conf
The input.conf file consists of a list of key bindings, for example:
input.conf 文件包含一系列键绑定列表,例如:
s screenshot # take a screenshot with the s key LEFT seek 15 # map the left-arrow key to seeking forward by 15 seconds
Each line maps a key to an input command. Keys are specified with their literal
value (upper case if combined with Shift), or a name for special keys. For
example, a maps to the a key without shift, and A maps to a
with shift.
每行将一个键映射到一个输入命令。键通过它们的字面值(如果与 Shift 结合则为大写)或特殊键的名称来指定。例如, a 映射到不带 shift 的 a 键,而 A 映射到带 shift 的 a 键。
The file is located in the mpv configuration directory (normally at
~/.config/mpv/input.conf depending on platform). The default bindings are
defined here:
文件位于 mpv 配置目录中(通常在 ~/.config/mpv/input.conf ,取决于平台)。默认绑定在此定义:
https://github.com/mpv-player/mpv/blob/master/etc/input.conf
A list of special keys can be obtained with
可以通过以下方式获取特殊键列表:
mpv --input-keylist
In general, keys can be combined with Shift, Ctrl and Alt:
通常,键可以与 Shift , Ctrl 和 Alt 结合:
ctrl+q quit
mpv can be started in input test mode, which displays key bindings and the
commands they're bound to on the OSD, instead of executing the commands:
mpv 可以以输入测试模式启动,该模式在 OSD 上显示键绑定及其关联的命令,而不是执行命令:
mpv --input-test --force-window --idle
(Only closing the window will make mpv exit, pressing normal keys will
merely display the binding, even if mapped to quit.)
(只有关闭窗口才会使 mpv 退出,按下常规键只会显示绑定,即使映射到退出也是如此。)
Also see Key names. 另请参阅键名称。
input.conf syntax input.conf 语法
[Shift+][Ctrl+][Alt+][Meta+]<key> [{<section>}] <command> ( ; <command> )*
Note that by default, the right Alt key can be used to create special
characters, and thus does not register as a modifier. This can be changed
with --input-right-alt-gr option.
请注意,默认情况下,右 Alt 键可以用来创建特殊字符,因此不会注册为修饰键。这可以通过 --input-right-alt-gr 选项来更改。
Newlines always start a new binding. # starts a comment (outside of quoted
string arguments). To bind commands to the # key, SHARP can be used.
换行符始终表示开始新的绑定。 # 表示开始注释(在引号字符串参数之外)。要将命令绑定到 # 键,可以使用 SHARP 。
<key> is either the literal character the key produces (ASCII or Unicode
character), or a symbolic name (as printed by --input-keylist).
<key> 是按键产生的字符(ASCII 或 Unicode 字符),或者是一个符号名称(由 --input-keylist 打印)。
<section> (braced with { and }) is the input section for this
command.
<section> (用 { 和 } 括起来)是此命令的输入部分。
<command> is the command itself. It consists of the command name and
multiple (or none) arguments, all separated by whitespace. String arguments
should be quoted, typically with ". See Flat command syntax.
<command> 是命令本身。它由命令名称和多个(或没有)参数组成,所有参数都由空格分隔。字符串参数应该用引号引起来,通常用 " 。参见 Flat command syntax 。
You can bind multiple commands to one key. For example:
您可以绑定多个命令到一个键上。例如:
a show-text “命令 1” ; show-text “命令 2”
It's also possible to bind a command to a sequence of keys:
同时,也可以将命令绑定到一系列按键上:
a-b-c show-text “在按下 a、b、c 后运行的命令”
(This is not shown in the general command syntax.)
(此内容在一般命令语法中不会显示。)
If a or a-b or b are already bound, this will run the first command
that matches, and the multi-key command will never be called. Intermediate keys
can be remapped to ignore in order to avoid this issue. The maximum number
of (non-modifier) keys for combinations is currently 4.
如果 a 或 a-b 或 b 已经绑定,则将运行第一个匹配的命令,多键命令将不会被调用。中间键可以被重新映射到 ignore 以避免这个问题。组合键(非修饰键)的最大数量目前为 4。
Key names 键名
All mouse and keyboard input is to converted to mpv-specific key names. Key
names are either special symbolic identifiers representing a physical key, or
text key names, which are Unicode code points encoded as UTF-8. These are what
keyboard input would normally produce, for example a for the A key.
These are influenced by keyboard modifiers which affect produced text, such as
shift and caps lock. As a consequence, mpv uses input translated by the current
OS keyboard layout, rather than physical scan codes.
所有鼠标和键盘输入都将转换为 mpv 特定的键名。键名要么是表示物理键的特殊符号标识符,要么是文本键名,它们是作为 UTF-8 编码的 Unicode 代码点。这些是键盘输入通常产生的结果,例如 a 代表 A 键。这些受键盘修饰符的影响,这些修饰符会影响产生的文本,例如 shift 和大写锁定。因此,mpv 使用当前操作系统键盘布局进行输入翻译,而不是物理扫描码。
Currently there is the hardcoded assumption that every text key can be
represented as a single Unicode code point (in NFKC form).
当前存在一个硬编码的假设,即每个文本键都可以表示为一个单一的 Unicode 代码点(NFKC 形式)。
All key names can be combined with the modifiers Shift, Ctrl, Alt,
Meta. They must be prefixed to the actual key name, where each modifier
is followed by a + (for example ctrl+q).
所有键名都可以与修饰符 Shift 、 Ctrl 、 Alt 、 Meta 结合。它们必须作为前缀添加到实际键名之前,每个修饰符后面跟着一个 + (例如 ctrl+q )。
Note 注意
The Shift modifier requires some attention. In general, when the
Shift modifier is combined with a key which produces text, the actual
produced text key name when shift is pressed should be used.
Shift 修饰符需要特别注意。一般来说,当 Shift 修饰符与一个产生文本的键结合时,应使用实际产生的文本键名,当按下 shift 键时使用。
For instance, on the US keyboard layout, Shift+2 should usually be
specified as key-name @ at input.conf, and similarly the
combination Alt+Shift+2 is usually Alt+@, etc.
例如,在 US 键盘布局中, Shift+2 通常应指定为键名 @ 在 input.conf ,同样组合 Alt+Shift+2 通常为 Alt+@ ,等等。
In general, the Shift modifier, when specified with text key names,
is ignored: for instance, mpv interprets Shift+2 as 2.
The only exceptions are ASCII letters, which are normalized by mpv.
For example, Shift+a is interpreted as A.
通常,当与文本键名一起指定时, Shift 修饰符会被忽略:例如,mpv 将 Shift+2 解释为 2 。唯一的例外是 ASCII 字母,它们会被 mpv 规范化。例如, Shift+a 会被解释为 A 。
Special key names like Shift+LEFT work as expected.
If in doubt - use --input-test to check how a key/combination is seen
by mpv.
特殊键名如 Shift+LEFT 按预期工作。如有疑问,请使用 --input-test 来检查键/组合在 mpv 中是如何被看到的。
Symbolic key names and modifier names are case-insensitive. Unicode key names
are case-sensitive just like how keyboard text input would produce.
符号键名和修饰键名不区分大小写。Unicode 键名的大小写敏感,就像键盘文本输入一样。
Another type of key names are hexadecimal key names, which start with 0x,
followed by the hexadecimal value of the key. The hexadecimal value can be
either a Unicode code point value, or can serve as fallback for special keys
that do not have a special mpv defined name. They will break as soon as mpv
adds proper names for them, but can enable you to use a key at all if that
does not happen.
另一种类型的键名是十六进制键名,以 0x 开头,后跟键的十六进制值。十六进制值可以是 Unicode 代码点值,也可以作为没有特殊 mpv 定义名称的特殊键的回退。一旦 mpv 为它们添加了正确的名称,它们就会失效,但如果没有发生这种情况,它们可以让你使用该键。
All symbolic names are listed by --input-keylist. --input-test is a
special mode that prints all input on the OSD.
所有符号名称都通过 --input-keylist 列出。 --input-test 是一种特殊模式,它会将所有输入打印到 OSD 上。
Comments on some symbolic names:
一些符号名称的注释:
- KP*
- Keypad names. Behavior varies by backend (whether they implement this, and
on how they treat numlock), but typically, mpv tries to map keys on the
keypad to separate names, even if they produce the same text as normal keys.
键盘名称。行为因后端而异(它们是否实现此功能以及如何处理 numlock),但通常,mpv 会尝试将键盘上的键映射到单独的名称,即使它们产生的文本与普通键相同。 - MOUSE_BTN*, MBTN*
Various mouse buttons. 各种鼠标按钮。
Depending on backend, the mouse wheel might also be represented as a button. In addition, MOUSE_BTN3 to MOUSE_BTN6 are deprecated aliases for WHEEL_UP, WHEEL_DOWN, WHEEL_LEFT, WHEEL_RIGHT.
根据后端,鼠标滚轮也可能表示为一个按钮。此外, MOUSE_BTN3 到 MOUSE_BTN6 是 WHEEL_UP 、 WHEEL_DOWN 、 WHEEL_LEFT 、 WHEEL_RIGHT 的已弃用别名。MBTN* are aliases for MOUSE_BTN*.
MBTN* 是 MOUSE_BTN* 的别名。- WHEEL_*
Mouse wheels and touch pads (typically).
鼠标滚轮和触摸板(通常是)。These key are scalable when used with scalable commands if the underlying device supports high-resolution scrolling (e.g. touch pads).
这些键在使用可扩展命令时是可伸缩的,如果底层设备支持高分辨率滚动(例如触摸板)。- AXIS_*
- Deprecated aliases for WHEEL_*.
已弃用的别名 WHEEL_* . - *_DBL
- Mouse button double clicks.
鼠标按钮双击。 - MOUSE_MOVE, MOUSE_ENTER, MOUSE_LEAVE
- Emitted by mouse move events. Enter/leave happens when the mouse enters or
leave the mpv window (or the current mouse region, using the deprecated
mouse region input section mechanism).
由鼠标移动事件发出。进入/离开发生在鼠标进入或离开 mpv 窗口(或当前鼠标区域,使用已弃用的鼠标区域输入部分机制)。 - CLOSE_WIN
- Pseudo key emitted when closing the mpv window using the OS window manager
(for example, by clicking the close button in the window title bar).
使用操作系统窗口管理器关闭 mpv 窗口时发出的伪键(例如,通过点击窗口标题栏的关闭按钮)。 - GAMEPAD_*
- Keys emitted by the SDL gamepad backend.
SDL 游戏手柄后端发出的键。 - UNMAPPED
- Pseudo-key that matches any unmapped key. (You should probably avoid this
if possible, because it might change behavior or get removed in the future.)
匹配任何未映射键的伪键。(如果可能的话,您可能应该避免使用它,因为它可能会改变行为或在未来被移除。) - ANY_UNICODE
- Pseudo-key that matches any key that produces text. (You should probably
avoid this if possible, because it might change behavior or get removed in
the future.)
匹配任何产生文本的键的伪键。(如果可能的话,您可能应该避免使用它,因为它可能会改变行为或在未来被移除。)
Flat command syntax 平面命令语法
This is the syntax used in input.conf, and referred to "input.conf syntax" in
a number of other places.
这是在 input.conf 中使用的语法,并在其他多个地方被引用为 "input.conf 语法"。
command_name is an unquoted string with the command name itself. See
List of Input Commands for a list.
command_name 是一个未引用的字符串,包含命令名称本身。查看输入命令列表以获取列表。
Arguments are separated by whitespaces even if the command expects only one
argument. Arguments with whitespaces or other special characters must be quoted,
or the command cannot be parsed correctly.
即使命令只期望一个参数,参数也由空白字符分隔。带有空白字符或其他特殊字符的参数必须引用,否则命令无法正确解析。
Double quotes interpret JSON/C-style escaping, like \t or \" or \\.
JSON escapes according to RFC 8259, minus surrogate pair escapes. This is the
only form which allows newlines at the value - as \n.
双引号解释 JSON/C 风格的转义,如 \t 或 \" 或 \\ 。JSON 转义根据 RFC 8259,但不包括代理对转义。这是唯一允许在值中包含换行符的形式 - 如 \n 。
Single quotes take the content literally, and cannot include the single-quote
character at the value.
单引号将内容视为字面意思,值中不能包含单引号字符。
Custom quotes also take the content literally, but are more flexible than single
quotes. They start with ` (back-quote) followed by any ASCII character,
and end at the first occurrence of the same pair in reverse order, e.g.
`-foo-` or ``bar``. The final pair sequence is not allowed at the
value - in these examples -` and `` respectively. In the second
example the last character of the value also can't be a back-quote.
自定义引号也将内容视为字面意思,但比单引号更灵活。它们以 ` (反引号)开头,后跟任何 ASCII 字符,并以相同字符的反向顺序的第一个出现结束,例如 `-foo-` 或 ``bar`` 。不允许在值中使用最后的配对序列 - 在这些例子中分别是 -` 和 `` 。在第二个例子中,值的最后一个字符也不能是反引号。
Mixed quoting at the same argument, like 'foo'"bar", is not supported.
不支持在同一参数中使用混合引号,如 'foo'"bar" 。
Note that argument parsing and property expansion happen at different stages.
First, arguments are determined as described above, and then, where applicable,
properties are expanded - regardless of argument quoting. However, expansion
can still be prevented with the raw prefix or $>. See Input Command
Prefixes and Property Expansion.
请注意,参数解析和属性展开发生在不同的阶段。首先,参数如上所述确定,然后,在适用的情况下,属性被展开 - 不论参数引号如何。然而,仍然可以使用 raw 前缀或 $> 防止展开。参见输入命令前缀和属性展开。
Commands specified as arrays
指定为数组的命令
This applies to certain APIs, such as mp.commandv() or
mp.command_native() (with array parameters) in Lua scripting, or
mpv_command() or mpv_command_node() (with MPV_FORMAT_NODE_ARRAY) in the
C libmpv client API.
这适用于某些 API,例如 Lua 脚本中的 mp.commandv() 或 mp.command_native() (带有数组参数),或在 C 库 mpv 客户端 API 中的 mpv_command() 或 mpv_command_node() (带有 MPV_FORMAT_NODE_ARRAY)。
The command as well as all arguments are passed as a single array. Similar to
the Flat command syntax, you can first pass prefixes as strings (each as
separate array item), then the command name as string, and then each argument
as string or a native value.
命令以及所有参数都作为一个单独的数组传递。类似于 Flat 命令语法,您首先可以传递前缀作为字符串(每个作为单独的数组项),然后传递命令名称作为字符串,然后传递每个参数作为字符串或原生值。
Since these APIs pass arguments as separate strings or native values, they do
not expect quotes, and do support escaping. Technically, there is the input.conf
parser, which first splits the command string into arguments, and then invokes
argument parsers for each argument. The input.conf parser normally handles
quotes and escaping. The array command APIs mentioned above pass strings
directly to the argument parsers, or can sidestep them by the ability to pass
non-string values.
由于这些 API 将参数作为单独的字符串或原生值传递,它们不需要引号,并支持转义。技术上,存在 input.conf 解析器,它首先将命令字符串拆分为参数,然后对每个参数调用参数解析器。input.conf 解析器通常处理引号和转义。上述提到的数组命令 API 直接将字符串传递给参数解析器,或者可以通过传递非字符串值的能力绕过它们。
Property expansion is disabled by default for these APIs. This can be changed
with the expand-properties prefix. See Input Command Prefixes.
这些 API 默认禁用属性扩展。这可以通过 expand-properties 前缀进行更改。请参阅输入命令前缀。
Sometimes commands have string arguments, that in turn are actually parsed by
other components (e.g. filter strings with vf add) - in these cases, you
you would have to double-escape in input.conf, but not with the array APIs.
有时命令具有字符串参数,这些参数实际上由其他组件解析(例如,使用 vf add 解析过滤器字符串) - 在这种情况下,您需要在 input.conf 中进行双重转义,但不是使用数组 API。
For complex commands, consider using Named arguments instead, which should
give slightly more compatibility. Some commands do not support named arguments
and inherently take an array, though.
对于复杂的命令,考虑使用命名参数,这应该会提供略微更好的兼容性。尽管有些命令不支持命名参数,但它们天生就是数组。
Named arguments 命名参数
This applies to certain APIs, such as mp.command_native() (with tables that
have string keys) in Lua scripting, or mpv_command_node() (with
MPV_FORMAT_NODE_MAP) in the C libmpv client API.
这适用于某些 API,例如 Lua 脚本中的 mp.command_native() (具有字符串键的表)或 C 语言 libmpv 客户端 API 中的 mpv_command_node() (具有 MPV_FORMAT_NODE_MAP)。
The name of the command is provided with a name string field. The name of
each command is defined in each command description in the
List of Input Commands. --input-cmdlist also lists them. See the
subprocess command for an example.
命令名称通过一个 name 字符串字段提供。每个命令的名称在输入命令列表的每个命令描述中定义。 --input-cmdlist 也列出了它们。请参阅 subprocess 命令以获取示例。
Some commands do not support named arguments (e.g. run command). You need
to use APIs that pass arguments as arrays.
某些命令不支持命名参数(例如 run 命令)。您需要使用将参数作为数组传递的 API。
Named arguments are not supported in the "flat" input.conf syntax, which means you cannot use them for key bindings in input.conf at all.
Property expansion is disabled by default for these APIs. This can be changed
with the expand-properties prefix. See Input Command Prefixes.
这些 API 默认禁用属性扩展。这可以通过 expand-properties 前缀进行更改。请参阅输入命令前缀。
List of Input Commands
输入命令列表
Commands with parameters have the parameter name enclosed in < / >.
Don't add those to the actual command. Optional arguments are enclosed in
[ / ]. If you don't pass them, they will be set to a default value.
带有参数的命令将参数名称用 < / > 括起来。不要将这些添加到实际命令中。可选参数用 [ / ] 括起来。如果您不传递它们,它们将被设置为默认值。
Remember to quote string arguments in input.conf (see Flat command syntax).
请记住在 input.conf 中引用字符串参数(参见 Flat 命令语法)。
Playback Control 播放控制
- seek <target> [<flags>]
Change the playback position. By default, seeks by a relative amount of seconds.
更改播放位置。默认情况下,通过相对秒数进行搜索。The second argument consists of flags controlling the seek mode:
第二个参数包含控制查找模式的标志:- relative (default) 相对(默认)
- Seek relative to current position (a negative value seeks backwards).
相对于当前位置进行搜索(负值表示向后搜索)。 - absolute 绝对
- Seek to a given time (a negative value starts from the end of the file).
定位到指定时间(负值从文件末尾开始)。 - absolute-percent 绝对百分比
- Seek to a given percent position.
定位到指定百分比位置。 - relative-percent 相对百分比
- Seek relative to current position in percent.
相对于当前位置的百分比查找。 - keyframes 关键帧
- Always restart playback at keyframe boundaries (fast).
始终在关键帧边界处重新开始播放(快速)。 - exact 精确的
- Always do exact/hr/precise seeks (slow).
始终进行精确/hr/precise 搜索(慢)。
Multiple flags can be combined, e.g.: absolute+keyframes.
多个标志可以组合使用,例如: absolute+keyframes 。By default, keyframes is used for relative, relative-percent, and absolute-percent seeks, while exact is used for absolute seeks.
默认情况下, keyframes 用于 relative , relative-percent ,和 absolute-percent 查找,而 exact 用于 absolute 查找。Before mpv 0.9, the keyframes and exact flags had to be passed as 3rd parameter (essentially using a space instead of +). The 3rd parameter is still parsed, but is considered deprecated.
在 mpv 0.9 之前, keyframes 和 exact 标志必须作为第三个参数传递(实际上是用空格代替 + )。第三个参数仍然会被解析,但被认为是过时的。This is a scalable command. See the documentation of nonscalable input command prefix in Input Command Prefixes for details.
这是一个可扩展的命令。请参阅文档中关于 nonscalable 输入命令前缀的详细信息。- revert-seek [<flags>]
Undoes the seek command, and some other commands that seek (but not necessarily all of them). Calling this command once will jump to the playback position before the seek. Calling it a second time undoes the revert-seek command itself. This only works within a single file.
撤销 seek 命令以及一些其他搜索(但不一定是所有)的命令。调用此命令一次将跳转到搜索前的播放位置。再次调用它将撤销 revert-seek 命令本身。这仅在单个文件内有效。The first argument is optional, and can change the behavior:
第一个参数是可选的,可以更改行为:- mark 标记
- Mark the current time position. The next normal revert-seek command
will seek back to this point, no matter how many seeks happened since
last time.
标记当前时间位置。下一个正常 revert-seek 命令将回溯到此点,无论自上次以来发生了多少次查找。 - mark-permanent 永久标记
- If set, mark the current position, and do not change the mark position
before the next revert-seek command that has mark or
mark-permanent set (or playback of the current file ends). Until
this happens, revert-seek will always seek to the marked point. This
flag cannot be combined with mark.
如果设置,则标记当前位置,并在下一个具有 mark 或 mark-permanent 设置(或当前文件播放结束)的 revert-seek 命令之前不更改标记位置。在此发生之前, revert-seek 将始终寻找标记点。此标志不能与 mark 结合使用。
Using it without any arguments gives you the default behavior.
不使用任何参数使用它将提供默认行为。- sub-seek <skip> [<flags>]
Change video and audio position such that the subtitle event after <skip> subtitle events is displayed. For example, sub-seek 1 skips to the next subtitle, sub-seek -1 skips to the previous subtitles, and sub-seek 0 seeks to the beginning of the current subtitle.
更改视频和音频位置,以便在 <skip> 字幕事件之后显示字幕事件。例如, sub-seek 1 跳转到下一个字幕, sub-seek -1 跳转到上一个字幕, sub-seek 0 寻找当前字幕的开始位置。This is similar to sub-step, except that it seeks video and audio instead of adjusting the subtitle delay.
这与 sub-step 类似,但它是寻找视频和音频而不是调整字幕延迟。Secondary argument: 次要参数:
- primary (default) 主要(默认)
- Seeks through the primary subtitles.
通过主要副标题进行搜索。 - secondary 次要
- Seeks through the secondary subtitles.
遍历二级字幕。
For embedded subtitles (like with Matroska), this works only with subtitle events that have already been displayed, or are within a short prefetch range. See Cache for details on how to control the available prefetch range.
对于嵌入字幕(如 Matroska),这仅在已显示的字幕事件或短预取范围内有效。有关如何控制可用预取范围的详细信息,请参阅缓存。- frame-step [<frames>] [<flags>]
Go forward or backwards by a given amount of frames. If <frames> is omitted, the value is assumed to be 1.
向前或向后移动指定数量的帧。如果省略 <frames> ,则假定值为 1 。The second argument consists of flags controlling the frameskip mode:
第二个参数包含控制帧跳过模式的标志:- play (default) 播放(默认)
- Play the video forward by the desired amount of frames and then pause.
This only works with a positive value (i.e. frame stepping forwards).
以所需的帧数向前播放视频,然后暂停。这仅适用于正值(即帧步进向前)。 - seek 查找
- Perform a very exact seek that attempts to seek by the desired amount
of frames. If <frames> is -1, this will go exactly to the
previous frame.
执行一个非常精确的搜索,尝试通过所需的帧数进行搜索。如果 <frames> 是 -1 ,这将精确地跳转到前一帧。 - mute 静音
- The same as play but mutes the audio stream if there is any during
the duration of the frame step.
与 play 相同,但如果在帧步长期间有任何音频流,则将静音音频流。
Note that the default frameskip mode, play, is more accurate but can be slow depending on how many frames you are skipping (i.e. skipping forward 100 frames will play 100 frames of video before stopping). This mode only works when going forwards. Frame stepping back always performs a seek.
请注意,默认的帧跳过模式,播放,更准确但可能因跳过的帧数多少而变慢(例如,跳过 100 帧将在停止前播放 100 帧的视频)。此模式仅适用于向前播放。向后帧步进始终执行搜索。When using seek mode, this can still be very slow (it tries to be precise, not fast), and sometimes fails to behave as expected. How well this works depends on whether precise seeking works correctly (e.g. see the --hr-seek-demuxer-offset option). Video filters or other video post-processing that modifies timing of frames (e.g. deinterlacing) should usually work, but might make framestepping silently behave incorrectly in corner cases. Using --hr-seek-framedrop=no should help, although it might make precise seeking slower. Also if the video is VFR, framestepping using seeks will probably not work correctly except for the -1 case.
在使用搜索模式时,这仍然可能非常慢(它试图尽可能精确,而不是快速),有时无法按预期行为。这效果的好坏取决于精确搜索是否正确工作(例如,查看 --hr-seek-demuxer-offset 选项)。视频过滤器或其他修改帧时序的视频后处理(例如,去隔行扫描)通常应该工作,但可能在某些边缘情况下使帧步进无声地表现不正确。使用 --hr-seek-framedrop=no 应该有所帮助,尽管这可能会使精确搜索变慢。此外,如果视频是 VFR,使用搜索进行帧步进可能除了 -1 情况外都不会正确工作。This does not work with audio-only playback.
此功能不适用于仅音频播放。- frame-back-step
Calls frame-step with a value of -1 and the seek flag.
使用值 -1 和 seek 标志调用 frame-step 。This does not work with audio-only playback.
此功能不适用于仅音频播放。- stop [<flags>]
Stop playback and clear playlist. With default settings, this is essentially like quit. Useful for the client API: playback can be stopped without terminating the player.
停止播放并清除播放列表。默认设置下,这本质上等同于 quit 。对客户端 API 有用:可以停止播放而不终止播放器。The first argument is optional, and supports the following flags:
第一个参数是可选的,并支持以下标志:- keep-playlist 保留播放列表
- Do not clear the playlist.
不要清除播放列表。
Property Manipulation 属性操作
- set <name> <value>
- Set the given property or option to the given value.
将给定的属性或选项设置为给定的值。 - del <name>
- Delete the given property. Most properties cannot be deleted.
删除给定的属性。大多数属性不能被删除。 - add <name> [<value>]
Add the given value to the property or option. On overflow or underflow, clamp the property to the maximum. If <value> is omitted, assume 1.
将给定的值添加到属性或选项中。在溢出或下溢时,将属性夹到最大值。如果省略了 <value> ,则假设为 1 。Whether or not key-repeat is enabled by default depends on the property. Currently properties with continuous values are repeatable by default (like volume), while discrete values are not (like osd-level).
是否默认启用 key-repeat 取决于属性。目前具有连续值的属性默认可重复(如 volume ),而离散值则不可重复(如 osd-level )。This is a scalable command. See the documentation of nonscalable input command prefix in Input Command Prefixes for details.
这是一个可扩展的命令。请参阅文档中关于 nonscalable 输入命令前缀的详细信息。- multiply <name> <value>
- Similar to add, but multiplies the property or option with the numeric
value.
类似于 add ,但将属性或选项与数值相乘。 - cycle <name> [<value>]
Cycle the given property or option. The second argument can be up or down to set the cycle direction. On overflow, set the property back to the minimum, on underflow set it to the maximum. If up or down is omitted, assume up.
循环给定的属性或选项。第二个参数可以是 up 或 down 来设置循环方向。在溢出时,将属性设置回最小值,在下溢时设置到最大值。如果省略 up 或 down ,则默认为 up 。Whether or not key-repeat is enabled by default depends on the property. Currently properties with continuous values are repeatable by default (like volume), while discrete values are not (like osd-level).
是否默认启用 key-repeat 取决于属性。目前具有连续值的属性默认可重复(如 volume ),而离散值则不可重复(如 osd-level )。This is a scalable command. See the documentation of nonscalable input command prefix in Input Command Prefixes for details.
这是一个可扩展的命令。请参阅文档中关于 nonscalable 输入命令前缀的详细信息。- cycle-values [<"!reverse">] <property> <value1> [<value2> [...]]
Cycle through a list of values. Each invocation of the command will set the given property to the next value in the list. The command will use the current value of the property/option, and use it to determine the current position in the list of values. Once it has found it, it will set the next value in the list (wrapping around to the first item if needed).
遍历一组值。每次调用该命令都会将指定的属性设置为列表中的下一个值。该命令将使用属性/选项的当前值,并使用它来确定值列表中的当前位置。一旦找到它,它将设置列表中的下一个值(如果需要,则回绕到第一个项目)。This command has a variable number of arguments, and cannot be used with named arguments.
此命令具有可变数量的参数,并且不能与命名参数一起使用。The special argument !reverse can be used to cycle the value list in reverse. The only advantage is that you don't need to reverse the value list yourself when adding a second key binding for cycling backwards.
可以使用特殊参数 !reverse 来反向循环值列表。唯一的优点是,在添加第二个反向循环的快捷键时,您不需要自己反转值列表。- change-list <name> <operation> <value>
This command changes list options as described in List Options. The <name> parameter is the normal option name, while <operation> is the suffix or action used on the option.
此命令更改列表选项,如列表选项中所述。 <name> 参数是正常的选项名称,而 <operation> 是用于选项的后缀或操作。Some operations take no value, but the command still requires the value parameter. In these cases, the value must be an empty string.
某些操作不需要值,但命令仍然需要值参数。在这些情况下,值必须是一个空字符串。Example 示例
change-list glsl-shaders append file.glsl
Add a filename to the glsl-shaders list. The command line equivalent is --glsl-shaders-append=file.glsl or alternatively --glsl-shader=file.glsl.
添加一个文件名到 glsl-shaders 列表中。命令行等效为 --glsl-shaders-append=file.glsl 或 alternatively --glsl-shader=file.glsl 。
Playlist Manipulation 播放列表操作
- playlist-next [<flags>]
Go to the next entry on the playlist.
转到播放列表中的下一个条目。First argument: 第一个参数:
- weak (default) 弱(默认)
- If the last file on the playlist is currently played, do nothing.
如果播放列表中的最后一个文件正在播放,则不执行任何操作。 - force 强制
- Terminate playback if there are no more files on the playlist.
如果播放列表中没有更多文件,则终止播放。
- playlist-prev [<flags>]
Go to the previous entry on the playlist.
转到播放列表中的上一条条目。First argument: 第一个参数:
- weak (default) 弱(默认)
- If the first file on the playlist is currently played, do nothing.
如果播放列表中的第一个文件正在播放,则不执行任何操作。 - force 强制
- Terminate playback if the first file is being played.
如果正在播放第一个文件,则终止播放。
- playlist-next-playlist
- Go to the next entry on the playlist with a different playlist-path.
使用不同的 playlist-path 跳转到播放列表中的下一个条目。 - playlist-prev-playlist
- Go to the first of the previous entries on the playlist with a different
playlist-path.
使用不同的 playlist-path 跳转到播放列表中上一个条目的第一个。 - playlist-play-index <integer|current|none>
Start (or restart) playback of the given playlist index. In addition to the 0-based playlist entry index, it supports the following values:
开始(或重新启动)播放指定播放列表索引。除了基于 0 的播放列表条目索引外,它还支持以下值:- <current> <当前>
- The current playlist entry (as in playlist-current-pos) will be
played again (unload and reload). If none is set, playback is stopped.
(In corner cases, playlist-current-pos can point to a playlist entry
even if playback is currently inactive,
当前播放列表条目(即 playlist-current-pos )将被再次播放(卸载并重新加载)。如果没有设置,则停止播放。(在边缘情况下,即使播放当前不活跃, playlist-current-pos 也可以指向播放列表条目) - <none> <无>
- Playback is stopped. If idle mode (--idle) is enabled, the player
will enter idle mode, otherwise it will exit.
播放已停止。如果启用空闲模式( --idle ),则播放器将进入空闲模式,否则将退出。
This command is similar to loadfile in that it only manipulates the state of what to play next, without waiting until the current file is unloaded, and the next one is loaded.
该命令与 loadfile 类似,因为它只操作下一个要播放的状态,而不等待当前文件卸载,下一个文件加载。Setting playlist-pos or similar properties can have a similar effect to this command. However, it's more explicit, and guarantees that playback is restarted if for example the new playlist entry is the same as the previous one.
设置 playlist-pos 或类似属性可能具有与此命令类似的效果。然而,它更明确,并保证如果新播放列表条目与上一个相同,则播放将重新启动。- loadfile <url> [<flags> [<index> [<options>]]]
Load the given file or URL and play it. Technically, this is just a playlist manipulation command (which either replaces the playlist or adds an entry to it). Actual file loading happens independently. For example, a loadfile command that replaces the current file with a new one returns before the current file is stopped, and the new file even begins loading.
加载指定的文件或 URL 并播放。技术上,这只是一个播放列表操作命令(它要么替换播放列表,要么向其中添加条目)。实际的文件加载是独立进行的。例如,一个替换当前文件的新文件的 loadfile 命令在停止当前文件之前就返回了,而新文件甚至已经开始加载。Second argument: 第二个参数:
- <replace> (default) <替换>(默认)
- Stop playback of the current file, and play the new file immediately.
停止当前文件的播放,并立即播放新文件。 - <append> <追加>
- Append the file to the playlist.
将文件追加到播放列表中。 - <append-play> <追加播放>
- Append the file, and if nothing is currently playing, start playback.
(Always starts with the added file, even if the playlist was not empty
before running this command.)
追加文件,如果当前没有播放内容,则开始播放。(始终从添加的文件开始播放,即使运行此命令之前播放列表不为空。) - <insert-next> <插入下一项>
- Insert the file into the playlist, directly after the current entry.
将文件插入到播放列表中,直接在当前条目之后。 - <insert-next-play> <插入下一播放>
- Insert the file next, and if nothing is currently playing, start playback.
(Always starts with the added file, even if the playlist was not empty
before running this command.)
将文件插入到下一个位置,如果当前没有播放内容,则开始播放。(始终从添加的文件开始播放,即使运行此命令之前播放列表不为空。) - <insert-at> <插入位置>
- Insert the file into the playlist, at the index given in the third
argument.
将文件插入到播放列表中,位置由第三个参数指定。 - <insert-at-play> <插入到播放列表中>
- Insert the file at the index given in the third argument, and if nothing
is currently playing, start playback. (Always starts with the added
file, even if the playlist was not empty before running this command.)
将文件插入到由第三个参数指定的位置,如果当前没有播放内容,则开始播放。(始终从添加的文件开始播放,即使运行此命令之前播放列表不为空。)
The third argument is an insertion index, used only by the insert-at and insert-at-play actions. When used with those actions, the new item will be inserted at the index position in the playlist, or appended to the end if index is less than 0 or greater than the size of the playlist. This argument will be ignored for all other actions. This argument is added in mpv 0.38.0.
第三个参数是一个插入索引,仅由 insert-at 和 insert-at-play 动作使用。当与这些动作一起使用时,新项目将被插入到播放列表的索引位置,如果索引小于 0 或大于播放列表的大小,则将其附加到末尾。对于所有其他动作,此参数将被忽略。此参数是在 mpv 0.38.0 中添加的。The fourth argument is a list of options and values which should be set while the file is playing. It is of the form opt1=value1,opt2=value2,... When using the client API, this can be a MPV_FORMAT_NODE_MAP (or a Lua table), however the values themselves must be strings currently. These options are set during playback, and restored to the previous value at end of playback (see Per-File Options).
第四个参数是一组选项和值,应在文件播放时设置。其形式为 opt1=value1,opt2=value2,.. 。当使用客户端 API 时,这可以是一个 MPV_FORMAT_NODE_MAP (或 Lua 表),但是当前值本身必须是字符串。这些选项在播放期间设置,并在播放结束时恢复到之前的值(参见按文件选项)。Warning 警告
Since mpv 0.38.0, an insertion index argument is added as the third argument. This breaks all existing uses of this command which make use of the argument to include the list of options to be set while the file is playing. To address this problem, the third argument now needs to be set to -1 if the fourth argument needs to be used.
自 mpv 0.38.0 以来,已将插入索引参数作为第三个参数添加。这破坏了所有使用此命令并利用参数包含在播放文件时设置的选项列表的现有用法。为了解决这个问题,如果需要使用第四个参数,现在需要将第三个参数设置为 -1。- loadlist <url> [<flags> [<index>]]
Load the given playlist file or URL (like --playlist).
加载指定的播放列表文件或 URL(如 --playlist )。Second argument: 第二个参数:
- <replace> (default) <替换>(默认)
- Stop playback and replace the internal playlist with the new one.
停止播放并将内部播放列表替换为新播放列表。 - <append> <追加>
- Append the new playlist at the end of the current internal playlist.
将新播放列表追加到当前内部播放列表的末尾。 - <append-play> <追加播放>
- Append the new playlist, and if nothing is currently playing, start
playback. (Always starts with the new playlist, even if the internal
playlist was not empty before running this command.)
追加新的播放列表,如果当前没有正在播放的内容,则开始播放。(始终以新的播放列表开始播放,即使运行此命令之前内部播放列表不为空。) - <insert-next> <插入下一项>
- Insert the new playlist into the current internal playlist, directly
after the current entry.
将新播放列表直接插入到当前内部播放列表中,紧接当前条目之后。 - <insert-next-play> <插入下一播放>
- Insert the new playlist, and if nothing is currently playing, start
playback. (Always starts with the new playlist, even if the internal
playlist was not empty before running this command.)
插入新播放列表,如果当前没有播放内容,则开始播放。(始终以新播放列表开始播放,即使运行此命令之前内部播放列表不为空。) - <insert-at> <插入位置>
- Insert the new playlist at the index given in the third argument.
在第三个参数指定的索引处插入新的播放列表。 - <insert-at-play> <插入到播放列表中>
- Insert the new playlist at the index given in the third argument, and if
nothing is currently playing, start playback. (Always starts with the
new playlist, even if the internal playlist was not empty before running
this command.)
在第三个参数指定的索引处插入新的播放列表,如果当前没有正在播放的内容,则开始播放。(始终以新的播放列表开始播放,即使运行此命令之前内部播放列表不为空。)
The third argument is an insertion index, used only by the insert-at and insert-at-play actions. When used with those actions, the new playlist will be inserted at the index position in the internal playlist, or appended to the end if index is less than 0 or greater than the size of the internal playlist. This argument will be ignored for all other actions.
第三个参数是插入索引,仅由 insert-at 和 insert-at-play 动作使用。当与这些动作一起使用时,新的播放列表将被插入到内部播放列表的索引位置,如果索引小于 0 或大于内部播放列表的大小,则将其追加到末尾。对于所有其他动作,此参数将被忽略。- playlist-clear
- Clear the playlist, except the currently played file.
清除播放列表,除了当前播放的文件。 - playlist-remove <index>
- Remove the playlist entry at the given index. Index values start counting
with 0. The special value current removes the current entry. Note that
removing the current entry also stops playback and starts playing the next
entry.
移除给定索引处的播放列表条目。索引值从 0 开始计数。特殊值 current 移除当前条目。请注意,移除当前条目也会停止播放并开始播放下一个条目。 - playlist-move <index1> <index2>
- Move the playlist entry at index1, so that it takes the place of the
entry index2. (Paradoxically, the moved playlist entry will not have
the index value index2 after moving if index1 was lower than index2,
because index2 refers to the target entry, not the index the entry
will have after moving.)
移动索引 1 处的播放列表条目,使其取代索引 2 处的条目。(矛盾的是,移动后的播放列表条目在移动后不会具有索引值 index2,如果 index1 小于 index2,因为 index2 指的是目标条目,而不是条目移动后的索引。) - playlist-shuffle
- Shuffle the playlist. This is similar to what is done on start if the
--shuffle option is used.
随机播放播放列表。这类似于使用 --shuffle 选项启动时所做的操作。 - playlist-unshuffle
- Attempt to revert the previous playlist-shuffle command. This works
only once (multiple successive playlist-unshuffle commands do nothing).
May not work correctly if new recursive playlists have been opened since
a playlist-shuffle command.
尝试撤销之前的 playlist-shuffle 命令。这只能执行一次(连续多次执行 playlist-unshuffle 命令将不起作用)。如果自 playlist-shuffle 命令以来已打开新的递归播放列表,可能无法正确执行。
Track Manipulation 轨道操作
- sub-add <url> [<flags> [<title> [<lang>]]]
Load the given subtitle file or stream. By default, it is selected as current subtitle after loading.
加载指定的字幕文件或流。默认情况下,加载后它将被选为当前字幕。The flags argument is one of the following values:
flags 参数是以下值之一:<select>
Select the subtitle immediately (default).
选择立即选择副标题(默认)。<auto>
Don't select the subtitle. (Or in some special situations, let the default stream selection mechanism decide.)
不要选择字幕。(或者在某些特殊情况下,让默认流选择机制决定。)<cached> <已缓存>
Select the subtitle. If a subtitle with the same filename was already added, that one is selected, instead of loading a duplicate entry. (In this case, title/language are ignored, and if the was changed since it was loaded, these changes won't be reflected.)
"选择副标题。如果已添加具有相同文件名的副标题,则选择该副标题,而不是加载重复条目。(在这种情况下,标题/语言将被忽略,并且如果自加载以来已更改,则这些更改不会反映出来。)Additionally the following flags can be added with a +:
此外,还可以通过 + 添加以下标志:<hearing-impaired> <听力受损>
Marks the track as suitable for the hearing impaired.
标记轨道为适合听力受损者。<visual-impaired> <视觉障碍者>
Marks the track as suitable for the visually impaired.
标记轨道为适合视觉障碍者。<attached-picture> (only for video-add)
<附加图片> (仅适用于 video-add )Marks the track as an attached picture, same as albumart argument for `video-add.
标记轨道为附加图片,与 `video-add 的 albumart 参数相同。The title argument sets the track title in the UI.
The lang argument sets the track language, and can also influence stream selection with flags set to auto.
- sub-remove [<id>]
- Remove the given subtitle track. If the id argument is missing, remove
the current track. (Works on external subtitle files only.)
删除指定的字幕轨道。如果缺少 id 参数,则删除当前轨道。(仅适用于外部字幕文件。) - sub-reload [<id>]
Reload the given subtitle tracks. If the id argument is missing, reload the current track. (Works on external subtitle files only.)
重新加载指定的字幕轨道。如果缺少 id 参数,则重新加载当前轨道。(仅适用于外部字幕文件。)This works by unloading and re-adding the subtitle track.
这是通过卸载并重新添加字幕轨道来实现的。- sub-step <skip> [<flags>]
Change subtitle timing such, that the subtitle event after the next <skip> subtitle events is displayed. <skip> can be negative to step backwards.
更改字幕时间,以便在下一个 <skip> 字幕事件之后显示字幕事件。 <skip> 可以是负数以向后移动。Secondary argument: 次要参数:
- primary (default) 主要(默认)
- Steps through the primary subtitles.
遍历主字幕步骤。 - secondary 次要
- Steps through the secondary subtitles.
遍历次要字幕。
- audio-add <url> [<flags> [<title> [<lang>]]]
- Load the given audio file. See sub-add command.
加载指定的音频文件。请参阅 sub-add 命令。 - audio-remove [<id>]
- Remove the given audio track. See sub-remove command.
移除指定的音频轨道。请参阅 sub-remove 命令。 - audio-reload [<id>]
- Reload the given audio tracks. See sub-reload command.
重新加载指定的音频轨道。请参阅 sub-reload 命令。 - video-add <url> [<flags> [<title> [<lang> [<albumart>]]]]
Load the given video file. See sub-add command for common options.
加载指定的视频文件。请参阅 sub-add 命令以获取常见选项。- video-remove [<id>]
- Remove the given video track. See sub-remove command.
删除指定的视频轨道。参见 sub-remove 命令。 - video-reload [<id>]
- Reload the given video tracks. See sub-reload command.
重新加载指定的视频轨道。参见 sub-reload 命令。 - rescan-external-files [<mode>]
Rescan external files according to the current --sub-auto, --audio-file-auto and --cover-art-auto settings. This can be used to auto-load external files after the file was loaded.
根据当前的 --sub-auto , --audio-file-auto 和 --cover-art-auto 设置重新扫描外部文件。这可以在文件加载后自动加载外部文件。The mode argument is one of the following:
mode 参数是以下之一:- <reselect> (default) (默认)
- Select the default audio and subtitle streams, which typically selects
external files with the highest preference. (The implementation is not
perfect, and could be improved on request.)
选择默认的音频和字幕流,通常选择具有最高优先级的外部文件。(实现并不完美,可以根据要求进行改进。) - <keep-selection> <保持选择>
- Do not change current track selections.
不要更改当前轨道选择。
Text Manipulation 文本操作
- print-text <text>
- Print text to stdout. The string can contain properties (see
Property Expansion). Take care to put the argument in quotes.
将文本打印到标准输出。字符串可以包含属性(见属性展开)。请务必将参数放在引号内。 - expand-text <text>
- Property-expand the argument and return the expanded string. This can be
used only through the client API or from a script using
mp.command_native. (see Property Expansion).
展开参数并返回展开后的字符串。这只能通过客户端 API 或使用 mp.command_native .的脚本进行(见属性展开)。 - expand-path <text>
Expand a path's double-tilde placeholders into a platform-specific path. As expand-text, this can only be used through the client API or from a script using mp.command_native.
将路径的双波浪线占位符展开为特定平台的路径。如 expand-text ,这只能通过客户端 API 或使用 mp.command_native 的脚本来实现。Example 示例
mp.osd_message(mp.command_native({"expand-path", "~~home/"}))
This line of Lua would show the location of the user's mpv configuration directory on the OSD.
此行 Lua 代码会在 OSD 上显示用户 mpv 配置目录的位置。- normalize-path <filename>
Return a canonical representation of the path filename by converting it to an absolute path, removing consecutive slashes, removing . components, resolving .. components, and converting slashes to backslashes on Windows. Symlinks are not resolved unless the platform is Unix-like and one of the path components is ... If filename is a URL, it is returned unchanged. This can only be used through the client API or from a script using mp.command_native.
通过将路径 filename 转换为绝对路径、删除连续的斜杠、删除 . 组件、解析 .. 组件以及在 Windows 上将斜杠转换为反斜杠来返回路径的规范表示。除非平台是类 Unix 且路径组件之一是 .. ,否则不会解析符号链接。如果 filename 是 URL,则返回不变。这只能通过客户端 API 或使用 mp.command_native 的脚本来实现。Example 示例
mp.osd_message(mp.command_native({"normalize-path", "/foo//./bar"}))
This line of Lua prints "/foo/bar" on the OSD.
这一行 Lua 代码在 OSD 上打印"/foo/bar"。- escape-ass <text>
Modify text so that commands and functions that interpret ASS tags, such as osd-overlay and mp.create_osd_overlay, will display it verbatim, and return it. This can only be used through the client API or from a script using mp.command_native.
修改 text ,以便解释 ASS 标签的命令和函数,如 osd-overlay 和 mp.create_osd_overlay ,能够显示其原始文本并返回。这只能通过客户端 API 或使用 mp.command_native 的脚本来实现。Example 示例
mp.osd_message(mp.command_native({"escape-ass", "foo {bar}"}))
This line of Lua prints "foo \{bar}" on the OSD.
这一行 Lua 代码在 OSD 上打印"foo \{bar}"。
Configuration Commands 配置命令
- apply-profile <name> [<mode>]
Apply the contents of a named profile. This is like using profile=name in a config file, except you can map it to a key binding to change it at runtime.
应用命名配置文件的内容。这类似于在配置文件中使用 profile=name ,但你可以将其映射到键盘快捷键以在运行时更改它。The mode argument: 模式参数:
- apply
- Apply the profile. Default if the argument is omitted.
应用配置文件。如果省略参数,则为默认值。 - restore
- Restore options set by a previous apply-profile command for this
profile. Only works if the profile has profile-restore set to a
relevant mode. Prints a warning if nothing could be done. See
Runtime profiles for details.
恢复之前由 apply-profile 命令为此配置文件设置的选项。只有当配置文件将 profile-restore 设置为相关模式时才有效。如果无法执行任何操作,则打印警告。有关详细信息,请参阅运行时配置文件。
- load-config-file <filename>
- Load a configuration file, similar to the --include option. If the file
was already included, its previous options are not reset before it is
reparsed.
加载配置文件,类似于 --include 选项。如果文件已被包含,则在重新解析之前不会重置其先前选项。 - write-watch-later-config
- Write the resume config file that the quit-watch-later command writes,
but continue playback normally.
编写由 quit-watch-later 命令写入的简历配置文件,但继续正常回放。 - delete-watch-later-config [<filename>]
- Delete any existing resume config file that was written by
quit-watch-later or write-watch-later-config. If a filename is
specified, then the deleted config is for that file; otherwise, it is the
same one as would be written by quit-watch-later or
write-watch-later-config in the current circumstance.
删除由 quit-watch-later 或 write-watch-later-config 编写的任何现有简历配置文件。如果指定了文件名,则删除的配置文件为该文件;否则,与当前情况下 quit-watch-later 或 write-watch-later-config 编写的相同。
OSD Commands OSD 命令
- show-text <text> [<duration>|-1 [<level>]]
Show text on the OSD. The string can contain properties, which are expanded as described in Property Expansion. This can be used to show playback time, filename, and so on. no-osd has no effect on this command.
在 OSD 上显示文本。字符串可以包含属性,这些属性将按属性扩展中所述进行展开。这可以用来显示播放时间、文件名等。 no-osd 对此命令没有影响。- <duration>
- The time in ms to show the message for. By default, it uses the same
value as --osd-duration.
显示消息的时间(毫秒)。默认情况下,它使用与 --osd-duration 相同的值。 - <level> <级别>
- The minimum OSD level to show the text at (see --osd-level).
显示文本的最小 OSD 级别(见 --osd-level )。
- show-progress
- Show the progress bar, the elapsed time and the total duration of the file
on the OSD. no-osd has no effect on this command.
在 OSD 上显示进度条、已过时间和文件的总时长。 no-osd 对此命令没有影响。 - overlay-add <id> <x> <y> <file> <offset> <fmt> <w> <h> <stride> <dw> <dh>
Add an OSD overlay sourced from raw data. This might be useful for scripts and applications controlling mpv, and which want to display things on top of the video window.
添加来自原始数据的 OSD 投影。这可能对控制 mpv 的脚本和应用程序很有用,并且它们想在视频窗口上显示内容。Overlays are usually displayed in screen resolution, but with some VOs, the resolution is reduced to that of the video's. You can read the osd-width and osd-height properties. At least with --vo-xv and anamorphic video (such as DVD), osd-par should be read as well, and the overlay should be aspect-compensated.
叠加通常以屏幕分辨率显示,但某些视频对象(VO)的分辨率会降低到视频的分辨率。您可以读取 osd-width 和 osd-height 属性。至少对于 --vo-xv 和非标准宽高比视频(如 DVD),还应读取 osd-par ,并且叠加应进行宽高比补偿。This has the following named arguments. The order of them is not guaranteed, so you should always call them with named arguments, see Named arguments.
以下是有名参数。它们的顺序没有保证,因此您应该始终使用有名参数调用它们,参见有名参数。id is an integer between 0 and 63 identifying the overlay element. The ID can be used to add multiple overlay parts, update a part by using this command with an already existing ID, or to remove a part with overlay-remove. Using a previously unused ID will add a new overlay, while reusing an ID will update it.
id 是一个介于 0 和 63 之间的整数,用于标识叠加元素。ID 可以用来添加多个叠加部分,通过使用此命令并带有已存在的 ID 来更新部分,或者使用 overlay-remove 来删除部分。使用之前未使用的 ID 将添加新的叠加,而重用 ID 将更新它。x and y specify the position where the OSD should be displayed.
x 和 y 指定 OSD 应显示的位置。file specifies the file the raw image data is read from. It can be either a numeric UNIX file descriptor prefixed with @ (e.g. @4), or a filename. The file will be mapped into memory with mmap(), copied, and unmapped before the command returns (changed in mpv 0.18.1).
file 指定读取原始图像数据的文件。它可以是带有前缀 @ 的数字 UNIX 文件描述符(例如 @4 ),或者是一个文件名。文件将在命令返回之前被映射到内存中,复制,然后取消映射(自 mpv 0.18.1 以来更改)。It is also possible to pass a raw memory address for use as bitmap memory by passing a memory address as integer prefixed with an & character. Passing the wrong thing here will crash the player. This mode might be useful for use with libmpv. The offset parameter is simply added to the memory address (since mpv 0.8.0, ignored before).
还可以通过传递一个以 & 字符前缀的整数内存地址作为位图内存的地址来传递一个原始内存地址。在这里传递错误的内容会导致播放器崩溃。这种模式可能适用于与 libmpv 一起使用。 offset 参数只是简单地添加到内存地址中(自 mpv 0.8.0 以来,忽略之前的内容)。offset is the byte offset of the first pixel in the source file. (The current implementation always mmap's the whole file from position 0 to the end of the image, so large offsets should be avoided. Before mpv 0.8.0, the offset was actually passed directly to mmap, but it was changed to make using it easier.)
offset 是源文件中第一个像素的字节偏移量。(当前实现始终从位置 0 到图像末尾映射整个文件,因此应避免大偏移量。在 mpv 0.8.0 之前,偏移量实际上是直接传递给 mmap 的,但为了更容易使用而进行了更改。)fmt is a string identifying the image format. Currently, only bgra is defined. This format has 4 bytes per pixels, with 8 bits per component. The least significant 8 bits are blue, and the most significant 8 bits are alpha (in little endian, the components are B-G-R-A, with B as first byte). This uses premultiplied alpha: every color component is already multiplied with the alpha component. This means the numeric value of each component is equal to or smaller than the alpha component. (Violating this rule will lead to different results with different VOs: numeric overflows resulting from blending broken alpha values is considered something that shouldn't happen, and consequently implementations don't ensure that you get predictable behavior in this case.)
fmt 是标识图像格式的字符串。目前,只有 bgra 已定义。此格式每像素占用 4 个字节,每个组件 8 位。最低的 8 位是蓝色,最高的 8 位是 alpha(在 little endian 中,组件顺序为 B-G-R-A,其中 B 是第一个字节)。这使用预乘 alpha:每个颜色组件都已与 alpha 组件相乘。这意味着每个组件的数值等于或小于 alpha 组件。违反此规则会导致不同 VOs 的结果不同:混合损坏的 alpha 值导致的数值溢出被认为是不应该发生的,因此实现不保证在这种情况下获得可预测的行为。)w, h, and stride specify the size of the overlay. w is the visible width of the overlay, while stride gives the width in bytes in memory. In the simple case, and with the bgra format, stride==4*w. In general, the total amount of memory accessed is stride * h. (Technically, the minimum size would be stride * (h - 1) + w * 4, but for simplicity, the player will access all stride * h bytes.)
w 、 h 和 stride 指定覆盖层的尺寸。 w 是覆盖层的可见宽度,而 stride 提供内存中的字节数宽度。在简单情况下,以及使用 bgra 格式时, stride==4*w 。一般来说,访问的总内存量是 stride * h 。(技术上,最小尺寸应该是 stride * (h - 1) + w * 4 ,但为了简单起见,播放器将访问所有 stride * h 字节。)dw and dh specify the (optional) display size of the overlay. The overlay visible portion of the overlay (w and h) is scaled to in display to dw and dh. If parameters are not present, the values for w and h are used.
dw 和 dh 指定覆盖层的(可选)显示尺寸。覆盖层的可见部分( w 和 h )按显示比例缩放到 dw 和 dh 。如果不存在参数,则使用 w 和 h 的值。Note 注意
Before mpv 0.18.1, you had to do manual "double buffering" when updating an overlay by replacing it with a different memory buffer. Since mpv 0.18.1, the memory is simply copied and doesn't reference any of the memory indicated by the command's arguments after the command returns. If you want to use this command before mpv 0.18.1, reads the old docs to see how to handle this correctly.
在 mpv 0.18.1 之前,您在通过替换不同的内存缓冲区来更新覆盖层时,必须手动执行“双缓冲”。从 mpv 0.18.1 开始,内存只是简单地复制,并在命令返回后不引用任何命令参数中指定的内存。如果您想在 mpv 0.18.1 之前使用此命令,请阅读旧文档以了解如何正确处理此问题。- overlay-remove <id>
- Remove an overlay added with overlay-add and the same ID. Does nothing
if no overlay with this ID exists.
删除使用 overlay-add 和相同 ID 添加的覆盖层。如果不存在此 ID 的覆盖层,则不执行任何操作。 - osd-overlay
Add/update/remove an OSD overlay.
添加/更新/删除一个 OSD 覆盖层。(Although this sounds similar to overlay-add, osd-overlay is for text overlays, while overlay-add is for bitmaps. Maybe overlay-add will be merged into osd-overlay to remove this oddity.)
(尽管这听起来与 overlay-add 相似,但 osd-overlay 用于文本覆盖,而 overlay-add 用于位图。也许 overlay-add 将被合并到 osd-overlay 中,以消除这种异常。)You can use this to add text overlays in ASS format. ASS has advanced positioning and rendering tags, which can be used to render almost any kind of vector graphics.
您可以使用此功能添加 ASS 格式的文本覆盖。ASS 具有高级定位和渲染标签,可以用来渲染几乎任何类型的矢量图形。This command accepts the following parameters:
此命令接受以下参数:- id
Arbitrary integer that identifies the overlay. Multiple overlays can be added by calling this command with different id parameters. Calling this command with the same id replaces the previously set overlay.
标识叠加层的任意整数。可以通过调用此命令并使用不同的 id 参数来添加多个叠加层。使用相同的 id 调用此命令将替换之前设置的叠加层。There is a separate namespace for each libmpv client (i.e. IPC connection, script), so IDs can be made up and assigned by the API user without conflicting with other API users.
每个 libmpv 客户端(即 IPC 连接、脚本)都有一个独立的命名空间,因此 ID 可以由 API 用户自行创建和分配,而不会与其他 API 用户冲突。If the libmpv client is destroyed, all overlays associated with it are also deleted. In particular, connecting via --input-ipc-server, adding an overlay, and disconnecting will remove the overlay immediately again.
如果销毁 libmpv 客户端,与其关联的所有叠加层也将被删除。特别是,通过 --input-ipc-server 连接、添加叠加层和断开连接将立即再次删除叠加层。- format
String that gives the type of the overlay. Accepts the following values (HTML rendering of this is broken, view the generated manpage instead, or the raw RST source):
表示叠加层类型的字符串。接受以下值(HTML 渲染此内容已损坏,请查看生成的手册页,或查看原始 RST 源代码):- ass-events
The data parameter is a string. The string is split on the newline character. Every line is turned into the Text part of a Dialogue ASS event. Timing is unused (but behavior of timing dependent ASS tags may change in future mpv versions).
data 参数是一个字符串。字符串在换行符处分割。每一行被转换为 Dialogue ASS 事件的 Text 部分。时间戳未使用(但在未来 mpv 版本中,依赖于时间戳的 ASS 标签的行为可能会改变)。Note that it's better to put multiple lines into data, instead of adding multiple OSD overlays.
请注意,将多行放入 data ,而不是添加多个 OSD 窥视层,会更好。This provides 2 ASS Styles. OSD contains the text style as defined by the current --osd-... options. Default is similar, and contains style that OSD would have if all options were set to the default.
这提供了 2 个 ASS Styles 。 OSD 包含由当前 --osd-... 选项定义的文本样式。 Default 类似,包含 OSD 如果所有选项都设置为默认值时将具有的样式。In addition, the res_x and res_y options specify the value of the ASS PlayResX and PlayResY header fields. If res_y is set to 0, PlayResY is initialized to an arbitrary default value (but note that the default for this command is 720, not 0). If res_x is set to 0, PlayResX is set based on res_y such that a virtual ASS pixel has a square pixel aspect ratio.
此外, res_x 和 res_y 选项指定了 ASS PlayResX 和 PlayResY 标头字段的值。如果 res_y 设置为 0, PlayResY 将初始化为任意默认值(但请注意,此命令的默认值为 720,而不是 0)。如果 res_x 设置为 0, PlayResX 将基于 res_y 设置,使得虚拟 ASS 像素具有正方形像素宽高比。- none
- Special value that causes the overlay to be removed. Most parameters
other than id and format are mostly ignored.
导致覆盖层被移除的特殊值。除了 id 和 format 之外的大多数参数通常被忽略。
- data
- String defining the overlay contents according to the format
parameter.
定义根据 format 参数的叠加内容字符串。 - res_x, res_y
- Used if format is set to ass-events (see description there).
Optional, defaults to 0/720.
如果 format 设置为 ass-events (请参阅那里的描述)。可选,默认为 0/720。 - z
The Z order of the overlay. Optional, defaults to 0.
叠加的 Z 调序。可选,默认为 0。Note that Z order between different overlays of different formats is static, and cannot be changed (currently, this means that bitmap overlays added by overlay-add are always on top of the ASS overlays added by osd-overlay). In addition, the builtin OSD components are always below any of the custom OSD. (This includes subtitles of any kind as well as text rendered by show-text.)
请注意,不同格式的不同叠加之间的 Z 调序是静态的,无法更改(目前这意味着由 overlay-add 添加的位图叠加始终位于由 osd-overlay 添加的 ASS 叠加之上)。此外,内置的 OSD 组件始终位于任何自定义 OSD 之下。(这包括任何类型的字幕以及由 show-text 渲染的文本。)It's possible that future mpv versions will randomly change how Z order between different OSD formats and builtin OSD is handled.
未来 mpv 版本可能会随机更改不同 OSD 格式和内置 OSD 之间的 Z 调序处理方式。- hidden
- If set to true, do not display this (default: false).
如果设置为 true,则不显示此内容(默认:false)。 - compute_bounds
If set to true, attempt to determine bounds and write them to the command's result value as x0, x1, y0, y1 rectangle (default: false). If the rectangle is empty, not known, or somehow degenerate, it is not set. x1/y1 is the coordinate of the bottom exclusive corner of the rectangle.
如果设置为 true,尝试确定边界并将它们写入命令的结果值作为 x0 , x1 , y0 , y1 矩形(默认:false)。如果矩形为空、未知或以某种方式退化,则不设置。 x1 / y1 是矩形底部非包含角的坐标。The result value may depend on the VO window size, and is based on the last known window size at the time of the call. This means the results may be different from what is actually rendered.
结果值可能取决于 VO 窗口大小,并且基于调用时的最后已知窗口大小。这意味着结果可能与实际渲染的不同。For ass-events, the result rectangle is recomputed to PlayRes coordinates (res_x/res_y). If window size is not known, a fallback is chosen.
对于 ass-events ,结果矩形重新计算为 PlayRes 坐标( res_x / res_y )。如果未知窗口大小,则选择回退选项。You should be aware that this mechanism is very inefficient, as it renders the full result, and then uses the bounding box of the rendered bitmap list (even if hidden is set). It will flush various caches. Its results also depend on the used libass version.
您应该知道,这种机制非常低效,因为它会渲染完整的结果,然后使用渲染的位图列表的边界框(即使 hidden 已设置)。它将刷新各种缓存。其结果还取决于使用的 libass 版本。This feature is experimental, and may change in some way again.
此功能为实验性,可能再次以某种方式发生变化。
Note 注意
Always use named arguments (mpv_command_node()). Lua scripts should use the mp.create_osd_overlay() helper instead of invoking this command directly.
始终使用命名参数( mpv_command_node() )。Lua 脚本应使用 mp.create_osd_overlay() 辅助函数而不是直接调用此命令。
Input and Keybind Commands
输入和按键绑定命令
- mouse <x> <y> [<button> [<mode>]]
Send a mouse event with given coordinate (<x>, <y>).
发送具有给定坐标的鼠标事件( <x> , <y> )。Second argument: 第二个参数:
- <button>
- The button number of clicked mouse button. This should be one of 0-19.
If <button> is omitted, only the position will be updated.
点击鼠标按钮的按钮编号。这应该是 0-19 中的一个。如果省略 <button> ,则只更新位置。
Third argument: 第三个参数:
- <single> (default) <单个>(默认)
- The mouse event represents regular single click.
鼠标事件表示常规单次点击。 - <double>
- The mouse event represents double-click.
鼠标事件表示双击。
- keypress <name> [<scale>]
- Send a key event through mpv's input handler, triggering whatever
behavior is configured to that key. name uses the input.conf
naming scheme for keys and modifiers. scale is used to scale numerical
change effected by the bound command (same mechanism as precise scrolling).
Useful for the client API: key events can be sent to libmpv to handle
internally.
通过 mpv 的输入处理器发送按键事件,触发为该键配置的行为。 name 使用 input.conf 命名方案为键和修饰符。 scale 用于缩放由绑定命令引起的数值变化(与精确滚动的机制相同)。对于客户端 API 很有用:可以将按键事件发送到 libmpv 以内部处理。 - keydown <name>
- Similar to keypress, but sets the KEYDOWN flag so that if the key is
bound to a repeatable command, it will be run repeatedly with mpv's key
repeat timing until the keyup command is called.
类似于 keypress ,但设置 KEYDOWN 标志,以便如果键绑定到可重复命令,它将使用 mpv 的按键重复时间重复运行,直到调用 keyup 命令。 - keyup [<name>]
- Set the KEYUP flag, stopping any repeated behavior that had been
triggered. name is optional. If name is not given or is an
empty string, KEYUP will be set on all keys. Otherwise, KEYUP will
only be set on the key specified by name.
设置 KEYUP 标志,停止任何已被触发的重复行为。 name 是可选的。如果 name 未提供或为空字符串, KEYUP 将设置在所有键上。否则, KEYUP 将仅设置在由 name 指定的键上。 - keybind <name> <cmd> [<comment>]
- Binds a key to an input command. cmd must be a complete command
containing all the desired arguments and flags. Both name and
cmd use the input.conf naming scheme. comment is an optional
string which can be read as the comment entry of input-bindings.
This is primarily useful for the client API.
将一个键绑定到输入命令。 cmd 必须是一个包含所有所需参数和标志的完整命令。 name 和 cmd 都使用 input.conf 命名方案。 comment 是一个可选的字符串,可以读取为 input-bindings 的 comment 条目。这对于客户端 API 主要是有用的。 - enable-section <name> [<flags>]
This command is deprecated, except for mpv-internal uses.
此命令已弃用,除了 mpv 内部使用。Enable all key bindings in the named input section.
启用命名输入部分中的所有键绑定。The enabled input sections form a stack. Bindings in sections on the top of the stack are preferred to lower sections. This command puts the section on top of the stack. If the section was already on the stack, it is implicitly removed beforehand. (A section cannot be on the stack more than once.)
启用的输入部分形成一个堆栈。堆栈顶部的部分绑定优先于较低部分。此命令将部分置于堆栈顶部。如果部分已经在堆栈中,则它将隐式删除。 (部分不能在堆栈中出现多次。)The flags parameter can be a combination (separated by +) of the following flags:
flags 参数可以是以下标志的组合(由 + 分隔):- <exclusive> <独家>
- All sections enabled before the newly enabled section are disabled.
They will be re-enabled as soon as all exclusive sections above them
are removed. In other words, the new section shadows all previous
sections.
在新的启用部分之前启用的所有部分都被禁用。一旦移除它们上面的所有独占部分,它们将立即重新启用。换句话说,新部分会覆盖所有先前的部分。 - <allow-hide-cursor> <允许隐藏光标>
- This feature can't be used through the public API.
此功能无法通过公共 API 使用。 - <allow-vo-dragging> <允许-vo-拖动>
- Same. 相同。
- disable-section <name>
This command is deprecated, except for mpv-internal uses.
此命令已弃用,除了 mpv 内部使用。Disable the named input section. Undoes enable-section.
禁用指定的输入部分。撤销 enable-section 。- define-section <name> <contents> [<flags>]
This command is deprecated, except for mpv-internal uses.
此命令已弃用,除了 mpv 内部使用。Create a named input section, or replace the contents of an already existing input section. The contents parameter uses the same syntax as the input.conf file (except that using the section syntax in it is not allowed), including the need to separate bindings with a newline character.
创建一个命名的输入部分,或替换已存在的输入部分的内容。 contents 参数使用与 input.conf 文件相同的语法(除了在其中使用部分语法是不允许的),包括需要使用换行符分隔绑定。If the contents parameter is an empty string, the section is removed.
如果 contents 参数是一个空字符串,则删除该部分。The section with the name default is the normal input section.
名为 default 的部分是正常输入部分。In general, input sections have to be enabled with the enable-section command, or they are ignored.
通常,必须使用 enable-section 命令启用输入部分,否则它们将被忽略。The last parameter has the following meaning:
最后一个参数具有以下含义:- <default> (also used if parameter omitted)
<默认>(如果省略参数也使用此设置) - Use a key binding defined by this section only if the user hasn't
already bound this key to a command.
只有当用户尚未将此键绑定到命令时,才使用本节定义的键绑定。 - <force> <强制>
- Always bind a key. (The input section that was made active most recently
wins if there are ambiguities.)
始终绑定一个键。(如果有歧义,最近激活的输入部分将获胜。)
This command can be used to dispatch arbitrary keys to a script or a client API user. If the input section defines script-binding commands, it is also possible to get separate events on key up/down, and relatively detailed information about the key state. The special key name unmapped can be used to match any unmapped key.
此命令可用于将任意键派发到脚本或客户端 API 用户。如果输入部分定义了 script-binding 命令,还可以获取按键上下时的单独事件,以及关于按键状态的相对详细信息。特殊键名 unmapped 可用于匹配任何未映射的键。- <default> (also used if parameter omitted)
- load-input-conf <filename>
- Load an input configuration file, similar to the --input-conf option. If
the file was already included, its previous bindings are not reset before it
is reparsed.
加载一个输入配置文件,类似于 --input-conf 选项。如果文件已经被包含,则在重新解析之前不会重置其之前的绑定。
Execution Commands 执行命令
- run <command> [<arg1> [<arg2> [...]]]
Run the given command. Unlike in MPlayer/mplayer2 and earlier versions of mpv (0.2.x and older), this doesn't call the shell. Instead, the command is run directly, with each argument passed separately. Each argument is expanded like in Property Expansion.
运行指定的命令。与 MPlayer/mplayer2 以及 mpv(0.2.x 及更早版本)不同,此命令不调用 shell。相反,命令直接运行,每个参数单独传递。每个参数的展开方式与属性展开类似。This command has a variable number of arguments, and cannot be used with named arguments.
此命令具有可变数量的参数,并且不能与命名参数一起使用。The program is run in a detached way. mpv doesn't wait until the command is completed, but continues playback right after spawning it.
程序以分离的方式运行。mpv 不会等待命令完成,而是在启动后立即继续播放。To get the old behavior, use /bin/sh and -c as the first two arguments.
要获取旧行为,请使用 /bin/sh 和 -c 作为前两个参数。Example 示例
run "/bin/sh" "-c" "echo ${title} > /tmp/playing"
This is not a particularly good example, because it doesn't handle escaping, and a specially prepared file might allow an attacker to execute arbitrary shell commands. It is recommended to write a small shell script, and call that with run.
这不是一个特别好的例子,因为它没有处理转义,一个特别准备好的文件可能允许攻击者执行任意 shell 命令。建议编写一个小 shell 脚本,并使用 run 来调用它。- subprocess
Similar to run, but gives more control about process execution to the caller, and does not detach the process.
类似于 run ,但给调用者提供了更多关于进程执行的控制,并且不会使进程分离。You can avoid blocking until the process terminates by running this command asynchronously. (For example mp.command_native_async() in Lua scripting.)
您可以通过异步运行此命令来避免在进程终止前阻塞。(例如,在 Lua 脚本中使用 mp.command_native_async() 。)This has the following named arguments. The order of them is not guaranteed, so you should always call them with named arguments, see Named arguments.
以下是有名参数。它们的顺序没有保证,因此您应该始终使用有名参数调用它们,参见有名参数。- args (MPV_FORMAT_NODE_ARRAY[MPV_FORMAT_STRING])
Array of strings with the command as first argument, and subsequent command line arguments following. This is just like the run command argument list.
以命令作为第一个参数的字符串数组,后续的命令行参数依次排列。这就像 run 命令参数列表。The first array entry is either an absolute path to the executable, or a filename with no path components, in which case the executable is searched in the directories in the PATH environment variable. On Unix, this is equivalent to posix_spawnp and execvp behavior.
第一个数组条目要么是可执行文件的绝对路径,要么是不包含路径组件的文件名,在这种情况下,可执行文件将在 PATH 环境变量中指定的目录中进行搜索。在 Unix 上,这相当于 posix_spawnp 和 execvp 的行为。- playback_only (MPV_FORMAT_FLAG)
- Boolean indicating whether the process should be killed when playback
of the current playlist entry terminates (optional, default: true). If
enabled, stopping playback will automatically kill the process, and you
can't start it outside of playback.
布尔值,表示是否应在当前播放列表条目播放结束后杀死进程(可选,默认:true)。如果启用,停止播放将自动杀死进程,并且您不能在播放之外启动它。 - capture_size (MPV_FORMAT_INT64)
- Integer setting the maximum number of stdout plus stderr bytes that can
be captured (optional, default: 64MB). If the number of bytes exceeds
this, capturing is stopped. The limit is per captured stream.
整数设置可捕获的最大 stdout 加 stderr 字节数(可选,默认:64MB)。如果字节数超过此限制,则停止捕获。此限制适用于每个捕获流。 - capture_stdout (MPV_FORMAT_FLAG)
- Capture all data the process outputs to stdout and return it once the
process ends (optional, default: no).
捕获进程输出到 stdout 的所有数据,并在进程结束时返回(可选,默认:否)。 - capture_stderr (MPV_FORMAT_FLAG)
- Same as capture_stdout, but for stderr.
与 capture_stdout 相同,但针对 stderr。 - detach (MPV_FORMAT_FLAG)
- Whether to run the process in detached mode (optional, default: no). In
this mode, the process is run in a new process session, and the command
does not wait for the process to terminate. If neither
capture_stdout nor capture_stderr have been set to true,
the command returns immediately after the new process has been started,
otherwise the command will read as long as the pipes are open.
是否以分离模式运行进程(可选,默认:否)。在此模式下,进程将在新的进程会话中运行,命令不会等待进程终止。如果 neither capture_stdout nor capture_stderr 都未设置为 true,则命令在启动新进程后立即返回,否则命令将一直读取,直到管道打开。 - env (MPV_FORMAT_NODE_ARRAY[MPV_FORMAT_STRING])
Set a list of environment variables for the new process (default: empty). If an empty list is passed, the environment of the mpv process is used instead. (Unlike the underlying OS mechanisms, the mpv command cannot start a process with empty environment. Fortunately, that is completely useless.) The format of the list is as in the execle() syscall. Each string item defines an environment variable as in NAME=VALUE.
为新的进程设置环境变量列表(默认:空)。如果传递空列表,则使用 mpv 进程的环境。 (与底层 OS 机制不同,mpv 命令不能以空环境启动进程。幸运的是,这完全没有用。)列表的格式与 execle() 系统调用中的格式相同。每个字符串项定义一个环境变量,如 NAME=VALUE 。On Lua, you may use utils.get_env_list() to retrieve the current environment if you e.g. simply want to add a new variable.
在 Lua 中,您可以使用 utils.get_env_list() 来获取当前环境,如果您只是想简单地添加一个新变量,例如。- stdin_data (MPV_FORMAT_STRING)
- Feed the given string to the new process' stdin. Since this is a string,
you cannot pass arbitrary binary data. If the process terminates or
closes the pipe before all data is written, the remaining data is
silently discarded. Probably does not work on win32.
将给定的字符串传递给新进程的 stdin。由于这是一个字符串,您不能传递任意二进制数据。如果进程在所有数据写入之前终止或关闭管道,剩余的数据将被静默丢弃。可能不适用于 win32。 - passthrough_stdin (MPV_FORMAT_FLAG)
- If enabled, wire the new process' stdin to mpv's stdin (default: no).
Before mpv 0.33.0, this argument did not exist, but the behavior was as
if this was set to true.
如果启用,将新进程的 stdin 连接到 mpv 的 stdin(默认:否)。在 mpv 0.33.0 之前,此参数不存在,但行为与设置为 true 时相同。
The command returns the following result (as MPV_FORMAT_NODE_MAP):
命令返回以下结果(如 MPV_FORMAT_NODE_MAP ):- status (MPV_FORMAT_INT64)
Typically this is the process exit code (0 or positive) if the process terminates normally, or negative for other errors (failed to start, terminated by mpv, and others). The meaning of negative values is undefined, other than meaning error (and does not correspond to OS low level exit status values).
通常情况下,这是进程退出代码(0 或正数),如果进程正常终止,或者为其他错误(启动失败、由 mpv 终止等)返回负数。负数的意义未定义,除了表示错误(且不对应于操作系统低级退出状态值)。On Windows, it can happen that a negative return value is returned even if the process terminates normally, because the win32 UINT exit code is assigned to an int variable before being set as int64_t field in the result map. This might be fixed later.
在 Windows 上,即使进程正常终止,也可能返回负数,因为 win32 UINT 退出代码在设置结果映射中的 int 字段之前被分配给 int64_t 变量。这可能在以后得到修复。- stdout (MPV_FORMAT_BYTE_ARRAY)
- Captured stdout stream, limited to capture_size.
捕获的 stdout 流,限制为 capture_size 。 - stderr (MPV_FORMAT_BYTE_ARRAY)
- Same as stdout, but for stderr.
与 stdout 相同,但针对 stderr。 - error_string (MPV_FORMAT_STRING)
Empty string if the process terminated normally. The string killed if the process was terminated in an unusual way. The string init if the process could not be started.
如果进程正常终止,则为空字符串。如果进程以非正常方式终止,则为字符串 killed 。如果进程无法启动,则为字符串 init 。On Windows, killed is only returned when the process has been killed by mpv as a result of playback_only being set to true.
在 Windows 上,只有当进程因 playback_only 设置为 true 而被 mpv 杀死时,才会返回 killed 。- killed_by_us (MPV_FORMAT_FLAG)
- Whether the process has been killed by mpv, for example as a result of
playback_only being set to true, aborting the command (e.g. by
mp.abort_async_command()), or if the player is about to exit.
进程是否被 mpv 杀死,例如,由于 playback_only 设置为 true,中止命令(例如通过 mp.abort_async_command() ),或者如果播放器即将退出。
Note that the command itself will always return success as long as the parameters are correct. Whether the process could be spawned or whether it was somehow killed or returned an error status has to be queried from the result value.
请注意,只要参数正确,命令本身总是会返回成功。是否能够启动进程或是否以某种方式被杀死或返回错误状态,必须从结果值中查询。This command can be asynchronously aborted via API. Also see Asynchronous command details. Only the run command can start processes in a truly detached way.
此命令可以通过 API 异步取消。另请参阅异步命令详情。只有 run 命令可以以真正分离的方式启动进程。Note 注意
The subprocess will always be terminated on player exit if it wasn't started in detached mode, even if playback_only is false.
子进程将在玩家退出时始终被终止,即使它没有在分离模式下启动,即使 playback_only 为假。Warning 警告
Don't forget to set the playback_only field to false if you want the command to run while the player is in idle mode, or if you don't want the end of playback to kill the command.
如果您想在玩家处于空闲模式时运行命令,或者不希望播放结束时终止命令,请务必将 playback_only 字段设置为假。Example 示例
local r = mp.command_native({ name = "subprocess", playback_only = false, capture_stdout = true, args = {"cat", "/proc/cpuinfo"}, }) if r.status == 0 then print("result: " .. r.stdout) end
This is a fairly useless Lua example, which demonstrates how to run a process in a blocking manner, and retrieving its stdout output.
这是一个相当无用的 Lua 示例,演示了如何以阻塞方式运行进程,并检索其 stdout 输出。- quit [<code>]
- Exit the player. If an argument is given, it's used as process exit code.
退出播放器。如果提供了参数,则用作进程退出代码。 - quit-watch-later [<code>]
- Exit player, and store current playback position. Playing that file later
will seek to the previous position on start. The (optional) argument is
exactly as in the quit command. See RESUMING PLAYBACK.
退出玩家,并存储当前播放位置。稍后播放该文件时将在启动时跳转到上一个位置。(可选)参数与 quit 命令中的参数完全相同。请参阅“恢复播放”。
Scripting Commands 脚本命令
- script-message [<arg1> [<arg2> [...]]]
Send a message to all clients, and pass it the following list of arguments. What this message means, how many arguments it takes, and what the arguments mean is fully up to the receiver and the sender. Every client receives the message, so be careful about name clashes (or use script-message-to).
向所有客户端发送消息,并传递以下参数列表。此消息的含义、所需参数数量以及参数的含义完全取决于接收者和发送者。每个客户端都会接收到此消息,因此请小心处理名称冲突(或使用 script-message-to )。This command has a variable number of arguments, and cannot be used with named arguments.
此命令具有可变数量的参数,并且不能与命名参数一起使用。- script-message-to <target> [<arg1> [<arg2> [...]]]
Same as script-message, but send it only to the client named <target>. Each client (scripts etc.) has a unique name. For example, Lua scripts can get their name via mp.get_script_name(). Note that client names only consist of alphanumeric characters and _.
与 script-message 相同,但只发送给名为 <target> 的客户端。每个客户端(脚本等)都有一个唯一名称。例如,Lua 脚本可以通过 mp.get_script_name() 获取其名称。请注意,客户端名称仅由字母数字字符和 _ 组成。This command has a variable number of arguments, and cannot be used with named arguments.
此命令具有可变数量的参数,并且不能与命名参数一起使用。- script-binding <name> [<arg>]
Invoke a script-provided key binding. This can be used to remap key bindings provided by external Lua scripts.
调用脚本提供的键绑定。这可以用来重新映射外部 Lua 脚本提供的键绑定。<name> is the name of the binding. <arg> is a user-provided arbitrary string which can be used to provide extra information.
<name> 是绑定的名称。 <arg> 是用户提供的任意字符串,可以用来提供额外信息。It can optionally be prefixed with the name of the script, using / as separator, e.g. script-binding scriptname/bindingname. Note that script names only consist of alphanumeric characters and _.
可以可选地使用脚本名称作为前缀,使用 / 作为分隔符,例如 script-binding scriptname/bindingname 。请注意,脚本名称仅由字母数字字符组成,并且 _ 。For completeness, here is how this command works internally. The details could change any time. On any matching key event, script-message-to or script-message is called (depending on whether the script name is included), with the following arguments in string format:
为了完整性,以下是该命令内部的工作方式。详细信息可能会随时更改。在任何匹配的关键事件上, script-message-to 或 script-message 被调用(取决于是否包含脚本名称),以下参数以字符串格式传递:- The string key-binding. 字符串 key-binding 。
- The name of the binding (as established above).
绑定名称(如上所述)。 - The key state as string (see below).
作为字符串的关键状态(见下文)。 - The key name (since mpv 0.15.0).
关键名称(自 mpv 0.15.0 以来)。 - The text the key would produce, or empty string if not applicable.
键将生成的文本,如果不适用则为空字符串。 - The scale of the key, such as the ones produced by WHEEL_* keys.
The scale is 1 if the key is nonscalable.
键的规模,例如由 WHEEL_* 键产生的那些。如果键不可缩放,则规模为 1。 - The user-provided string <arg>, or empty string if the argument is
not used.
用户提供的字符串 <arg> ,如果没有使用参数则为空字符串。
The 5th argument is only set if no modifiers are present (using the shift key with a letter is normally not emitted as having a modifier, and results in upper case text instead, but some backends may mess up).
如果不存在修饰符,则仅设置第 5 个参数(使用字母与 shift 键一起通常不被视为有修饰符,并导致文本变为大写,但某些后端可能会出错)。The key state consists of 3 characters:
键状态由 3 个字符组成:- One of d (key was pressed down), u (was released), r (key
is still down, and was repeated; only if key repeat is enabled for this
binding), p (key was pressed; happens if up/down can't be tracked).
其中之一 d (按键被按下), u (被释放), r (按键仍然按下,并且被重复;只有在此绑定启用了按键重复时), p (按键被按下;如果无法跟踪上/下,则会发生)。 - Whether the event originates from the mouse, either m (mouse button)
or - (something else).
事件是否来自鼠标,无论是 m (鼠标按钮)还是 - (其他事物)。 - Whether the event results from a cancellation (e.g. the key is logically
released but not physically released), either c (canceled) or -
(something else). Not all types of cancellations set this flag.
事件是否由取消操作(例如,按键在逻辑上被释放但未物理释放)引起,无论是 c (已取消)还是 - (其他事物)。并非所有类型的取消都会设置此标志。
Future versions can add more arguments and more key state characters to support more input peculiarities.
未来的版本可以添加更多参数和更多按键状态字符,以支持更多输入特性。This is a scalable command. See the documentation of nonscalable input command prefix in Input Command Prefixes for details.
这是一个可扩展的命令。请参阅文档中关于 nonscalable 输入命令前缀的详细信息。- load-script <filename>
Load a script, similar to the --script option. Whether this waits for the script to finish initialization or not changed multiple times, and the future behavior is left undefined.
加载脚本,类似于 --script 选项。是否等待脚本完成初始化,以及这一行为是否多次更改,未来的行为尚未定义。On success, returns a mpv_node with a client_id field set to the return value of the mpv_client_id() API call of the newly created script handle.
成功时,返回一个包含设置有新创建脚本句柄的 mpv_client_id() API 调用返回值的 mpv_node 字段的 client_id 。
Screenshot Commands 截图命令
- screenshot [<flags>]
Take a screenshot. 截取屏幕截图。
Multiple flags are available (some can be combined with +):
有多个标志可用(一些可以与 + 结合使用):- <subtitles> (default) <字幕>(默认)
- Save the video image, in its original resolution, and with subtitles.
Some video outputs may still include the OSD in the output under certain
circumstances.
保存视频图像,保持原始分辨率,并添加字幕。在某些情况下,某些视频输出可能仍然包含 OSD。 - <video> <视频>
- Like subtitles, but typically without OSD or subtitles. The exact
behavior depends on the selected video output.
类似于 subtitles ,但通常不包含 OSD 或字幕。确切的行为取决于所选的视频输出。 - <window> <窗口>
- Save the contents of the mpv window. Typically scaled, with OSD and
subtitles. The exact behavior depends on the selected video output.
保存 mpv 窗口的全部内容。通常缩放,包含 OSD 和字幕。具体行为取决于选定的视频输出。 - <each-frame> <每个帧>
- Take a screenshot each frame. Issue this command again to stop taking
screenshots. Note that you should disable frame-dropping when using
this mode - or you might receive duplicate images in cases when a
frame was dropped. This flag can be combined with the other flags,
e.g. video+each-frame.
每帧都截取一张屏幕截图。再次运行此命令以停止截取屏幕截图。请注意,在使用此模式时应禁用帧丢弃 - 否则,在帧被丢弃的情况下可能会收到重复的图像。此标志可以与其他标志结合使用,例如 video+each-frame 。
Older mpv versions required passing single and each-frame as second argument (and did not have flags). This syntax is still understood, but deprecated and might be removed in the future.
较旧的 mpv 版本需要将 single 和 each-frame 作为第二个参数传递(并且没有标志)。此语法仍然被理解,但已弃用,并且可能在将来被删除。If you combine this command with another one using ;, you can use the async flag to make encoding/writing the image file asynchronous. For normal standalone commands, this is always asynchronous, and the flag has no effect. (This behavior changed with mpv 0.29.0.)
如果您将此命令与其他命令结合使用 ; ,则可以使用 async 标志使编码/写入图像文件异步。对于正常的独立命令,这始终是异步的,并且该标志没有效果。(此行为在 mpv 0.29.0 版本中已更改。)On success, returns a mpv_node with a filename field set to the saved screenshot location.
成功时,返回一个包含 filename 字段设置为保存的屏幕截图位置的 mpv_node 。- screenshot-to-file <filename> [<flags>]
Take a screenshot and save it to a given file. The format of the file will be guessed by the extension (and --screenshot-format is ignored - the behavior when the extension is missing or unknown is arbitrary).
截取屏幕截图并将其保存到指定的文件。文件的格式将通过扩展名来猜测(并且 --screenshot-format 被忽略 - 当扩展名缺失或未知时的行为是任意的)。The second argument is like the first argument to screenshot and supports subtitles, video, window.
第二个参数类似于第一个参数到 screenshot ,并支持 subtitles , video , window 。If the file already exists, it's overwritten.
如果文件已存在,则会被覆盖。Like all input command parameters, the filename is subject to property expansion as described in Property Expansion.
与所有输入命令参数一样,文件名将受到属性扩展的影响,如属性扩展中所述。- screenshot-raw [<flags> [<format>]]
Return a screenshot in memory. This can be used only through the client API. The MPV_FORMAT_NODE_MAP returned by this command has the w, h, stride fields set to obvious contents.
返回内存中的截图。这只能通过客户端 API 使用。此命令返回的 MPV_FORMAT_NODE_MAP 具有 w 、 h 、 stride 字段设置为明显内容。The format field is set to the format of the screenshot image data. This can be controlled by the format argument. The format can be one of the following:
format 字段设置为截图图像数据的格式。这可以通过 format 参数控制。格式可以是以下之一:- bgr0 (default) bgr0 (默认)
- This format is organized as B8G8R8X8 (where B is the LSB).
The contents of the padding X are undefined.
此格式组织为 B8G8R8X8 (其中 B 是 LSB)。填充 X 的内容未定义。 - bgra
- This format is organized as B8G8R8A8 (where B is the LSB).
此格式组织为 B8G8R8A8 (其中 B 是 LSB)。 - rgba
- This format is organized as R8G8B8A8 (where R is the LSB).
此格式组织为 R8G8B8A8 (其中 R 是 LSB)。 - rgba64
- This format is organized as R16G16B16A16 (where R is the LSB).
Each component occupies 2 bytes per pixel.
When this format is used, the image data will be high bit depth, and
--screenshot-high-bit-depth is ignored.
此格式组织为 R16G16B16A16 (其中 R 是 LSB)。每个组件占用每像素 2 个字节。当使用此格式时,图像数据将具有高比特深度,且 --screenshot-high-bit-depth 被忽略。
The data field is of type MPV_FORMAT_BYTE_ARRAY with the actual image data. The image is freed as soon as the result mpv_node is freed. As usual with client API semantics, you are not allowed to write to the image data.
The stride is the number of bytes from a pixel at (x0, y0) to the pixel at (x0, y0 + 1). This can be larger than w * bpp if the image was cropped, or if there is padding. This number can be negative as well. You access a pixel with byte_index = y * stride + x * bpp. Here, bpp is the number of bytes per pixel, which is 8 for rgba64 format and 4 for other formats.
The flags argument is like the first argument to screenshot and supports subtitles, video, window.
Filter Commands
- af <operation> <value>
- Change audio filter chain. See vf command.
- vf <operation> <value>
Change video filter chain.
The semantics are exactly the same as with option parsing (see VIDEO FILTERS). As such the text below is a redundant and incomplete summary.
语义与选项解析完全相同(参见 VIDEO FILTERS)。因此,下面的文本是冗余且不完整的摘要。The first argument decides what happens:
第一个参数决定发生什么:- <set> <集合>
- Overwrite the previous filter chain with the new one.
用新的过滤器链覆盖之前的过滤器链。 - <add> <添加>
- Append the new filter chain to the previous one.
将新的过滤器链追加到上一个链中。 - <toggle> <切换>
Check if the given filter (with the exact parameters) is already in the video chain. If it is, remove the filter. If it isn't, add the filter. (If several filters are passed to the command, this is done for each filter.)
检查给定的过滤器(带有精确的参数)是否已经在视频链中。如果是,则删除该过滤器。如果不是,则添加该过滤器。(如果命令传递了多个过滤器,则对每个过滤器都执行此操作。)A special variant is combining this with labels, and using @name without filter name and parameters as filter entry. This toggles the enable/disable flag.
一个特殊变体是将此与标签结合使用,并使用 @name (不带过滤器名称和参数)作为过滤器条目。这切换启用/禁用标志。- <remove> <删除>
- Like toggle, but always remove the given filter from the chain.
类似于 toggle ,但始终从链中移除指定的过滤器。 - <clr>
- Remove all filters. Note that like the other sub-commands, this does
not control automatically inserted filters.
移除所有过滤器。注意,与其他子命令一样,这不会控制自动插入的过滤器。
The argument is always needed. E.g. in case of clr use vf clr "".
参数总是需要的。例如,在 clr 的情况下使用 vf clr "" 。You can assign labels to filter by prefixing them with @name: (where name is a user-chosen arbitrary identifier). Labels can be used to refer to filters by name in all of the filter chain modification commands. For add, using an already used label will replace the existing filter.
您可以通过在前面加上 @name: (其中 name 是用户选择的任意标识符) 来分配标签以进行筛选。标签可用于在所有筛选链修改命令中通过名称引用筛选器。对于 add ,使用已使用的标签将替换现有筛选器。The vf command shows the list of requested filters on the OSD after changing the filter chain. This is roughly equivalent to show-text ${vf}. Note that auto-inserted filters for format conversion are not shown on the list, only what was requested by the user.
The vf 命令显示在更改筛选链后 OSD 上的请求筛选器列表。这大致相当于 show-text ${vf} 。请注意,格式转换自动插入的筛选器不会显示在列表中,只有用户请求的内容。Normally, the commands will check whether the video chain is recreated successfully, and will undo the operation on failure. If the command is run before video is configured (can happen if the command is run immediately after opening a file and before a video frame is decoded), this check can't be run. Then it can happen that creating the video chain fails.
通常,命令将检查视频链是否成功重建,并在失败时撤销操作。如果在视频配置之前运行命令(如果命令在打开文件后立即运行且在解码视频帧之前,这种情况可能发生),则无法执行此检查。然后可能会发生创建视频链失败的情况。Example for input.conf input.conf 的示例
- a vf set vflip turn the video upside-down on the a key
a vf set vflip 在 a 键上翻转视频 - b vf set "" remove all video filters on b
b vf set "" 在 b 上移除所有视频过滤器 - c vf toggle gradfun toggle debanding on c
c vf toggle gradfun 在 c 上切换去杂色
Example how to toggle disabled filters at runtime
示例如何在实际运行时切换禁用过滤器- Add something like vf-add=@deband:!gradfun to mpv.conf.
The @deband: is the label, an arbitrary, user-given name for this
filter entry. The ! before the filter name disables the filter by
default. Everything after this is the normal filter name and possibly
filter parameters, like in the normal --vf syntax.
添加类似于 vf-add=@deband:!gradfun 到 mpv.conf 。 @deband: 是标签,是用户为这个过滤器条目提供的任意名称。 ! 在过滤器名称之前默认禁用过滤器。此之后是正常的过滤器名称,以及可能的过滤器参数,类似于正常的 --vf 语法。 - Add a vf toggle @deband to input.conf. This toggles the
"disabled" flag for the filter with the label deband when the
a key is hit.
添加 a vf toggle @deband 到 input.conf 。当按下 a 键时,这会切换标签为 deband 的过滤器的 "禁用" 标志。
- vf-command <label> <command> <argument> [<target>]
Send a command to the filter. Note that currently, this only works with the lavfi filter. Refer to the libavfilter documentation for the list of supported commands for each filter.
发送命令到过滤器。注意,目前这仅适用于 lavfi 过滤器。有关每个过滤器支持的命令列表,请参阅 libavfilter 文档。<label> is a mpv filter label, use all to send it to all filters at once.
<label> 是一个 mpv 过滤器标签,使用 all 一次性将其发送到所有过滤器。<command> and <argument> are filter-specific strings.
<command> 和 <argument> 是特定于过滤器的字符串。<target> is a filter or filter instance name and defaults to all. Note that the target is an additional specifier for filters that support them, such as complex lavfi filter chains.
<target> 是一个过滤器或过滤器实例名称,默认为 all 。请注意,目标是支持它们的过滤器的附加指定符,例如复杂的 lavfi 过滤器链。- af-command <label> <command> <argument> [<target>]
- Same as vf-command, but for audio filters.
与 vf-command 相同,但用于音频过滤器。
Miscellaneous Commands 杂项命令
- ignore
- Use this to "block" keys that should be unbound, and do nothing. Useful for
disabling default bindings, without disabling all bindings with
--input-default-bindings=no.
使用此功能来“锁定”应解除绑定的键,不执行任何操作。用于禁用默认绑定,而不禁用所有绑定(使用 --input-default-bindings=no )。 - drop-buffers
- Drop audio/video/demuxer buffers, and restart from fresh. Might help with
unseekable streams that are going out of sync.
This command might be changed or removed in the future.
丢弃音频/视频/解复用器缓冲区,并从新开始。可能有助于处理即将出错的无法定位的流。此命令可能在将来被更改或删除。 - dump-cache <start> <end> <filename>
Dump the current cache to the given filename. The <filename> file is overwritten if it already exists. <start> and <end> give the time range of what to dump. If no data is cached at the given time range, nothing may be dumped (creating a file with no packets).
将当前缓存输出到指定的文件名。如果 <filename> 文件已存在,则会被覆盖。 <start> 和 <end> 指定要输出的时间范围。如果指定的时间范围内没有缓存数据,则可能不会输出任何内容(创建一个没有数据包的文件)。Dumping a larger part of the cache will freeze the player. No effort was made to fix this, as this feature was meant mostly for creating small excerpts.
导出较大部分的缓存将使玩家冻结。没有努力修复这个问题,因为这个功能主要是为了创建小片段。See --stream-record for various caveats that mostly apply to this command too, as both use the same underlying code for writing the output file.
参见 --stream-record 了解对该命令也大多适用的各种注意事项,因为它们都使用相同的底层代码来写入输出文件。If <filename> is an empty string, an ongoing dump-cache is stopped.
如果 <filename> 是空字符串,则正在进行的 dump-cache 将被停止。If <end> is no, then continuous dumping is enabled. Then, after dumping the existing parts of the cache, anything read from network is appended to the cache as well. This behaves similar to --stream-record (although it does not conflict with that option, and they can be both active at the same time).
如果 <end> 是 no ,则启用连续导出。然后,在导出现有缓存部分之后,从网络读取的任何内容也将附加到缓存中。这的行为类似于 --stream-record (尽管它不与该选项冲突,并且它们可以同时激活)。If the <end> time is after the cache, the command will _not_ wait and write newly received data to it.
如果 <end> 时间在缓存之后,则命令将不会等待并将新接收到的数据写入其中。The end of the resulting file may be slightly damaged or incomplete at the end. (Not enough effort was made to ensure that the end lines up properly.)
结果文件的末尾可能略有损坏或不完整。(没有足够努力确保末尾正确对齐。)Note that this command will finish only once dumping ends. That means it works similar to the screenshot command, just that it can block much longer. If continuous dumping is used, the command will not finish until playback is stopped, an error happens, another dump-cache command is run, or an API like mp.abort_async_command was called to explicitly stop the command. See Synchronous vs. Asynchronous.
请注意,此命令仅在转储完成后才会结束。这意味着它的工作方式类似于 screenshot 命令,只是它可以阻塞更长的时间。如果使用连续转储,则命令将不会结束,直到回放停止、发生错误、运行另一个 dump-cache 命令或调用类似 mp.abort_async_command 的 API 以显式停止命令。请参阅同步与异步。Note 注意
This was mostly created for network streams. For local files, there may be much better methods to create excerpts and such. There are tons of much more user-friendly Lua scripts, that will re-encode parts of a file by spawning a separate instance of ffmpeg. With network streams, this is not that easily possible, as the stream would have to be downloaded again. Even if --stream-record is used to record the stream to the local filesystem, there may be problems, because the recorded file is still written to.
这主要是为网络流创建的。对于本地文件,可能有更好的方法来创建摘录等。有大量的更用户友好的 Lua 脚本,可以通过启动一个单独的 ffmpeg 实例来重新编码文件的部分。对于网络流,这并不容易实现,因为流需要再次下载。即使使用 --stream-record 将流记录到本地文件系统,也可能存在问题,因为记录的文件仍然会被写入。This command is experimental, and all details about it may change in the future.
此命令是实验性的,其所有详细信息可能在将来发生变化。- ab-loop
- Cycle through A-B loop states. The first command will set the A point
(the ab-loop-a property); the second the B point, and the third
will clear both points.
循环通过 A-B 状态。第一个命令将设置 A 点(即 ab-loop-a 属性);第二个命令设置 B 点,第三个命令将清除这两个点。 - ab-loop-dump-cache <filename>
Essentially calls dump-cache with the current AB-loop points as arguments. Like dump-cache, this will overwrite the file at <filename>. Likewise, if the B point is set to no, it will enter continuous dumping after the existing cache was dumped.
基本上调用 dump-cache 并以当前 AB-loop 点作为参数。像 dump-cache 一样,这将覆盖 <filename> 中的文件。同样,如果 B 点设置为 no ,它将在现有缓存已导出后进入连续导出模式。The author reserves the right to remove this command if enough motivation is found to move this functionality to a trivial Lua script.
作者保留在找到足够动机将此功能移至简单的 Lua 脚本的情况下删除此命令的权利。- ab-loop-align-cache
Re-adjust the A/B loop points to the start and end within the cache the ab-loop-dump-cache command will (probably) dump. Basically, it aligns the times on keyframes. The guess might be off especially at the end (due to granularity issues due to remuxing). If the cache shrinks in the meantime, the points set by the command will not be the effective parameters either.
重新调整 A/B loop 点,使其在 ab-loop-dump-cache 命令(可能)导出的缓存内的开始和结束位置。基本上,它使关键帧上的时间对齐。由于重新混流的粒度问题,猜测可能不准确,尤其是在结尾处。如果在同时缓存缩小,该命令设置的点也不会是有效的参数。This command has an even more uncertain future than ab-loop-dump-cache and might disappear without replacement if the author decides it's useless.
此命令的未来比 ab-loop-dump-cache 更加不确定,如果作者认为它无用,可能会消失而不再替换。- begin-vo-dragging
- Begin window dragging if supported by the current VO. This command should
only be called while a mouse button is being pressed, otherwise it will
be ignored. The exact effect of this command depends on the VO implementation
of window dragging. For example, on Windows and macOS only the left mouse
button can begin window dragging, while X11 and Wayland allow other mouse
buttons.
如果当前 VO 支持,则开始窗口拖动。此命令应在鼠标按钮被按下时调用,否则将被忽略。此命令的确切效果取决于 VO 对窗口拖动的实现。例如,在 Windows 和 macOS 上,只有左鼠标按钮可以开始窗口拖动,而 X11 和 Wayland 允许其他鼠标按钮。 - context-menu
- Show context menu on the video window. See Context Menu section for details.
在视频窗口上显示上下文菜单。有关详细信息,请参阅上下文菜单部分。
Undocumented commands: ao-reload (experimental/internal).
未记录的命令: ao-reload (实验性/内部)。
List of events 事件列表
This is a partial list of events. This section describes what
mpv_event_to_node() returns, and which is what scripting APIs and the JSON
IPC sees. Note that the C API has separate C-level declarations with
mpv_event, which may be slightly different.
这是事件的部分列表。本节描述了 mpv_event_to_node() 返回的内容,以及脚本 API 和 JSON IPC 所看到的内容。请注意,C API 有与 mpv_event 不同的单独的 C 级声明,可能略有不同。
Note that events are asynchronous: the player core continues running while
events are delivered to scripts and other clients. In some cases, you can use
hooks to enforce synchronous execution.
请注意,事件是异步的:在将事件传递给脚本和其他客户端时,玩家核心继续运行。在某些情况下,您可以使用钩子强制同步执行。
All events can have the following fields:
所有事件都可以包含以下字段:
- event
- Name as the event (as returned by mpv_event_name()).
事件名称(由 mpv_event_name() 返回)。 - id
- The reply_userdata field (opaque user value). If reply_userdata is 0,
the field is not added.
reply_userdata 字段(不透明用户值)。如果 reply_userdata 为 0,则不添加该字段。 - error
- Set to an error string (as returned by mpv_error_string()). This field
is missing if no error happened, or the event type does not report error.
Most events leave this unset.
设置为错误字符串(由 mpv_error_string() 返回)。如果没有发生错误或事件类型不报告错误,则该字段不存在。大多数事件都未设置此字段。
This list uses the event name field value, and the C API symbol in brackets:
此列表使用事件名称字段值,以及方括号中的 C API 符号:
- start-file (MPV_EVENT_START_FILE)
Happens right before a new file is loaded. When you receive this, the player is loading the file (or possibly already done with it).
就在新文件加载之前发生。当你收到这个时,播放器正在加载文件(或者可能已经完成了)。This has the following fields:
以下字段:- end-file (MPV_EVENT_END_FILE)
Happens after a file was unloaded. Typically, the player will load the next file right away, or quit if this was the last file.
在文件卸载后发生。通常,玩家会立即加载下一个文件,或者如果这是最后一个文件,则退出。The event has the following fields:
事件具有以下字段:- reason
Has one of these values:
具有以下这些值之一:- eof
- The file has ended. This can (but doesn't have to) include
incomplete files or broken network connections under
circumstances.
文件已结束。这可以(但不一定)包括在特定情况下不完整的文件或损坏的网络连接。 - stop
- Playback was ended by a command.
播放被命令结束。 - quit
- Playback was ended by sending the quit command.
通过发送退出命令结束播放。 - error
- An error happened. In this case, an error field is present with
the error string.
发生错误。在这种情况下,存在一个带有错误字符串的 error 字段。 - redirect
- Happens with playlists and similar. Details see
MPV_END_FILE_REASON_REDIRECT in the C API.
在播放列表和类似情况下发生。详细信息请参阅 C API 中的 MPV_END_FILE_REASON_REDIRECT 。 - unknown
- Unknown. Normally doesn't happen, unless the Lua API is out of sync
with the C API. (Likewise, it could happen that your script gets
reason strings that did not exist yet at the time your script was
written.)
未知。通常不会发生,除非 Lua API 与 C API 不同步。同样,也可能发生你的脚本获得了在脚本编写时还不存在的理由字符串。
- playlist_entry_id
- Playlist entry ID of the file that was being played or attempted to be
played. This has the same value as the playlist_entry_id field in the
corresponding start-file event.
正在播放或尝试播放的文件的播放列表条目 ID。此值与相应 start-file 事件中的 playlist_entry_id 字段相同。 - file_error
- Set to mpv error string describing the approximate reason why playback
failed. Unset if no error known. (In Lua scripting, this value was set
on the error field directly. This is deprecated since mpv 0.33.0.
In the future, this error field will be unset for this specific
event.)
设置为描述播放失败的大致原因的 mpv 错误字符串。如果未知错误则未设置。(在 Lua 脚本中,此值直接设置在 error 字段上。自 mpv 0.33.0 起已弃用。将来,此特定事件的 error 字段将未设置。) - playlist_insert_id
- If loading ended, because the playlist entry to be played was for example
a playlist, and the current playlist entry is replaced with a number of
other entries. This may happen at least with MPV_END_FILE_REASON_REDIRECT
(other event types may use this for similar but different purposes in the
future). In this case, playlist_insert_id will be set to the playlist
entry ID of the first inserted entry, and playlist_insert_num_entries to
the total number of inserted playlist entries. Note this in this specific
case, the ID of the last inserted entry is playlist_insert_id+num-1.
Beware that depending on circumstances, you may observe the new playlist
entries before seeing the event (e.g. reading the "playlist" property or
getting a property change notification before receiving the event).
If this is 0 in the C API, this field isn't added.
如果加载结束,因为要播放的播放列表条目是一个播放列表,并且当前播放列表条目被多个其他条目替换。这至少可能发生在 MPV_END_FILE_REASON_REDIRECT(其他事件类型可能在将来用于类似但不同的目的)。在这种情况下,playlist_insert_id 将被设置为第一个插入条目的播放列表条目 ID,而 playlist_insert_num_entries 将被设置为插入的播放列表条目总数。请注意,在这个特定情况下,最后一个插入条目的 ID 是 playlist_insert_id+num-1。请注意,根据具体情况,您可能会在看到事件之前观察到新的播放列表条目(例如,在读取“播放列表”属性或接收到属性更改通知之前接收事件)。如果在这个 C API 中为 0,则此字段不会被添加。 - playlist_insert_num_entries
- See playlist_insert_id. Only present if playlist_insert_id is present.
参见 playlist_insert_id。仅在 playlist_insert_id 存在时才存在。
- file-loaded (MPV_EVENT_FILE_LOADED)
- Happens after a file was loaded and begins playback.
在文件加载并开始播放后发生。 - seek (MPV_EVENT_SEEK)
- Happens on seeking. (This might include cases when the player seeks
internally, even without user interaction. This includes e.g. segment
changes when playing ordered chapters Matroska files.)
在搜索时发生。(这可能包括播放器在内部搜索的情况,即使没有用户交互。这包括例如播放顺序章节 Matroska 文件时的段变化。) - playback-restart (MPV_EVENT_PLAYBACK_RESTART)
- Start of playback after seek or after file was loaded.
播放搜索后或文件加载后的开始。 - shutdown (MPV_EVENT_SHUTDOWN)
- Sent when the player quits, and the script should terminate. Normally
handled automatically. See Details on the script initialization and lifecycle.
当播放器退出时发送,脚本应终止。通常自动处理。请参阅脚本初始化和生命周期详情。 - log-message (MPV_EVENT_LOG_MESSAGE)
Receives messages enabled with mpv_request_log_messages() (Lua: mp.enable_messages).
接收启用 mpv_request_log_messages() 的消息(Lua: mp.enable_messages )。This contains, in addition to the default event fields, the following fields:
除了默认事件字段外,还包括以下字段:- prefix
- The module prefix, identifies the sender of the message. This is what
the terminal player puts in front of the message text when using the
--v option, and is also what is used for --msg-level.
模块前缀,用于标识消息的发送者。这是终端玩家在使用 --v 选项时放在消息文本前面的内容,也是用于 --msg-level 的内容。 - level
- The log level as string. See msg.log for possible log level names.
Note that later versions of mpv might add new levels or remove
(undocumented) existing ones.
日志级别字符串。查看 msg.log 了解可能的日志级别名称。请注意,mpv 的后续版本可能会添加新的级别或删除(未记录的)现有级别。 - text
- The log message. The text will end with a newline character. Sometimes
it can contain multiple lines.
日志消息。文本将以换行符结束。有时它可能包含多行。
Keep in mind that these messages are meant to be hints for humans. You should not parse them, and prefix/level/text of messages might change any time.
请注意,这些消息旨在为人类提供提示。您不应解析它们,并且消息的/前缀/级别/文本可能会随时更改。- hook
The event has the following fields:
事件具有以下字段:- get-property-reply (MPV_EVENT_GET_PROPERTY_REPLY)
- See C API. 查看 C API。
- set-property-reply (MPV_EVENT_SET_PROPERTY_REPLY)
- See C API. 查看 C API。
- command-reply (MPV_EVENT_COMMAND_REPLY)
This is one of the commands for which the `error field is meaningful.
这是其中之一, `error 字段具有意义的命令。JSON IPC and Lua and possibly other backends treat this specially and may not pass the actual event to the user. See C API.
JSON IPC 和 Lua 以及可能的其他后端会特别处理此情况,可能不会将实际事件传递给用户。参见 C API。The event has the following fields:
事件具有以下字段:- client-message (MPV_EVENT_CLIENT_MESSAGE)
Lua and possibly other backends treat this specially and may not pass the actual event to the user.
Lua 以及可能的其他后端会特别处理此情况,可能不会将实际事件传递给用户。The event has the following fields:
事件具有以下字段:- video-reconfig (MPV_EVENT_VIDEO_RECONFIG)
- Happens on video output or filter reconfig.
在视频输出或过滤器重新配置时发生。 - audio-reconfig (MPV_EVENT_AUDIO_RECONFIG)
- Happens on audio output or filter reconfig.
在音频输出或过滤器重新配置时发生。 - property-change (MPV_EVENT_PROPERTY_CHANGE)
Happens when a property that is being observed changes value.
当被观察的属性值发生变化时发生。The event has the following fields:
事件具有以下字段:
The following events also happen, but are deprecated: idle, tick
Use mpv_observe_property() (Lua: mp.observe_property()) instead.
以下事件也会发生,但已弃用: idle , tick 使用 mpv_observe_property() (Lua: mp.observe_property() )代替。
Hooks 钩子
Hooks are synchronous events between player core and a script or similar. This
applies to client API (including the Lua scripting interface). Normally,
events are supposed to be asynchronous, and the hook API provides an awkward
and obscure way to handle events that require stricter coordination. There are
no API stability guarantees made. Not following the protocol exactly can make
the player freeze randomly. Basically, nobody should use this API.
钩子是玩家核心和脚本或类似之间的同步事件。这适用于客户端 API(包括 Lua 脚本接口)。通常,事件应该是异步的,钩子 API 提供了一种笨拙且不透明的方式来处理需要更严格协调的事件。没有提供 API 稳定性保证。不严格按照协议执行可能会导致玩家随机冻结。基本上,没有人应该使用这个 API。
The C API is described in the header files. The Lua API is described in the
Lua section.
C API 在头文件中描述。Lua API 在 Lua 部分。
Before a hook is actually invoked on an API clients, it will attempt to return
new values for all observed properties that were changed before the hook. This
may make it easier for an application to set defined "barriers" between property
change notifications by registering hooks. (That means these hooks will have an
effect, even if you do nothing and make them continue immediately.)
在实际上调用 API 客户端的钩子之前,它将尝试返回所有在钩子之前发生变化的观察到的属性的新的值。这可能会使应用程序通过注册钩子来设置属性更改通知之间的定义的“障碍”变得更容易。(这意味着即使您什么都不做并立即继续,这些钩子也会产生效果。)
The following hooks are currently defined:
以下钩子目前已被定义:
- on_load
Called when a file is to be opened, before anything is actually done. For example, you could read and write the stream-open-filename property to redirect an URL to something else (consider support for streaming sites which rarely give the user a direct media URL), or you could set per-file options with by setting the property file-local-options/<option name>. The player will wait until all hooks are run.
当文件即将打开时调用,在实际上执行任何操作之前。例如,您可以通过读取和写入 stream-open-filename 属性来重定向 URL 到其他位置(考虑对很少提供用户直接媒体 URL 的流媒体站点的支持),或者您可以通过设置属性 file-local-options/<option name> 来设置每个文件的选项。播放器将等待所有钩子运行。Ordered after start-file and before playback-restart.
在 start-file 之后和 playback-restart 之前排序。- on_load_fail
Called after after a file has been opened, but failed to. This can be used to provide a fallback in case native demuxers failed to recognize the file, instead of always running before the native demuxers like on_load. Demux will only be retried if stream-open-filename was changed. If it fails again, this hook is _not_ called again, and loading definitely fails.
在文件打开之后调用,但失败了。这可以用来在原生解复用器无法识别文件的情况下提供回退,而不是像 on_load 一样始终在原生解复用器之前运行。只有当 stream-open-filename 被更改时,才会重试解复用。如果再次失败,此钩子将 _不会_ 再次调用,并且加载肯定失败。Ordered after on_load, and before playback-restart and end-file.
在 on_load 之后,并在 playback-restart 和 end-file 之前排序。- on_preloaded
Called after a file has been opened, and before tracks are selected and decoders are created. This has some usefulness if an API users wants to select tracks manually, based on the set of available tracks. It's also useful to initialize --lavfi-complex in a specific way by API, without having to "probe" the available streams at first.
在文件打开之后调用,并在选择轨道和创建解码器之前。如果 API 用户想要根据可用的轨道集手动选择轨道,这有一些用途。它也有助于通过 API 以特定方式初始化 --lavfi-complex ,而无需首先“探测”可用的流。Note that this does not yet apply default track selection. Which operations exactly can be done and not be done, and what information is available and what is not yet available yet, is all subject to change.
请注意,这尚未应用默认轨道选择。确切可以执行和不能执行的操作,以及可用的信息和尚未提供的信息,都可能发生变化。Ordered after on_load_fail etc. and before playback-restart.
在 on_load_fail 等之后排序,并在 playback-restart 之前。- on_unload
Run before closing a file, and before actually uninitializing everything. It's not possible to resume playback in this state.
在关闭文件之前,以及在实际上解除初始化一切之前运行。在此状态下无法恢复播放。Ordered before end-file. Will also happen in the error case (then after on_load_fail).
在 end-file 之前排序。错误情况下也会发生(然后是 on_load_fail 之后)。- on_before_start_file
- Run before a start-file event is sent. (If any client changes the
current playlist entry, or sends a quit command to the player, the
corresponding event will not actually happen after the hook returns.)
Useful to drain property changes before a new file is loaded.
在发送 start-file 事件之前运行。 (如果任何客户端更改了当前播放列表条目,或者向播放器发送退出命令,钩子返回后相应的事件实际上不会发生。) 在加载新文件之前清除属性变化很有用。 - on_after_end_file
- Run after an end-file event. Useful to drain property changes after a
file has finished.
在 end-file 事件之后运行。 在文件完成后清除属性变化很有用。
Input Command Prefixes 输入命令前缀
These prefixes are placed between key name and the actual command. Multiple
prefixes can be specified. They are separated by whitespace.
这些前缀放置在键名和实际命令之间。可以指定多个前缀。它们由空格分隔。
- osd-auto
- Use the default behavior for this command. This is the default for
input.conf commands. Some libmpv/scripting/IPC APIs do not use this as
default, but use no-osd instead.
使用此命令的默认行为。这是 input.conf 命令的默认设置。某些 libmpv/scripting/IPC API 不使用此默认设置,而是使用 no-osd 。 - no-osd
- Do not use any OSD for this command.
不要为此命令使用任何 OSD。 - osd-bar
- If possible, show a bar with this command. Seek commands will show the
progress bar, property changing commands may show the newly set value.
如果可能,使用此命令显示一个条形图。搜索命令将显示进度条,属性更改命令可能显示新设置的值。 - osd-msg
- If possible, show an OSD message with this command. Seek command show
the current playback time, property changing commands show the newly set
value as text.
如果可能,使用此命令显示一个 OSD 消息。搜索命令显示当前播放时间,属性更改命令以文本形式显示新设置的值。 - osd-msg-bar
- Combine osd-bar and osd-msg.
合并 osd-bar 和 osd-msg。 - raw
- Do not expand properties in string arguments. (Like "${property-name}".)
This is the default for some libmpv/scripting/IPC APIs.
不要在字符串参数中展开属性。(例如 "${property-name}" 。)这是某些 libmpv/scripting/IPC API 的默认设置。 - expand-properties
- All string arguments are expanded as described in Property Expansion.
This is the default for input.conf commands.
所有字符串参数都按照属性展开的描述进行展开。这是 input.conf 命令的默认设置。 - repeatable
- For some commands, keeping a key pressed doesn't run the command repeatedly.
This prefix forces enabling key repeat in any case. For a list of commands:
the first command determines the repeatability of the whole list (up to and
including version 0.33 - a list was always repeatable).
对于某些命令,即使按住键也不会重复执行命令。此前缀强制在任何情况下都启用按键重复。命令列表:第一个命令确定整个列表的可重复性(包括版本 0.33 及以下版本 - 列表始终可重复)。 - nonrepeatable
- For some commands, keeping a key pressed runs the command repeatedly.
This prefix forces disabling key repeat in any case.
对于某些命令,按住键重复执行命令。此前缀强制在任何情况下禁用键重复。 - nonscalable
- When some commands (e.g. add) are bound to scalable keys associated to a
high-precision input device like a touchpad (e.g. WHEEL_UP), the value
specified in the command is scaled to smaller steps based on the high
resolution input data if available.
This prefix forces disabling this behavior, so the value is always changed
in the discrete unit specified in the key binding.
当某些命令(例如 add )绑定到与高精度输入设备(例如触摸板 WHEEL_UP )相关联的可伸缩键时,如果可用,命令中指定的值将根据高分辨率输入数据调整为更小的步长。此前缀强制禁用此行为,因此值始终以键绑定中指定的离散单位更改。 - async
- Allow asynchronous execution (if possible). Note that only a few commands
will support this (usually this is explicitly documented). Some commands
are asynchronous by default (or rather, their effects might manifest
after completion of the command). The semantics of this flag might change
in the future. Set it only if you don't rely on the effects of this command
being fully realized when it returns. See Synchronous vs. Asynchronous.
允许异步执行(如果可能)。请注意,只有少数命令支持此功能(通常这会明确记录)。一些命令默认为异步(或者,它们的效果可能在命令完成后才会显现)。此标志的语义可能会在未来发生变化。仅在您不依赖此命令返回时完全实现其效果的情况下设置。参见 同步与异步。 - sync
- Allow synchronous execution (if possible). Normally, all commands are
synchronous by default, but some are asynchronous by default for
compatibility with older behavior.
允许同步执行(如果可能)。通常,所有命令默认为同步,但为了与旧行为兼容,一些命令默认为异步。
All of the osd prefixes are still overridden by the global --osd-level
settings.
所有 osd 前缀仍然被全局 --osd-level 设置覆盖。
Synchronous vs. Asynchronous
同步与异步
The async and sync prefix matter only for how the issuer of the command
waits on the completion of the command. Normally it does not affect how the
command behaves by itself. There are the following cases:
async 和 sync 前缀仅影响命令发出者等待命令完成的方式。通常它不会影响命令本身的行为。以下是一些情况:
- Normal input.conf commands are always run asynchronously. Slow running
commands are queued up or run in parallel.
正常的 input.conf 命令总是异步运行。运行缓慢的命令会被排队或并行运行。 - "Multi" input.conf commands (1 key binding, concatenated with ;) will be
executed in order, except for commands that are async (either prefixed with
async, or async by default for some commands). The async commands are
run in a detached manner, possibly in parallel to the remaining sync commands
in the list.
"“Multi” 输入.conf 命令(1 个快捷键绑定,通过 ; 连接)将按顺序执行,除非是异步命令(要么以 async 前缀开头,要么某些命令默认为异步)。异步命令以分离的方式运行,可能与其他同步命令并行运行。" - Normal Lua and libmpv commands (e.g. mpv_command()) are run in a blocking
manner, unless the async prefix is used, or the command is async by
default. This means in the sync case the caller will block, even if the core
continues playback. Async mode runs the command in a detached manner.
正常的 Lua 和 libmpv 命令(例如 mpv_command() )以阻塞方式运行,除非使用 async 前缀,或者命令默认为异步。这意味着在同步情况下,调用者将被阻塞,即使核心继续播放。异步模式以分离的方式运行命令。 - Async libmpv command API (e.g. mpv_command_async()) never blocks the
caller, and always notify their completion with a message. The sync and
async prefixes make no difference.
异步 libmpv 命令 API(例如 mpv_command_async() )永远不会阻塞调用者,并且总是通过消息通知其完成。 sync 和 async 前缀没有区别。 - Lua also provides APIs for running async commands, which behave similar to the
C counterparts.
Lua 还提供了运行异步命令的 API,其行为类似于 C 对应版本。 - In all cases, async mode can still run commands in a synchronous manner, even
in detached mode. This can for example happen in cases when a command does not
have an asynchronous implementation. The async libmpv API still never blocks
the caller in these cases.
在所有情况下,异步模式仍然可以以同步方式运行命令,即使在分离模式下也是如此。例如,当命令没有异步实现时,这种情况就会发生。在这些情况下,async libmpv API 仍然不会阻塞调用者。
Before mpv 0.29.0, the async prefix was only used by screenshot commands,
and made them run the file saving code in a detached manner. This is the
default now, and async changes behavior only in the ways mentioned above.
在 mpv 0.29.0 之前, async 前缀仅由截图命令使用,并以分离方式运行文件保存代码。现在这是默认设置,而 async 仅在上述方式中改变行为。
Currently the following commands have different waiting characteristics with
sync vs. async: sub-add, audio-add, sub-reload, audio-reload,
rescan-external-files, screenshot, screenshot-to-file, dump-cache,
ab-loop-dump-cache.
当前以下命令在同步与异步模式下具有不同的等待特性:sub-add、audio-add、sub-reload、audio-reload、rescan-external-files、screenshot、screenshot-to-file、dump-cache、ab-loop-dump-cache。
Asynchronous command details
异步命令详情
On the API level, every asynchronous command is bound to the context which
started it. For example, an asynchronous command started by mpv_command_async
is bound to the mpv_handle passed to the function. Only this mpv_handle
receives the completion notification (MPV_EVENT_COMMAND_REPLY), and only
this handle can abort a still running command directly. If the mpv_handle is
destroyed, any still running async. commands started by it are terminated.
在 API 层面,每个异步命令都与启动它的上下文绑定。例如,由 mpv_command_async 启动的异步命令绑定到传递给函数的 mpv_handle 。只有这个 mpv_handle 会收到完成通知( MPV_EVENT_COMMAND_REPLY ),只有这个句柄可以直接终止仍在运行的命令。如果 mpv_handle 被销毁,它启动的任何仍在运行的异步命令都将终止。
The scripting APIs and JSON IPC give each script/connection its own implicit
mpv_handle.
脚本 API 和 JSON IPC 为每个脚本/连接提供自己的隐式 mpv_handle 。
If the player is closed, the core may abort all pending async. commands on its
own (like a forced mpv_abort_async_command() call for each pending command
on behalf of the API user). This happens at the same time MPV_EVENT_SHUTDOWN
is sent, and there is no way to prevent this.
如果玩家被关闭,核心可能会自行取消所有挂起的异步命令(例如,代表 API 用户强制调用每个挂起命令的 mpv_abort_async_command() )。这发生在发送 MPV_EVENT_SHUTDOWN 的同时,且无法阻止这种情况。
Input Sections 输入部分
Input sections group a set of bindings, and enable or disable them at once.
In input.conf, each key binding is assigned to an input section, rather
than actually having explicit text sections.
输入部分将一组绑定分组,并可以一次性启用或禁用它们。在 input.conf 中,每个键绑定都分配给一个输入部分,而不是实际有明确的文本部分。
See also: enable-section and disable-section commands.
另请参阅: enable-section 和 disable-section 命令。
Predefined bindings: 预定义绑定:
- default
- Bindings without input section are implicitly assigned to this section. It
is enabled by default during normal playback.
没有输入部分的绑定默认分配到本部分。在正常播放期间默认启用。 - encode
- Section which is active in encoding mode. It is enabled exclusively, so
that bindings in the default sections are ignored.
编码模式中处于活动状态的章节。它仅被启用,因此忽略 default 章节中的绑定。
Properties 属性
Properties are used to set mpv options during runtime, or to query arbitrary
information. They can be manipulated with the set/add/cycle
commands, and retrieved with show-text, or anything else that uses property
expansion. (See Property Expansion.)
属性用于在运行时设置 mpv 选项或查询任意信息。可以使用 set / add / cycle 命令来操作属性,使用 show-text 或任何使用属性展开的功能来检索。 (参见属性展开。)
If an option is referenced, the property will normally take/return exactly the
same values as the option. In these cases, properties are merely a way to change
an option at runtime.
如果引用了选项,属性通常将取/返回与选项完全相同的值。在这些情况下,属性仅是更改运行时选项的一种方式。
Note that many properties are unavailable at startup. See Details on the script
initialization and lifecycle.
请注意,许多属性在启动时不可用。请参阅脚本初始化和生命周期的详细信息。
Property list 属性列表
Note 注意
Most options can be set at runtime via properties as well. Just remove the
leading -- from the option name. These are not documented below, see
OPTIONS instead. Only properties which do not exist as option with the
same name, or which have very different behavior from the options are
documented below.
大多数选项也可以通过属性在运行时设置。只需从选项名称中删除前缀 -- 。这些选项在下面没有文档说明,请参阅 OPTIONS。下面只记录了那些没有与相同名称的选项存在,或者与选项有非常不同行为的属性。
Properties marked as (RW) are writeable, while those that aren't are
read-only.
标记为 (RW) 的属性是可写的,而那些不可写的属性是只读的。
- audio-speed-correction, video-speed-correction
Factor multiplied with speed at which the player attempts to play the file. Usually it's exactly 1. (Display sync mode will make this useful.)
与 speed 相乘的系数,玩家尝试播放文件时使用。通常正好是 1。(显示同步模式将使此功能变得有用。)OSD formatting will display it in the form of +1.23456%, with the number being (raw - 1) * 100 for the given raw property value.
OSD 格式化将以 +1.23456% 的形式显示它,其中数字是 (raw - 1) * 100 ,对于给定的原始属性值。- display-sync-active
- Whether --video-sync=display is actually active.
是否 --video-sync=display 实际上处于活动状态。 - filename
Currently played file, with path stripped. If this is an URL, try to undo percent encoding as well. (The result is not necessarily correct, but looks better for display purposes. Use the path property to get an unmodified filename.)
当前播放的文件,路径已被去除。如果是 URL,尝试撤销百分号编码。(结果不一定正确,但显示效果更好。使用 path 属性获取未修改的文件名。)This has a sub-property:
这有一个子属性:- file-size
- Length in bytes of the source file/stream. (This is the same as
${stream-end}. For segmented/multi-part files, this will return the
size of the main or manifest file, whatever it is.)
源文件/流的字节数。(这与 ${stream-end} 相同。对于分段/多部分文件,这将返回主文件或清单文件的大小,具体取决于哪个。) - estimated-frame-count
Total number of frames in current file.
当前文件中的帧总数。Note 注意
This is only an estimate. (It's computed from two unreliable quantities: fps and stream length.)
这只是一个估计。(它是从两个不可靠的数量:fps 和流长度计算得出的。)- estimated-frame-number
Number of current frame in current stream.
当前流中当前帧的数量。Note 注意
This is only an estimate. (It's computed from two unreliable quantities: fps and possibly rounded timestamps.)
"这只是一个估计。(它是从两个不可靠的数量:fps 和可能四舍五入的时间戳计算得出的。)- pid
- Process-id of mpv. 进程 ID of mpv.
- path
- Full absolute path of the currently played file.
"当前播放文件的完整绝对路径。 - stream-open-filename
- The full path to the currently played media. This is different from
path only in special cases. In particular, if --ytdl=yes is used,
and the URL is detected by youtube-dl, then the script will set this
property to the actual media URL. This property should be set only during
the on_load or on_load_fail hooks, otherwise it will have no effect
(or may do something implementation defined in the future). The property is
reset if playback of the current media ends.
当前播放媒体的完整路径。这仅在特殊情况下与 path 不同。特别是,如果使用 --ytdl=yes ,并且 URL 被 youtube-dl 检测到,那么脚本将此属性设置为实际媒体 URL。此属性应在 on_load 或 on_load_fail 钩子期间设置,否则将没有效果(或可能在未来的实现中定义某些操作)。如果当前媒体的播放结束,则重置此属性。 - media-title
If the currently played file has a title tag, use that.
如果当前播放的文件有 title 标签,则使用该标签。Otherwise, return the filename property.
否则,返回 filename 属性。- file-format
- Symbolic name of the file format. In some cases, this is a comma-separated
list of format names, e.g. mp4 is mov,mp4,m4a,3gp,3g2,mj2 (the list
may grow in the future for any format).
文件格式的符号名称。在某些情况下,这是一个以逗号分隔的格式名称列表,例如 mp4 是 mov,mp4,m4a,3gp,3g2,mj2 (列表可能会在未来为任何格式增长)。 - current-demuxer
Name of the current demuxer. (This is useless.)
当前解复用器的名称。(这毫无用处。)(Renamed from demuxer.) (从 demuxer 重命名。)
- stream-path
- Filename (full path) of the stream layer filename. (This is probably
useless and is almost never different from path.)
流层文件名的完整路径文件名。这可能毫无用处,几乎总是与 path . 相同。) - stream-pos
- Raw byte position in source stream. Technically, this returns the position
of the most recent packet passed to a decoder.
源流中的原始字节位置。技术上,这返回传递给解码器的最新数据包的位置。 - stream-end
- Raw end position in bytes in source stream.
源流中的原始字节结束位置。 - duration
Duration of the current file in seconds. If the duration is unknown, the property is unavailable. Note that the file duration is not always exactly known, so this is an estimate.
当前文件的持续时间(秒)。如果持续时间未知,则该属性不可用。请注意,文件持续时间不一定总是确切已知,因此这是一个估计值。This replaces the length property, which was deprecated after the mpv 0.9 release. (The semantics are the same.)
这取代了 length 属性,该属性在 mpv 0.9 版本发布后已弃用。(语义相同。)This has a sub-property:
这有一个子属性:- avsync
- Last A/V synchronization difference. Unavailable if audio or video is
disabled.
最后一次 A/V 同步差异。如果禁用音频或视频,则不可用。 - total-avsync-change
- Total A-V sync correction done. Unavailable if audio or video is
disabled.
完成总 A-V 同步校正。如果音频或视频被禁用,则不可用。 - decoder-frame-drop-count
- Video frames dropped by decoder, because video is too far behind audio (when
using --framedrop=decoder). Sometimes, this may be incremented in other
situations, e.g. when video packets are damaged, or the decoder doesn't
follow the usual rules. Unavailable if video is disabled.
解码器丢弃视频帧,因为视频落后音频太远(当使用 --framedrop=decoder 时)。有时,在其他情况下也可能增加,例如视频数据包损坏或解码器不遵循常规规则。如果视频被禁用,则不可用。 - frame-drop-count
- Frames dropped by VO (when using --framedrop=vo).
在 VO(当使用 --framedrop=vo 时)丢弃的帧。 - mistimed-frame-count
- Number of video frames that were not timed correctly in display-sync mode
for the sake of keeping A/V sync. This does not include external
circumstances, such as video rendering being too slow or the graphics
driver somehow skipping a vsync. It does not include rounding errors either
(which can happen especially with bad source timestamps). For example,
using the display-desync mode should never change this value from 0.
在显示同步模式下,为了保持 A/V 同步而丢弃的视频帧数量。这不包括外部环境,例如视频渲染过慢或图形驱动程序以某种方式跳过 vsync。也不包括舍入误差(尤其是在源时间戳不佳时可能发生)。例如,使用 display-desync 模式不应改变此值从 0。 - vsync-ratio
- For how many vsyncs a frame is displayed on average. This is available if
display-sync is active only. For 30 FPS video on a 60 Hz screen, this will
be 2. This is the moving average of what actually has been scheduled, so
24 FPS on 60 Hz will never remain exactly on 2.5, but jitter depending on
the last frame displayed.
平均每帧显示多少次垂直同步。仅在显示同步激活时才可用。对于 60 赫兹屏幕上的 30 帧每秒视频,这将等于 2。这是实际已安排的平均值,因此 60 赫兹上的 24 帧每秒永远不会精确保持在 2.5,而是根据最后显示的帧产生抖动。 - vo-delayed-frame-count
- Estimated number of frames delayed due to external circumstances in
display-sync mode. Note that in general, mpv has to guess that this is
happening, and the guess can be inaccurate.
在显示同步模式下,由于外部环境因素导致的延迟帧数估计。请注意,通常情况下,mpv 需要猜测这种情况正在发生,猜测可能不准确。 - percent-pos (RW) percent-pos (读写)
- Position in current file (0-100). The advantage over using this instead of
calculating it out of other properties is that it properly falls back to
estimating the playback position from the byte position, if the file
duration is not known.
当前文件中的位置(0-100)。与使用其他属性计算相比的优势在于,如果文件持续时间未知,它将正确地回退到从字节位置估计播放位置。 - time-pos (RW) time-pos (读写)
Position in current file in seconds.
当前文件中的位置(以秒为单位)。This has a sub-property:
这有一个子属性:- time-start
- Deprecated. Always returns 0. Before mpv 0.14, this used to return the start
time of the file (could affect e.g. transport streams). See
--rebase-start-time option.
已弃用。始终返回 0。在 mpv 0.14 之前,这曾经返回文件的起始时间(可能会影响例如传输流)。请参阅 --rebase-start-time 选项。 - time-remaining
Remaining length of the file in seconds. Note that the file duration is not always exactly known, so this is an estimate.
文件剩余长度(以秒为单位)。请注意,文件持续时间并不总是完全准确,因此这是一个估计值。This has a sub-property:
这有一个子属性:- audio-pts
Current audio playback position in current file in seconds. Unlike time-pos, this updates more often than once per frame. This is mostly equivalent to time-pos for audio-only files however it also takes into account the audio driver delay. This can lead to negative values in certain cases, so in general you probably want to simply use time-pos.
当前文件中当前音频播放位置(以秒为单位)。与 time-pos 不同,它比每帧更新更频繁。对于仅音频文件,这基本上等同于 time-pos ,但它还考虑了音频驱动程序的延迟。这可能导致某些情况下出现负值,因此通常您可能只想简单地使用 time-pos 。This has a sub-property:
这有一个子属性:- playtime-remaining
time-remaining scaled by the current speed.
time-remaining 通过当前的 speed 缩放。This has a sub-property:
这有一个子属性:- playback-time (RW) playback-time (读写)
Alias for time-pos. 别名: time-pos 。
Prior to mpv 0.39.0, time-pos and playback-time could report different values in certain edge cases.
在 mpv 0.39.0 之前, time-pos 和 playback-time 在某些边缘情况下可能会报告不同的值。This has a sub-property:
这有一个子属性:- remaining-file-loops
- How many more times the current file is going to be looped. This is
initialized from the value of --loop-file. This counts the number of
times it causes the player to seek to the beginning of the file, so it is 0
the last the time is played. -1 corresponds to infinity.
当前文件将要循环多少次。这是从 --loop-file 的值初始化的。这计算了它导致播放器将文件从头开始查找的次数,所以最后一次播放时为 0。-1 对应于无穷大。 - remaining-ab-loops
- How many more times the current A-B loop is going to be looped, if one is
active. This is initialized from the value of --ab-loop-count. This
counts the number of times it causes the player to seek to --ab-loop-a,
so it is 0 the last the time the loop is played. -1 corresponds to infinity.
当前 A-B 循环将要被循环多少次,如果有一个是激活的。这是从 --ab-loop-count 的值初始化的。这计算了它导致玩家寻求到 --ab-loop-a 的次数,所以当循环最后一次播放时它是 0。-1 对应于无穷大。 - chapter (RW) chapter (读写)
Current chapter number. The number of the first chapter is 0. A value of -1 indicates that the current playback position is before the start of the first chapter,
当前章节编号。第一章节的编号是 0。值为 -1 表示当前播放位置在第一章节的开始之前。Setting this property results in an absolute seek to the start of the chapter. However, if the property is changed with add or cycle command which results in a decrement in value, it may go to the start of the current chapter instead of the previous chapter. See --chapter-seek-threshold for details.
设置此属性会导致绝对定位到章节的开始。然而,如果使用 add 或 cycle 命令更改此属性,并且导致值减小,它可能会定位到当前章节的开始而不是上一章节的开始。有关详细信息,请参阅 --chapter-seek-threshold 。- edition (RW) edition (读写)
Current edition number. Setting this property to a different value will restart playback. The number of the first edition is 0.
当前版本号。将此属性设置为不同值将重新启动播放。第一个版本的编号为 0。For Matroska files, this is the edition. For DVD/Blu-ray, this is the title.
对于 Matroska 文件,这是版本。对于 DVD/Blu-ray,这是标题。Before mpv 0.31.0, this showed the actual edition selected at runtime, if you didn't set the option or property manually. With mpv 0.31.0 and later, this strictly returns the user-set option or property value, and the current-edition property was added to return the runtime selected edition (this matters with --edition=auto, the default).
在 mpv 0.31.0 之前,此选项显示运行时实际选择的版本,如果您没有手动设置选项或属性。从 mpv 0.31.0 开始,此选项严格返回用户设置的选项或属性值,并添加了 current-edition 属性以返回运行时选择的版本(这对于 --edition=auto ,默认值很重要)。- current-edition
- Currently selected edition. This property is unavailable if no file is
loaded, or the file has no editions. (Matroska files make a difference
between having no editions and a single edition, which will be reflected by
the property, although in practice it does not matter.)
当前选择的版本。如果没有加载文件,或者文件没有版本,则此属性不可用。 (Matroska 文件在无版本和单个版本之间有所区别,这将通过属性反映出来,尽管在实践中并不重要。) - chapters
- Number of chapters. 章节数量。
- editions
- Number of editions. 版本数量。
- edition-list
List of editions, current entry marked.
版本列表,当前条目已标记。This has a number of sub-properties. Replace N with the 0-based edition index.
这包含多个子属性。将 N 替换为基于 0 的版本索引。- edition-list/count
- Number of editions. If there are no editions, this can be 0 or 1 (1
if there's a useless dummy edition).
版本数量。如果没有版本,则可以是 0 或 1(如果有无用的虚拟版本,则为 1)。 - edition-list/N/id
- Edition ID as integer. Currently, this is the same as the edition index.
版本 ID 作为整数。目前,这与版本索引相同。 - edition-list/N/default
- Whether this is the default edition.
是否为默认版本。 - edition-list/N/title
- Edition title as stored in the file. Not always available.
存储在文件中的版本标题。不一定可用。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each edition) "id" MPV_FORMAT_INT64 "title" MPV_FORMAT_STRING "default" MPV_FORMAT_FLAG
- metadata
Metadata key/value pairs.
元数据键/值对。If the property is accessed with Lua's mp.get_property_native, this returns a table with metadata keys mapping to metadata values. If it is accessed with the client API, this returns a MPV_FORMAT_NODE_MAP, with tag keys mapping to tag values.
如果使用 Lua 的 mp.get_property_native 访问属性,则返回一个表,其中元数据键映射到元数据值。如果使用客户端 API 访问,则返回一个 MPV_FORMAT_NODE_MAP ,其中标签键映射到标签值。For OSD, it returns a formatted list. Trying to retrieve this property as a raw string doesn't work.
对于 OSD,它返回一个格式化列表。尝试以原始字符串形式检索此属性将不起作用。This has a number of sub-properties:
这有几个子属性:- metadata/by-key/<key>
- Value of metadata entry <key>.
元数据条目 <key> 的值。 - metadata/list/count
- Number of metadata entries.
元数据条目数量。 - metadata/list/N/key
- Key name of the Nth metadata entry. (The first entry is 0).
第 N 个元数据条目的键名。(第一个条目是 0 。) - metadata/list/N/value
- Value of the Nth metadata entry.
第 N 个元数据条目的值。 - metadata/<key>
- Old version of metadata/by-key/<key>. Use is discouraged, because
the metadata key string could conflict with other sub-properties.
旧版 metadata/by-key/<key> 。使用不推荐,因为元数据键字符串可能与其他子属性冲突。
The layout of this property might be subject to change. Suggestions are welcome how exactly this property should work.
此属性的布局可能会发生变化。欢迎提出具体建议,关于此属性应该如何工作。When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_MAP (key and string value for each metadata entry)
- filtered-metadata
- Like metadata, but includes only fields listed in the --display-tags
option. This is the same set of tags that is printed to the terminal.
类似于 metadata ,但仅包括在 --display-tags 选项中列出的字段。这是打印到终端的相同标签集。 - chapter-metadata
Metadata of current chapter. Works similar to metadata property. It also allows the same access methods (using sub-properties).
当前章节的元数据。与 metadata 属性功能相似。它还允许使用相同的访问方法(使用子属性)。Per-chapter metadata is very rare. Usually, only the chapter name (title) is set.
每章元数据非常罕见。通常,只有章节名称( title )被设置。For accessing other information, like chapter start, see the chapter-list property.
要访问其他信息,如章节开始,请参阅 chapter-list 属性。- vf-metadata/<filter-label>
Metadata added by video filters. Accessed by the filter label, which, if not explicitly specified using the @filter-label: syntax, will be <filter-name>.NN.
元数据由视频过滤器添加。通过过滤器标签访问,如果未使用 @filter-label: 语法显式指定,则默认为 <filter-name>.NN 。Works similar to metadata property. It allows the same access methods (using sub-properties).
与 metadata 属性类似。它允许相同的访问方法(使用子属性)。An example of this kind of metadata are the cropping parameters added by --vf=lavfi=cropdetect.
此类元数据的示例是 --vf=lavfi=cropdetect 添加的裁剪参数。- af-metadata/<filter-label>
- Equivalent to vf-metadata/<filter-label>, but for audio filters.
相当于 vf-metadata/<filter-label> ,但用于音频过滤器。 - deinterlace-active
- Returns yes/true if mpv's deinterlacing filter is active. Note that it
will not detect any manually inserted deinterlacing filters done via
--vf.
返回 yes /true 如果 mpv 的去隔行滤波器处于活动状态。注意,它将无法检测通过 --vf 手动插入的去隔行滤波器。 - idle-active
Returns yes/true if no file is loaded, but the player is staying around because of the --idle option.
返回 yes /true 如果没有加载文件,但玩家因为 --idle 选项而停留。(Renamed from idle.) (从 idle 重命名。)
- core-idle
Whether the playback core is paused. This can differ from pause in special situations, such as when the player pauses itself due to low network cache.
播放核心是否暂停。在特殊情况下,这可能不同于 pause ,例如当玩家因网络缓存低而自动暂停时。This also returns yes/true if playback is restarting or if nothing is playing at all. In other words, it's only no/false if there's actually video playing. (Behavior since mpv 0.7.0.)
如果正在重新启动播放或根本没有任何播放内容,它也会返回 yes /true。换句话说,只有当实际上有视频播放时,它才为 no /false。 (自 mpv 0.7.0 以来行为。)- cache-speed
Current I/O read speed between the cache and the lower layer (like network). This gives the number bytes per seconds over a 1 second window (using the type MPV_FORMAT_INT64 for the client API).
当前缓存与底层(如网络)之间的 I/O 读取速度。这表示在 1 秒窗口内每秒的字节数(使用类型 MPV_FORMAT_INT64 作为客户端 API)。This is the same as demuxer-cache-state/raw-input-rate.
这与 demuxer-cache-state/raw-input-rate 相同。- demuxer-cache-duration
- Approximate duration of video buffered in the demuxer, in seconds. The
guess is very unreliable, and often the property will not be available
at all, even if data is buffered.
在解复用器中缓冲的视频的大致持续时间,以秒为单位。猜测非常不可靠,并且通常即使有数据缓冲,该属性也可能完全不可用。 - demuxer-cache-time
- Approximate time of video buffered in the demuxer, in seconds. Same as
demuxer-cache-duration but returns the last timestamp of buffered
data in demuxer.
在解复用器中缓冲的视频的大致时间,以秒为单位。与 demuxer-cache-duration 相同,但返回解复用器中缓冲数据的最后时间戳。 - demuxer-cache-idle
- Whether the demuxer is idle, which means that the demuxer cache is filled
to the requested amount, and is currently not reading more data.
是否解复用器处于空闲状态,这意味着解复用器缓存已填充到请求的量,并且当前没有读取更多数据。 - demuxer-cache-state
Each entry in seekable-ranges represents a region in the demuxer cache that can be seeked to, with a start and end fields containing the respective timestamps. If there are multiple demuxers active, this only returns information about the "main" demuxer, but might be changed in future to return unified information about all demuxers. The ranges are in arbitrary order. Often, ranges will overlap for a bit, before being joined. In broken corner cases, ranges may overlap all over the place.
在 seekable-ranges 中的每个条目代表解复用器缓存中的一个区域,该区域可以被寻址,其中 start 和 end 字段包含相应的时间戳。如果有多个解复用器处于活动状态,此操作仅返回有关“主”解复用器的信息,但未来可能会更改以返回有关所有解复用器的统一信息。范围是任意顺序的。通常,范围会在合并之前稍微重叠。在破损的边缘情况下,范围可能会到处重叠。The end of a seek range is usually smaller than the value returned by the demuxer-cache-time property, because that property returns the guessed buffering amount, while the seek ranges represent the buffered data that can actually be used for cached seeking.
寻址范围的结束通常小于由 demuxer-cache-time 属性返回的值,因为该属性返回的是猜测的缓冲量,而寻址范围表示可以实际用于缓存寻址的已缓冲数据。bof-cached indicates whether the seek range with the lowest timestamp points to the beginning of the stream (BOF). This implies you cannot seek before this position at all. eof-cached indicates whether the seek range with the highest timestamp points to the end of the stream (EOF). If both bof-cached and eof-cached are true, and there's only 1 cache range, the entire stream is cached.
" bof-cached 表示具有最低时间戳的查找范围是否指向流的开头(BOF)。这意味着您根本无法在此位置之前进行查找。 eof-cached 表示具有最高时间戳的查找范围是否指向流的末尾(EOF)。如果 bof-cached 和 eof-cached 都为真,并且只有一个缓存范围,则整个流都被缓存。fw-bytes is the number of bytes of packets buffered in the range starting from the current decoding position. This is a rough estimate (may not account correctly for various overhead), and stops at the demuxer position (it ignores seek ranges after it).
fw-bytes 是从当前解码位置开始的缓冲区中数据包的字节数。这是一个粗略估计(可能无法正确计算各种开销),并在解复用器位置停止(它忽略了之后的搜索范围)。file-cache-bytes is the number of bytes stored in the file cache. This includes all overhead, and possibly unused data (like pruned data). This member is missing if the file cache wasn't enabled with --cache-on-disk=yes.
file-cache-bytes 是文件缓存中存储的字节数。这包括所有开销,以及可能未使用的数据(如已修剪的数据)。如果未使用 --cache-on-disk=yes 启用文件缓存,则此成员将不存在。cache-end is demuxer-cache-time. Missing if unavailable.
cache-end 是 demuxer-cache-time 。如果不可用则缺失。reader-pts is the approximate timestamp of the start of the buffered range. Missing if unavailable.
reader-pts 是缓冲范围开始的大致时间戳。如果不可用则缺失。cache-duration is demuxer-cache-duration. Missing if unavailable.
cache-duration 是 demuxer-cache-duration 。如果不可用则缺失。raw-input-rate is the estimated input rate of the network layer (or any other byte-oriented input layer) in bytes per second. May be inaccurate or missing.
raw-input-rate 是网络层(或任何其他以字节为单位的输入层)的估计输入速率,单位为每秒字节数。可能不准确或缺失。ts-per-stream is an array containing an entry for each stream type: video, audio, and subtitle. For each stream type, the details for the demuxer cache for that stream type are available as cache-duration, reader-pts and cache-end.
ts-per-stream 是一个数组,包含每种流类型的条目:视频、音频和字幕。对于每种流类型,该流类型的解复用器缓存的详细信息都可用作 cache-duration 、 reader-pts 和 cache-end 。When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_MAP "seekable-ranges" MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP "start" MPV_FORMAT_DOUBLE "end" MPV_FORMAT_DOUBLE "bof-cached" MPV_FORMAT_FLAG "eof-cached" MPV_FORMAT_FLAG "fw-bytes" MPV_FORMAT_INT64 "file-cache-bytes" MPV_FORMAT_INT64 "cache-end" MPV_FORMAT_DOUBLE "reader-pts" MPV_FORMAT_DOUBLE "cache-duration" MPV_FORMAT_DOUBLE "raw-input-rate" MPV_FORMAT_INT64 "ts-per-stream" MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP "type" MPV_FORMAT_STRING "cache-duration" MPV_FORMAT_DOUBLE "reader-pts" MPV_FORMAT_DOUBLE "cache-end" MPV_FORMAT_DOUBLE
Other fields (might be changed or removed in the future):
其他字段(可能在将来被更改或删除):- eof
- Whether the reader thread has hit the end of the file.
读取线程是否已到达文件末尾。 - underrun
- Whether the reader thread could not satisfy a decoder's request for a
new packet.
读取线程是否无法满足解码器对新数据包的请求。 - idle
- Whether the thread is currently not reading.
线程当前是否未在读取。 - total-bytes
- Sum of packet bytes (plus some overhead estimation) of the entire packet
queue, including cached seekable ranges.
整个数据包队列中数据包字节的和(包括一些开销估计),包括缓存的可寻址范围。
- demuxer-via-network
- Whether the stream demuxed via the main demuxer is most likely played via
network. What constitutes "network" is not always clear, might be used for
other types of untrusted streams, could be wrong in certain cases, and its
definition might be changing. Also, external files (like separate audio
files or streams) do not influence the value of this property (currently).
通过主解复用器解复用的流最有可能通过网络播放。构成“网络”的内容并不总是清晰的,可能用于其他类型的不可信流,在某些情况下可能错误,其定义可能正在变化。此外,外部文件(如单独的音频文件或流)(目前)不会影响此属性的值。 - demuxer-start-time
- The start time reported by the demuxer in fractional seconds.
解复用器报告的起始时间,以分数秒为单位。 - paused-for-cache
- Whether playback is paused because of waiting for the cache.
是否因为等待缓存而暂停播放。 - cache-buffering-state
- The percentage (0-100) of the cache fill status until the player will
unpause (related to paused-for-cache).
缓存填充状态(0-100%)的百分比,直到播放器将取消暂停(与 paused-for-cache 相关)。 - eof-reached
- Whether the end of playback was reached. Note that this is usually
interesting only if --keep-open is enabled, since otherwise the player
will immediately play the next file (or exit or enter idle mode), and in
these cases the eof-reached property will logically be cleared
immediately after it's set.
是否已达到播放结束。注意,通常只有在 --keep-open 启用时才有趣,因为否则播放器将立即播放下一个文件(或退出或进入空闲模式),在这些情况下, eof-reached 属性将在设置后立即逻辑上清除。 - seeking
- Whether the player is currently seeking, or otherwise trying to restart
playback. (It's possible that it returns yes/true while a file is
loaded. This is because the same underlying code is used for seeking and
resyncing.)
播放器当前是否正在搜索,或尝试重新启动播放。(在文件加载时,它可能返回 yes /true。这是因为搜索和重新同步使用相同的底层代码。) - mixer-active
Whether the audio mixer is active.
音频混音器是否处于活动状态。This option is relatively useless. Before mpv 0.18.1, it could be used to infer behavior of the volume property.
此选项相对无用。在 mpv 0.18.1 之前,它可以用来推断 volume 属性的行为。- ao-volume (RW) ao-volume (读写)
- System volume. This property is available only if mpv audio output is
currently active, and only if the underlying implementation supports volume
control. What this option does, or how the value is interpreted depends on
the API. For example, on ALSA this usually changes system-wide audio volume
on a linear curve, while with PulseAudio this controls per-application volume
on a cubic curve.
系统音量。此属性仅在 mpv 音频输出当前处于活动状态时可用,并且只有当底层实现支持音量控制时才可用。此选项的作用或值的解释取决于 API。例如,在 ALSA 上这通常会在线性曲线上改变系统级音频音量,而在 PulseAudio 上则通过立方曲线控制每个应用程序的音量。 - ao-mute (RW) ao-mute (读写)
- Similar to ao-volume, but controls the mute state. May be unimplemented
even if ao-volume works.
与 ao-volume 类似,但控制静音状态。即使 ao-volume 工作,可能仍未实现。 - audio-params
Audio format as output by the audio decoder. This has a number of sub-properties:
音频解码器输出的音频格式。这包含多个子属性:- audio-params/format
- The sample format as string. This uses the same names as used in other
places of mpv.
字符串的示例格式。这使用与 mpv 其他地方相同的名称。 - audio-params/samplerate
- Samplerate. 采样率。
- audio-params/channels
- The channel layout as a string. This is similar to what the
--audio-channels accepts.
字符串形式的通道布局。这与 --audio-channels 接受的类似。 - audio-params/hr-channels
- As channels, but instead of the possibly cryptic actual layout
sent to the audio device, return a hopefully more human readable form.
(Usually only audio-out-params/hr-channels makes sense.)
"与 channels 类似,但不是发送给音频设备的可能难以理解的实际布局,而是返回一个更易于人类阅读的格式。通常只有 audio-out-params/hr-channels 才有意义。) - audio-params/channel-count
- Number of audio channels. This is redundant to the channels field
described above.
音频通道数量。这与上面描述的 channels 字段重复。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_MAP "format" MPV_FORMAT_STRING "samplerate" MPV_FORMAT_INT64 "channels" MPV_FORMAT_STRING "channel-count" MPV_FORMAT_INT64 "hr-channels" MPV_FORMAT_STRING
- audio-out-params
- Same as audio-params, but the format of the data written to the audio
API.
与 audio-params 相同,但这是写入音频 API 的数据格式。 - colormatrix
- Redirects to video-params/colormatrix. This parameter (as well as
similar ones) can be overridden with the format video filter.
重定向到 video-params/colormatrix 。此参数(以及类似的参数)可以通过 format 视频过滤器进行覆盖。 - colormatrix-input-range
- See colormatrix. 参见 colormatrix 。
- colormatrix-primaries
- See colormatrix. 参见 colormatrix 。
- hwdec (RW) hwdec (读写)
Reflects the --hwdec option. 反映 --hwdec 选项。
Writing to it may change the currently used hardware decoder, if possible. (Internally, the player may reinitialize the decoder, and will perform a seek to refresh the video properly.) You can watch the other hwdec properties to see whether this was successful.
写入它可能会更改当前使用的硬件解码器(如果可能的话)。(内部,播放器可能会重新初始化解码器,并执行搜索以正确刷新视频。)您可以查看其他 hwdec 属性以查看此操作是否成功。Unlike in mpv 0.9.x and before, this does not return the currently active hardware decoder. Since mpv 0.18.0, hwdec-current is available for this purpose.
与 mpv 0.9.x 及之前版本不同,此函数不返回当前活动的硬件解码器。自 mpv 0.18.0 版本起, hwdec-current 可用于此目的。- hwdec-current
- The current hardware decoding in use. If decoding is active, return one of
the values used by the hwdec option/property. no/false indicates
software decoding. If no decoder is loaded, the property is unavailable.
当前正在使用的硬件解码器。如果解码器处于活动状态,则返回 hwdec 选项/属性使用的值之一。 no /false 表示软件解码。如果没有加载解码器,则该属性不可用。 - hwdec-interop
This returns the currently loaded hardware decoding/output interop driver. This is known only once the VO has opened (and possibly later). With some VOs (like gpu), this might be never known in advance, but only when the decoder attempted to create the hw decoder successfully. (Using --gpu-hwdec-interop can load it eagerly.) If there are multiple drivers loaded, they will be separated by ,.
此函数返回当前加载的硬件解码器/输出互操作驱动程序。这只有在 VO 已打开(可能之后)时才为人所知。对于某些 VO(如 gpu ),可能永远无法提前知道,而只能在解码器成功创建 hw 解码器时才知道。(使用 --gpu-hwdec-interop 可以立即加载它。)如果有多个驱动程序已加载,它们将通过 , 分隔。If no VO is active or no interop driver is known, this property is unavailable.
如果没有活动 VO 或没有已知互操作驱动程序,则此属性不可用。This does not necessarily use the same values as hwdec. There can be multiple interop drivers for the same hardware decoder, depending on platform and VO.
这不一定使用与 hwdec 相同的值。根据平台和 VO,可能存在多个针对同一硬件解码器的互操作驱动程序。- width, height
- Video size. This uses the size of the video as decoded, or if no video
frame has been decoded yet, the (possibly incorrect) container indicated
size.
视频大小。这使用解码后的视频大小,或者如果尚未解码任何视频帧,则使用(可能不正确)的容器指示的大小。 - video-params
Video parameters, as output by the decoder (with overrides like aspect etc. applied). This has a number of sub-properties:
解码器输出的视频参数(应用了如纵横比等覆盖)。这包含多个子属性:- video-params/pixelformat
- The pixel format as string. This uses the same names as used in other
places of mpv.
像素格式作为字符串。这使用与其他地方相同的名称,如 mpv。 - video-params/hw-pixelformat
- The underlying pixel format as string. This is relevant for some cases
of hardware decoding and unavailable otherwise.
作为字符串的底层像素格式。这在某些硬件解码的情况下是相关的,否则不可用。 - video-params/average-bpp
- Average bits-per-pixel as integer. Subsampled planar formats use a
different resolution, which is the reason this value can sometimes be
odd or confusing. Can be unavailable with some formats.
平均每像素位数,以整数表示。子采样平面格式使用不同的分辨率,这也是为什么这个值有时可能是奇数或令人困惑的原因。某些格式可能不可用。 - video-params/w, video-params/h
- Video size as integers, with no aspect correction applied.
视频尺寸作为整数,未应用纵横比校正。 - video-params/dw, video-params/dh
- Video size as integers, scaled for correct aspect ratio.
视频尺寸作为整数,已缩放以正确显示纵横比。 - video-params/crop-x, video-params/crop-y
- Crop offset of the source video frame.
源视频帧的裁剪偏移量。 - video-params/crop-w, video-params/crop-h
- Video size after cropping.
裁剪后的视频大小。 - video-params/aspect
- Display aspect ratio as double.
以双精度浮点数显示宽高比。 - video-params/aspect-name
- Display aspect ratio name as string. The name corresponds to motion
picture film format that introduced given aspect ratio in film.
以字符串形式显示宽高比名称。该名称对应于在电影中引入给定宽高比的电影胶片格式。 - video-params/par
- Pixel aspect ratio. 像素纵横比。
- video-params/sar
- Storage aspect ratio. 存储纵横比。
- video-params/sar-name
- Storage aspect ratio name as string.
存储纵横比名称作为字符串。 - video-params/colormatrix
- The colormatrix in use as string. (Exact values subject to change.)
当前使用的颜色矩阵字符串。(精确值可能更改。) - video-params/colorlevels
- The colorlevels as string. (Exact values subject to change.)
颜色级别作为字符串。 (精确值可能更改。) - video-params/primaries
- The primaries in use as string. (Exact values subject to change.)
正在使用的基色作为字符串。 (精确值可能更改。) - video-params/gamma
- The gamma function in use as string. (Exact values subject to change.)
正在使用的伽玛函数作为字符串。 (精确值可能更改。) - video-params/sig-peak (deprecated) video-params/sig-peak (已弃用)
- The video file's tagged signal peak as float.
视频文件的标记信号峰值作为浮点数。 - video-params/light
- The light type in use as a string. (Exact values subject to change.)
正在使用的灯光类型作为字符串。(确切值可能会更改。) - video-params/chroma-location
- Chroma location as string. (Exact values subject to change.)
色度位置作为字符串。(确切值可能会更改。) - video-params/rotate
- Intended display rotation in degrees (clockwise).
期望显示旋转角度(顺时针)。 - video-params/stereo-in
- Source file stereo 3D mode. (See the format video filter's
stereo-in option.)
源文件立体 3D 模式。(参见 format 视频滤镜的 stereo-in 选项。) - video-params/alpha
- Alpha type. If the format has no alpha channel, this will be unavailable
(but in future releases, it could change to no). If alpha is
present, this is set to straight or premul.
Alpha 类型。如果格式没有 alpha 通道,此选项将不可用(但在未来的版本中,它可能变为 no )。如果存在 alpha,则设置为 straight 或 premul 。 - video-params/min-luma
- Minimum luminance, as reported by HDR10 metadata (in cd/m²)
HDR10 元数据报告的最小亮度(cd/m²)。 - video-params/max-luma
- Maximum luminance, as reported by HDR10 metadata (in cd/m²)
最大亮度,由 HDR10 元数据报告(单位:cd/m²) - video-params/max-cll
- Maximum content light level, as reported by HDR10 metadata (in cd/m²)
最大内容光亮度,由 HDR10 元数据报告(单位:cd/m²) - video-params/max-fall
- Maximum frame average light level, as reported by HDR10 metadata (in cd/m²)
最大帧平均光亮度,由 HDR10 元数据报告(单位:cd/m²) - video-params/scene-max-r
- MaxRGB of a scene for R component, as reported by HDR10+ metadata (in cd/m²)
场景的 MaxRGB 值(R 分量),由 HDR10+元数据报告(单位:cd/m²) - video-params/scene-max-g
- MaxRGB of a scene for G component, as reported by HDR10+ metadata (in cd/m²)
场景中 G 分量的 MaxRGB,由 HDR10+ 元数据报告(单位:cd/m²) - video-params/scene-max-b
- MaxRGB of a scene for B component, as reported by HDR10+ metadata (in cd/m²)
场景中 B 分量的 MaxRGB,由 HDR10+ 元数据报告(单位:cd/m²) - video-params/max-pq-y
- Maximum PQ luminance of a frame, as reported by peak detection (in PQ, 0-1)
帧的最大 PQ 亮度,由峰值检测报告(单位:PQ,0-1) - video-params/avg-pq-y
- Average PQ luminance of a frame, as reported by peak detection (in PQ, 0-1)
帧的平均 PQ 亮度,由峰值检测报告(在 PQ 中,0-1)
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_MAP "pixelformat" MPV_FORMAT_STRING "hw-pixelformat" MPV_FORMAT_STRING "w" MPV_FORMAT_INT64 "h" MPV_FORMAT_INT64 "dw" MPV_FORMAT_INT64 "dh" MPV_FORMAT_INT64 "aspect" MPV_FORMAT_DOUBLE "par" MPV_FORMAT_DOUBLE "colormatrix" MPV_FORMAT_STRING "colorlevels" MPV_FORMAT_STRING "primaries" MPV_FORMAT_STRING "gamma" MPV_FORMAT_STRING "sig-peak" MPV_FORMAT_DOUBLE "light" MPV_FORMAT_STRING "chroma-location" MPV_FORMAT_STRING "rotate" MPV_FORMAT_INT64 "stereo-in" MPV_FORMAT_STRING "average-bpp" MPV_FORMAT_INT64 "alpha" MPV_FORMAT_STRING "min-luma" MPV_FORMAT_DOUBLE "max-luma" MPV_FORMAT_DOUBLE "max-cll" MPV_FORMAT_DOUBLE "max-fall" MPV_FORMAT_DOUBLE "scene-max-r" MPV_FORMAT_DOUBLE "scene-max-g" MPV_FORMAT_DOUBLE "scene-max-b" MPV_FORMAT_DOUBLE "max-pq-y" MPV_FORMAT_DOUBLE "avg-pq-y" MPV_FORMAT_DOUBLE
- dwidth, dheight
Video display size. This is the video size after filters and aspect scaling have been applied. The actual video window size can still be different from this, e.g. if the user resized the video window manually.
视频显示尺寸。这是应用过滤器和对宽高比缩放后的视频尺寸。实际视频窗口尺寸可能与此不同,例如,如果用户手动调整了视频窗口大小。These have the same values as video-out-params/dw and video-out-params/dh.
这些值与 video-out-params/dw 和 video-out-params/dh 相同。- video-dec-params
- Exactly like video-params, but no overrides applied.
与 video-params 完全相同,但没有应用覆盖。 - video-out-params
Same as video-params, but after video filters have been applied. If there are no video filters in use, this will contain the same values as video-params. Note that this is still not necessarily what the video window uses, since the user can change the window size, and all real VOs do their own scaling independently from the filter chain.
与 video-params 相同,但在应用视频过滤器之后。如果没有使用视频过滤器,这将包含与 video-params 相同的值。请注意,这仍然不一定是视频窗口使用的值,因为用户可以更改窗口大小,并且所有真实 VO 都会独立于过滤器链进行自己的缩放。Has the same sub-properties as video-params.
与 video-params 具有相同的子属性。- video-target-params
Same as video-params, but with the target properties that VO outputs to.
与 video-params 相同,但包含 VO 输出的目标属性。Has the same sub-properties as video-params.
与 video-params 具有相同的子属性。- video-frame-info
Approximate information of the current frame. Note that if any of these are used on OSD, the information might be off by a few frames due to OSD redrawing and frame display being somewhat disconnected, and you might have to pause and force a redraw.
当前帧的大致信息。请注意,如果在 OSD 上使用这些信息,由于 OSD 重绘和帧显示有些脱节,信息可能会因帧数偏差而略有误差,可能需要暂停并强制重绘。This has a number of sub-properties:
这有几个子属性:- video-frame-info/picture-type
- The type of the picture. It can be "I" (intra), "P" (predicted), "B"
(bi-dir predicted) or unavailable.
图片的类型。可以是“I”(帧内),“P”(预测),“B”(双向预测)或不可用。 - video-frame-info/interlaced
- Whether the content of the frame is interlaced.
帧的内容是否隔行扫描。 - video-frame-info/tff
- If the content is interlaced, whether the top field is displayed first.
如果内容是交织的,则首先显示顶部字段。 - video-frame-info/repeat
- Whether the frame must be delayed when decoding.
解码时是否必须延迟帧。 - video-frame-info/gop-timecode
- String with the GOP timecode encoded in the frame.
包含在帧中编码的 GOP 时间码的字符串。 - video-frame-info/smpte-timecode
- String with the SMPTE timecode encoded in the frame.
包含在帧中编码的 SMPTE 时间码的字符串。 - video-frame-info/estimated-smpte-timecode
- Estimated timecode based on the current playback position and frame count.
基于当前播放位置和帧计数估计的时间码。
- container-fps
Container FPS. This can easily contain bogus values. For videos that use modern container formats or video codecs, this will often be incorrect.
容器帧率。这很容易包含无效值。对于使用现代容器格式或视频编解码器的视频,这通常是不正确的。(Renamed from fps.) (从 fps 重命名。)
- estimated-vf-fps
- Estimated/measured FPS of the video filter chain output. (If no filters
are used, this corresponds to decoder output.) This uses the average of
the 10 past frame durations to calculate the FPS. It will be inaccurate
if frame-dropping is involved (such as when framedrop is explicitly
enabled, or after precise seeking). Files with imprecise timestamps (such
as Matroska) might lead to unstable results.
视频滤波器链输出估计/测量帧率。(如果没有使用过滤器,则对应解码器输出。)这使用过去 10 个帧持续时间的平均值来计算帧率。如果涉及帧丢弃(例如,当显式启用 framedrop 或在精确搜索后),则可能不准确。具有不精确时间戳的文件(如 Matroska)可能导致结果不稳定。 - current-window-scale (RW) current-window-scale (读写)
The window-scale value calculated from the current window size. This has the same value as window-scale if the window size was not changed since setting the option, and the window size was not restricted in other ways. If the window is fullscreened, this will return the scale value calculated from the last non-fullscreen size of the window. The property is unavailable if no video is active.
从当前窗口大小计算得到的 window-scale 值。如果自设置选项以来窗口大小未更改,并且窗口大小未以其他方式受限,则此值与 window-scale 相同。如果窗口全屏,则此值将返回从窗口最后非全屏大小计算得到的缩放值。如果没有活动视频,则此属性不可用。It is also possible to write to this property. This has the same behavior as writing window-scale. Note that writing to current-window-scale will not affect the value of window-scale.
也可以写入此属性。此行为与写入 window-scale 相同。请注意,写入 current-window-scale 不会影响 window-scale 的值。- focused
- Whether the window has focus. Might not be supported by all VOs.
窗口是否具有焦点。可能不是所有 VOs 都支持。 - ambient-light
- Ambient lighting condition in lux. (macOS only)
环境光照条件,单位为勒克斯。(仅限 macOS) - display-names
- Names of the displays that the mpv window covers. On X11, these
are the xrandr names (LVDS1, HDMI1, DP1, VGA1, etc.). On Windows, these
are the GDI names (\.DISPLAY1, \.DISPLAY2, etc.) and the first display
in the list will be the one that Windows considers associated with the
window (as determined by the MonitorFromWindow API.) On macOS these are the
Display Product Names as used in the System Information with a serial number
in parentheses and only one display name is returned since a window can only be
on one screen. On Wayland, these are the wl_output names if protocol
version >= 4 is used (LVDS-1, HDMI-A-1, X11-1, etc.), or the wl_output model
reported by the geometry event if protocol version < 4 is used.
mpv 窗口覆盖的显示器名称。在 X11 上,这些是 xrandr 名称(LVDS1、HDMI1、DP1、VGA1 等)。在 Windows 上,这些是 GDI 名称(\.DISPLAY1、\.DISPLAY2 等),列表中的第一个显示器将是 Windows 认为与窗口关联的显示器(由 MonitorFromWindow API 确定)。在 macOS 上,这些是系统信息中使用的显示产品名称,括号内带有序列号,并且只返回一个显示器名称,因为窗口只能位于一个屏幕上。在 Wayland 上,如果使用协议版本 >= 4,则是 wl_output 名称(LVDS-1、HDMI-A-1、X11-1 等),如果使用协议版本 < 4,则是几何事件报告的 wl_output 型号。 - display-fps
- The refresh rate of the current display. Currently, this is the lowest FPS
of any display covered by the video, as retrieved by the underlying system
APIs (e.g. xrandr on X11). It is not the measured FPS. It's not necessarily
available on all platforms. Note that any of the listed facts may change
any time without a warning.
当前显示器的刷新率。目前,这是通过底层系统 API(例如 X11 上的 xrandr)获取的任何显示覆盖的视频的最低 FPS,它不是测量的 FPS。这不一定在所有平台上都可用。请注意,列出的任何事实都可能随时更改,而无需警告。 - estimated-display-fps
- The actual rate at which display refreshes seem to occur, measured by
system time. Only available if display-sync mode (as selected by
--video-sync) is active.
显示器似乎刷新的实际速率,通过系统时间测量。仅在显示同步模式(由 --video-sync 选择)激活时才可用。 - vsync-jitter
- Estimated deviation factor of the vsync duration.
Vsync 持续时间的估计偏差因子。 - display-width, display-height
- The current display's horizontal and vertical resolution in pixels. Whether
or not these values update as the mpv window changes displays depends on
the windowing backend. It may not be available on all platforms.
当前显示器的水平和垂直分辨率(以像素为单位)。这些值是否随着 mpv 窗口的变化而更新取决于窗口后端。这可能不是所有平台上都可用。 - display-hidpi-scale
- The HiDPI scale factor as reported by the windowing backend. If no VO is
active, or if the VO does not report a value, this property is unavailable.
It may be saner to report an absolute DPI, however, this is the way HiDPI
support is implemented on most OS APIs. See also --hidpi-window-scale.
窗口后端报告的 HiDPI 缩放因子。如果没有活动 VO,或者 VO 没有报告值,则此属性不可用。然而,报告绝对 DPI 可能更合理,但这是在大多数操作系统 API 上实现 HiDPI 支持的方式。另见 --hidpi-window-scale 。 - osd-width, osd-height
Last known OSD width (can be 0). This is needed if you want to use the overlay-add command. It gives you the actual OSD/window size (not including decorations drawn by the OS window manager).
最后已知 OSD 宽度(可能为 0)。如果您想使用 overlay-add 命令,则需要此值。它提供了实际的 OSD/窗口大小(不包括操作系统窗口管理器绘制的装饰)。Alias to osd-dimensions/w and osd-dimensions/h.
别名到 osd-dimensions/w 和 osd-dimensions/h 。- osd-par
Last known OSD display pixel aspect (can be 0).
最后已知 OSD 显示像素宽高比(可能为 0)。Alias to osd-dimensions/osd-par. 别名到 osd-dimensions/osd-par 。
- osd-dimensions
Last known OSD dimensions.
最后已知 OSD 尺寸。Has the following sub-properties (which can be read as MPV_FORMAT_NODE or Lua table with mp.get_property_native):
具有以下子属性(可以读取为 MPV_FORMAT_NODE 或 Lua 表格中的 mp.get_property_native ):- osd-dimensions/w
- Size of the VO window in OSD render units (usually pixels, but may be
scaled pixels with VOs like xv).
窗口大小为 OSD 渲染单元中的 VO(通常为像素,但可能是带有 VO 如 xv 的缩放像素)。 - osd-dimensions/h
- Size of the VO window in OSD render units,
窗口 VO 尺寸在 OSD 渲染单元中 - osd-dimensions/par
- Pixel aspect ratio of the OSD (usually 1).
OSD(通常为 1)的像素宽高比。 - osd-dimensions/aspect
- Display aspect ratio of the VO window. (Computing from the properties
above.)
VO 窗口的显示宽高比。(从上述属性计算得出。) - osd-dimensions/mt, osd-dimensions/mb, osd-dimensions/ml, osd-dimensions/mr
- OSD to video margins (top, bottom, left, right). This describes the
area into which the video is rendered.
OSD 到视频边距(顶部、底部、左侧、右侧)。这描述了视频渲染的区域。
Any of these properties may be unavailable or set to dummy values if the VO window is not created or visible.
如果 VO 窗口未创建或不可见,则这些属性可能不可用或设置为占位符值。- term-size
The current terminal size.
当前终端大小。This has two sub-properties.
这有两个子属性。- term-size/w
- width of the terminal in cells
终端的单元格宽度 - term-size/h
- height of the terminal in cells
终端的单元格高度
This property is not observable. Reacting to size changes requires polling.
此属性不可观察。响应尺寸变化需要轮询。- window-id
- Read-only - mpv's window id. May not always be available, i.e due to window
not being opened yet or not being supported by the VO.
只读 - mpv 的窗口 ID。可能并不总是可用,例如窗口尚未打开或不受 VO 支持。 - mouse-pos
Read-only - last known mouse position, normalized to OSD dimensions.
只读 - 最后已知鼠标位置,已归一化到 OSD 尺寸。Has the following sub-properties (which can be read as MPV_FORMAT_NODE or Lua table with mp.get_property_native):
具有以下子属性(可以读取为 MPV_FORMAT_NODE 或 Lua 表格中的 mp.get_property_native ):- mouse-pos/x, mouse-pos/y
- Last known coordinates of the mouse pointer.
鼠标指针最后已知坐标。 - mouse-pos/hover
- Boolean - whether the mouse pointer hovers the video window. The
coordinates should be ignored when this value is false, because the
video backends update them only when the pointer hovers the window.
布尔值 - 是否鼠标指针悬停在视频窗口上。当此值为 false 时,应忽略坐标,因为视频后端仅在指针悬停在窗口上时更新它们。
- touch-pos
Read-only - last known touch point positions, normalized to OSD dimensions.
只读 - 最后已知触摸点位置,归一化到 OSD 尺寸。This has a number of sub-properties. Replace N with the 0-based touch point index. Whenever a new finger touches the screen, a new touch point is added to the list of touch points with the smallest unused N available.
这有几个子属性。将 N 替换为基于 0 的触摸点索引。每当新手指触摸屏幕时,就会将新的触摸点添加到触摸点列表中,其中包含最小的未使用 N 。- touch-pos/count
- Number of active touch points.
活跃触摸点的数量。 - touch-pos/N/x, touch-pos/N/y
- Position of the Nth touch point.
第 N 个触摸点的位置。 - touch-pos/N/id
- Unique identifier of the touch point. This can be used to identify
individual touch points when their indexes change.
触摸点的唯一标识符。这可以用来在索引改变时识别单个触摸点。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each touch point) "x" MPV_FORMAT_INT64 "y" MPV_FORMAT_INT64 "id" MPV_FORMAT_INT64
- sub-ass-extradata
- The current ASS subtitle track's extradata. There is no formatting done.
The extradata is returned as a string as-is. This property is not
available for non-ASS subtitle tracks.
当前 ASS 字幕轨道的 extradata。没有进行格式化。extradata 以字符串形式原样返回。此属性对于非 ASS 字幕轨道不可用。 - sub-text
The current subtitle text regardless of sub visibility. Formatting is stripped. If the subtitle is not text-based (i.e. DVD/BD subtitles), an empty string is returned.
无论子标题可见性如何,当前的字幕文本。格式被移除。如果字幕不是基于文本的(即 DVD/BD 字幕),则返回空字符串。This has sub-properties for different formats:
此属性具有不同格式的子属性:- sub-text/ass
Like sub-text, but return the text in ASS format. Text subtitles in other formats are converted. For native ASS subtitles, events that do not contain any text (but vector drawings etc.) are not filtered out. If multiple events match with the current playback time, they are concatenated with line breaks. Contains only the "Text" part of the events.
类似于 sub-text ,但以 ASS 格式返回文本。其他格式的文本字幕将被转换。对于原生 ASS 字幕,不包含任何文本(但矢量图形等)的事件不会被过滤掉。如果有多个事件与当前播放时间匹配,它们将使用换行符连接。仅包含事件的“Text”部分。This property is not enough to render ASS subtitles correctly, because ASS header and per-event metadata are not returned. Use /ass-full for that.
此属性不足以正确渲染 ASS 字幕,因为 ASS 头信息和每个事件的元数据未返回。请使用 /ass-full 进行此操作。- sub-text/ass-full
- Like sub-text-ass, but return the full event with all fields, formatted as
lines in a .ass text file. Use with sub-ass-extradata for style information.
类似于 sub-text-ass ,但返回包含所有字段的事件,格式化为行,存储在.ass 文本文件中。与 sub-ass-extradata 一起使用以获取样式信息。
- sub-text-ass (deprecated) sub-text-ass (已弃用)
- Deprecated alias for sub-text/ass.
已弃用的 sub-text/ass 别名。 - secondary-sub-text
- Same as sub-text (with the same sub-properties), but for the secondary subtitles.
与 sub-text (具有相同的子属性)相同,但用于次要副标题。 - sub-start
The current subtitle start time (in seconds). If there's multiple current subtitles, returns the first start time. If no current subtitle is present null is returned instead.
当前副标题的开始时间(以秒为单位)。如果有多个当前副标题,则返回第一个开始时间。如果没有当前副标题,则返回 null。This has a sub-property:
这有一个子属性:- secondary-sub-start
- Same as sub-start, but for the secondary subtitles.
与 sub-start 相同,但用于副字幕。 - sub-end
The current subtitle end time (in seconds). If there's multiple current subtitles, return the last end time. If no current subtitle is present, or if it's present but has unknown or incorrect duration, null is returned instead.
当前副标题结束时间(以秒为单位)。如果有多个当前副标题,则返回最后一个结束时间。如果没有当前副标题,或者当前副标题存在但持续时间未知或不正确,则返回 null。This has a sub-property:
这有一个子属性:- secondary-sub-end
- Same as sub-end, but for the secondary subtitles.
与 sub-end 相同,但用于副字幕。 - playlist-pos (RW) playlist-pos (读写)
Current position on playlist. The first entry is on position 0. Writing to this property may start playback at the new position.
播放列表中的当前位置。第一个条目位于位置 0。写入此属性可能会在新位置开始播放。In some cases, this is not necessarily the currently playing file. See explanation of current and playing flags in playlist.
在某些情况下,这不一定是指当前正在播放的文件。请参阅 playlist 中 current 和 playing 标志的解释。If there the playlist is empty, or if it's non-empty, but no entry is "current", this property returns -1. Likewise, writing -1 will put the player into idle mode (or exit playback if idle mode is not enabled). If an out of range index is written to the property, this behaves as if writing -1. (Before mpv 0.33.0, instead of returning -1, this property was unavailable if no playlist entry was current.)
如果播放列表为空,或者播放列表不为空但没有任何条目是“当前”的,则此属性返回-1。同样,写入-1 将使播放器进入空闲模式(如果未启用空闲模式,则退出播放)。如果写入属性的是超出范围的索引,则此行为与写入-1 相同。(在 mpv 0.33.0 之前,如果没有当前播放列表条目,则此属性不可用,而不是返回-1。)Writing the current value back to the property will have no effect. Use playlist-play-index to restart the playback of the current entry if desired.
将当前值写回属性将不会有任何效果。如果需要,请使用 playlist-play-index 重新播放当前条目。- playlist-pos-1 (RW) playlist-pos-1 (读写)
- Same as playlist-pos, but 1-based.
与 playlist-pos 相同,但基于 1。 - playlist-current-pos (RW) playlist-current-pos (读写)
Index of the "current" item on playlist. This usually, but not necessarily, the currently playing item (see playlist-playing-pos). Depending on the exact internal state of the player, it may refer to the playlist item to play next, or the playlist item used to determine what to play next.
播放列表中“当前”项的索引。这通常,但不一定是当前播放的项(见 playlist-playing-pos )。根据播放器的确切内部状态,它可能指的是下一个要播放的播放列表项,或者用于确定下一个要播放的播放列表项。For reading, this is exactly the same as playlist-pos.
对于读取,这与 playlist-pos 完全相同。For writing, this only sets the position of the "current" item, without stopping playback of the current file (or starting playback, if this is done in idle mode). Use -1 to remove the current flag.
对于写入,这仅设置“当前”项的位置,而不会停止当前文件的播放(或如果在此空闲模式下执行,则开始播放)。使用 -1 来移除当前标记。This property is only vaguely useful. If set during playback, it will typically cause the playlist entry after it to be played next. Another possibly odd observable state is that if playlist-next is run during playback, this property is set to the playlist entry to play next (unlike the previous case). There is an internal flag that decides whether the current playlist entry or the next one should be played, and this flag is currently inaccessible for API users. (Whether this behavior will kept is possibly subject to change.)
此属性只有一点用处。如果在播放期间设置,通常会导致播放该属性之后的播放列表条目。另一个可能奇怪的可观察状态是,如果在播放期间运行 playlist-next ,此属性将设置为下一个要播放的播放列表条目(与上一个情况不同)。有一个内部标志决定是播放当前播放列表条目还是下一个条目,并且此标志目前对 API 用户不可访问。(此行为是否保留可能有所变化。)- playlist-playing-pos
Index of the "playing" item on playlist. A playlist item is "playing" if it's being loaded, actually playing, or being unloaded. This property is set during the MPV_EVENT_START_FILE (start-file) and the MPV_EVENT_START_END (end-file) events. Outside of that, it returns -1. If the playlist entry was somehow removed during playback, but playback hasn't stopped yet, or is in progress of being stopped, it also returns -1. (This can happen at least during state transitions.)
播放列表中 "playing" 项的索引。播放列表项 "playing" 如果正在加载、实际播放或正在卸载,则表示正在播放。此属性在 MPV_EVENT_START_FILE ( start-file ) 和 MPV_EVENT_START_END ( end-file ) 事件期间设置。在此之外,它返回 -1。如果播放列表条目在播放过程中被意外删除,但播放尚未停止,或正在停止过程中,它也返回 -1。(这至少在状态转换期间可能发生。)In the "playing" state, this is usually the same as playlist-pos, except during state changes, or if playlist-current-pos was written explicitly.
在 "playing" 状态下,这通常与 playlist-pos 相同,除非在状态变化期间,或如果 playlist-current-pos 被显式写入。- playlist-count
- Number of total playlist entries.
播放列表条目总数。 - playlist-path
- The original path of the playlist for the current entry before mpv expanded
the entries. Unavailable if the file was not originally associated with a
playlist in some way.
当前条目在 mpv 扩展条目之前播放列表的原始路径。如果文件最初未以某种方式与播放列表关联,则不可用。 - playlist
Playlist, current entry marked. Currently, the raw property value is useless.
播放列表,当前条目已标记。当前,原始属性值是无用的。This has a number of sub-properties. Replace N with the 0-based playlist entry index.
这有几个子属性。将 N 替换为基于 0 的播放列表条目索引。- playlist/count
- Number of playlist entries (same as playlist-count).
播放列表条目数量(与 playlist-count 相同)。 - playlist/N/filename
- Filename of the Nth entry.
第 N 个条目的文件名。 - playlist/N/playing
- yes/true if the playlist-playing-pos property points to this
entry, no/false or unavailable otherwise.
yes /true 如果 playlist-playing-pos 属性指向此条目, no /false 或不可用否则。 - playlist/N/current
- yes/true if the playlist-current-pos property points to this
entry, no/false or unavailable otherwise.
yes /true 如果 playlist-current-pos 属性指向此条目, no /false 或不可用否则。 - playlist/N/title
- Name of the Nth entry. Available if the playlist file contains
such fields and mpv's parser supports it for the given
playlist format, or if the playlist entry has been opened before and a
media-title other than filename has been acquired.
第 N 个条目的名称。如果播放列表文件包含此类字段且 mpv 的解析器支持该播放列表格式,或者播放列表条目之前已打开并且已获取到除文件名之外的媒体标题,则可用。 - playlist/N/id
- Unique ID for this entry. This is an automatically assigned integer ID
that is unique for the entire life time of the current mpv core
instance. Other commands, events, etc. use this as playlist_entry_id
fields.
此条目的唯一标识符。这是一个自动分配的整数 ID,在整个 mpv 核心实例的生命周期内都是唯一的。其他命令、事件等使用此作为 playlist_entry_id 字段。 - playlist/N/playlist-path
- The original path of the playlist for this entry before mpv expanded
it. Unavailable if the file was not originally associated with a playlist
in some way.
此条目在 mpv 扩展之前播放列表的原始路径。如果文件最初没有以某种方式与播放列表关联,则不可用。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each playlist entry) "filename" MPV_FORMAT_STRING "current" MPV_FORMAT_FLAG (might be missing; since mpv 0.7.0) "playing" MPV_FORMAT_FLAG (same) "title" MPV_FORMAT_STRING (optional) "id" MPV_FORMAT_INT64
- track-list
List of audio/video/sub tracks, current entry marked.
音频/视频/子轨道列表,当前条目标记。This has a number of sub-properties. Replace N with the 0-based track index.
此属性包含多个子属性。将 N 替换为基于 0 的轨道索引。- track-list/count
- Total number of tracks.
轨道总数。 - track-list/video
- The list of video tracks. This is only usable for printing and its value
can't be retrieved.
视频轨道列表。此属性仅用于打印,其值无法检索。 - track-list/audio
- The list of audio tracks. This is only usable for printing and its value
can't be retrieved.
音频轨道列表。此属性仅用于打印,其值无法检索。 - track-list/sub
- The list of sub tracks. This is only usable for printing and its value
can't be retrieved.
子轨道列表。这仅适用于打印,其值无法检索。 - track-list/N/id
- The ID as it's used for --sid/--aid/--vid. This is unique
within tracks of the same type (sub/audio/video), but otherwise not.
用作 --sid / --aid / --vid 的 ID。在同一类型的轨道(子/音频/视频)中是唯一的,但除此之外不是。 - track-list/N/type
- String describing the media type. One of audio, video, sub.
描述媒体类型的字符串。以下之一 audio , video , sub 。 - track-list/N/src-id
- Track ID as used in the source file. Not always available. (It is
missing if the format has no native ID, if the track is a pseudo-track
that does not exist in this way in the actual file, or if the format
is handled by libavformat, and the format was not whitelisted as having
track IDs.)
在源文件中使用的轨道 ID。不一定可用。(如果格式没有本地 ID,如果轨道是伪轨道,实际上文件中不存在这种轨道,或者如果格式由 libavformat 处理,并且格式未被列入具有轨道 ID 的白名单,则缺失。) - track-list/N/title
- Track title as it is stored in the file. Not always available.
跟踪文件中存储的标题。不一定总是可用。 - track-list/N/lang
- Track language as identified by the file. Not always available.
跟踪文件识别的语言。不一定总是可用。 - track-list/N/image
- yes/true if this is a video track that consists of a single
picture, no/false or unavailable otherwise. The heuristic used to
determine if a stream is an image doesn't attempt to detect images in
codecs normally used for videos. Otherwise, it is reliable.
yes /true 如果这是一个由单张图片组成的视频轨道, no /false 或不可用。用于确定流是否为图像的启发式方法不尝试检测通常用于视频的编解码器中的图像。否则,它是可靠的。 - track-list/N/albumart
- yes/true if this is an image embedded in an audio file or external
cover art, no/false or unavailable otherwise.
yes /true 如果这是一个嵌入在音频文件中的图像或外部封面艺术, no /false 或不可用。 - track-list/N/default
- yes/true if the track has the default flag set in the file,
no/false or unavailable otherwise.
yes /true 如果轨道在文件中设置了默认标志, no /false 或不可用否则。 - track-list/N/forced
- yes/true if the track has the forced flag set in the file,
no/false or unavailable otherwise.
yes /true 如果轨道在文件中设置了强制标志, no /false 或不可用否则。 - track-list/N/dependent
- yes/true if the track has the dependent flag set in the file,
no/false or unavailable otherwise.
yes /true 如果轨道在文件中设置了依赖标志, no /false 或不可用否则。 - track-list/N/visual-impaired
- yes/true if the track has the visual impaired flag set in the file,
no/false or unavailable otherwise.
yes /true 如果轨道在文件中设置了视觉障碍标志, no /false 或不可用否则。 - track-list/N/hearing-impaired
- yes/true if the track has the hearing impaired flag set in the file,
no/false or unavailable otherwise.
yes /true 如果文件中设置了听力受损标志的轨道, no /false 或不可用。 - track-list/N/hls-bitrate
- The bitrate of the HLS stream, if available.
如果可用,HLS 流的比特率。 - track-list/N/program-id
- The program ID of the HLS stream, if available.
如果可用,HLS 流的节目 ID。 - track-list/N/codec
- The codec name used by this track, for example h264. Unavailable
in some rare cases.
此轨道使用的编解码器名称,例如 h264 。在某些罕见情况下不可用。 - track-list/N/codec-desc
- The codec descriptive name used by this track.
此轨道使用的编解码器描述性名称。 - track-list/N/codec-profile
- The codec profile used by this track. Available only if the track has
been already decoded.
此轨道使用的编解码器配置文件。仅在轨道已被解码的情况下可用。 - track-list/N/external
- yes/true if the track is an external file, no/false or
unavailable otherwise. This is set for separate subtitle files.
yes /true 如果轨道是外部文件, no /false 或不可用。这是为单独的字幕文件设置的。 - track-list/N/external-filename
- The filename if the track is from an external file, unavailable
otherwise.
如果音轨来自外部文件,则为文件名,否则不可用。 - track-list/N/selected
- yes/true if the track is currently decoded, no/false or
unavailable otherwise.
yes /true 如果音轨当前已解码, no /false 或不可用。 - track-list/N/main-selection
- It indicates the selection order of tracks for the same type.
If a track is not selected, or is selected by the --lavfi-complex,
it is not available. For subtitle tracks, 0 represents the sid,
and 1 represents the secondary-sid.
表示相同类型音轨的选择顺序。如果音轨未选择,或由 --lavfi-complex 选择,则不可用。对于字幕音轨, 0 代表 sid , 1 代表 secondary-sid 。 - track-list/N/ff-index
- The stream index as usually used by the FFmpeg utilities. Note that
this can be potentially wrong if a demuxer other than libavformat
(--demuxer=lavf) is used. For mkv files, the index will usually
match even if the default (builtin) demuxer is used, but there is
no hard guarantee.
通常由 FFmpeg 工具使用的流索引。注意,如果使用除 libavformat ( --demuxer=lavf ) 之外的解复用器,这可能会出错。对于 mkv 文件,即使使用默认(内置)解复用器,索引通常也会匹配,但没有硬性保证。 - track-list/N/decoder
- If this track is being decoded, the short decoder name,
如果此轨道正在解码,则短解码器名称, - track-list/N/decoder-desc
- If this track is being decoded, the human-readable decoder name,
如果此轨道正在解码,则可读的解码器名称, - track-list/N/demux-w, track-list/N/demux-h
- Video size hint as indicated by the container. (Not always accurate.)
由容器指示的视频大小提示。(不一定准确。) - track-list/N/demux-crop-x, track-list/N/demux-crop-y
- Crop offset of the source video frame.
源视频帧的裁剪偏移量。 - track-list/N/demux-crop-w, track-list/N/demux-crop-h
- Video size after cropping.
裁剪后的视频大小。 - track-list/N/demux-channel-count
- Number of audio channels as indicated by the container. (Not always
accurate - in particular, the track could be decoded as a different
number of channels.)
容器中指示的音频通道数。(不一定准确 - 特别是轨道可能被解码为不同的通道数。) - track-list/N/demux-channels
- Channel layout as indicated by the container. (Not always accurate.)
容器中指示的通道布局。(不一定准确。) - track-list/N/demux-samplerate
- Audio sample rate as indicated by the container. (Not always accurate.)
容器中指示的音频采样率。(不一定准确。) - track-list/N/demux-fps
- Video FPS as indicated by the container. (Not always accurate.)
容器中指示的视频帧率。(不一定准确。) - track-list/N/demux-bitrate
- Audio average bitrate, in bits per second. (Not always accurate.)
音频平均比特率,以每秒比特数表示。(不一定准确。) - track-list/N/demux-rotation
- Video clockwise rotation metadata, in degrees.
视频顺时针旋转元数据,单位为度。 - track-list/N/demux-par
- Pixel aspect ratio. 像素纵横比。
- track-list/N/format-name
- Short name for format from ffmpeg. If the track is audio, this will be
the name of the sample format. If the track is video, this will be the
name of the pixel format.
ffmpeg 中格式的简称。如果轨道是音频,这将是指示样本格式的名称。如果轨道是视频,这将是指示像素格式的名称。 - track-list/N/audio-channels (deprecated) track-list/N/audio-channels (已弃用)
- Deprecated alias for track-list/N/demux-channel-count.
已弃用的 track-list/N/demux-channel-count 别名。 - track-list/N/replaygain-track-peak, track-list/N/replaygain-track-gain
- Per-track replaygain values. Only available for audio tracks with
corresponding information stored in the source file.
每个轨道的 replaygain 值。仅适用于存储在源文件中的相应信息的音频轨道。 - track-list/N/replaygain-album-peak, track-list/N/replaygain-album-gain
- Per-album replaygain values. If the file has per-track but no per-album
information, the per-album values will be copied from the per-track
values currently. It's possible that future mpv versions will make
these properties unavailable instead in this case.
"每个专辑的 replaygain 值。如果文件有每个轨道的 replaygain 值但没有每个专辑的信息,则当前每个轨道的值将被复制到每个专辑的值中。未来 mpv 版本可能会在这种情况下使这些属性不可用。 - track-list/N/dolby-vision-profile, track-list/N/dolby-vision-level
- Dolby Vision profile and level. May not be available if the container
does not provide this information.
Dolby Vision 配置文件和级别。如果容器不提供此信息,可能不可用。 - track-list/N/metadata,
- Works like the metadata property, but it accesses metadata that is
set per track/stream instead of global values for the entire file.
与 metadata 属性类似,但它访问的是每个轨道/流的元数据,而不是整个文件的全局值。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each track) "id" MPV_FORMAT_INT64 "type" MPV_FORMAT_STRING "src-id" MPV_FORMAT_INT64 "title" MPV_FORMAT_STRING "lang" MPV_FORMAT_STRING "image" MPV_FORMAT_FLAG "albumart" MPV_FORMAT_FLAG "default" MPV_FORMAT_FLAG "forced" MPV_FORMAT_FLAG "dependent" MPV_FORMAT_FLAG "visual-impaired" MPV_FORMAT_FLAG "hearing-impaired" MPV_FORMAT_FLAG "hls-bitrate" MPV_FORMAT_INT64 "program-id" MPV_FORMAT_INT64 "selected" MPV_FORMAT_FLAG "main-selection" MPV_FORMAT_INT64 "external" MPV_FORMAT_FLAG "external-filename" MPV_FORMAT_STRING "codec" MPV_FORMAT_STRING "codec-desc" MPV_FORMAT_STRING "codec-profile" MPV_FORMAT_STRING "ff-index" MPV_FORMAT_INT64 "decoder" MPV_FORMAT_STRING "decoder-desc" MPV_FORMAT_STRING "demux-w" MPV_FORMAT_INT64 "demux-h" MPV_FORMAT_INT64 "demux-crop-x" MPV_FORMAT_INT64 "demux-crop-y" MPV_FORMAT_INT64 "demux-crop-w" MPV_FORMAT_INT64 "demux-crop-h" MPV_FORMAT_INT64 "demux-channel-count" MPV_FORMAT_INT64 "demux-channels" MPV_FORMAT_STRING "demux-samplerate" MPV_FORMAT_INT64 "demux-fps" MPV_FORMAT_DOUBLE "demux-bitrate" MPV_FORMAT_INT64 "demux-rotation" MPV_FORMAT_INT64 "demux-par" MPV_FORMAT_DOUBLE "format-name" MPV_FORMAT_STRING "audio-channels" MPV_FORMAT_INT64 "replaygain-track-peak" MPV_FORMAT_DOUBLE "replaygain-track-gain" MPV_FORMAT_DOUBLE "replaygain-album-peak" MPV_FORMAT_DOUBLE "replaygain-album-gain" MPV_FORMAT_DOUBLE "dolby-vision-profile" MPV_FORMAT_INT64 "dolby-vision-level" MPV_FORMAT_INT64 "metadata" MPV_FORMAT_NODE_MAP (key and string value for each metadata entry)
- current-tracks/...
This gives access to currently selected tracks. It redirects to the correct entry in track-list.
这提供了访问当前选中轨道的权限。它将重定向到正确的条目在 track-list 。The following sub-entries are defined: video, audio, sub, sub2
以下子条目被定义: video , audio , sub , sub2For example, current-tracks/audio/lang returns the current audio track's language field (the same value as track-list/N/lang).
例如, current-tracks/audio/lang 返回当前音频轨道的语言字段(与 track-list/N/lang 相同的值)。If tracks of the requested type are selected via --lavfi-complex, the first one is returned.
如果通过 --lavfi-complex 选择请求类型的轨道,则返回第一个。- chapter-list (RW) chapter-list (读写)
List of chapters, current entry marked.
章节列表,当前条目已标记。This has a number of sub-properties. Replace N with the 0-based chapter index.
具有多个子属性。将 N 替换为基于 0 的章节索引。- chapter-list/count
- Number of chapters. 章节数量。
- chapter-list/N/title
- Chapter title as stored in the file. Not always available.
存储在文件中的章节标题。不一定总是可用。 - chapter-list/N/time
- Chapter start time in seconds as float.
章节开始时间(以秒为浮点数)。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each chapter) "title" MPV_FORMAT_STRING "time" MPV_FORMAT_DOUBLE
- af, vf (RW) af , vf (读写)
See --vf/--af and the vf/af command.
请参阅 --vf / --af 以及 vf / af 命令。When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each filter entry) "name" MPV_FORMAT_STRING "label" MPV_FORMAT_STRING [optional] "enabled" MPV_FORMAT_FLAG [optional] "params" MPV_FORMAT_NODE_MAP [optional] "key" MPV_FORMAT_STRING "value" MPV_FORMAT_STRING
It's also possible to write the property using this format.
也可以使用此格式来编写属性。- seekable
- Whether it's generally possible to seek in the current file.
当前文件是否通常可以搜索。 - partially-seekable
Whether the current file is considered seekable, but only because the cache is active. This means small relative seeks may be fine, but larger seeks may fail anyway. Whether a seek will succeed or not is generally not known in advance.
当前文件被认为是可搜索的,但这仅因为缓存处于活动状态。这意味着小范围的相对搜索可能没问题,但大范围的搜索可能会失败。是否可以成功搜索通常事先并不知道。If this property returns yes/true, so will seekable.
如果此属性返回 yes /true,则 seekable 也会。- playback-abort
- Whether playback is stopped or is to be stopped. (Useful in obscure
situations like during on_load hook processing, when the user can stop
playback, but the script has to explicitly end processing.)
播放是否已停止或将要停止。(在诸如在 on_load 钩子处理期间等不常见的情况下很有用,此时用户可以停止播放,但脚本必须明确结束处理。) - cursor-autohide (RW) cursor-autohide (读写)
- See --cursor-autohide. Setting this to a new value will always update
the cursor, and reset the internal timer.
查看 --cursor-autohide . 将此设置为新的值将始终更新光标,并重置内部计时器。 - term-clip-cc
- Inserts the symbol to force line truncation to the current terminal width.
This can be used for show-text and other OSD messages. It must be the
first character in the line. It takes effect until the end of the line.
插入符号以强制将行截断到当前终端宽度。这可以用于 show-text 和其他 OSD 消息。它必须是行中的第一个字符。它直到行尾才生效。 - osd-sym-cc
- Inserts the current OSD symbol as opaque OSD control code (cc). This makes
sense only with the show-text command or options which set OSD messages.
The control code is implementation specific and is useless for anything else.
插入当前 OSD 符号作为不透明 OSD 控制代码(cc)。这仅在 show-text 命令或设置 OSD 消息的选项中使用才有意义。控制代码是特定实现的,对其他任何用途都无意义。 - osd-ass-cc
${osd-ass-cc/0} disables escaping ASS sequences of text in OSD, ${osd-ass-cc/1} enables it again. By default, ASS sequences are escaped to avoid accidental formatting, and this property can disable this behavior. Note that the properties return an opaque OSD control code, which only makes sense for the show-text command or options which set OSD messages.
${osd-ass-cc/0} 禁用 OSD 中文本 ASS 序列的转义, ${osd-ass-cc/1} 再次启用。默认情况下,ASS 序列会被转义以避免意外格式化,此属性可以禁用此行为。请注意,这些属性返回一个不透明的 OSD 控制代码,这仅在 show-text 命令或设置 OSD 消息的选项中才有意义。Example 示例
- --osd-msg3='This is ${osd-ass-cc/0}{\\b1}bold text'
- show-text "This is ${osd-ass-cc/0}{\\b1}bold text"
Any ASS override tags as understood by libass can be used.
可以使用 libass 理解的任何 ASS 覆盖标签。Note that you need to escape the \ character, because the string is processed for C escape sequences before passing it to the OSD code. See Flat command syntax for details.
请注意,您需要转义 \ 字符,因为字符串在传递给 OSD 代码之前会处理 C 转义序列。有关详细信息,请参阅 Flat 命令语法。A list of tags can be found here: https://aegisub.org/docs/latest/ass_tags/
标签列表可在此处找到:https://aegisub.org/docs/latest/ass_tags/- vo-configured
- Whether the VO is configured right now. Usually this corresponds to whether
the video window is visible. If the --force-window option is used, this
usually always returns yes/true.
是否已正确配置 VO。通常这对应于视频窗口是否可见。如果使用 --force-window 选项,这通常总是返回 yes /true。 - vo-passes
Contains introspection about the VO's active render passes and their execution times. Not implemented by all VOs.
包含关于 VO 活动渲染通道及其执行时间的内省。并非所有 VO 都实现此功能。This is further subdivided into two frame types, vo-passes/fresh for fresh frames (which have to be uploaded, scaled, etc.) and vo-passes/redraw for redrawn frames (which only have to be re-painted). The number of passes for any given subtype can change from frame to frame, and should not be relied upon.
这进一步细分为两种帧类型, vo-passes/fresh 用于新鲜帧(需要上传、缩放等)和 vo-passes/redraw 用于重绘帧(只需重新绘制)。任何给定子类型的通道数可能会从帧到帧变化,不应依赖于此。Each frame type has a number of further sub-properties. Replace TYPE with the frame type, N with the 0-based pass index, and M with the 0-based sample index.
每个帧类型都有若干个进一步子属性。将 TYPE 替换为帧类型,将 N 替换为基于 0 的遍历索引,将 M 替换为基于 0 的样本索引。- vo-passes/TYPE/count
- Number of passes. 遍历次数。
- vo-passes/TYPE/N/desc
- Human-friendy description of the pass.
人性化的通行描述。 - vo-passes/TYPE/N/last
- Last measured execution time, in nanoseconds.
最后测量的执行时间,以纳秒为单位。 - vo-passes/TYPE/N/avg
- Average execution time of this pass, in nanoseconds. The exact
timeframe varies, but it should generally be a handful of seconds.
此遍历的平均执行时间,以纳秒为单位。确切的时间范围可能会有所不同,但通常应该是几秒钟。 - vo-passes/TYPE/N/peak
- The peak execution time (highest value) within this averaging range, in
nanoseconds.
在此平均时间范围内的峰值执行时间(最高值),以纳秒为单位。 - vo-passes/TYPE/N/count
- The number of samples for this pass.
此遍历的样本数量。 - vo-passes/TYPE/N/samples/M
- The raw execution time of a specific sample for this pass, in
nanoseconds.
此遍历特定样本的原始执行时间,以纳秒为单位。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_MAP "TYPE" MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP "desc" MPV_FORMAT_STRING "last" MPV_FORMAT_INT64 "avg" MPV_FORMAT_INT64 "peak" MPV_FORMAT_INT64 "count" MPV_FORMAT_INT64 "samples" MPV_FORMAT_NODE_ARRAY MP_FORMAT_INT64
Note that directly accessing this structure via subkeys is not supported, the only access is through aforementioned MPV_FORMAT_NODE.
请注意,直接通过子键访问此结构不受支持,唯一的方式是通过上述 MPV_FORMAT_NODE 。- perf-info
- Further performance data. Querying this property triggers internal
collection of some data, and may slow down the player. Each query will reset
some internal state. Property change notification doesn't and won't work.
All of this may change in the future, so don't use this. The builtin
stats script is supposed to be the only user; since it's bundled and
built with the source code, it can use knowledge of mpv internal to render
the information properly. See stats script description for some details.
进一步的性能数据。查询此属性会触发内部数据的收集,可能会减慢播放器。每次查询都会重置一些内部状态。属性更改通知不会也不应该工作。所有这些可能在将来改变,所以不要使用它。内建的 stats 脚本应该是唯一的使用者;因为它与源代码捆绑并构建,所以它可以利用 mpv 内部知识来正确渲染信息。有关详细信息,请参阅 stats 脚本描述。 - video-bitrate, audio-bitrate, sub-bitrate
Bitrate values calculated on the packet level. This works by dividing the bit size of all packets between two keyframes by their presentation timestamp distance. (This uses the timestamps are stored in the file, so e.g. playback speed does not influence the returned values.) In particular, the video bitrate will update only per keyframe, and show the "past" bitrate. To make the property more UI friendly, updates to these properties are throttled in a certain way.
在数据包级别计算比特率值。这是通过将所有数据包的比特大小除以两个关键帧之间的显示时间戳距离来实现的。(这使用存储在文件中的时间戳,因此例如播放速度不会影响返回的值。)特别是,视频比特率将仅按关键帧更新,并显示“过去”的比特率。为了使属性更友好,这些属性的更新以某种方式进行了节流。The unit is bits per second. OSD formatting turns these values in kilobits (or megabits, if appropriate), which can be prevented by using the raw property value, e.g. with ${=video-bitrate}.
单位是每秒比特数。OSD 格式化将这些值转换为千比特(或如果适用,兆比特),可以通过使用原始属性值来防止,例如使用 ${=video-bitrate} 。Note that the accuracy of these properties is influenced by a few factors. If the underlying demuxer rewrites the packets on demuxing (done for some file formats), the bitrate might be slightly off. If timestamps are bad or jittery (like in Matroska), even constant bitrate streams might show fluctuating bitrate.
请注意,这些属性的准确性受几个因素的影响。如果底层解复用器在解复用过程中重写数据包(针对某些文件格式执行),比特率可能会略有偏差。如果时间戳不良或抖动(如 Matroska),即使是恒定比特率流也可能显示比特率波动。How exactly these values are calculated might change in the future.
这些值的确切计算方式可能会在未来发生变化。In earlier versions of mpv, these properties returned a static (but bad) guess using a completely different method.
在 mpv 的早期版本中,这些属性使用完全不同的方法返回一个静态(但很糟糕)的猜测。- audio-device-list
The list of discovered audio devices. This is mostly for use with the client API, and reflects what --audio-device=help with the command line player returns.
已发现音频设备的列表。这主要用于客户端 API,并反映了使用命令行播放器的 --audio-device=help 返回的内容。When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each device entry) "name" MPV_FORMAT_STRING "description" MPV_FORMAT_STRING
The name is what is to be passed to the --audio-device option (and often a rather cryptic audio API-specific ID), while description is human readable free form text. The description is set to the device name (minus mpv-specific <driver>/ prefix) if no description is available or the description would have been an empty string.
The name 是要传递给 --audio-device 选项的内容(通常是一个相当晦涩的音频 API 特定 ID),而 description 是人类可读的自由格式文本。如果没有描述或描述将是空字符串,则描述设置为设备名称(减去 mpv 特定的 <driver>/ 前缀)。The special entry with the name set to auto selects the default audio output driver and the default device.
具有名称设置为 auto 的特殊条目选择默认音频输出驱动程序和默认设备。The property can be watched with the property observation mechanism in the client API and in Lua scripts. (Technically, change notification is enabled the first time this property is read.)
可以使用客户端 API 和 Lua 脚本中的属性观察机制监视该属性。 (技术上,在第一次读取此属性时启用更改通知。)- audio-device (RW) audio-device (读写)
Set the audio device. This directly reads/writes the --audio-device option, but on write accesses, the audio output will be scheduled for reloading.
设置音频设备。这直接读取/写入 --audio-device 选项,但在写入访问时,音频输出将安排重新加载。Writing this property while no audio output is active will not automatically enable audio. (This is also true in the case when audio was disabled due to reinitialization failure after a previous write access to audio-device.)
在无音频输出激活时写入此属性将不会自动启用音频。(在由于重新初始化失败而禁用音频的先前写入访问到 audio-device 的情况下也是如此。)This property also doesn't tell you which audio device is actually in use.
此属性也不会告诉您实际正在使用的音频设备。How these details are handled may change in the future.
这些细节的处理方式在未来可能会改变。- current-vo
- Current video output driver (name as used with --vo).
当前视频输出驱动程序(使用 --vo 的名称)。 - current-gpu-context
- Current GPU context of video output driver (name as used with --gpu-context).
Valid for --vo=gpu and --vo=gpu-next.
当前视频输出驱动程序的 GPU 上下文(与 --gpu-context 使用的名称相同)。适用于 --vo=gpu 和 --vo=gpu-next 。 - current-ao
- Current audio output driver (name as used with --ao).
当前音频输出驱动程序(与 --ao 使用的名称相同)。 - user-data (RW) user-data (读写)
This is a recursive key/value map of arbitrary nodes shared between clients for general use (i.e. scripts, IPC clients, host applications, etc). The player itself does not use any data in it (although some builtin scripts may). The property is not preserved across player restarts.
这是一个递归的键/值映射,任意节点在客户端之间共享,用于通用目的(例如脚本、IPC 客户端、主机应用程序等)。播放器本身不使用其中的任何数据(尽管一些内置脚本可能会使用)。该属性在播放器重启后不会保留。Sub-paths can be accessed directly; e.g. user-data/my-script/state/a can be read, written, or observed.
可以直接访问子路径;例如,可以读取、写入或观察 user-data/my-script/state/a 。The top-level object itself cannot be written directly; write to sub-paths instead.
顶级对象本身不能直接写入;请写入子路径。Converting this property or its sub-properties to strings will give a JSON representation. If converting a leaf-level object (i.e. not a map or array) and not using raw mode, the underlying content will be given (e.g. strings will be printed directly, rather than quoted and JSON-escaped).
将此属性或其子属性转换为字符串将给出 JSON 表示。如果转换叶子级对象(即不是映射或数组)且不使用原始模式,则将给出底层内容(例如,字符串将直接打印,而不是引用和 JSON 转义)。The following sub-paths are reserved for internal uses or have special semantics: user-data/osc, user-data/mpv. Unless noted otherwise, the semantics of any properties under these sub-paths can change at any time and may not be relied upon, and writing to these properties may prevent builtin scripts from working properly.
以下子路径保留供内部使用或具有特殊语义: user-data/osc , user-data/mpv 。除非另有说明,这些子路径下任何属性的语义可能在任何时候更改,并且可能不可依赖,并且写入这些属性可能会阻止内置脚本正常工作。Currently, the following properties have defined special semantics:
当前,以下属性已定义了特殊语义:- user-data/osc/margins
- This property is written by an OSC implementation to indicate the margins that it
occupies. Its sub-properties l, r, t, and b should all be set to
the left, right, top, and bottom margins respectively.
Values are between 0.0 and 1.0, normalized to window width/height.
此属性由 OSC 实现写入,以指示它占用的边距。其子属性 l 、 r 、 t 和 b 应分别设置为左、右、上、下边距。值介于 0.0 和 1.0 之间,归一化到窗口宽度/高度。 - user-data/mpv/ytdl
Data shared by the builtin ytdl hook script.
由内置 ytdl 钩子脚本共享的数据。- user-data/mpv/ytdl/path
- Path to the ytdl executable, if found, or an empty string otherwise.
The property is not set until the script attempts to find the ytdl
executable, i.e. until an URL is being loaded by the script.
如果找到,则表示 ytdl 可执行文件的路径,否则为空字符串。该属性在脚本尝试找到 ytdl 可执行文件之前不设置,即直到脚本正在加载 URL。 - user-data/mpv/ytdl/json-subprocess-result
- Result of executing ytdl to retrieve the JSON data of the URL being
loaded. The format is the same as subprocess's result, capturing
stdout and stderr.
执行 ytdl 获取正在加载的 URL 的 JSON 数据的结果。格式与 subprocess 的结果相同,捕获标准输出和标准错误。
- user-data/mpv/console/open
- Whether the console is open.
控制台是否打开。
- menu-data (RW) menu-data (读写)
This property stores the raw menu definition. See Context Menu section for details.
此属性存储原始菜单定义。有关详细信息,请参阅上下文菜单部分。- type
- Menu item type. Can be: separator, submenu, or empty.
菜单项类型。可以是: separator , submenu ,或者为空。 - title
- Menu item title. Required if type is not separator.
菜单项标题。如果类型不是 separator ,则为必填项。 - cmd
- Command to execute when the menu item is clicked.
点击菜单项时执行的命令。 - shortcut
- Menu item shortcut key which appears to the right of the menu item.
A shortcut key does not have to be functional; it's just a visual hint.
出现在菜单项右侧的菜单项快捷键。快捷键不必是可用的;它只是一个视觉提示。 - state
- Menu item state. Can be: checked, disabled, hidden, or empty.
菜单项状态。可以是: checked , disabled , hidden ,或为空。 - submenu
- Submenu items, which is required if type is submenu.
子菜单项,如果类型是 submenu 则是必需的。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (menu item) "type" MPV_FORMAT_STRING "title" MPV_FORMAT_STRING "cmd" MPV_FORMAT_STRING "shortcut" MPV_FORMAT_STRING "state" MPV_FORMAT_NODE_ARRAY[MPV_FORMAT_STRING] "submenu" MPV_FORMAT_NODE_ARRAY[menu item]
Writing to this property with the client API using MPV_FORMAT_NODE or with Lua mp.set_property_native will trigger an immediate update of the menu if mpv video output is currently active. You may observe the current-vo property to check if this is the case.
使用客户端 API 通过 MPV_FORMAT_NODE 或 Lua mp.set_property_native 写入此属性将触发菜单立即更新,如果 mpv 视频输出当前处于活动状态。您可以通过观察 current-vo 属性来检查是否处于此状态。- working-directory
- The working directory of the mpv process. Can be useful for JSON IPC users,
because the command line player usually works with relative paths.
mpv 进程的工作目录。对于 JSON IPC 用户来说可能很有用,因为命令行播放器通常使用相对路径。 - current-watch-later-dir
- The directory in which watch later config files are stored. This returns
--watch-later-dir, or the default directory if --watch-later-dir has
not been modified, with tilde placeholders expanded.
存储观看稍后配置文件的目录。此返回值是 --watch-later-dir ,或者如果没有修改 --watch-later-dir ,则返回默认目录,波浪线占位符已展开。 - protocol-list
- List of protocol prefixes potentially recognized by the player. They are
returned without trailing :// suffix (which is still always required).
In some cases, the protocol will not actually be supported (consider
https if ffmpeg is not compiled with TLS support).
玩家可能识别的协议前缀列表。它们返回时不带尾随的 :// 后缀(但仍然始终需要)。在某些情况下,该协议实际上可能不受支持(如果 ffmpeg 没有编译 TLS 支持,请考虑 https )。 - decoder-list
List of decoders supported. This lists decoders which can be passed to --vd and --ad.
支持的解码器列表。此列表列出可以传递给 --vd 和 --ad 的解码器。- codec
- Canonical codec name, which identifies the format the decoder can
handle.
规范编解码器名称,用于标识解码器可以处理的格式。 - driver
- The name of the decoder itself. Often, this is the same as codec.
Sometimes it can be different. It is used to distinguish multiple
decoders for the same codec.
解码器的名称本身。通常,这与 codec 相同。有时它可能不同。它用于区分同一编解码器的多个解码器。 - description
- Human readable description of the decoder and codec.
解码器和编解码器的人类可读描述。
When querying the property with the client API using MPV_FORMAT_NODE, or with Lua mp.get_property_native, this will return a mpv_node with the following contents:
当使用客户端 API 通过 MPV_FORMAT_NODE 查询属性,或使用 Lua mp.get_property_native 时,这将返回以下内容的 mpv_node:MPV_FORMAT_NODE_ARRAY MPV_FORMAT_NODE_MAP (for each decoder entry) "codec" MPV_FORMAT_STRING "driver" MPV_FORMAT_STRING "description" MPV_FORMAT_STRING
- encoder-list
- List of libavcodec encoders. This has the same format as decoder-list.
The encoder names (driver entries) can be passed to --ovc and
--oac (without the lavc: prefix required by --vd and --ad).
libavcodec 编码器列表。此格式与 decoder-list 相同。编码器名称( driver 条目)可以传递给 --ovc 和 --oac (无需 lavc: 前缀,如 --vd 和 --ad 所需)。 - demuxer-lavf-list
- List of available libavformat demuxers' names. This can be used to check
for support for a specific format or use with --demuxer-lavf-format.
可用 libavformat 解复用器名称列表。可用于检查对特定格式的支持或与 --demuxer-lavf-format 一起使用。 - input-key-list
- List of Key names, same as output by --input-keylist.
键名称列表,与 --input-keylist 输出相同。 - mpv-version
- The mpv version/copyright string. Depending on how the binary was built, it
might contain either a release version, or just a git hash.
mpv 版本/版权字符串。根据二进制文件的构建方式,它可能包含发布版本或仅包含 git 哈希。 - mpv-configuration
- The configuration arguments that were passed to the build system. If the
meson version used to compile mpv is older than 1.1.0, then a hardcoded
string of a few, arbitrary options is displayed instead.
传递给构建系统的配置参数。如果用于编译 mpv 的 meson 版本低于 1.1.0,则显示几个硬编码的任意选项字符串。 - ffmpeg-version
- The contents of the av_version_info() API call. This is a string which
identifies the build in some way, either through a release version number,
or a git hash. This property is unavailable if mpv is linked against older
FFmpeg versions.
API 调用 av_version_info() 的内容。这是一个字符串,以某种方式标识构建版本,无论是通过发布版本号还是 git 哈希。如果 mpv 链接到较旧的 FFmpeg 版本,则此属性不可用。 - libass-version
- The value of ass_library_version(). This is an integer, encoded in a
somewhat weird form (apparently "hex BCD"), indicating the release version
of the libass library linked to mpv.
值 ass_library_version() 的值。这是一个整数,以某种奇怪的形式(显然是“十六进制 BCD”)编码,表示链接到 mpv 的 libass 库的发布版本。 - platform
- Returns a string describing what target platform mpv was built for. The value
of this is dependent on what the underlying build system detects. Some of the
most common values are: windows, darwin (macos or ios), linux,
android, and freebsd. Note that this is not a complete listing.
返回描述 mpv 构建所针对的目标平台的字符串。此值的确定取决于底层构建系统检测到的结果。一些最常见的值包括: windows , darwin (macos 或 ios), linux , android ,和 freebsd 。请注意,这并不是一个完整的列表。 - options/<name> (RW) options/<name> (读写)
The value of option --<name>. Most options can be changed at runtime by writing to this property. Note that many options require reloading the file for changes to take effect. If there is an equivalent property, prefer setting the property instead.
选项 --<name> 的值。大多数选项可以在运行时通过写入此属性进行更改。请注意,许多选项需要重新加载文件才能使更改生效。如果有等效属性,则优先设置该属性。There shouldn't be any reason to access options/<name> instead of <name>, except in situations in which the properties have different behavior or conflicting semantics.
通常没有理由访问 options/<name> 而不是 <name> ,除非在属性具有不同行为或冲突语义的情况下。- file-local-options/<name> (RW) file-local-options/<name> (读写)
Similar to options/<name>, but when setting an option through this property, the option is reset to its old value once the current file has stopped playing. Trying to write an option while no file is playing (or is being loaded) results in an error.
与 options/<name> 类似,但通过此属性设置选项时,一旦当前文件停止播放,选项将重置为其旧值。在没有文件播放(或正在加载)时尝试写入选项将导致错误。(Note that if an option is marked as file-local, even options/ will access the local value, and the old value, which will be restored on end of playback, cannot be read or written until end of playback.)
(注意:如果选项被标记为文件局部,即使使用 options/ 也会访问局部值,而 old 值,在播放结束时将恢复,直到播放结束时都无法读取或写入。)- option-info/<name>
Additional per-option information.
附加的选项信息。This has a number of sub-properties. Replace <name> with the name of a top-level option. No guarantee of stability is given to any of these sub-properties - they may change radically in the future.
这有多个子属性。将 <name> 替换为顶级选项的名称。对于这些子属性不提供稳定性保证 - 它们可能在将来发生根本性的变化。- option-info/<name>/name
- The name of the option.
选项的名称。 - option-info/<name>/type
- The name of the option type, like String or Integer. For many
complex types, this isn't very accurate.
选项类型名称,例如 String 或 Integer 。对于许多复杂类型,这并不非常准确。 - option-info/<name>/set-from-commandline
- Whether the option was set from the mpv command line. What this is set
to if the option is e.g. changed at runtime is left undefined (meaning
it could change in the future).
选项是否由 mpv 命令行设置。如果选项在运行时更改,则此设置留空(意味着它可能在将来更改)。 - option-info/<name>/set-locally
- Whether the option was set per-file. This is the case with
automatically loaded profiles, file-dir configs, and other cases. It
means the option value will be restored to the value before playback
start when playback ends.
选项是否按文件设置。这是自动加载配置文件、文件目录配置和其他情况的情况。这意味着在播放结束时,选项值将恢复到播放开始前的值。 - option-info/<name>/expects-file
- Whether the option takes file paths as arguments.
选项是否接受文件路径作为参数。 - option-info/<name>/default-value
- The default value of the option. May not always be available.
选项的默认值。可能并不总是可用。 - option-info/<name>/min, option-info/<name>/max
- Integer minimum and maximum values allowed for the option. Only
available if the options are numeric, and the minimum/maximum has been
set internally. It's also possible that only one of these is set.
选项允许的整数最小值和最大值。只有当选项是数值型,并且内部已设置最小值/最大值时才可用。也可能只设置了一个。 - option-info/<name>/choices
- If the option is a choice option, the possible choices. Choices that
are integers may or may not be included (they can be implied by min
and max). Note that options which behave like choice options, but
are not actual choice options internally, may not have this info
available.
如果选项是选择型选项,则可能的选项。整数选项可能包含或不包含(它们可以通过 min 和 max 来暗示)。请注意,虽然某些选项的行为类似于选择型选项,但它们在内部并非实际的选择型选项,可能没有此信息可用。
- property-list
- The list of top-level properties.
顶级属性列表。 - profile-list
The list of profiles and their contents. This is highly implementation-specific, and may change any time. Currently, it returns an array of options for each profile. Each option has a name and a value, with the value currently always being a string. Note that the options array is not a map, as order matters and duplicate entries are possible. Recursive profiles are not expanded, and show up as special profile options.
配置文件列表及其内容。这非常依赖于具体实现,并且可能随时更改。目前,它为每个配置文件返回一个选项数组。每个选项都有一个名称和一个值,当前的值始终是字符串。请注意,选项数组不是一个映射,因为顺序很重要,并且可能存在重复条目。递归配置文件不会被展开,会以特殊 profile 选项的形式出现。The profile-restore field is currently missing if it holds the default value (either because it was not set, or set explicitly to default), but in the future it might hold the value default.
如果该字段保持默认值(无论是未设置还是显式设置为 default ),则当前可能缺失,但将来可能包含值 default 。- command-list
- The list of input commands. This returns an array of maps, where each map
node represents a command. This map currently only has a single entry:
name for the name of the command. (This property is supposed to be a
replacement for --input-cmdlist. The option dumps some more
information, but it's a valid feature request to extend this property if
needed.)
输入命令列表。此操作返回一个包含地图的数组,其中每个地图节点代表一个命令。此地图目前只有一个条目: name 表示命令名称。(此属性应替代 --input-cmdlist 。选项会输出更多详细信息,但如果需要,这是一个有效的功能请求来扩展此属性。) - input-bindings
The list of current input key bindings. This returns an array of maps, where each map node represents a binding for a single key/command. This map has the following entries:
当前输入键绑定列表。此操作返回一个包含地图的数组,其中每个地图节点代表单个键/命令的绑定。此地图有以下条目:- key
- The key name. This is normalized and may look slightly different from
how it was specified in the source (e.g. in input.conf).
键名称。这是经过规范化的,可能与在源文件(例如 input.conf)中指定的略有不同。 - cmd
- The command mapped to the key. (Currently, this is exactly the same
string as specified in the source, other than stripping whitespace and
comments. It's possible that it will be normalized in the future.)
映射到键的命令。(目前,这正好与源文件中指定的字符串相同,除了去除空格和注释。将来它可能会被规范化。) - is_weak
- If set to true, any existing and active user bindings will take priority.
如果设置为 true,则现有和活动的用户绑定将具有优先权。 - owner
- If this entry exists, the name of the script (or similar) which added
this binding.
如果此条目存在,则添加此绑定(或类似)脚本的名称。 - section
- Name of the section this binding is part of. This is a rarely used
mechanism. This entry may be removed or change meaning in the future.
本绑定所属部分的名称。这是一个很少使用的机制。此条目可能在将来被删除或改变含义。 - priority
- A number. Bindings with a higher value are preferred over bindings
with a lower value. If the value is negative, this binding is inactive
and will not be triggered by input. Note that mpv does not use this
value internally, and matching of bindings may work slightly differently
in some cases. In addition, this value is dynamic and can change around
at runtime.
一个数字。值较高的绑定比值较低的绑定更受青睐。如果值为负,则此绑定不活跃,不会被输入触发。请注意,mpv 在内部不使用此值,并且在某些情况下绑定匹配可能略有不同。此外,此值是动态的,在运行时可能会改变。 - comment
- If available, the comment following the command on the same line. (For
example, the input.conf entry f cycle bla # toggle bla would
result in an entry with comment = "toggle bla", cmd = "cycle bla".)
如果可用,同一行上命令之后的注释。(例如,input.conf 条目 f cycle bla # toggle bla 将导致条目为 comment = "toggle bla", cmd = "cycle bla" 。)
This property is read-only, and change notification is not supported.
此属性为只读,不支持更改通知。- clipboard
The clipboard contents, only works when native clipboard (--clipboard-enable) is supported on the platform. Depending on the platform, some sub-properties, writing to properties, or change notifications are not currently functional.
剪贴板内容,仅在平台支持原生剪贴板( --clipboard-enable )时有效。根据平台的不同,一些子属性、写入属性或更改通知目前可能无法使用。This has a number of sub-properties:
这有几个子属性:- clipboard/text (RW) clipboard/text (读写)
- The text content in the clipboard (Windows, Wayland and macOS only).
Writing to this property sets the text clipboard content (Windows only).
剪贴板中的文本内容(仅限 Windows、Wayland 和 macOS)。向此属性写入将设置文本剪贴板内容(仅限 Windows)。 - clipboard/text-primary
- The text content in the primary selection (Wayland only).
主选择中的文本内容(仅限 Wayland)。
Note 注意
On Wayland with the vo clipboard backend, the clipboard content is only updated when the compositor sends a selection data offer (typically when VO window is focused). The wayland backend typically does not have this limitation. See current-clipboard-backend property for more details.
在 Wayland 与 vo 剪贴板后端中,剪贴板内容仅在合成器发送选择数据提供(通常在 VO 窗口聚焦时)时更新。 wayland 后端通常没有这个限制。有关更多详细信息,请参阅 current-clipboard-backend 属性。- current-clipboard-backend
- A string containing the currently active clipboard backend.
See --clipboard-backends option for the list of available backends.
包含当前活动剪贴板后端的字符串。查看 --clipboard-backends 选项以获取可用后端列表。 - clock
- The current local time in hour:minutes format.
当前本地时间,格式为小时:分钟。
Inconsistencies between options and properties
选项和属性之间的不一致
You can access (almost) all options as properties, though there are some
caveats with some properties (due to historical reasons):
您可以将(几乎)所有选项作为属性访问,尽管某些属性存在一些注意事项(由于历史原因):
- vid, aid, sid
While playback is active, these return the actually active tracks. For example, if you set aid=5, and the currently played file contains no audio track with ID 5, the aid property will return no.
在播放活动时,这些返回实际活动的轨道。例如,如果您设置了 aid=5 ,并且当前播放的文件不包含 ID 为 5 的音频轨道, aid 属性将返回 no 。Before mpv 0.31.0, you could set existing tracks at runtime only.
在 mpv 0.31.0 之前,您只能在运行时设置现有轨道。- display-fps
- This inconsistent behavior is deprecated. Post-deprecation, the reported
value and the option value are cleanly separated (override-display-fps
for the option value).
这种不一致的行为已被弃用。弃用后,报告的值和选项值被干净地分离( override-display-fps 用于选项值)。 - vf, af
If you set the properties during playback, and the filter chain fails to reinitialize, the option will be set, but the runtime filter chain does not change. On the other hand, the next video to be played will fail, because the initial filter chain cannot be created.
如果在播放期间设置属性,并且过滤器链无法重新初始化,则选项将被设置,但运行时过滤器链不会改变。另一方面,下一个要播放的视频将失败,因为无法创建初始过滤器链。This behavior changed in mpv 0.31.0. Before this, the new value was rejected iff a video (for vf) or an audio (for af) track was active. If playback was not active, the behavior was the same as the current one.
此行为在 mpv 0.31.0 中发生了变化。在此之前,如果存在视频(对于 vf )或音频(对于 af )轨道,则拒绝新值。如果播放未激活,则行为与当前相同。- playlist
- The property is read-only and returns the current internal playlist. The
option is for loading playlist during command line parsing. For client API
uses, you should use the loadlist command instead.
该属性为只读,并返回当前内部播放列表。该选项用于在命令行解析期间加载播放列表。对于客户端 API 使用,您应使用 loadlist 命令。 - profile, include
- These are write-only, and will perform actions as they are written to,
exactly as if they were used on the mpv CLI commandline. Their only use is
when using libmpv before mpv_initialize(), which in turn is probably
only useful in encoding mode. Normal libmpv users should use other
mechanisms, such as the apply-profile command, and the
mpv_load_config_file API function. Avoid these properties.
这些属性为只写,并将执行写入时的操作,就像它们在 mpv CLI 命令行上使用一样。它们的唯一用途是在使用 libmpv 之前 mpv_initialize() ,这反过来又可能在编码模式下有用。正常 libmpv 用户应使用其他机制,例如 apply-profile 命令和 mpv_load_config_file API 函数。避免使用这些属性。
Property Expansion 属性扩展
All string arguments to input commands as well as certain options (like
--term-playing-msg) are subject to property expansion. Note that property
expansion does not work in places where e.g. numeric parameters are expected.
(For example, the add command does not do property expansion. The set
command is an exception and not a general rule.)
所有输入命令的字符串参数以及某些选项(如 --term-playing-msg )都受属性扩展的影响。请注意,属性扩展在例如期望数字参数的地方不起作用。(例如, add 命令不执行属性扩展。 set 命令是一个例外,而不是一般规则。)
Example for input.conf input.conf 的示例
Whether property expansion is enabled by default depends on which API is used
(see Flat command syntax, Commands specified as arrays and Named
arguments), but it can always be enabled with the expand-properties
prefix or disabled with the raw prefix, as described in Input Command
Prefixes.
属性扩展是否默认启用取决于使用的 API(参见平面命令语法、作为数组指定的命令和命名参数),但始终可以通过 expand-properties 前缀启用或通过 raw 前缀禁用,如输入命令前缀中所述。
The following expansions are supported:
以下扩展被支持:
- ${NAME}
- Expands to the value of the property NAME. If retrieving the property
fails, expand to an error string. (Use ${NAME:} with a trailing
: to expand to an empty string instead.)
If NAME is prefixed with =, expand to the raw value of the property
(see section below).
扩展到属性 NAME 的值。如果检索属性失败,则扩展到错误字符串。(使用 ${NAME:} 并以 : 结尾来扩展到空字符串。)如果 NAME 前缀为 = ,则扩展到属性的原始值(见下文章节)。 - ${NAME:STR}
- Expands to the value of the property NAME, or STR if the
property cannot be retrieved. STR is expanded recursively.
扩展到属性 NAME 的值,或如果无法检索属性,则扩展到 STR 。 STR 会递归扩展。 - ${?NAME:STR}
- Expands to STR (recursively) if the property NAME is available.
如果属性 NAME 可用,则扩展到 STR (递归)。 - ${!NAME:STR}
- Expands to STR (recursively) if the property NAME cannot be
retrieved.
如果属性 NAME 无法检索,则扩展到 STR (递归)。 - ${?NAME==VALUE:STR}
- Expands to STR (recursively) if the property NAME expands to a
string equal to VALUE. You can prefix NAME with = in order to
compare the raw value of a property (see section below). If the property
is unavailable, or other errors happen when retrieving it, the value is
never considered equal.
Note that VALUE can't contain any of the characters : or }.
Also, it is possible that escaping with " or % might be added in
the future, should the need arise.
如果属性 NAME 扩展到等于 VALUE 的字符串,则扩展到 STR (递归)。您可以在 NAME 前面加上 = 以比较属性的原始值(见下文章节)。如果属性不可用,或检索它时发生其他错误,则值永远不会被视为相等。请注意, VALUE 不能包含任何 : 或 } 字符。此外,如果需要,将来可能会添加使用 " 或 % 进行转义的功能。 - ${!NAME==VALUE:STR}
- Same as with the ? variant, but STR is expanded if the value is
not equal. (Using the same semantics as with ?.)
与 ? 变体相同,但如果值不相等,则 STR 会扩展。 (使用与 ? 相同的语义。) - $$
- Expands to $. 展开为 $ 。
- $}
- Expands to }. (To produce this character inside recursive
expansion.)
展开为 } 。(用于在递归展开中生成此字符。) - $>
- Disable property expansion and special handling of $ for the rest
of the string.
禁用属性展开以及字符串剩余部分对 $ 的特殊处理。
In places where property expansion is allowed, C-style escapes are often
accepted as well. Example:
在允许属性展开的地方,通常也接受 C 风格的转义序列。例如:
- \n becomes a newline character
\n 变成换行符- \\ expands to \ \\ 展开为 \
Raw and Formatted Properties
原始和格式化属性
Normally, properties are formatted as human-readable text, meant to be
displayed on OSD or on the terminal. It is possible to retrieve an unformatted
(raw) value from a property by prefixing its name with =. These raw values
can be parsed by other programs and follow the same conventions as the options
associated with the properties. Additionally, there is a > prefix to format
human-readable text, with fixed precision for floating-point values. This is
useful for printing values where a constant width is important.
通常,属性以可读文本格式化,旨在在 OSD 或终端上显示。可以通过在属性名称前加上 = 前缀来检索属性的未格式化(原始)值。这些原始值可以被其他程序解析,并遵循与属性相关选项相同的约定。此外,还有一个 > 前缀用于格式化可读文本,对于浮点值具有固定精度。这在打印需要固定宽度的值时非常有用。
Examples 示例
- ${time-pos} expands to 00:14:23 (if playback position is at 14
minutes 23 seconds)
${time-pos} 展开为 00:14:23 (如果播放位置在 14 分钟 23 秒处) - ${=time-pos} expands to 863.4 (same time, plus 400 milliseconds -
milliseconds are normally not shown in the formatted case)
${=time-pos} 展开为 863.4 (相同时间,加 400 毫秒 - 毫秒通常在格式化情况下不显示) - ${avsync} expands to +0.003 ${avsync} 展开为 +0.003
- ${>avsync} expands to +0.0030 ${>avsync} 展开为 +0.0030
- ${=avsync} expands to 0.003028 ${=avsync} 展开为 0.003028
Sometimes, the difference in amount of information carried by raw and formatted
property values can be rather big. In some cases, raw values have more
information, like higher precision than seconds with time-pos. Sometimes
it is the other way around, e.g. aid shows track title and language in the
formatted case, but only the track number if it is raw.
有时,原始属性值和格式化属性值所携带的信息量差异可能相当大。在某些情况下,原始值包含更多信息,例如,比秒更高的精度,如 time-pos 。有时情况相反,例如 aid 在格式化情况下显示曲目标题和语言,但如果是原始的,则只显示曲目编号。
ON SCREEN CONTROLLER 屏幕控制器
The On Screen Controller (short: OSC) is a minimal GUI integrated with mpv to
offer basic mouse-controllability. It is intended to make interaction easier
for new users and to enable precise and direct seeking.
屏幕控制器(简称:OSC)是一个与 mpv 集成的最小 GUI,提供基本的鼠标可控性。它的目的是让新用户更容易交互,并实现精确和直接的搜索。
The OSC is enabled by default if mpv was compiled with Lua support. It can be
disabled entirely using the --osc=no option.
如果 mpv 编译时带有 Lua 支持,则默认启用 OSC。可以使用 --osc=no 选项完全禁用。
Using the OSC 使用 OSC
By default, the OSC will show up whenever the mouse is moved inside the
player window and will hide if the mouse is not moved outside the OSC for
0.5 seconds or if the mouse leaves the window.
默认情况下,当鼠标移动到播放器窗口内部时,OSC 将显示,如果鼠标在 0.5 秒内没有移动到 OSC 外部,或者鼠标离开窗口,OSC 将隐藏。
The Interface 界面
+------+---------+---------+-----------------------------------------------+ | menu | pl prev | pl next | title cache | +------+------+------+---------+-----------+------+-------+-----+-----+----+ | play | skip | skip | time | seekbar | time | audio | sub | vol | fs | | | back | frwd | elapsed | | left | | | | | +------+------+------+---------+-----------+------+-------+-----+-----+----+
- menu 菜单
left-click 左键单击 open the menu 打开菜单 - pl prev
left-click 左键单击 play previous file in playlist
在播放列表中播放上一文件shift+L-click shift+L 键单击 show the playlist 显示播放列表 middle-click 中键单击 show the playlist 显示播放列表 right-click 右键点击 open the playlist menu
打开播放列表菜单- pl next 下一曲
left-click 左键单击 play next file in playlist
播放播放列表中的下一文件shift+L-click shift+L 键单击 show the playlist 显示播放列表 middle-click 中键单击 show the playlist 显示播放列表 right-click 右键点击 open the playlist menu
打开播放列表菜单- title 标题
- Displays the current playlist position and media-title, filename or custom title, or the target chapter name while hovering the seekbar.
在拖动进度条时显示当前播放列表位置和媒体标题、文件名或自定义标题,或目标章节名称。left-click 左键单击 show file and track info
显示文件和曲目信息shift+L-click shift+L 键单击 show the path 显示路径 middle-click 中键单击 show the path 显示路径 right-click 右键点击 open the history menu
打开历史菜单 - cache 缓存
- Shows current cache fill status
显示当前缓存填充状态 - play 播放
left-click 左键单击 toggle play/pause 切换播放/暂停 shift+L-click shift+L 键单击 toggle infinite looping of the playlist
切换播放列表无限循环middle-click 中键单击 toggle infinite looping of the playlist
切换播放列表无限循环right-click 右键点击 toggle infinite looping of the current file
切换当前文件的无限循环- skip back 跳过上一段
left-click 左键单击 go to beginning of chapter / previous chapter
跳转到章节开头/上一章节shift+L-click shift+L 键单击 show chapters 显示章节 middle-click 中键单击 show chapters 显示章节 right-click 右键点击 open the chapter menu
打开章节菜单- skip frwd 跳过前向
left-click 左键单击 go to next chapter
跳转到下一章shift+L-click shift+L 键单击 show chapters 显示章节 middle-click 中键单击 show chapters 显示章节 right-click 右键点击 open the chapter menu
打开章节菜单- time elapsed 已过时间
- Shows current playback position timestamp
显示当前播放位置的时间戳left-click 左键单击 toggle displaying timecodes with milliseconds
切换显示毫秒级时间码 - seekbar 滑动条
- Indicates current playback position and position of chapters
指示当前播放位置和章节位置left-click 左键单击 seek to position 跳转到指定位置 right-click 右键点击 seek to the nearest chapter
寻找最近的章节mouse wheel 鼠标滚轮 seek forward/backward 快进/快退 - time left 剩余时间
- Shows remaining playback time timestamp
显示剩余播放时间的时间戳left-click 左键单击 toggle between total and remaining time
在总时间和剩余时间之间切换 - audio and sub 音频和字幕
- Displays selected track and amount of available tracks
显示所选轨道和可用轨道数量left-click 左键单击 cycle audio/sub tracks forward
循环音频/子轨道向前shift+L-click shift+L 键单击 cycle audio/sub tracks backwards
循环音频/子轨道向后播放middle-click 中键单击 cycle audio/sub tracks backwards
循环音频/子轨道向后播放right-click 右键点击 open the audio/sub track menu
打开音频/子轨道菜单mouse wheel 鼠标滚轮 cycle audio/sub tracks forward/backwards
循环音频/子轨道向前/向后 - vol 音量
left-click 左键单击 toggle mute 切换静音 right-click 右键点击 open the audio device menu
打开音频设备菜单mouse wheel 鼠标滚轮 volume up/down 音量增加/减少 - fs
left-click 左键单击 toggle fullscreen 切换全屏 right-click 右键点击 toggle whether the window is maximized
切换窗口是否最大化
Since mpv 0.40.0, it is possible to configure the commands to run with mouse
actions on some interface elements, and the default behaviors of several
elements were changed. If you miss some older behaviors, look at
etc/restore-osc-bindings.conf in the mpv git repository.
自 mpv 0.40.0 版本起,可以配置在界面元素上使用鼠标操作时运行的命令,并且几个元素的默认行为已更改。如果您怀念某些旧行为,请查看 mpv git 仓库中的 etc/restore-osc-bindings.conf 。
Key Bindings 快捷键
These key bindings are active by default if nothing else is already bound to
these keys. In case of collision, the function needs to be bound to a
different key. See the Script Commands section.
如果没有其他内容已绑定到这些键,则这些键绑定默认激活。如果发生冲突,需要将功能绑定到不同的键。请参阅脚本命令部分。
del | Cycles visibility between never / auto (mouse-move) / always 在从不 / 自动(鼠标移动) / 总是之间循环可见性 |
Configuration 配置
This script can be customized through a config file script-opts/osc.conf
placed in mpv's user directory and through the --script-opts command-line
option. The configuration syntax is described in mp.options functions.
此脚本可以通过放置在 mpv 用户目录中的配置文件 script-opts/osc.conf 和通过 --script-opts 命令行选项进行自定义。配置语法在 mp.options 函数中描述。
Command-line Syntax 命令行语法
To avoid collisions with other scripts, all options need to be prefixed with
osc-.
为了避免与其他脚本冲突,所有选项都需要以 osc- 前缀。
Example: 示例:
--script-opts=osc-optionA=value1,osc-optionB=value2
Configurable Options 可配置选项
- layout
Default: bottombar 默认:bottombar
The layout for the OSC. Currently available are: box, slimbox, bottombar, topbar, slimbottombar and slimtopbar. Default pre-0.21.0 was 'box'.
OSC 的布局。目前可用的是:box、slimbox、bottombar、topbar、slimbottombar 和 slimtopbar。默认的 0.21.0 之前是 'box'。- seekbarstyle
Default: bar 默认: bar
Sets the style of the playback position marker and overall shape of the seekbar: bar, diamond or knob.
设置播放位置标记的样式和整个进度条的形状: bar 、 diamond 或 knob 。- seekbarhandlesize
Default: 0.6 默认: 0.6
Size ratio of the seek handle if seekbarstyle is set to diamond or knob. This is relative to the full height of the seekbar.
大小比率为寻道手柄,如果 seekbarstyle 设置为 diamond 或 knob 。这是相对于整个进度条的高度。- seekbarkeyframes
Default: yes 默认:是
Controls the mode used to seek when dragging the seekbar. If set to yes, default seeking mode is used (usually keyframes, but player defaults and heuristics can change it to exact). If set to no, exact seeking on mouse drags will be used instead. Keyframes are preferred, but exact seeks may be useful in cases where keyframes cannot be found. Note that using exact seeks can potentially make mouse dragging much slower.
控制拖动进度条时使用的查找模式。如果设置为 yes ,则使用默认查找模式(通常是关键帧,但播放器默认值和启发式算法可能会将其更改为精确查找)。如果设置为 no ,则将使用鼠标拖动的精确查找。首选关键帧,但在无法找到关键帧的情况下,精确查找可能很有用。请注意,使用精确查找可能会使鼠标拖动速度大大减慢。- seekrangestyle
Default: inverted 默认:反转
Display seekable ranges on the seekbar. bar shows them on the full height of the bar, line as a thick line and inverted as a thin line that is inverted over playback position markers. none will hide them. Additionally, slider will show a permanent handle inside the seekbar with cached ranges marked inside. Note that these will look differently based on the seekbarstyle option. Also, slider does not work with seekbarstyle set to bar.
在滑动条上显示可寻址范围。 bar 在滑动条的整个高度上显示它们, line 以粗线显示, inverted 以细线显示,该细线在播放位置标记上反转。 none 将隐藏它们。此外, slider 将在滑动条内显示一个永久的手柄,并标记缓存的范围。请注意,这些外观将根据滑动条样式选项而有所不同。另外, slider 在 seekbarstyle 设置为 bar 时不起作用。- seekrangeseparate
Default: yes 默认:是
Controls whether to show line-style seekable ranges on top of the seekbar or separately if seekbarstyle is set to bar.
控制是否在滑动条顶部显示线型可寻址范围,或者如果 seekbarstyle 设置为 bar 则单独显示。- seekrangealpha
Default: 20 默认:20
Alpha of the seekable ranges, 0 (opaque) to 255 (fully transparent).
可寻址范围的透明度,0(不透明)到 255(完全透明)。- scrollcontrols
Default: yes 默认:是
By default, going up or down with the mouse wheel can trigger certain actions (such as seeking) if the mouse is hovering an OSC element. Set to no to disable any special mouse wheel behavior.
默认情况下,如果鼠标悬停在 OSC 元素上,使用鼠标滚轮上下滚动可以触发某些操作(如寻址)。将设置为 no 以禁用任何特殊的鼠标滚轮行为。- deadzonesize
Default: 0.5 默认:0.5
Size of the deadzone. The deadzone is an area that makes the mouse act like leaving the window. Movement there won't make the OSC show up and it will hide immediately if the mouse enters it. The deadzone starts at the window border opposite to the OSC and the size controls how much of the window it will span. Values between 0.0 and 1.0, where 0 means the OSC will always popup with mouse movement in the window, and 1 means the OSC will only show up when the mouse hovers it. Default pre-0.21.0 was 0.
死区大小。死区是一个使鼠标表现得像离开窗口的区域。在该区域内移动鼠标不会使 OSC 显示,并且如果鼠标进入该区域,它将立即隐藏。死区从与 OSC 相对的窗口边框开始,大小控制了它将跨越的窗口部分。值介于 0.0 和 1.0 之间,其中 0 表示 OSC 将在窗口内鼠标移动时始终弹出,1 表示 OSC 仅在鼠标悬停时显示。默认值在 0.21.0 之前为 0。- minmousemove
Default: 0 默认:0
Minimum amount of pixels the mouse has to move between ticks to make the OSC show up. Default pre-0.21.0 was 3.
鼠标在两次 tick 之间必须移动的最小像素数,才能使 OSC 显示。默认值在 0.21.0 之前为 3。- showwindowed
Default: yes 默认:是
Enable the OSC when windowed
当窗口化时启用 OSC- showfullscreen
Default: yes 默认:是
Enable the OSC when fullscreen
当全屏时启用 OSC- idlescreen
Default: yes 默认:是
Show the mpv logo and message when idle
在空闲时显示 mpv 标志和信息- scalewindowed
Default: 1.0 默认:1.0
Scale factor of the OSC when windowed.
窗口化时 OSC 的缩放因子。- scalefullscreen
Default: 1.0 默认:1.0
Scale factor of the OSC when fullscreen
全屏时 OSC 的缩放因子- vidscale
Default: auto 默认:auto
Scale the OSC with the video. no tries to keep the OSC size constant as much as the window size allows. auto scales the OSC with the OSD, which is scaled with the window or kept at a constant size, depending on the --osd-scale-by-window option.
将 OSC 与视频一起缩放。 no 尽可能在窗口大小允许的范围内保持 OSC 大小不变。 auto 将 OSC 与 OSD 一起缩放,OSD 的缩放取决于窗口或根据 --osd-scale-by-window 选项保持恒定大小。- valign
Default: 0.8 默认:0.8
Vertical alignment in box and slimbox layouts, -1 (top) to 1 (bottom).
盒子和 slimbox 布局中的垂直对齐,-1(顶部)到 1(底部)。- halign
Default: 0.0 默认:0.0
Horizontal alignment in box and slimbox layouts, -1 (left) to 1 (right).
盒子和 slimbox 布局中的水平对齐,-1(左侧)到 1(右侧)。- barmargin
Default: 0 默认:0
Margin from bottom (bottombar, slimbottombar) or top (topbar, slimtopbar), in pixels.
底部边距(bottombar,slimbottombar)或顶部边距(topbar,slimtopbar),以像素为单位。- boxalpha
Default: 80 默认:80
Alpha of the background box, 0 (opaque) to 255 (fully transparent)
背景框的 Alpha 值,0(不透明)到 255(完全透明)- hidetimeout
Default: 500 默认:500
Duration in ms until the OSC hides if no mouse movement, must not be negative
鼠标无移动时 OSC 隐藏的持续时间(毫秒),必须不小于 0- fadeduration
Default: 200 默认:200
Duration of fade effects in ms, 0 = no fade.
渐变效果的持续时间(毫秒),0 表示无渐变- fadein
Default: no 默认:否
Enable fade-in. 启用淡入
- title
Default: ${!playlist-count==1:[${playlist-pos-1}/${playlist-count}] }${media-title}
默认值:${!playlist-count==1:[${playlist-pos-1}/${playlist-count}] }${media-title}String that supports property expansion that will be displayed as OSC title. ASS tags are escaped and newlines are converted to spaces.
支持属性展开的字符串,将作为 OSC 标题显示。ASS 标签被转义,换行符被转换为空格。- tooltipborder
Default: 1 默认:1
Size of the tooltip outline when using bottombar or topbar layouts
使用底部栏或顶部栏布局时工具提示轮廓的大小- timetotal
Default: no 默认:否
Show total time instead of time remaining
显示总时间而不是剩余时间- remaining_playtime
Default: yes 默认:是
Whether the time-remaining display takes speed into account. yes - how much playback time remains at the current speed. no - how much video-time remains.
是否时间剩余显示考虑了速度。 yes - 当前速度下的剩余播放时间。 no - 剩余视频时间。- timems
Default: no 默认:否
Display timecodes with milliseconds
显示带有毫秒的时间码- tcspace
Default: 100 (allowed: 50-200)
默认:100(允许:50-200)Adjust space reserved for timecodes (current time and time remaining) in the bottombar and topbar layouts. The timecode width depends on the font, and with some fonts the spacing near the timecodes becomes too small. Use values above 100 to increase that spacing, or below 100 to decrease it.
调整 bottombar 和 topbar 布局中预留的时间码(当前时间和剩余时间)的空间。时间码的宽度取决于字体,并且在使用某些字体时,时间码附近的间距变得太小。使用大于 100 的值来增加该间距,或使用小于 100 的值来减小它。- visibility
Default: auto (auto hide/show on mouse move)
默认:自动(鼠标移动时自动隐藏/显示)Also supports never and always
也支持 never 和 always- visibility_modes
Default: never_auto_always
默认:never_auto_alwaysThe list of visibility modes to cycle through when calling the osc-visibility cycle script message. Modes are separated by _.
调用 osc-visibility cycle 脚本消息时循环遍历的可见性模式列表。模式由 _ 分隔。- boxmaxchars
Default: 80 默认:80
Max chars for the osc title at the box layout. mpv does not measure the text width on screen and so it needs to limit it by number of chars. The default is conservative to allow wide fonts to be used without overflow. However, with many common fonts a bigger number can be used. YMMV.
osc 标题在框布局中的最大字符数。mpv 不在屏幕上测量文本宽度,因此需要通过字符数来限制。默认值较为保守,以允许使用宽字体而不溢出。然而,对于许多常见字体,可以使用更大的数字。因人而异。- boxvideo
Default: no 默认:否
Whether to overlay the osc over the video (no), or to box the video within the areas not covered by the osc (yes). If this option is set, the osc may overwrite the --video-margin-ratio-* options, even if the user has set them. (It will not overwrite them if all of them are set to default values.) Additionally, visibility must be set to always. Otherwise, this option does nothing.
是否在视频上叠加 osc ( no ),或者将视频框在 osc 未覆盖的区域内部 ( yes )。如果设置此选项,osc 可能会覆盖 --video-margin-ratio-* 选项,即使用户已经设置了它们。 (如果它们都设置为默认值,则不会覆盖。)此外, visibility 必须设置为 always 。否则,此选项不起作用。Currently, this is supported for the bottombar, slimbottombar, topbar and slimtopbar layouts only. The other layouts do not change if this option is set. Separately, if window controls are present (see below), they will be affected regardless of which osc layout is in use.
目前,此选项仅支持 bottombar , slimbottombar , topbar 和 slimtopbar 布局。其他布局即使设置此选项也不会改变。另外,如果存在窗口控件(见下文),它们将受到影响,无论正在使用哪个 osc 布局。The border is static and appears even if the OSC is configured to appear only on mouse interaction. If the OSC is invisible, the border is simply filled with the background color (black by default).
边框是静态的,即使 osc 配置为仅在鼠标交互时出现,也会出现。如果 osc 不可见,边框将简单地填充背景颜色(默认为黑色)。This currently still makes the OSC overlap with subtitles (if the --sub-use-margins option is set to yes, the default). This may be fixed later.
目前这仍然会使 osc 与字幕重叠(如果 --sub-use-margins 选项设置为 yes ,默认值)。这可能在以后得到修复。This does not work correctly with video outputs like --vo=xv, which render OSD into the unscaled video.
此代码与视频输出(如 --vo=xv )不正确,这些输出将 OSD 渲染到未缩放的视频中。- windowcontrols
Default: auto (Show window controls if there is no window border)
默认:自动(如果没有窗口边框,则显示窗口控件)Whether to show window management controls over the video, and if so, which side of the window to place them. This may be desirable when the window has no decorations, either because they have been explicitly disabled (border=no) or because the current platform doesn't support them (eg: gnome-shell with wayland).
是否在视频上显示窗口管理控件,以及如果显示,应将它们放置在窗口的哪一侧。当窗口没有装饰时,这可能是有用的,无论是由于它们已被明确禁用( border=no )还是因为当前平台不支持它们(例如:gnome-shell with wayland)。The set of window controls is fixed, offering minimize, maximize, and quit. Not all platforms implement minimize and maximize, but quit will always work.
窗口控件集是固定的,提供 minimize , maximize 和 quit 。并非所有平台都实现了 minimize 和 maximize ,但 quit 总是会工作。- windowcontrols_alignment
Default: right 默认:右侧
If window controls are shown, indicates which side should they be aligned to.
如果显示窗口控件,指示它们应对齐到哪一侧。Supports left and right which will place the controls on those respective sides.
支持 left 和 right ,这将使控件放置在相应的两侧。- windowcontrols_title
Default: ${media-title} 默认值:${media-title}
String that supports property expansion that will be displayed as the windowcontrols title. ASS tags are escaped, and newlines and trailing slashes are stripped.
支持属性展开的字符串,将作为窗口控件标题显示。ASS 标签将被转义,并删除换行符和尾随斜杠。- greenandgrumpy
Default: no 默认:否
Set to yes to reduce festivity (i.e. disable santa hat in December.)
设置为 yes 以减少节日气氛(例如,在十二月禁用圣诞帽。)- livemarkers
Default: yes 默认:是
Update chapter markers positions on duration changes, e.g. live streams. The updates are unoptimized - consider disabling it on very low-end systems.
在持续时间更改时更新章节标记位置,例如直播流。更新未优化 - 考虑在非常低端的系统上禁用它。- chapter_fmt
Default: Chapter: %s 默认: Chapter: %s
Template for the chapter-name display when hovering the seekbar. Use no to disable chapter display on hover. Otherwise it's a lua string.format template and %s is replaced with the actual name.
悬停在进度条上时显示章节名称的模板。使用 no 禁用悬停时显示章节。否则它是一个 lua string.format 模板, %s 被替换为实际名称。- unicodeminus
Default: no 默认:否
Use a Unicode minus sign instead of an ASCII hyphen when displaying the remaining playback time.
使用 Unicode 减号代替 ASCII 连字符来显示剩余播放时间。- background_color
Default: #000000 默认:#000000
Sets the background color of the OSC.
设置 OSC 的背景颜色。- timecode_color
Default: #FFFFFF 默认:#FFFFFF
Sets the color of the timecode and seekbar, of the OSC.
设置 OSC 的时间码和 seekbar 的颜色。- title_color
Default: #FFFFFF 默认:#FFFFFF
Sets the color of the video title. Formatted as #RRGGBB.
设置视频标题的颜色。格式为#RRGGBB。- time_pos_color
Default: #FFFFFF 默认:#FFFFFF
Sets the color of the timecode at hover position in the seekbar.
设置 seekbar 中悬停位置的时间码颜色。- time_pos_outline_color
Default: #FFFFFF 默认:#FFFFFF
Sets the color of the timecode's outline at hover position in the seekbar. Also affects the timecode in the slimbox layout.
设置 seekbar 中悬停位置的时间码轮廓颜色。同时影响 slimbox 布局中的时间码。- buttons_color
Default: #FFFFFF 默认:#FFFFFF
Sets the colors of the big buttons.
设置大按钮的颜色。- top_buttons_color
Default: #FFFFFF 默认:#FFFFFF
Sets the colors of the top buttons.
设置顶部按钮的颜色。- small_buttonsL_color
Default: #FFFFFF 默认:#FFFFFF
Sets the colors of the small buttons on the left in the box layout.
设置框布局中左侧的小按钮的颜色。- small_buttonsR_color
Default: #FFFFFF 默认:#FFFFFF
Sets the colors of the small buttons on the right in the box layout.
设置框布局中右侧的小按钮的颜色。- held_element_color
Default: #999999 默认:#999999
Sets the colors of the elements that are being pressed or held down.
设置被按下或按住的元素的颜色。- tick_delay
Default: 1/60 默认:1/60
Sets the minimum interval between OSC redraws in seconds. This can be decreased on fast systems to make OSC rendering smoother.
设置 OSC 重绘之间的最小间隔(秒)。在快速系统上可以减小此值以使 OSC 渲染更平滑。Ignored if tick_delay_follow_display_fps is set to yes and the VO supports the display-fps property.
如果 tick_delay_follow_display_fps 设置为 yes 并且 VO 支持该 display-fps 属性,则忽略。- tick_delay_follow_display_fps
Default: no 默认:否
Use display fps to calculate the interval between OSC redraws.
使用显示帧率来计算 OSC 重绘之间的间隔。
The following options configure what commands are run when the buttons are
clicked. mbtn_mid commands are also triggered with shift+mbtn_left.
以下选项配置了按钮点击时运行的命令。 mbtn_mid 命令也会在 shift+mbtn_left 时触发。
menu_mbtn_left_command=script-binding select/menu; script-message-to osc osc-hide
menu_mbtn_mid_command=
menu_mbtn_right_command=
playlist_prev_mbtn_left_command=playlist-prev; show-text ${playlist} 3000
playlist_prev_mbtn_mid_command=show-text ${playlist} 3000
playlist_prev_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide
playlist_next_mbtn_left_command=playlist-next; show-text ${playlist} 3000
playlist_next_mbtn_mid_command=show-text ${playlist} 3000
playlist_next_mbtn_right_command=script-binding select/select-playlist; script-message-to osc osc-hide
title_mbtn_left_command=script-binding stats/display-page-5
title_mbtn_mid_command=show-text ${path}
title_mbtn_right_command=script-binding select/select-watch-history; script-message-to osc osc-hide
play_pause_mbtn_left_command=cycle pause
play_pause_mbtn_mid_command=cycle-values loop-playlist inf no
play_pause_mbtn_right_command=cycle-values loop-file inf no
chapter_prev_mbtn_left_command=osd-msg add chapter -1
chapter_prev_mbtn_mid_command=show-text ${chapter-list} 3000
chapter_prev_mbtn_right_command=script-binding select/select-chapter; script-message-to osc osc-hide
chapter_next_mbtn_left_command=osd-msg add chapter 1
chapter_next_mbtn_mid_command=show-text ${chapter-list} 3000
chapter_next_mbtn_right_command=script-binding select/select-chapter; script-message-to osc osc-hide
audio_track_mbtn_left_command=cycle audio
audio_track_mbtn_mid_command=cycle audio down
audio_track_mbtn_right_command=script-binding select/select-aid; script-message-to osc osc-hide
audio_track_wheel_down_command=cycle audio
audio_track_wheel_up_command=cycle audio down
sub_track_mbtn_left_command=cycle sub
sub_track_mbtn_mid_command=cycle sub down
sub_track_mbtn_right_command=script-binding select/select-sid; script-message-to osc osc-hide
sub_track_wheel_down_command=cycle sub
sub_track_wheel_up_command=cycle sub down
volume_mbtn_left_command=no-osd cycle mute
volume_mbtn_mid_command=
volume_mbtn_right_command=script-binding select/select-audio-device; script-message-to osc osc-hide
volume_wheel_down_command=add volume -5
volume_wheel_up_command=add volume 5
fullscreen_mbtn_left_command="cycle fullscreen"
fullscreen_mbtn_mid_command=
fullscreen_mbtn_right_command="cycle window-maximized"
Script Commands 脚本命令
The OSC script listens to certain script commands. These commands can bound
in input.conf, or sent by other scripts.
OSC 脚本监听某些脚本命令。这些命令可以绑定在 input.conf ,或者由其他脚本发送。
- osc-visibility
- Controls visibility mode never / auto (on mouse move) / always
and also cycle to cycle between the modes. If a second argument is
passed (any value), then the output on the OSD will be silenced.
控制可见模式 never / auto (鼠标移动时) / always 以及 cycle 在模式之间循环。如果传递第二个参数(任何值),则 OSD 上的输出将被静音。 - osc-show
- Triggers the OSC to show up, just as if user moved mouse.
触发 OSC 显示,就像用户移动鼠标一样。 - osc-hide
- Hide the OSC when visibility is auto.
当 visibility 为 auto 时隐藏 OSC 。
Example 示例
You could put this into input.conf to hide the OSC with the a key and
to set auto mode (the default) with b:
您可以将此放入 input.conf 以隐藏带有 a 键的 OSC,并使用 b 设置自动模式(默认):
a script-message osc-visibility never b script-message osc-visibility auto
- osc-idlescreen
- Controls the visibility of the mpv logo on idle. Valid arguments are yes,
no, and cycle to toggle between yes and no. If a second argument is
passed (any value), then the output on the OSD will be silenced.
控制空闲时 mpv 标志的可见性。有效的参数是 yes , no 和 cycle 以在是和否之间切换。如果传递第二个参数(任何值),则将在 OSD 上静音输出。
STATS 统计数据
This builtin script displays information and statistics for the currently
played file. It is enabled by default if mpv was compiled with Lua support.
It can be disabled entirely using the --load-stats-overlay=no option.
"此内置脚本显示当前播放文件的信息和统计信息。如果 mpv 是使用 Lua 支持编译的,则默认启用。可以使用 --load-stats-overlay=no 选项完全禁用。
Usage 使用说明
The following key bindings are active by default unless something else is
already bound to them:
以下键绑定默认激活,除非它们已经被其他绑定占用:
i | Show stats for a fixed duration 显示固定时间的统计信息 |
I | Toggle stats (shown until toggled again) 切换统计信息(显示直到再次切换) |
? | Toggle displaying the key bindings 切换显示快捷键 |
While the stats are visible on screen the following key bindings are active,
regardless of existing bindings. They allow you to switch between pages of
stats:
当统计信息在屏幕上可见时,以下键绑定将激活,无论是否存在其他绑定。它们允许您在统计信息的页面之间切换:
1 | Show usual stats 显示常规统计数据 |
2 | Show frame timings (scroll) 显示帧时间(滚动) |
3 | Input cache stats 输入缓存统计信息 |
4 | Active key bindings (scroll) 活动键绑定(滚动) |
5 | Selected Tracks Info (scroll) 选定的轨道信息(滚动) |
0 | Internal stuff (scroll) 内部内容(滚动) |
If stats were displayed by toggling, these key bindings are also active:
如果通过切换显示统计信息,这些快捷键也将生效:
ESC | Close the stats 关闭统计信息 |
On pages which support scroll, these key bindings are also active:
在支持滚动的页面上,这些快捷键也将生效:
UP | Scroll one line up 向上滚动一行 |
DOWN | Scroll one line down 向下滚动一行 |
On page 4, these key bindings are also active:
在第 4 页,这些快捷键也有效:
/ | Search key bindings 搜索快捷键 |
Configuration 配置
This script can be customized through a config file script-opts/stats.conf
placed in mpv's user directory and through the --script-opts command-line
option. The configuration syntax is described in mp.options functions.
此脚本可以通过放置在 mpv 用户目录中的配置文件 script-opts/stats.conf 和通过 --script-opts 命令行选项进行自定义。配置语法在 mp.options 函数中描述。
Configurable Options 可配置选项
- key_page_1
- Default: 1 默认:1
- key_page_2
- Default: 2 默认:2
- key_page_3
- Default: 3 默认:3
- key_page_4
- Default: 4 默认:4
- key_page_5
- Default: 5 默认:5
- key_page_0
- Default: 0 默认:0
- key_exit
Default: ESC 默认:ESC
Key bindings for page switching while stats are displayed.
在显示统计数据时切换页面的快捷键。- key_scroll_up
- Default: UP 默认:UP
- key_scroll_down
- Default: DOWN 默认:DOWN
- key_scroll_search
- Default: / 默认:/
- scroll_lines
Default: 1 默认:1
Scroll key bindings and number of lines to scroll on pages which support it.
在支持此功能的页面上滚动按键绑定以及每页滚动的行数。- duration
Default: 4 默认:4
How long the stats are shown in seconds (oneshot).
统计信息显示的秒数(一次性)。- redraw_delay
Default: 1 默认:1
How long it takes to refresh the displayed stats in seconds (toggling).
刷新显示的统计数据所需时间(切换)以秒为单位。- persistent_overlay
Default: no 默认:否
When no, other scripts printing text to the screen can overwrite the displayed stats. When yes, displayed stats are persistently shown for the respective duration. This can result in overlapping text when multiple scripts decide to print text at the same time.
当无时,其他打印文本到屏幕的脚本可以覆盖显示的统计数据。当有时,显示的统计数据会持续显示相应的时间长度。这可能导致多个脚本决定同时打印文本时出现文本重叠。- file_tag_max_length
Default: 128 默认:128
Only show file tags shorter than this length, in bytes.
仅显示小于此长度的文件标签,以字节为单位。- file_tag_max_count
Default: 16 默认:16
Only show the first specified amount of file tags.
仅显示指定数量的第一个文件标签。- term_clip
Default: yes 默认:是
Whether to clip lines to the terminal width.
是否将行裁剪到终端宽度。- plot_perfdata
Default: yes 默认:是
Show graphs for performance data (page 2).
显示性能数据的图表(第 2 页)。- plot_vsync_ratio
- Default: yes 默认:是
- plot_vsync_jitter
Default: yes 默认:是
Show graphs for vsync and jitter values (page 1). Only when toggled.
显示垂直同步和抖动值的图表(第 1 页)。仅在切换时显示。- plot_tonemapping_lut
Default: no 默认:否
Enable tone-mapping LUT visualization automatically. Only when toggled.
自动启用色调映射查找表可视化。仅在切换时启用。- flush_graph_data
Default: yes 默认:是
Clear data buffers used for drawing graphs when toggling.
在切换时清除用于绘制图形的数据缓冲区。- font
Default: same as osd-font 默认:与 osd-font 相同
Font name. Should support as many font weights as possible for optimal visual experience.
字体名称。应尽可能支持更多字体粗细以获得最佳视觉体验。- font_mono
Default: monospace 默认:等宽
Font name for parts where monospaced characters are necessary to align text. Currently, monospaced digits are sufficient.
用于需要使用等宽字符对齐文本的部分的字体名称。目前,等宽数字已足够。- font_size
Default: 20 默认:20
Font size used to render text.
用于渲染文本的字体大小。- font_color
Default: same as osd-color 默认:与 osd-color 相同
Color of the text.
文本的颜色。- border_size
Default: 1.65 默认:1.65
Size of border drawn around the font.
围绕字体绘制的边框大小。- border_color
Default: same as osd-border-color 默认:与 osd-border-color 相同
Color of the text border.
文本边框颜色。- shadow_x_offset
Default: same as --osd-shadow-offset 默认:与 --osd-shadow-offset 相同
The horizontal distance from the text to position the shadow at.
文本到放置阴影的位置的水平距离。- shadow_y_offset
Default: same as --osd-shadow-offset 默认:与 --osd-shadow-offset 相同
The vertical distance from the text to position the shadow at.
文本到放置阴影的位置的垂直距离。- shadow_color
Default: same as osd-shadow-color 默认:与 osd-shadow-color 相同
Color of the text shadow.
文本阴影的颜色。- alpha
Default: 11 默认:11
Transparency of text when font_color is specified, of text borders when border_color is specified, and of text shadows when shadow_color is specified.
当指定 font_color 时文本的透明度,当指定 border_color 时文本边框的透明度,以及当指定 shadow_color 时文本阴影的透明度。- plot_bg_border_color
Default: 0000FF 默认:0000FF
Border color used for drawing graphs.
用于绘制图表的边框颜色。- plot_bg_border_width
Default: 1.25 默认:1.25
Border width used for drawing graphs.
用于绘制图形的边框宽度。- plot_bg_color
Default: 262626 默认:262626
Background color used for drawing graphs.
用于绘制图形的背景颜色。- plot_color
Default: FFFFFF 默认:FFFFFF
Color used for drawing graphs.
用于绘制图表的颜色。- vidscale
Default: auto 默认:auto
Scale the text and graphs with the video. no tries to keep the sizes constant. auto scales the text and graphs with the OSD, which is scaled with the window or kept at a constant size, depending on the --osd-scale-by-window option.
使用视频缩放文本和图表。 no 尝试保持大小不变。 auto 根据 OSD 缩放文本和图表,OSD 的大小会随着窗口缩放或保持恒定大小,具体取决于 --osd-scale-by-window 选项。
Note: colors are given as hexadecimal values and use ASS tag order: BBGGRR
(blue green red).
注意:颜色以十六进制值给出,并使用 ASS 标签顺序:BBGGRR(蓝色 绿色 红色)。
Different key bindings 不同的键绑定
Additional keys can be configured in input.conf to display the stats:
可以在 input.conf 中配置额外的键来显示统计数据:
e script-binding stats/display-stats E script-binding stats/display-stats-toggle
And to display a certain page directly:
直接显示某个页面:
i script-binding stats/display-page-1 h script-binding stats/display-page-4-toggle
Active key bindings page
活动键绑定页面
Lists the active key bindings and the commands they're bound to, excluding the
interactive keys of the stats script itself. See also --input-test for more
detailed view of each binding.
列出活动键绑定及其关联的命令,不包括统计脚本本身的交互键。有关每个绑定的更详细视图,请参阅 --input-test 。
The keys are grouped automatically using a simple analysis of the command
string, and one should not expect documentation-level grouping accuracy,
however, it should still be reasonably useful.
键是使用对命令字符串的简单分析自动分组的,不应期望文档级别的分组精度,然而,它仍然应该是有用的。
Using --idle --script-opt=stats-bindlist=yes will print the list to
the terminal and quit immediately. Long lines are clipped to the terminal width
unless this is disabled with --script-opt=stats-term_clip=no. Escape
sequences can be disabled by adding - before yes, i.e.
--script-opt=stats-bindlist=-yes.
使用 --idle --script-opt=stats-bindlist=yes 将打印列表到终端并立即退出。除非使用 --script-opt=stats-term_clip=no 禁用,否则长行将被截断到终端宽度。可以通过在 yes 前添加 - 来禁用转义序列,即 --script-opt=stats-bindlist=-yes 。
Like with --input-test, the list includes bindings from input.conf and
from user scripts. Use --no-config to list only built-in bindings.
与 --input-test 类似,列表包括来自 input.conf 和用户脚本的绑定。使用 --no-config 仅列出内置绑定。
Internal stuff page 内部内容页面
Most entries shown on this page have rather vague meaning. Likely none of this
is useful for you. Don't attempt to use it. Forget its existence.
本页上显示的大多数条目含义相当模糊。可能这些都没有对你有用。不要尝试使用它。忘记它的存在。
Selecting this for the first time will start collecting some internal
performance data. That means performance will be slightly lower than normal for
the rest of the time the player is running (even if the stats page is closed).
Note that the stats page itself uses a lot of CPU and even GPU resources, and
may have a heavy impact on performance.
首次选择此选项将开始收集一些内部性能数据。这意味着在玩家运行期间(即使统计页面已关闭),性能将略低于正常水平。请注意,统计页面本身会消耗大量的 CPU 和 GPU 资源,可能会对性能产生重大影响。
The displayed information is accumulated over the redraw delay (shown as
poll-time field).
显示的信息是在重绘延迟期间累积的(显示为 poll-time 字段)。
This adds entries for each Lua script. If there are too many scripts running,
parts of the list will simply be out of the screen, but it can be scrolled.
此操作将为每个 Lua 脚本添加条目。如果运行的脚本太多,列表的一部分将简单地超出屏幕,但可以进行滚动。
If the underlying platform does not support pthread per thread times, the
displayed times will be 0 or something random (I suspect that at time of this
writing, only Linux provides the correct via pthread APIs for per thread times).
如果底层平台不支持每个线程的 pthread 时间,则显示的时间将是 0 或随机(我怀疑在撰写本文时,只有 Linux 通过 pthread API 为每个线程时间提供正确支持)。
Most entries are added lazily and only during data collection, which is why
entries may pop up randomly after some time. It's also why the memory usage
entries for scripts that have been inactive since the start of data collection
are missing.
大多数条目都是懒加载的,并且仅在数据收集期间添加,这就是为什么条目可能在一段时间后随机出现。这也是为什么自数据收集开始以来未活跃的脚本的内存使用条目缺失的原因。
Memory usage is approximate and does not reflect internal fragmentation.
内存使用量是近似的,并不反映内部碎片。
JS scripts memory reporting is disabled by default because collecting the data
at the JS side has an overhead and will increase memory usage. It can be
enabled by setting the --js-memory-report option before starting mpv.
默认情况下禁用 JS 脚本的内存报告,因为收集 JS 端的数据会有开销并增加内存使用。可以在启动 mpv 之前设置 --js-memory-report 选项来启用它。
If entries have /time and /cpu variants, the former gives the real time
(monotonic clock), while the latter the thread CPU time (only if the
corresponding pthread API works and is supported).
如果条目有 /time 和 /cpu 变体,前者提供实时(单调时钟),而后者提供线程 CPU 时间(仅当相应的 pthread API 工作并受支持时)。
CONSOLE 控制台
This script provides the ability to process the user's textual input to other
scripts through the mp.input API. It can be displayed on both the video
window and the terminal. It can be disabled entirely using the
--load-console=no option.
此脚本提供了通过 mp.input API 处理用户文本输入到其他脚本的能力。它可以在视频窗口和终端上显示。可以使用 --load-console=no 选项完全禁用。
Console can either process free-form text or select from a predefined list of
items.
控制台可以处理自由文本或从预定义的项目列表中选择。
Free-form text mode keybindings
自由文本模式快捷键
- ESC and Ctrl+[ ESC 和 Ctrl+[
- Hide the console. 隐藏控制台。
- ENTER, Ctrl+j and Ctrl+m
按 ENTER、Ctrl+j 和 Ctrl+m - Select the first completion if one wasn't already manually selected, and run
the typed command.
如果尚未手动选择,请选择第一个完成项,并运行输入的命令。 - Shift+ENTER
- Type a literal newline character.
输入一个实际的换行符。 - LEFT and Ctrl+b LEFT 和 Ctrl+b
- Move the cursor to the previous character.
将光标移动到前一个字符。 - RIGHT and Ctrl+f RIGHT 和 Ctrl+f
- Move the cursor to the next character.
将光标移动到下一个字符。 - Ctrl+LEFT and Alt+b Ctrl+向左和 Alt+b
- Move the cursor to the beginning of the current word, or if between words,
to the beginning of the previous word.
将光标移至当前单词的开头,如果位于单词之间,则移至上一个单词的开头。 - Ctrl+RIGHT and Alt+f Ctrl+RIGHT 和 Alt+f
- Move the cursor to the end of the current word, or if between words, to the
end of the next word.
将光标移至当前单词的结尾,如果位于单词之间,则移至下一个单词的结尾。 - HOME and Ctrl+a HOME 和 Ctrl+a
- Move the cursor to the start of the current line.
将光标移至当前行的开头。 - END and Ctrl+e END 和 Ctrl+e
- Move the cursor to the end of the current line.
将光标移至当前行的末尾。 - BACKSPACE and Ctrl+h BACKSPACE 和 Ctrl+h
- Delete the previous character.
删除前一个字符。 - Ctrl+d
- Hide the console if the current line is empty, otherwise delete the next
character.
如果当前行是空的,则隐藏控制台,否则删除下一个字符。 - Ctrl+BACKSPACE and Ctrl+w
Ctrl+BACKSPACE 和 Ctrl+w - Delete text from the cursor to the beginning of the current word, or if
between words, to the beginning of the previous word.
从光标处删除到当前单词的开头,如果位于单词之间,则删除到前一个单词的开头。 - Ctrl+DEL and Alt+d Ctrl+DEL 和 Alt+d
- Delete text from the cursor to the end of the current word, or if between
words, to the end of the next word.
从光标处删除到当前单词的结尾,如果位于单词之间,则删除到下一个单词的结尾。 - Ctrl+u
- Delete text from the cursor to the beginning of the current line.
从光标处删除到当前行开头的文本。 - Ctrl+k
- Delete text from the cursor to the end of the current line.
从光标处删除到当前行结尾的文本。 - Ctrl+c
- Clear the current line.
清除当前行。 - UP and Ctrl+p 向上键和 Ctrl+p
- Move back in the command history.
在命令历史中后退。 - DOWN and Ctrl+n 向下和 Ctrl+n
- Move forward in the command history.
在命令历史中向前移动。 - PGUP 翻页向上
- Go to the first command in the history.
转到历史中的第一个命令。 - PGDN
- Stop navigating the command history.
停止导航命令历史。 - Ctrl+r
- Search the command history. See SELECT for the key bindings in this mode.
搜索命令历史。见 SELECT 了解此模式下的键绑定。 - INSERT
- Toggle insert mode. 切换插入模式。
- Ctrl+v
- Paste text (uses the clipboard on X11 and Wayland).
粘贴文本(在 X11 和 Wayland 上使用剪贴板)。 - Shift+INSERT
- Paste text (uses the primary selection on X11 and Wayland).
粘贴文本(在 X11 和 Wayland 上使用主选择)。 - TAB and Ctrl+i TAB 和 Ctrl+i
- Cycle through completions.
遍历完成项。 - Shift+TAB
- Cycle through the completions backwards.
遍历完成项的反向。 - Ctrl+l
- Clear all log messages from the console.
清除控制台中的所有日志消息。 - MBTN_MID
- Paste text (uses the primary selection on X11 and Wayland).
粘贴文本(在 X11 和 Wayland 上使用主选择)。 - WHEEL_UP
- Move back in the command history.
在命令历史中后退。 - WHEEL_DOWN
- Move forward in the command history.
在命令历史中向前移动。
Known issues 已知问题
- Non-ASCII keyboard input has restrictions
非 ASCII 键盘输入有限制 - The cursor keys move between Unicode code-points, not grapheme clusters
光标键在 Unicode 代码点之间移动,而不是在图形簇之间
Configuration 配置
This script can be customized through a config file script-opts/console.conf
placed in mpv's user directory and through the --script-opts command-line
option. The configuration syntax is described in mp.options functions.
此脚本可以通过放置在 mpv 用户目录中的配置文件 script-opts/console.conf 和通过 --script-opts 命令行选项进行自定义。配置语法在 mp.options 函数中描述。
Configurable Options 可配置选项
- font
The font name. 字体名称。
When necessary to align completions in a grid, a monospace font depending on the platform is the default. When there are no completions, --osd-font is the default.
当需要将补全内容对齐到网格中时,默认使用平台依赖的等宽字体。当没有补全内容时, --osd-font 是默认值。- font_size
Default: 24 默认:24
The font size. This will be multiplied by display-hidpi-scale when the console is not scaled with the window.
字体大小。当控制台未与窗口缩放时,这将乘以 display-hidpi-scale 。- border_size
Default: 1.65 默认:1.65
The font border size.
字体边框大小。- background_alpha
Default: 80 默认:80
The transparency of the menu's background. Ranges from 0 (opaque) to 255 (fully transparent).
菜单背景的透明度。范围从 0(不透明)到 255(完全透明)。- padding
Default: 10 默认:10
The padding of the menu.
菜单的内边距。- menu_outline_size
Default: 0 默认:0
The size of the menu's border.
菜单边框的大小。- menu_outline_color
Default: #FFFFFF 默认:#FFFFFF
The color of the menu's border.
菜单边框的颜色。- corner_radius
Default: 8 默认:8
The radius of the menu's corners.
菜单角落的半径。- margin_x
Default: same as --osd-margin-x 默认:与 --osd-margin-x 相同
The margin from the left of the window.
窗口左侧的边距。- margin_y
Default: same as --osd-margin-y 默认:与 --osd-margin-y 相同
The margin from the bottom of the window.
距窗口底部的边距。- scale_with_window
Default: auto 默认: auto
Whether to scale the console with the window height. Can be yes, no, or auto, which follows the value of --osd-scale-by-window.
是否根据窗口高度缩放控制台。可以是 yes , no ,或 auto ,它遵循 --osd-scale-by-window 的值。- selected_color
Default: #222222 默认: #222222
The color of the selected item.
选中项的颜色。- selected_back_color
Default: #FFFFFF 默认: #FFFFFF
The background color of the selected item.
选中项的背景颜色。- match_color
Default: #0088FF 默认: #0088FF
The color of characters that match the searched string.
字符匹配搜索字符串的颜色。- case_sensitive
Default: no on Windows, yes on other platforms.
默认:在 Windows 上无,在其他平台上为是。Whether autocompletion is case sensitive. Only works with ASCII characters.
自动补全是否区分大小写。仅适用于 ASCII 字符。- history_dedup
Default: true 默认:true
Remove duplicate entries in history as to only keep the latest one.
从历史记录中删除重复条目,以仅保留最新的一条。- font_hw_ratio
Default: auto 默认:auto
The ratio of font height to font width. Adjusts grid width of completions. Values in the range 1.8..2.5 make sense for common monospace fonts.
字体高度与字体宽度的比例。调整补全的网格宽度。范围在 1.8..2.5 之间的值对于常见的等宽字体是有意义的。
COMMANDS
This script allows running and completing input commands in the console
interactively, and also adds mpv's log to the console's log.
此脚本允许在控制台中交互式地运行和完成输入命令,并将 mpv 的日志添加到控制台日志中。
Keybindings 快捷键
- `
- Open the console to enter commands.
打开控制台以输入命令。
Commands 命令
script-binding commands/open
Open the console to enter commands.
打开控制台以输入命令。
- script-message-to commands type <text> [<cursor_pos>]
Show the console and pre-fill it with the provided text, optionally specifying the initial cursor position as a positive integer starting from 1. The console is automatically closed after running the command.
显示控制台并在其中预填充提供的文本,可选地指定从 1 开始的初始光标位置为正整数。运行命令后,控制台将自动关闭。Examples for input.conf input.conf 的示例
Configuration 配置
This script can be customized through a config file script-opts/commands.conf
placed in mpv's user directory and through the --script-opts command-line
option. The configuration syntax is described in mp.options functions.
此脚本可以通过放置在 mpv 用户目录中的配置文件 script-opts/commands.conf 和通过 --script-opts 命令行选项进行自定义。配置语法在 mp.options 函数中描述。
Configurable Options 可配置选项
- persist_history
Default: no 默认:否
Whether to save the command history to a file and load it.
是否将命令历史保存到文件并加载。- history_path
Default: ~~state/command_history.txt 默认: ~~state/command_history.txt
The file path for persist_history (see PATHS).
文件路径为 persist_history (参见 PATHS)。
SELECT
console can present a list of items to browse and select from with the
mp.input.select API. select.lua is a builtin client of this API
providing script bindings that gather and format the data to be selected in the
console and do operations on the selected item. It can be disabled using the
--load-select=no option.
控制台可以使用 mp.input.select API 显示一个项目列表以供浏览和选择。 select.lua 是此 API 的内置客户端,提供脚本绑定,用于收集和格式化要在控制台中选择的 数据,并对所选项目进行操作。可以使用 --load-select=no 选项将其禁用。
Key bindings 快捷键
When using mp.input.select, typing printable characters does a fuzzy search
of the presented items, and key bindings listed in CONSOLE are extended with
the following:
当使用 mp.input.select 时,输入可打印字符将对显示的项目进行模糊搜索,并且 CONSOLE 中列出的快捷键绑定将扩展以下:
- ENTER, Ctrl+j and Ctrl+m
按 ENTER、Ctrl+j 和 Ctrl+m - Confirm the selection of the highlighted item.
确认选择高亮的项目。 - UP and Ctrl+p 向上键和 Ctrl+p
- Select the item above, or the last one when the first item is selected.
选择上面的项目,或者当第一个项目被选中时最后一个项目。 - DOWN and Ctrl+n 向下和 Ctrl+n
- Select the item below, or the first one when the last item is selected.
选择下面的项目,或者当最后一个项目被选中时第一个项目。 - PGUP and Ctrl+b PGUP 和 Ctrl+b
- Scroll up one page.
向上滚动一页。 - PGDN and Ctrl+f PGDN 和 Ctrl+f
- Scroll down one page.
向下滚动一页。 - MBTN_LEFT
- Confirm the selection of the highlighted item, or close the console if
clicking outside of the menu rectangle.
确认选中高亮项,或如果点击菜单矩形外部,则关闭控制台。 - WHEEL_UP
- Scroll up. 向上滚动。
- WHEEL_DOWN
- Scroll down. 向下滚动。
Script bindings 脚本绑定
By default select.lua's script bindings are bound to key sequences starting with
g listed in Keyboard Control. The names of the script bindings listed
below can be used to bind them to different keys.
默认情况下,select.lua 的脚本绑定绑定到以 g 开头的键序列,列在键盘控制中。下面列出的脚本绑定名称可用于将它们绑定到不同的键。
Example to rebind playlist selection in input.conf
示例:在 input.conf 中重新绑定播放列表选择
Ctrl+p script-binding select/select-playlist
Ctrl+p 脚本绑定 select/select-playlist
Available script bindings are:
可用的脚本绑定有:
- select-playlist
- Select a playlist entry. --osd-playlist-entry determines how playlist
entries are formatted.
选择播放列表条目。 --osd-playlist-entry 决定了播放列表条目的格式。 - select-sid
- Select a subtitle track, or disable the current one.
选择一个副标题轨道,或禁用当前轨道。 - select-secondary-sid
- Select a secondary subtitle track, or disable the current one.
选择一个辅助副标题轨道,或禁用当前轨道。 - select-aid
- Select an audio track, or disable the current one.
选择一个音频轨道,或禁用当前轨道。 - select-vid
- Select a video track, or disable the current one.
选择一个视频轨道,或禁用当前轨道。 - select-track
- Select a track of any type, or disable a selected track.
选择任何类型的轨道,或禁用已选轨道。 - select-chapter
- Select a chapter. 选择一个章节。
- select-edition
- Select an MKV edition or DVD/Blu-ray title.
选择一个 MKV 版本或 DVD/Blu-ray 标题。 - select-subtitle-line
Select a subtitle line to seek to. This doesn't work with image subtitles.
选择要跳转到的字幕行。此功能不适用于图像字幕。This currently requires ffmpeg in PATH, or in the same folder as mpv on Windows.
当前需要 ffmpeg 在 PATH 中,或者在 Windows 上与 mpv 同一文件夹内。- select-audio-device
- Select an audio device.
选择一个音频设备。 - select-watch-history
Select a file from the watch history. Requires --save-watch-history.
从观看历史记录中选择一个文件。需要 --save-watch-history 。If you don't already use --autocreate-playlist, it is recommended to enable it with this script binding to populate the playlist with the other files in the entry's directory.
如果您尚未使用 --autocreate-playlist ,建议使用此脚本绑定启用它,以将条目目录中的其他文件填充到播放列表中。Example for input.conf to play files adjacent to the history entry
input.conf 的示例,用于播放与历史条目相邻的文件g-h script-binding select/select-watch-history; no-osd set autocreate-playlist filter
g-h 脚本绑定 select/select-watch-history; no-osd 设置 autocreate-playlist 过滤器- select-watch-later
Select a file from watch later config files (see RESUMING PLAYBACK) to resume playing. Requires --write-filename-in-watch-later-config. This doesn't work with --ignore-path-in-watch-later-config.
从稍后观看的配置文件中选择一个文件(见 RESUMING PLAYBACK)以继续播放。需要 --write-filename-in-watch-later-config 。这在与 --ignore-path-in-watch-later-config 不兼容。If you don't already use --autocreate-playlist, it is recommended to enable it with this script binding to populate the playlist with the other files in the entry's directory.
如果您尚未使用 --autocreate-playlist ,建议使用此脚本绑定启用它,以将条目目录中的其他文件填充到播放列表中。Example for input.conf to play files adjacent to the watch later entry
input.conf 的示例,用于播放“稍后观看”条目旁边的文件g-w script-binding select/select-watch-later; no-osd set autocreate-playlist filter
g-w 脚本绑定 select/select-watch-later; 无 OSD 设置自动创建播放列表过滤器- select-binding
- List the defined input bindings. You can also select one to run the
associated command.
列出定义的输入绑定。您还可以选择一个来运行相关命令。 - show-properties
- List the names and values of all properties. You can also select one to
print its value on the OSD, which is useful for long values that get
clipped.
列出所有属性的名称和值。您还可以选择一个来在 OSD 上打印其值,这对于被截断的长值很有用。 - menu
- Show a menu with miscellaneous entries.
显示包含杂项条目的菜单。
Configuration 配置
This script can be customized through a config file script-opts/select.conf
placed in mpv's user directory and through the --script-opts command-line
option. The configuration syntax is described in mp.options functions.
此脚本可以通过放置在 mpv 用户目录中的配置文件 script-opts/select.conf 和通过 --script-opts 命令行选项进行自定义。配置语法在 mp.options 函数中描述。
Configurable options 可配置选项
- history_date_format
Default: %Y-%m-%d %H:%M:%S
默认:%Y-%m-%d %H:%M:%SThe format of dates of history entries. This is passed to Lua's os.date, which uses the same formats as strftime(3).
历史条目日期的格式。这传递给 Lua 的 os.date ,它使用与 strftime(3) 相同的格式。- hide_history_duplicates
Default: yes 默认:是
Whether to show only the last of history entries with the same path.
是否仅显示具有相同路径的历史条目的最后一个。
POSITIONING 定位
This script provides script bindings to pan videos and images. It can be
disabled using the --load-positioning=no option.
此脚本提供脚本绑定以平移视频和图像。可以使用 --load-positioning=no 选项禁用此功能。
Script bindings 脚本绑定
- pan-x <amount>
Adjust --video-align-x relatively to the OSD width, rather than relatively to the video width like the option. This is useful to pan large images consistently.
相对于 OSD 宽度调整 --video-align-x ,而不是相对于视频宽度调整选项。这对于一致地平移大图像很有用。amount is a number such that an amount of 1 scrolls as much as the OSD width.
amount 是一个数字,表示 1 的数量滚动与 OSD 宽度相同。- pan-y <amount>
Adjust --video-align-y relatively to the OSD height, rather than relatively to the video height like the option.
相对于 OSD 高度调整 --video-align-y ,而不是相对于视频高度调整选项。amount is a number such that an amount of 1 scrolls as much as the OSD height.
amount 是一个数字,使得 1 的数量滚动与 OSD 高度相同。- drag-to-pan
- Pan the video while holding a mouse button, keeping the clicked part of the
video under the cursor.
按住鼠标按钮同时平移视频,保持点击的视频部分位于光标下。 - align-to-cursor
- Pan through the whole video while holding a mouse button, or after clicking
once if toggle_align_to_cursor is yes.
按住鼠标按钮平移整个视频,或者如果 toggle_align_to_cursor 等于 yes ,则点击一次后平移。 - cursor-centric-zoom <amount>
- Increase --video-zoom by amount while keeping the part of the video
hovered by the cursor under it, or the average position of touch points if
known.
增加 --video-zoom 的值 amount ,同时保持鼠标悬停的视频部分或已知的触摸点平均位置在其下方。
Configuration 配置
This script can be customized through a config file
script-opts/positioning.conf placed in mpv's user directory and through the
--script-opts command-line option. The configuration syntax is described in
mp.options functions.
此脚本可以通过放置在 mpv 用户目录中的配置文件 script-opts/positioning.conf 和通过 --script-opts 命令行选项进行自定义。配置语法在 mp.options 函数中描述。
Configurable Options 可配置选项
- toggle_align_to_cursor
Default: no 默认:否
Whether align-to-cursor requires holding down a mouse button to pan. If no, dragging pans. If yes, clicking the first time makes pan follow the cursor, and clicking a second time disables this.
是否需要按住鼠标按钮来平移 align-to-cursor 。如果 no ,则拖动平移。如果 yes ,则第一次点击使平移跟随光标,第二次点击则禁用此功能。- suppress_osd
Default: no 默认:否
Whether to not print the new value of --video-zoom when using cursor-centric-zoom.
是否在使用 cursor-centric-zoom 时不打印 --video-zoom 的新值。
LUA SCRIPTING LUA 脚本编程
mpv can load Lua scripts. (See Script location.)
mpv 可以加载 Lua 脚本。(见脚本位置。)
mpv provides the built-in module mp, which contains functions to send
commands to the mpv core and to retrieve information about playback state, user
settings, file information, and so on.
mpv 提供了内置模块 mp ,其中包含向 mpv 核心发送命令以及检索播放状态、用户设置、文件信息等功能。
These scripts can be used to control mpv in a similar way to slave mode.
Technically, the Lua code uses the client API internally.
这些脚本可以用来以类似从属模式的方式控制 mpv。技术上,Lua 代码内部使用客户端 API。
Example 示例
A script which leaves fullscreen mode when the player is paused:
当播放器暂停时退出全屏模式的脚本:
function on_pause_change(name, value) if value == true then mp.set_property("fullscreen", "no") end end mp.observe_property("pause", "bool", on_pause_change)
Script location 脚本位置
Scripts can be passed to the --script option, and are automatically loaded
from the scripts subdirectory of the mpv configuration directory (usually
~/.config/mpv/scripts/).
可以将脚本传递给 --script 选项,并且会自动从 mpv 配置目录的 scripts 子目录(通常是 ~/.config/mpv/scripts/ )中加载。
A script can be a single file. The file extension is used to select the
scripting backend to use for it. For Lua, it is .lua. If the extension is
not recognized, an error is printed. (If an error happens, the extension is
either mistyped, or the backend was not compiled into your mpv binary.)
一个脚本可以是一个单独的文件。文件扩展名用于选择用于该脚本的脚本后端。对于 Lua,它是 .lua 。如果扩展名不被识别,则会打印错误。(如果发生错误,扩展名可能是拼写错误,或者后端没有被编译进您的 mpv 二进制文件中。)
mpv internally loads the script's name by stripping the .lua extension and
replacing all nonalphanumeric characters with _. E.g., my-tools.lua
becomes my_tools. If there are several scripts with the same name, it is
made unique by appending a number. This is the name returned by
mp.get_script_name().
mpv 内部通过删除 .lua 扩展名并将所有非字母数字字符替换为 _ 来加载脚本的名称。例如, my-tools.lua 变为 my_tools 。如果有多个脚本具有相同的名称,则会通过附加数字使其唯一。这是由 mp.get_script_name() 返回的名称。
Entries with .disable extension are always ignored.
具有 .disable 扩展名的条目总是被忽略。
If a script is a directory (either if a directory is passed to --script,
or any sub-directories in the script directory, such as for example
~/.config/mpv/scripts/something/), then the directory represents a single
script. The player will try to load a file named main.x, where x is
replaced with the file extension. For example, if main.lua exists, it is
loaded with the Lua scripting backend.
如果脚本是一个目录(无论是将目录传递给 --script ,还是脚本目录中的任何子目录,例如例如 ~/.config/mpv/scripts/something/ ),则该目录代表一个单独的脚本。播放器将尝试加载一个名为 main.x 的文件,其中 x 被替换为文件扩展名。例如,如果 main.lua 存在,则使用 Lua 脚本后端加载它。
You must not put any other files or directories that start with main. into
the script's top level directory. If the script directory contains for example
both main.lua and main.js, only one of them will be loaded (and which
one depends on mpv internals that may change any time). Likewise, if there is
for example main.foo, your script will break as soon as mpv adds a backend
that uses the .foo file extension.
您不得将任何以 main. 开头的其他文件或目录放入脚本的顶级目录中。如果脚本目录中例如同时包含 main.lua 和 main.js ,则只加载其中一个(具体加载哪个取决于 mpv 内部可能随时更改的实现)。同样,如果有例如 main.foo ,则当 mpv 添加使用 .foo 文件扩展名的后端时,您的脚本将立即崩溃。
mpv also appends the top level directory of the script to the start of Lua's
package path so you can import scripts from there too. Be aware that this will
shadow Lua libraries that use the same package path. (Single file scripts do not
include mpv specific directories in the Lua package path. This was silently
changed in mpv 0.32.0.)
mpv 还会将脚本的顶级目录添加到 Lua 的包路径开头,这样您也可以从那里导入脚本。请注意,这将会覆盖使用相同包路径的 Lua 库。(单文件脚本不包括 mpv 特定的目录在 Lua 包路径中。这在 mpv 0.32.0 中被静默更改。)
Using a script directory is the recommended way to package a script that
consists of multiple source files, or requires other files (you can use
mp.get_script_directory() to get the location and e.g. load data files).
使用脚本目录是打包由多个源文件组成的脚本或需要其他文件(您可以使用 mp.get_script_directory() 获取位置并例如加载数据文件)的推荐方式。
Making a script a git repository, basically a repository which contains a
main.lua file in the root directory, makes scripts easily updateable
(without the dangers of auto-updates). Another suggestion is to use git
submodules to share common files or libraries.
将脚本变成 git 仓库,基本上是一个根目录包含 main.lua 文件的仓库,这使得脚本易于更新(无需担心自动更新的风险)。另一个建议是使用 git 子模块来共享常用文件或库。
Details on the script initialization and lifecycle
有关脚本初始化和生命周期的详细信息
Your script will be loaded by the player at program start from the scripts
configuration subdirectory, or from a path specified with the --script
option. Some scripts are loaded internally (like --osc). Each script runs in
its own thread. Your script is first run "as is", and once that is done, the event loop
is entered. This event loop will dispatch events received by mpv and call your
own event handlers which you have registered with mp.register_event, or
timers added with mp.add_timeout or similar. Note that since the
script starts execution concurrently with player initialization, some properties
may not be populated with meaningful values until the relevant subsystems have
initialized. Rather than retrieving these properties at the top of scripts, you
should use mp.observe_property or read them within event handlers.
您的脚本将在程序启动时由播放器从 scripts 配置子目录加载,或者从使用 --script 选项指定的路径加载。一些脚本会内部加载(如 --osc )。每个脚本都在自己的线程中运行。您的脚本首先“原样”运行,一旦完成,就会进入事件循环。这个事件循环将派发由 mpv 接收的事件,并调用您使用 mp.register_event 注册的自定义事件处理器,或者使用 mp.add_timeout 或类似方式添加的计时器。请注意,由于脚本与播放器初始化同时开始执行,一些属性可能在没有相关子系统初始化之前没有填充有意义的值。因此,您不应该在脚本顶部检索这些属性,而应使用 mp.observe_property 或在事件处理器中读取它们。
When the player quits, all scripts will be asked to terminate. This happens via
a shutdown event, which by default will make the event loop return. If your
script got into an endless loop, mpv will probably behave fine during playback,
but it won't terminate when quitting, because it's waiting on your script.
当播放器退出时,所有脚本都会被要求终止。这通过一个 shutdown 事件发生,默认情况下将使事件循环返回。如果您的脚本陷入无限循环,mpv 在播放期间可能表现良好,但在退出时不会终止,因为它正在等待您的脚本。
Internally, the C code will call the Lua function mp_event_loop after
loading a Lua script. This function is normally defined by the default prelude
loaded before your script (see player/lua/defaults.lua in the mpv sources).
The event loop will wait for events and dispatch events registered with
mp.register_event. It will also handle timers added with mp.add_timeout
and similar (by waiting with a timeout).
内部,C 代码将在加载 Lua 脚本后调用 Lua 函数 mp_event_loop 。这个函数通常由在您的脚本之前加载的默认序言定义(参见 mpv 源代码中的 player/lua/defaults.lua )。事件循环将等待事件并调度与 mp.register_event 注册的事件。它还将处理通过 mp.add_timeout 添加的定时器等(通过超时等待)。
Since mpv 0.6.0, the player will wait until the script is fully loaded before
continuing normal operation. The player considers a script as fully loaded as
soon as it starts waiting for mpv events (or it exits). In practice this means
the player will more or less hang until the script returns from the main chunk
(and mp_event_loop is called), or the script calls mp_event_loop or
mp.dispatch_events directly. This is done to make it possible for a script
to fully setup event handlers etc. before playback actually starts. In older
mpv versions, this happened asynchronously. With mpv 0.29.0, this changes
slightly, and it merely waits for scripts to be loaded in this manner before
starting playback as part of the player initialization phase. Scripts run though
initialization in parallel. This might change again.
自 mpv 0.6.0 以来,播放器将在继续正常操作之前等待脚本完全加载。播放器将脚本视为完全加载,一旦它开始等待 mpv 事件(或退出)。实际上这意味着播放器将或多或少地挂起,直到脚本从主块返回(并调用 mp_event_loop ),或者脚本直接调用 mp_event_loop 或 mp.dispatch_events 。这样做是为了使脚本能够在播放实际开始之前完全设置事件处理程序等。在较老的 mpv 版本中,这异步发生。从 mpv 0.29.0 开始,这种变化略有不同,它只是等待以这种方式加载脚本,然后作为播放器初始化阶段的一部分开始播放。初始化期间并行运行脚本。这可能会再次改变。
mp functions mp 函数
The mp module is preloaded, although it can be loaded manually with
require 'mp'. It provides the core client API.
模块 mp 已预加载,尽管可以使用 require 'mp' 手动加载。它提供核心客户端 API。
- mp.command(string)
Run the given command. This is similar to the commands used in input.conf. See List of Input Commands.
运行指定的命令。这与 input.conf 中使用的命令类似。参见输入命令列表。By default, this will show something on the OSD (depending on the command), as if it was used in input.conf. See Input Command Prefixes how to influence OSD usage per command.
默认情况下,这将在 OSD 上显示某些内容(取决于命令),就像在 input.conf 中使用一样。参见输入命令前缀以了解如何影响每个命令的 OSD 使用。Returns true on success, or nil, error on error.
成功时返回 true ,或错误时返回 nil, error 。- mp.commandv(arg1, arg2, ...)
Similar to mp.command, but pass each command argument as separate parameter. This has the advantage that you don't have to care about quoting and escaping in some cases.
类似于 mp.command ,但将每个命令参数作为单独的参数传递。这有一个优点,就是在某些情况下你不必关心引号和转义。Example: 示例:
mp.command("loadfile " .. filename .. " append") mp.commandv("loadfile", filename, "append")
These two commands are equivalent, except that the first version breaks if the filename contains spaces or certain special characters.
这两个命令是等效的,除了第一个版本如果文件名包含空格或某些特殊字符会出错。Note that properties are not expanded. You can use either mp.command, the expand-properties prefix, or the mp.get_property family of functions.
请注意属性不会被展开。您可以使用 mp.command , expand-properties 前缀,或者 mp.get_property 函数族。Unlike mp.command, this will not use OSD by default either (except for some OSD-specific commands).
与 mp.command 不同,默认情况下它也不会使用 OSD(除非是某些 OSD 特定命令)。- mp.command_native(table [,def])
Similar to mp.commandv, but pass the argument list as table. This has the advantage that in at least some cases, arguments can be passed as native types. It also allows you to use named argument.
类似于 mp.commandv ,但以表格形式传递参数列表。这至少在某些情况下具有优势,因为参数可以作为原生类型传递。它还允许您使用命名参数。If the table is an array, each array item is like an argument in mp.commandv() (but can be a native type instead of a string).
如果表格是数组,则每个数组项类似于 mp.commandv() 中的参数(但可以是原生类型而不是字符串)。If the table contains string keys, it's interpreted as command with named arguments. This requires at least an entry with the key name to be present, which must be a string, and contains the command name. The special entry _flags is optional, and if present, must be an array of Input Command Prefixes to apply. All other entries are interpreted as arguments.
如果表中包含字符串键,则将其解释为带有命名参数的命令。这要求至少存在一个键为 name 的条目,它必须是一个字符串,并包含命令名称。特殊条目 _flags 是可选的,如果存在,则必须是一个包含要应用的输入命令前缀的数组。所有其他条目都被解释为参数。Returns a result table on success (usually empty), or def, error on error. def is the second parameter provided to the function, and is nil if it's missing.
成功时(通常为空)返回结果表,或返回 def, error 表示错误。 def 是函数提供的第二个参数,如果缺失则为 nil。- mp.command_native_async(table [,fn])
Like mp.command_native(), but the command is ran asynchronously (as far as possible), and upon completion, fn is called. fn has three arguments: fn(success, result, error):
类似于 mp.command_native() ,但命令是异步执行的(尽可能异步),完成时调用 fn。fn 有三个参数: fn(success, result, error) :Returns a table with undefined contents, which can be used as argument for mp.abort_async_command.
返回一个内容未定义的表格,可以用作 mp.abort_async_command 的参数。If starting the command failed for some reason, nil, error is returned, and fn is called indicating failure, using the same error value.
如果由于某些原因启动命令失败,则返回 nil, error ,并调用 fn 表示失败,使用相同的错误值。fn is always called asynchronously, even if the command failed to start.
fn 总是异步调用,即使命令启动失败也是如此。- mp.abort_async_command(t)
- Abort a mp.command_native_async call. The argument is the return value
of that command (which starts asynchronous execution of the command).
Whether this works and how long it takes depends on the command and the
situation. The abort call itself is asynchronous. Does not return anything.
终止一个 mp.command_native_async 调用。参数是该命令的返回值(该值启动命令的异步执行)。这能否成功以及所需时间取决于命令和情况。终止调用本身是异步的。不返回任何内容。 - mp.del_property(name)
Delete the given property. See mp.get_property and Properties for more information about properties. Most properties cannot be deleted.
删除指定的属性。有关属性更多信息,请参阅 mp.get_property 和属性。大多数属性不能被删除。Returns true on success, or nil, error on error.
成功时返回 true,或错误时返回 nil, error 。- mp.get_property(name [,def])
Return the value of the given property as string. These are the same properties as used in input.conf. See Properties for a list of properties. The returned string is formatted similar to ${=name} (see Property Expansion).
返回给定属性的字符串值。这些属性与 input.conf 中使用的相同。有关属性列表,请参阅属性。返回的字符串格式类似于 ${=name} (请参阅属性扩展)。Returns the string on success, or def, error on error. def is the second parameter provided to the function, and is nil if it's missing.
成功时返回字符串,或错误时返回 def, error 。 def 是函数提供的第二个参数,如果缺失则为 nil。- mp.get_property_osd(name [,def])
Similar to mp.get_property, but return the property value formatted for OSD. This is the same string as printed with ${name} when used in input.conf.
类似于 mp.get_property ,但返回格式化用于 OSD 的属性值。这是与在 input.conf 中使用时通过 ${name} 打印的相同字符串。Returns the string on success, or def, error on error. def is the second parameter provided to the function, and is an empty string if it's missing. Unlike get_property(), assigning the return value to a variable will always result in a string.
在成功时返回字符串,或在错误时返回 def, error 。 def 是函数提供的第二个参数,如果缺失则为空字符串。与 get_property() 不同,将返回值赋给变量总是会得到一个字符串。- mp.get_property_bool(name [,def])
Similar to mp.get_property, but return the property value as Boolean.
类似于 mp.get_property ,但返回属性值作为布尔值。Returns a Boolean on success, or def, error on error.
在成功时返回布尔值,或在错误时返回 def, error 。- mp.get_property_number(name [,def])
Similar to mp.get_property, but return the property value as number.
类似于 mp.get_property ,但返回属性值作为数字。Note that while Lua does not distinguish between integers and floats, mpv internals do. This function simply request a double float from mpv, and mpv will usually convert integer property values to float.
请注意,虽然 Lua 不区分整数和浮点数,但 mpv 内部却区分。此函数只是从 mpv 请求一个双精度浮点数,mpv 通常会将整数属性值转换为浮点数。Returns a number on success, or def, error on error.
成功时返回一个数字,或在错误时返回 def, error 。- mp.get_property_native(name [,def])
Similar to mp.get_property, but return the property value using the best Lua type for the property. Most time, this will return a string, Boolean, or number. Some properties (for example chapter-list) are returned as tables.
类似于 mp.get_property ,但使用属性的最佳 Lua 类型返回属性值。大多数情况下,这将返回一个字符串、布尔值或数字。某些属性(例如 chapter-list )将作为表返回。Returns a value on success, or def, error on error. Note that nil might be a possible, valid value too in some corner cases.
成功时返回一个值,或在错误时返回 def, error 。请注意,在某些边缘情况下, nil 也可能是一个可能的、有效的值。- mp.set_property(name, value)
Set the given property to the given string value. See mp.get_property and Properties for more information about properties.
将给定的属性设置为给定的字符串值。有关属性更多信息,请参阅 mp.get_property 和 Properties。Returns true on success, or nil, error on error.
成功时返回 true,或错误时返回 nil, error 。- mp.set_property_bool(name, value)
- Similar to mp.set_property, but set the given property to the given
Boolean value.
类似于 mp.set_property ,但将给定的属性设置为给定的布尔值。 - mp.set_property_number(name, value)
Similar to mp.set_property, but set the given property to the given numeric value.
类似于 mp.set_property ,但将给定的属性设置为给定的数值。Note that while Lua does not distinguish between integers and floats, mpv internals do. This function will test whether the number can be represented as integer, and if so, it will pass an integer value to mpv, otherwise a double float.
请注意,虽然 Lua 不区分整数和浮点数,但 mpv 内部却区分。此函数将测试该数字是否可以表示为整数,如果是,则将整数值传递给 mpv,否则传递双精度浮点数。- mp.set_property_native(name, value)
Similar to mp.set_property, but set the given property using its native type.
类似于 mp.set_property ,但使用其原生类型设置给定的属性。Since there are several data types which cannot represented natively in Lua, this might not always work as expected. For example, while the Lua wrapper can do some guesswork to decide whether a Lua table is an array or a map, this would fail with empty tables. Also, there are not many properties for which it makes sense to use this, instead of set_property, set_property_bool, set_property_number. For these reasons, this function should probably be avoided for now, except for properties that use tables natively.
由于有几个数据类型在 Lua 中无法原生表示,这不一定总是按预期工作。例如,虽然 Lua 包装器可以做一些猜测工作以决定 Lua 表是否为数组或映射,但这在空表中会失败。此外,对于使用此方法而不是 set_property , set_property_bool , set_property_number 的属性来说,并没有很多属性是有意义的。因此,这个函数可能现在应该避免使用,除非是使用表原生的属性。- mp.get_time()
- Return the current mpv internal time in seconds as a number. This is
basically the system time, with an arbitrary offset.
返回当前 mpv 内部时间(以秒为单位)的数值。这基本上是系统时间,带有任意偏移量。 - mp.add_key_binding(key, name|fn [,fn [,flags]])
Register callback to be run on a key binding. The binding will be mapped to the given key, which is a string describing the physical key. This uses the same key names as in input.conf, and also allows combinations (e.g. ctrl+a). If the key is empty or nil, no physical key is registered, but the user still can create own bindings (see below).
注册要绑定到按键的回调函数。该绑定将映射到给定的 key ,它是一个描述物理按键的字符串。这使用与 input.conf 中相同的按键名称,并允许组合(例如 ctrl+a )。如果按键为空或 nil ,则不注册物理按键,但用户仍然可以创建自己的绑定(见下文)。After calling this function, key presses will cause the function fn to be called (unless the user remapped the key with another binding). However, if the key binding is canceled , the function will not be called, unless complex flag is set to true, where the function will be called with the canceled entry set to true.
调用此函数后,按键将触发调用函数 fn (除非用户使用另一个绑定重新映射了按键)。然而,如果取消键绑定,则不会调用该函数,除非 complex 标志设置为 true ,此时将使用 canceled 条目设置 true 来调用该函数。For example, a canceled key binding can happen in the following situations:
例如,取消键绑定可能发生在以下情况下:- If key A is pressed while key B is being held down, key B is logically
released ("canceled" by key A), which stops the current autorepeat
action key B has.
如果按下键 A 同时键 B 被按下,则键 B 逻辑上被释放(由键 A“取消”),这停止了键 B 当前的自重复动作。 - If key A is pressed while a mouse button is being held down, the mouse
button is logically released, but the mouse button's action will not be
called, unless complex flag is set to true.
如果按下键 A 同时鼠标按钮被按下,则鼠标按钮逻辑上被释放,但不会调用鼠标按钮的动作,除非将 complex 标志设置为 true 。
The name argument should be a short symbolic string. It allows the user to remap the key binding via input.conf using the script-message command, and the name of the key binding (see below for an example). The name should be unique across other bindings in the same script - if not, the previous binding with the same name will be overwritten. You can omit the name, in which case a random name is generated internally. (Omitting works as follows: either pass nil for name, or pass the fn argument in place of the name. The latter is not recommended and is handled for compatibility only.)
name 参数应该是一个简短的符号字符串。它允许用户通过 input.conf 使用 script-message 命令重新映射键绑定,并查看键绑定的名称(以下为示例)。名称应在同一脚本中的其他绑定中是唯一的 - 如果不是,则将覆盖具有相同名称的先前绑定。您可以省略名称,在这种情况下,将内部生成一个随机名称。(省略的方式如下:传递 nil 作为 name ,或者用名称替换 fn 参数。后者不建议使用,仅为了兼容性处理。)The flags argument is used for optional parameters. This is a table, which can have the following entries:
flags 参数用于可选参数。这是一个表,可以有以下条目:- repeatable
- If set to true, enables key repeat for this specific binding.
This option only makes sense when complex is not set to true.
如果设置为 true ,则启用此特定绑定的按键重复。此选项仅在 complex 未设置为 true 的情况下才有意义。 - scalable
- If set to true, enables key scaling for this specific binding.
This option only makes sense when complex is set to true.
Note that this has no effect if the key binding is invoked by
script-binding command, where the scalability of the command
takes precedence.
如果设置为 true ,则启用此特定绑定的按键缩放。此选项仅在 complex 设置为 true 的情况下才有意义。请注意,如果按键绑定是通过 script-binding 命令调用的,其中命令的可伸缩性优先,则此选项不起作用。 - complex
If set to true, then fn is called on key down, repeat and up events, with the first argument being a table. This table has the following entries (and may contain undocumented ones):
如果设置为 true ,则在下键、重复和上键事件上调用 fn ,第一个参数是一个表。此表具有以下条目(可能包含未记录的条目):- event
- Set to one of the strings down, repeat, up or
press (the latter if key up/down/repeat can't be
tracked), which indicates the key's logical state.
设置为以下字符串之一 down , repeat , up 或 press (如果无法跟踪按键的上/下/重复,则为后者),表示按键的逻辑状态。 - is_mouse
- Boolean: Whether the event was caused by a mouse button.
布尔值:事件是否由鼠标按钮引起。 - canceled
- Boolean: Whether the event was canceled.
Not all types of cancellations set this flag.
布尔值:事件是否已取消。并非所有类型的取消都会设置此标志。 - key_name
- The name of they key that triggered this, or nil if
invoked artificially. If the key name is unknown, it's an
empty string.
触发此事件的键的名称,或如果人工调用则为 nil 。如果键名未知,则为空字符串。 - key_text
- Text if triggered by a text key, otherwise nil. See
description of script-binding command for details (this
field is equivalent to the 5th argument).
如果由文本键触发,则为文本,否则为 nil 。有关 script-binding 命令的描述,请参阅详细信息(此字段等同于第 5 个参数)。 - scale
- The scale of the key, such as the ones produced by WHEEL_*
keys. The scale is 1 if the key is nonscalable.
键的规模,例如由 WHEEL_* 键产生的那些。如果键不可缩放,则规模为 1。 - arg
- User-provided string in the arg argument in the
script-binding command if the key binding is invoked
by that command.
如果键绑定由该命令调用,则在 script-binding 命令的 arg 参数中提供的用户字符串。
Internally, key bindings are dispatched via the script-message-to or script-binding input commands and mp.register_script_message.
内部,键绑定通过 script-message-to 或 script-binding 输入命令和 mp.register_script_message .Trying to map multiple commands to a key will essentially prefer a random binding, while the other bindings are not called. It is guaranteed that user defined bindings in the central input.conf are preferred over bindings added with this function (but see mp.add_forced_key_binding).
尝试将多个命令映射到键上,本质上会选择一个随机的绑定,而其他绑定则不会被调用。保证用户在 central.input.conf 中定义的绑定优先于使用此函数添加的绑定(但请参阅 mp.add_forced_key_binding 。)Example: 示例:
function something_handler() print("the key was pressed") end mp.add_key_binding("x", "something", something_handler)
This will print the message the key was pressed when x was pressed.
这将打印当按下 x 时 the key was pressed 的消息。The user can remap these key bindings. Then the user has to put the following into their input.conf to remap the command to the y key:
用户可以重新映射这些键绑定。然后用户需要在他们的 input.conf 中添加以下内容以将命令映射到 y 键:y script-binding something
This will print the message when the key y is pressed. (x will still work, unless the user remaps it.)
当按下键 y 时将打印消息。(除非用户重新映射,否则 x 仍然有效。""You can also explicitly send a message to a named script only. Assume the above script was using the filename fooscript.lua:
您还可以显式地向一个命名脚本发送消息。假设上面的脚本使用了文件名 fooscript.lua :""y script-binding fooscript/something
- If key A is pressed while key B is being held down, key B is logically
released ("canceled" by key A), which stops the current autorepeat
action key B has.
- mp.add_forced_key_binding(...)
- This works almost the same as mp.add_key_binding, but registers the
key binding in a way that will overwrite the user's custom bindings in their
input.conf. (mp.add_key_binding overwrites default key bindings only,
but not those by the user's input.conf.)
这与 mp.add_key_binding 几乎相同,但以会覆盖用户在 input.conf 中的自定义绑定方式注册键绑定。( mp.add_key_binding 仅覆盖默认键绑定,但不覆盖用户 input.conf 中的绑定。)"" - mp.remove_key_binding(name)
- Remove a key binding added with mp.add_key_binding or
mp.add_forced_key_binding. Use the same name as you used when adding
the bindings. It's not possible to remove bindings for which you omitted
the name.
"删除使用 mp.add_key_binding 或 mp.add_forced_key_binding 添加的键绑定。使用添加绑定时使用的相同名称。无法删除未指定名称的绑定。” - mp.register_event(name, fn)
Call a specific function when an event happens. The event name is a string, and the function fn is a Lua function value.
当事件发生时调用特定函数。事件名称是一个字符串,函数 fn 是 Lua 函数值。Some events have associated data. This is put into a Lua table and passed as argument to fn. The Lua table by default contains a name field, which is a string containing the event name. If the event has an error associated, the error field is set to a string describing the error, on success it's not set.
某些事件具有关联数据。这些数据被放入 Lua 表格中,并作为参数传递给 fn。Lua 表格默认包含一个 name 字段,它是一个包含事件名称的字符串。如果事件有关联错误,则 error 字段被设置为描述错误的字符串,在成功时则不设置。If multiple functions are registered for the same event, they are run in registration order, which the first registered function running before all the other ones.
如果为同一事件注册了多个函数,它们将按照注册顺序执行,即首先注册的函数将在所有其他函数之前运行。Returns true if such an event exists, false otherwise.
如果存在此类事件,则返回 true,否则返回 false。See Events and List of events for details.
有关详细信息,请参阅事件和事件列表。- mp.unregister_event(fn)
- Undo mp.register_event(..., fn). This removes all event handlers that
are equal to the fn parameter. This uses normal Lua == comparison,
so be careful when dealing with closures.
撤销 mp.register_event(..., fn) 。这会移除所有等于 fn 参数的事件处理器。这使用正常的 Lua == 比较方式,因此在处理闭包时要小心。 - mp.observe_property(name, type, fn)
Watch a property for changes. If the property name is changed, then the function fn(name) will be called. type can be nil, or be set to one of none, native, bool, string, or number. none is the same as nil. For all other values, the new value of the property will be passed as second argument to fn, using mp.get_property_<type> to retrieve it. This means if type is for example string, fn is roughly called as in fn(name, mp.get_property_string(name)).
监视属性的变化。如果属性 name 发生变化,则将调用函数 fn(name) 。 type 可以是 nil ,或者设置为 none , native , bool , string ,或 number 之一。 none 与 nil 相同。对于所有其他值,将把属性的新的值作为第二个参数传递给 fn ,使用 mp.get_property_<type> 来获取它。这意味着如果 type 是例如 string ,则 fn 大概会被调用为 fn(name, mp.get_property_string(name)) 。If possible, change events are coalesced. If a property is changed a bunch of times in a row, only the last change triggers the change function. (The exact behavior depends on timing and other things.)
如果可能,将事件合并。如果一个属性连续多次更改,则只有最后一次更改会触发更改函数。(确切行为取决于时间和其他因素。)If a property is unavailable, or on error, the value argument to fn is nil. (The observe_property() call always succeeds, even if a property does not exist.)
如果属性不可用或发生错误, fn 的值参数为 nil 。(即使属性不存在, observe_property() 调用也总是成功。)In some cases the function is not called even if the property changes. This depends on the property, and it's a valid feature request to ask for better update handling of a specific property.
在某些情况下,即使属性更改,函数也可能不会被调用。这取决于属性,请求改进特定属性的更新处理是一个有效的功能请求。If the type is none or nil, the change function fn will be called sporadically even if the property doesn't actually change. You should therefore avoid using these types.
如果 type 是 none 或 nil ,即使属性实际上没有更改,更改函数 fn 也会偶尔被调用。因此,应避免使用这些类型。You always get an initial change notification. This is meant to initialize the user's state to the current value of the property.
您始终会收到初始更改通知。这是为了将用户的当前属性值初始化为用户的状态。- mp.unobserve_property(fn)
- Undo mp.observe_property(..., fn). This removes all property handlers
that are equal to the fn parameter. This uses normal Lua ==
comparison, so be careful when dealing with closures.
撤销 mp.observe_property(..., fn) 。这会移除所有等于 fn 参数的属性处理程序。这使用正常的 Lua == 比较方式,因此在处理闭包时要小心。 - mp.add_timeout(seconds, fn [, disabled])
Call the given function fn when the given number of seconds has elapsed. Note that the number of seconds can be fractional. For now, the timer's resolution may be as low as 50 ms, although this will be improved in the future.
当给定秒数经过时调用给定的函数 fn。注意,秒数可以是分数。目前,计时器的分辨率可能低至 50 毫秒,尽管这将在未来得到改善。If the disabled argument is set to true or a truthy value, the timer will wait to be manually started with a call to its resume() method.
如果 disabled 参数设置为 true 或一个真值,计时器将等待通过调用其 resume() 方法手动启动。This is a one-shot timer: it will be removed when it's fired.
这是一个一次性计时器:它在被触发后会自动移除。Returns a timer object. See mp.add_periodic_timer for details.
返回一个计时器对象。有关详细信息,请参阅 mp.add_periodic_timer 。- mp.add_periodic_timer(seconds, fn [, disabled])
Call the given function periodically. This is like mp.add_timeout, but the timer is re-added after the function fn is run.
定期调用给定的函数。这与 mp.add_timeout 类似,但函数 fn 运行后计时器会被重新添加。- Returns a timer object. The timer object provides the following methods:
返回一个计时器对象。计时器对象提供以下方法: - stop()
- Disable the timer. Does nothing if the timer is already disabled.
This will remember the current elapsed time when stopping, so that
resume() essentially unpauses the timer.
禁用计时器。如果计时器已经禁用,则不执行任何操作。这将记住停止时的当前已过时间,因此 resume() 实际上相当于暂停计时器。 - kill()
- Disable the timer. Resets the elapsed time. resume() will
restart the timer.
禁用计时器。重置已过时间。 resume() 将重新启动计时器。 - resume()
- Restart the timer. If the timer was disabled with stop(), this
will resume at the time it was stopped. If the timer was disabled
with kill(), or if it's a previously fired one-shot timer (added
with add_timeout()), this starts the timer from the beginning,
using the initially configured timeout.
重新启动计时器。如果计时器是通过 stop() 禁用的,则将从停止时继续。如果计时器是通过 kill() 禁用的,或者它是一个之前已触发的一次性计时器(通过 add_timeout() 添加),则从开始时启动计时器,使用最初配置的超时时间。 - is_enabled()
- Whether the timer is currently enabled or was previously disabled
(e.g. by stop() or kill()).
定时器当前是否启用或之前已被禁用(例如,通过 stop() 或 kill() )。 - timeout (RW) timeout (读写)
This field contains the current timeout period. This value is not updated as time progresses. It's only used to calculate when the timer should fire next when the timer expires.
此字段包含当前超时时间。此值不会随时间推移而更新。它仅用于计算定时器何时应该触发,当定时器到期时。If you write this, you can call t:kill() ; t:resume() to reset the current timeout to the new one. (t:stop() won't use the new timeout.)
如果您写入此内容,您可以调用 t:kill() ; t:resume() 来将当前超时重置为新值。( t:stop() 不会使用新超时。)- oneshot (RW) oneshot (读写)
- Whether the timer is periodic (false) or fires just once
(true). This value is used when the timer expires (but before
the timer callback function fn is run).
是否定时器是周期性的( false )还是只触发一次( true )。此值在定时器到期时使用(但在定时器回调函数 fn 运行之前)。
Note that these are methods, and you have to call them using : instead of . (Refer to https://www.lua.org/manual/5.2/manual.html#3.4.9 .)
请注意,这些都是方法,您必须使用 : 而不是 . 来调用它们(参阅 https://www.lua.org/manual/5.2/manual.html#3.4.9)。Example: 示例:
seconds = 0 timer = mp.add_periodic_timer(1, function() print("called every second") -- stop it after 10 seconds seconds = seconds + 1 if seconds >= 10 then timer:kill() end end)
- Returns a timer object. The timer object provides the following methods:
- mp.get_opt(key)
- Return a setting from the --script-opts option. It's up to the user and
the script how this mechanism is used. Currently, all scripts can access
this equally, so you should be careful about collisions.
从 --script-opts 选项返回一个设置。如何使用此机制取决于用户和脚本。目前,所有脚本都可以平等地访问它,因此您应该小心冲突。 - mp.get_script_name()
Return the name of the current script. The name is usually made of the filename of the script, with directory and file extension removed. If there are several scripts which would have the same name, it's made unique by appending a number. Any nonalphanumeric characters are replaced with _.
返回当前脚本的名称。名称通常是脚本文件名,去除目录和文件扩展名。如果有多个脚本具有相同的名称,则通过附加数字来使其唯一。任何非字母数字字符都将被替换为 _ 。Example 示例
The script /path/to/foo-script.lua becomes foo_script.
脚本 /path/to/foo-script.lua 变为 foo_script 。- mp.get_script_directory()
- Return the directory if this is a script packaged as directory (see
Script location for a description). Return nothing if this is a single
file script.
如果这是一个打包为目录的脚本,则返回目录(有关脚本位置的描述,请参阅脚本位置)。如果是单个文件脚本,则不返回任何内容。 - mp.osd_message(text [,duration])
- Show an OSD message on the screen. duration is in seconds, and is
optional (uses --osd-duration by default).
在屏幕上显示一个 OSD 消息。 duration 以秒为单位,是可选的(默认使用 --osd-duration )。
Advanced mp functions 高级 mp 功能
These also live in the mp module, but are documented separately as they
are useful only in special situations.
这些也位于 mp 模块中,但它们被单独记录,因为它们仅在特殊情况下有用。
- mp.get_wakeup_pipe()
- Calls mpv_get_wakeup_pipe() and returns the read end of the wakeup
pipe. This is deprecated, but still works. (See client.h for details.)
调用 mpv_get_wakeup_pipe() 并返回唤醒管道的读取端。这已被弃用,但仍然有效。(有关详细信息,请参阅 client.h 。) - mp.get_next_timeout()
- Return the relative time in seconds when the next timer (mp.add_timeout
and similar) expires. If there is no timer, return nil.
返回下一个定时器( mp.add_timeout 和类似)到期的时间(以秒为单位)。如果没有定时器,则返回 nil 。 - mp.dispatch_events([allow_wait])
This can be used to run custom event loops. If you want to have direct control what the Lua script does (instead of being called by the default event loop), you can set the global variable mp_event_loop to your own function running the event loop. From your event loop, you should call mp.dispatch_events() to dequeue and dispatch mpv events.
这可以用来运行自定义的事件循环。如果你想直接控制 Lua 脚本的行为(而不是由默认的事件循环调用),可以将全局变量 mp_event_loop 设置为你自己的函数,该函数运行事件循环。从你的事件循环中,你应该调用 mp.dispatch_events() 来出队和分发 mpv 事件。If the allow_wait parameter is set to true, the function will block until the next event is received or the next timer expires. Otherwise (and this is the default behavior), it returns as soon as the event loop is emptied. It's strongly recommended to use mp.get_next_timeout() and mp.get_wakeup_pipe() if you're interested in properly working notification of new events and working timers.
如果将 allow_wait 参数设置为 true ,则函数将阻塞,直到接收到下一个事件或下一个定时器到期。否则(这是默认行为),一旦事件循环清空,它就会立即返回。如果你对正确工作的新事件和定时器通知感兴趣,强烈建议使用 mp.get_next_timeout() 和 mp.get_wakeup_pipe() 。- mp.register_idle(fn)
- Register an event loop idle handler. Idle handlers are called before the
script goes to sleep after handling all new events. This can be used for
example to delay processing of property change events: if you're observing
multiple properties at once, you might not want to act on each property
change, but only when all change notifications have been received.
注册事件循环空闲处理程序。空闲处理程序在处理所有新事件后,在脚本进入睡眠之前被调用。例如,这可以用来延迟处理属性更改事件:如果你同时观察多个属性,你可能不想对每个属性更改都采取行动,而只想在接收到所有更改通知后采取行动。 - mp.unregister_idle(fn)
- Undo mp.register_idle(fn). This removes all idle handlers that
are equal to the fn parameter. This uses normal Lua == comparison,
so be careful when dealing with closures.
撤销 mp.register_idle(fn) 。这会移除所有等于 fn 参数的空闲处理程序。这使用正常的 Lua == 比较方式,因此在处理闭包时要小心。 - mp.enable_messages(level)
- Set the minimum log level of which mpv message output to receive. These
messages are normally printed to the terminal. By calling this function,
you can set the minimum log level of messages which should be received with
the log-message event. See the description of this event for details.
The level is a string, see msg.log for allowed log levels.
设置接收 mpv 消息输出的最小日志级别。这些消息通常打印到终端。通过调用此函数,您可以设置应接收的 log-message 事件的最低日志级别。有关详细信息,请参阅此事件的描述。级别是一个字符串,请参阅 msg.log 了解允许的日志级别。 - mp.register_script_message(name, fn)
This is a helper to dispatch script-message or script-message-to invocations to Lua functions. fn is called if script-message or script-message-to (with this script as destination) is run with name as first parameter. The other parameters are passed to fn. If a message with the given name is already registered, it's overwritten.
这是一个辅助程序,用于将 script-message 或 script-message-to 调用分派到 Lua 函数。如果使用 name 作为第一个参数运行 script-message 或 script-message-to (此脚本作为目标),则调用 fn 。其他参数传递给 fn 。如果已注册具有给定名称的消息,则将其覆盖。Used by mp.add_key_binding, so be careful about name collisions.
由 mp.add_key_binding 使用,因此在使用时请注意名称冲突。- mp.unregister_script_message(name)
- Undo a previous registration with mp.register_script_message. Does
nothing if the name wasn't registered.
撤销先前的 mp.register_script_message 注册。如果 name 未注册,则不执行任何操作。 - mp.create_osd_overlay(format)
Create an OSD overlay. This is a very thin wrapper around the osd-overlay command. The function returns a table, which mostly contains fields that will be passed to osd-overlay. The format parameter is used to initialize the format field. The data field contains the text to be used as overlay. For details, see the osd-overlay command.
创建一个 OSD 覆盖层。这是对 osd-overlay 命令的一个非常薄的包装。该函数返回一个表,其中主要包含将传递给 osd-overlay 的字段。 format 参数用于初始化 format 字段。 data 字段包含用作覆盖层的文本。有关详细信息,请参阅 osd-overlay 命令。In addition, it provides the following methods:
此外,它还提供了以下方法:- update()
- Commit the OSD overlay to the screen, or in other words, run the
osd-overlay command with the current fields of the overlay table.
Returns the result of the osd-overlay command itself.
将 OSD 叠加层提交到屏幕,换句话说,使用当前叠加表字段运行 osd-overlay 命令。返回 osd-overlay 命令本身的结果。 - remove()
- Remove the overlay from the screen. A update() call will add it
again.
从屏幕上移除叠加层。一个 update() 调用将再次添加它。
Example: 示例:
ov = mp.create_osd_overlay("ass-events") ov.data = "{\\an5}{\\b1}hello world!" ov:update()
The advantage of using this wrapper (as opposed to running osd-overlay directly) is that the id field is allocated automatically.
使用此包装器(与直接运行 osd-overlay 相比)的优点是 id 字段会自动分配。- mp.get_osd_size()
Returns a tuple of osd_width, osd_height, osd_par. The first two give the size of the OSD in pixels (for video outputs like --vo=xv, this may be "scaled" pixels). The third is the display pixel aspect ratio.
返回一个包含 osd_width, osd_height, osd_par 的元组。前两个给出 OSD 的像素大小(对于像 --vo=xv 这样的视频输出,这可能是“缩放”像素)。第三个是显示像素宽高比。May return invalid/nonsense values if OSD is not initialized yet.
如果 OSD 尚未初始化,则可能返回无效/无意义的值。- exit() (global) exit() (全局)
Make the script exit at the end of the current event loop iteration. This does not terminate mpv itself or other scripts.
在当前事件循环迭代结束时使脚本退出。这不会终止 mpv 本身或其他脚本。This can be polyfilled to support mpv versions older than 0.40 with:
可以使用以下方法进行 polyfill 以支持低于 0.40 版本的 mpv:if not _G.exit then function exit() mp.keep_running = false end end
mp.msg functions mp.msg 函数
This module allows outputting messages to the terminal, and can be loaded
with require 'mp.msg'.
此模块允许将消息输出到终端,并且可以通过 require 'mp.msg' . 加载。
- msg.log(level, ...)
The level parameter is the message priority. It's a string and one of fatal, error, warn, info, v, debug, trace. The user's settings will determine which of these messages will be visible. Normally, all messages are visible, except v, debug and trace.
level 参数是消息优先级。它是一个字符串,可以是 fatal , error , warn , info , v , debug , trace 之一。用户的设置将决定哪些消息可见。通常,所有消息都是可见的,除了 v , debug 和 trace 。The parameters after that are all converted to strings. Spaces are inserted to separate multiple parameters.
之后的参数都将转换为字符串。在多个参数之间插入空格以分隔。You don't need to add newlines.
您不需要添加换行符。- msg.fatal(...), msg.error(...), msg.warn(...), msg.info(...), msg.verbose(...), msg.debug(...), msg.trace(...)
- All of these are shortcuts and equivalent to the corresponding
msg.log(level, ...) call.
这些都是快捷方式,与相应的 msg.log(level, ...) 调用等效。
mp.options functions mp.options 函数
mpv comes with a built-in module to manage options from config-files and the
command-line. All you have to do is to supply a table with default options to
the read_options function. The function will overwrite the default values
with values found in the config-file and the command-line (in that order).
mpv 自带一个内置模块来管理从配置文件和命令行中读取的选项。您只需向 read_options 函数提供一个默认选项的表格即可。该函数将按顺序用配置文件和命令行中找到的值覆盖默认值。
- options.read_options(table [, identifier [, on_update]])
A table with key-value pairs. The type of the default values is important for converting the values read from the config file or command-line back. Do not use nil as a default value!
一个包含键值对的 table 。默认值的类型对于将读取自配置文件或命令行的值转换回原始类型很重要。不要将 nil 用作默认值!The identifier is used to identify the config-file and the command-line options. These needs to unique to avoid collisions with other scripts. Defaults to mp.get_script_name() if the parameter is nil or missing.
identifier 用于标识配置文件和命令行选项。这些需要是唯一的,以避免与其他脚本冲突。如果参数是 nil 或缺失,则默认为 mp.get_script_name() 。The on_update parameter enables run-time updates of all matching option values via the script-opts option/property. If any of the matching options changes, the values in the table (which was originally passed to the function) are changed, and on_update(list) is called. list is a table where each updated option has a list[option_name] = true entry. There is no initial on_update() call. This never re-reads the config file. script-opts is always applied on the original config file, ignoring previous script-opts values (for example, if an option is removed from script-opts at runtime, the option will have the value in the config file). table entries are only written for option values whose values effectively change (this is important if the script changes table entries independently).
Example implementation:
local options = { optionA = "defaultvalueA", optionB = -0.5, optionC = true, } require "mp.options".read_options(options, "myscript") print(options.optionA)
The config file will be stored in script-opts/identifier.conf in mpv's user
folder. Comment lines can be started with # and stray spaces are not removed.
Boolean values will be represented with yes/no.
配置文件将存储在 mpv 的用户文件夹中的 script-opts/identifier.conf 。注释行可以以 # 开头,多余的空格不会被删除。布尔值将用 yes/no 表示。
Example config: 示例配置:
# comment optionA=Hello World optionB=9999 optionC=no
Command-line options are read from the --script-opts parameter. To avoid
collisions, all keys have to be prefixed with identifier-.
命令行选项从 --script-opts 参数中读取。为了避免冲突,所有键都必须以前缀 identifier- 开头。
Example command-line: 示例命令行:
--script-opts=myscript-optionA=TEST,myscript-optionB=0,myscript-optionC=yes
mp.utils functions
This built-in module provides generic helper functions for Lua, and have strictly speaking nothing to do with mpv or video/audio playback. They are provided for convenience. Most compensate for Lua's scarce standard library.
Be warned that any of these functions might disappear any time. They are not
strictly part of the guaranteed API.
请注意,这些函数中的任何一个都可能随时消失。它们不是保证的 API 的严格组成部分。
- utils.getcwd()
- Returns the directory that mpv was launched from. On error, nil, error
is returned.
返回 mpv 启动的目录。出错时返回 nil, error 。 - utils.readdir(path [, filter])
Enumerate all entries at the given path on the filesystem, and return them as array. Each entry is a directory entry (without the path). The list is unsorted (in whatever order the operating system returns it).
在文件系统中列出给定路径的所有条目,并将它们作为数组返回。每个条目是目录条目(不包含路径)。列表未排序(按操作系统返回的顺序)。If the filter argument is given, it must be one of the following strings:
如果提供了 filter 参数,它必须是以下字符串之一:- files
- List regular files only. This excludes directories, special files
(like UNIX device files or FIFOs), and dead symlinks. It includes
UNIX symlinks to regular files.
仅列出常规文件。这排除了目录、特殊文件(如 UNIX 设备文件或 FIFO)、以及死链接。包括指向常规文件的 UNIX 链接。 - dirs
- List directories only, or symlinks to directories. . and ..
are not included.
仅列出目录或指向目录的符号链接。 . 和 .. 不包括在内。 - normal
- Include the results of both files and dirs. (This is the
default.)
包含 files 和 dirs 的结果。(这是默认设置。) - all
- List all entries, even device files, dead symlinks, FIFOs, and the
. and .. entries.
列出所有条目,包括设备文件、死符号链接、FIFOs 以及 . 和 .. 条目。
On error, nil, error is returned.
发生错误时,返回 nil, error 。- utils.file_info(path)
Stats the given path for information and returns a table with the following entries:
统计给定路径的信息,并返回以下条目的表格:- mode
- protection bits (on Windows, always 755 (octal) for directories
and 644 (octal) for files)
保护位(在 Windows 上,目录始终为 755(八进制),文件为 644(八进制)) - size
- size in bytes 字节大小
- atime
- time of last access
最后访问时间 - mtime
- time of last modification
最后修改时间 - ctime
- time of last metadata change
最后元数据更改时间 - is_file
- Whether path is a regular file (boolean)
是否 path 是常规文件(布尔值) - is_dir
- Whether path is a directory (boolean)
是否 path 是目录(布尔值)
mode and size are integers. Timestamps (atime, mtime and ctime) are integer seconds since the Unix epoch (Unix time). The booleans is_file and is_dir are provided as a convenience; they can be and are derived from mode.
mode 和 size 是整数。时间戳( atime , mtime 和 ctime )是自 Unix 纪元(Unix 时间)以来的整数秒。布尔值 is_file 和 is_dir 提供为便利;它们可以并且是从 mode 推导出来的。On error (e.g. path does not exist), nil, error is returned.
在错误情况下(例如路径不存在),返回 nil, error 。- utils.split_path(path)
- Split a path into directory component and filename component, and return
them. The first return value is always the directory. The second return
value is the trailing part of the path, the directory entry.
将路径拆分为目录组件和文件名组件,并返回它们。第一个返回值始终是目录。第二个返回值是路径的尾部,即目录条目。 - utils.join_path(p1, p2)
- Return the concatenation of the 2 paths. Tries to be clever. For example,
if p2 is an absolute path, p2 is returned without change.
返回两个路径的连接。试图变得聪明。例如,如果 p2 是一个绝对路径,则返回 p2 而不进行更改。 - utils.subprocess(t)
Runs an external process and waits until it exits. Returns process status and the captured output. This is a legacy wrapper around calling the subprocess command with mp.command_native. It does the following things:
运行外部进程并等待其退出。返回进程状态和捕获的输出。这是围绕调用 subprocess 命令与 mp.command_native 的一个遗留包装器。它执行以下操作:- copy the table t 复制表 t
- rename cancellable field to playback_only
将 cancellable 字段重命名为 playback_only - rename max_size to capture_size 将 max_size 重命名为 capture_size
- set capture_stdout field to true if unset
如果未设置,则将 capture_stdout 字段设置为 true - set name field to subprocess
将 name 字段设置为 subprocess - call mp.command_native(copied_t) 调用 mp.command_native(copied_t)
- if the command failed, create a dummy result table
如果命令失败,创建一个虚拟结果表 - copy error_string to error field if the string is non-empty
如果字符串非空,将 error_string 复制到 error 字段 - return the result table
返回结果表
It is recommended to use mp.command_native or mp.command_native_async directly, instead of calling this legacy wrapper. It is for compatibility only.
建议直接使用 mp.command_native 或 mp.command_native_async ,而不是调用此旧版包装器。这只是为了兼容性。See the subprocess documentation for semantics and further parameters.
查看 subprocess 文档以了解语义和更多参数。- utils.subprocess_detached(t)
Runs an external process and detaches it from mpv's control.
运行外部进程并将其从 mpv 的控制中分离。The parameter t is a table. The function reads the following entries:
参数 t 是一个表。该函数读取以下条目:The function returns nil.
该函数返回 nil 。This is a legacy wrapper around calling the run command with mp.commandv and other functions.
这是一个围绕调用 run 命令以及 mp.commandv 和其他函数的遗留包装器。- utils.getpid()
- Returns the process ID of the running mpv process. This can be used to identify
the calling mpv when launching (detached) subprocesses.
返回正在运行的 mpv 进程的进程 ID。这可以用来在启动(分离)子进程时识别调用的 mpv。 - utils.get_env_list()
- Returns the C environment as a list of strings. (Do not confuse this with
the Lua "environment", which is an unrelated concept.)
返回 C 环境作为一个字符串列表。(不要与此处的 Lua "环境" 混淆,后者是一个无关的概念。) - utils.parse_json(str [, trail])
Parses the given string argument as JSON, and returns it as a Lua table. On error, returns nil, error. (Currently, error is just a string reading error, because there is no fine-grained error reporting of any kind.)
将给定的字符串参数解析为 JSON,并作为 Lua 表格返回。出错时返回 nil, error 。(目前, error 只是一个读取 error 的字符串,因为没有任何类型的细粒度错误报告。)The returned value uses similar conventions as mp.get_property_native() to distinguish empty objects and arrays.
返回值使用类似于 mp.get_property_native() 的约定来区分空对象和数组。If the trail parameter is true (or any value equal to true), then trailing non-whitespace text is tolerated by the function, and the trailing text is returned as 3rd return value. (The 3rd return value is always there, but with trail set, no error is raised.)
如果 trail 参数是 true (或任何等于 true 的值),则函数容忍尾随的非空白文本,并将尾随文本作为第 3 个返回值返回。 (第 3 个返回值始终存在,但设置 trail 后,不会引发错误。)- utils.format_json(v)
Format the given Lua table (or value) as a JSON string and return it. On error, returns nil, error. (Errors usually only happen on value types incompatible with JSON.)
将给定的 Lua 表(或值)格式化为 JSON 字符串并返回。出错时返回 nil, error 。 (错误通常仅在值类型与 JSON 不兼容时发生。)The argument value uses similar conventions as mp.set_property_native() to distinguish empty objects and arrays.
参数值使用类似于 mp.set_property_native() 的约定来区分空对象和数组。- utils.to_string(v)
- Turn the given value into a string. Formats tables and their contents. This
doesn't do anything special; it is only needed because Lua is terrible.
将给定的值转换为字符串。格式化表格及其内容。这并没有做什么特别的事情;只是因为 Lua 很糟糕,所以需要这样做。
mp.input functions mp 输入函数
This module lets scripts get textual input from the user using the console
REPL.
此模块允许脚本通过控制台 REPL 从用户获取文本输入。
- input.get(table)
Show the console to let the user enter text.
显示控制台,让用户输入文本。The following entries of table are read:
以下为 table 的条目读取:- prompt
- The string to be displayed before the input field.
在输入字段之前显示的字符串。 - submit
- A callback invoked when the user presses Enter. The first argument is
the text in the console.
当用户按下 Enter 键时调用的回调。第一个参数是控制台中的文本。 - keep_open
- Whether to keep the console open on submit. Defaults to false.
提交时是否保持控制台打开。默认为 false 。 - opened
- A callback invoked when the console is shown. This can be used to
present a list of options with input.set_log().
当控制台显示时调用的回调。这可以用来通过 input.set_log() . 展示选项列表。 - edited
- A callback invoked when the text changes. The first argument is the text
in the console.
当文本更改时调用的回调。第一个参数是控制台中的文本。 - complete
A callback invoked when the user edits the text or moves the cursor. The first argument is the text before the cursor. The callback should return a table of the string candidate completion values and the 1-based cursor position from which the completion starts. console will show the completions that fuzzily match the text between this position and the cursor and allow selecting them.
当用户编辑文本或移动光标时调用的回调。第一个参数是光标前的文本。回调应返回一个字符串候选完成值表和从哪个位置开始完成的基于 1 的光标位置。控制台将显示与该位置和光标之间的文本模糊匹配的完成项,并允许选择它们。The third and optional return value is a string that will be appended to the input line without displaying it in the completions.
第三个可选的返回值是一个字符串,它将被附加到输入行中,但不会在完成项中显示。- autoselect_completion
- Whether to automatically select the first completion on submit if one
wasn't already manually selected. Defaults to false.
是否在提交时自动选择第一个补全项,如果之前没有手动选择。默认为 false 。 - closed
- A callback invoked when the console is hidden, either because
input.terminate() was invoked from the other callbacks, or because
the user closed it with a key binding. The first argument is the text in
the console, and the second argument is the cursor position.
当控制台被隐藏时调用的回调,无论是由于从其他回调中调用了 input.terminate() ,还是因为用户使用快捷键关闭了它。第一个参数是控制台中的文本,第二个参数是光标位置。 - default_text
- A string to pre-fill the input field with.
一个字符串,用于预先填充输入字段。 - cursor_position
- The initial cursor position, starting from 1.
初始光标位置,从 1 开始。 - history_path
- If specified, the path to save and load the history of the entered
lines.
如果指定,则保存和加载输入行历史的路径。 - id
- An identifier that determines which input history and log buffer to use
among the ones stored for input.get() calls. Defaults to the calling
script name with prompt appended.
一个标识符,用于确定在存储的 input.get() 调用中,使用哪个输入历史和日志缓冲区。默认为带有 prompt 后缀的调用脚本名称。
- input.terminate()
- Close the console. 关闭控制台。
- input.log(message, style, terminal_style)
- Add a line to the log buffer. style can contain additional ASS tags to
apply to message, and terminal_style can contain escape sequences
that are used when the console is displayed in the terminal.
向日志缓冲区添加一行。 style 可以包含应用于 message 的附加 ASS 标签,而 terminal_style 可以包含在控制台在终端中显示时使用的转义序列。 - input.log_error(message)
- Helper to add a line to the log buffer with the same color as the one used
for commands that error. Useful when the user submits invalid input.
添加与用于错误命令相同颜色的行到日志缓冲区的辅助工具。当用户提交无效输入时非常有用。 - input.set_log(log)
Replace the entire log buffer.
替换整个日志缓冲区。log is a table of strings, or tables with text, style and terminal_style keys.
log 是一个字符串表,或者具有 text 、 style 和 terminal_style 键的表。Example: 示例:
input.set_log({ "regular text", { text = "error text", style = "{\\c&H7a77f2&}", terminal_style = "\027[31m", } })
- input.select(table)
Specify a list of items that are presented to the user for selection.
指定要呈现给用户进行选择的项目列表。The following entries of table are read:
以下为 table 的条目读取:- prompt
- The string to be displayed before the input field.
在输入字段之前显示的字符串。 - items
- The table of the entries to choose from.
可供选择的条目表。 - default_item
- The 1-based integer index of the preselected item.
基于 1 的整数索引,表示预选项目。 - submit
- The callback invoked when the user presses Enter. The first argument is
the 1-based index of the selected item.
当用户按下 Enter 键时调用的回调函数。第一个参数是所选项目的基于 1 的索引。 - keep_open
- Whether to keep the console open on submit. Defaults to false.
提交时是否保持控制台打开。默认为 false 。
Example: 示例:
input.select({ items = { "First playlist entry", "Second playlist entry", }, submit = function (id) mp.commandv("playlist-play-index", id - 1) end, })
Events 事件
Events are notifications from player core to scripts. You can register an
event handler with mp.register_event.
事件是玩家核心向脚本的通知。您可以使用 mp.register_event . 注册事件处理程序。
Note that all scripts (and other parts of the player) receive events equally,
and there's no such thing as blocking other scripts from receiving events.
请注意,所有脚本(以及玩家的其他部分)都会平等地接收事件,没有阻止其他脚本接收事件的情况。
Example: 示例:
function my_fn(event) print("start of playback!") end mp.register_event("file-loaded", my_fn)
For the existing event types, see List of events.
有关现有事件类型,请参阅事件列表。
Extras 额外内容
This documents experimental features, or features that are "too special" to
guarantee a stable interface.
本文件记录了实验性功能,或那些“过于特殊”而无法保证稳定界面的功能。
- mp.add_hook(type, priority, fn)
Add a hook callback for type (a string identifying a certain kind of hook). These hooks allow the player to call script functions and wait for their result (normally, the Lua scripting interface is asynchronous from the point of view of the player core). priority is an arbitrary integer that allows ordering among hooks of the same kind. Using the value 50 is recommended as neutral default value.
为 type (一个标识特定类型钩子的字符串)添加钩子回调。这些钩子允许玩家调用脚本函数并等待其结果(通常,Lua 脚本接口从玩家核心的角度来看是异步的)。 priority 是一个任意整数,允许对同一类型的钩子进行排序。建议使用值 50 作为中性的默认值。fn(hook) is the function that will be called during execution of the hook. The parameter passed to it (hook) is a Lua object that can control further aspects about the currently invoked hook. It provides the following methods:
fn(hook) 是在钩子执行期间将被调用的函数。传递给它的参数( hook )是一个 Lua 对象,可以控制当前调用的钩子的进一步方面。它提供了以下方法:- defer()
- Returning from the hook function should not automatically continue
the hook. Instead, the API user wants to call hook:cont() on its
own at a later point in time (before or after the function has
returned).
从钩子函数返回不应自动继续钩子。相反,API 用户希望在稍后的时间(在函数返回之前或之后)自己调用 hook:cont() 。 - cont()
- Continue the hook. Doesn't need to be called unless defer() was
called.
继续钩子。除非调用了 defer() ,否则不需要调用。
See Hooks for currently existing hooks and what they do - only the hook list is interesting; handling hook execution is done by the Lua script function automatically.
查看钩子以了解当前存在的钩子和它们的功能 - 只有钩子列表是有趣的;钩子执行的处理器由 Lua 脚本函数自动完成。
JAVASCRIPT
JavaScript support in mpv is near identical to its Lua support. Use this section
as reference on differences and availability of APIs, but otherwise you should
refer to the Lua documentation for API details and general scripting in mpv.
mpv 中的 JavaScript 支持与 Lua 支持几乎相同。使用本节作为差异和 API 可用性的参考,但除此之外,您应参考 Lua 文档以获取 API 详细信息以及 mpv 中的通用脚本。
Example 示例
JavaScript code which leaves fullscreen mode when the player is paused:
JavaScript 代码,当播放器暂停时退出全屏模式:
function on_pause_change(name, value) { if (value == true) mp.set_property("fullscreen", "no"); } mp.observe_property("pause", "bool", on_pause_change);
Similarities with Lua 与 Lua 的相似之处
mpv tries to load a script file as JavaScript if it has a .js extension, but
otherwise, the documented Lua options, script directories, loading, etc apply to
JavaScript files too.
mpv 尝试将具有 .js 扩展名的脚本文件加载为 JavaScript,但否则,文档中记录的 Lua 选项、脚本目录、加载等也适用于 JavaScript 文件。
Script initialization and lifecycle is the same as with Lua, and most of the Lua
functions in the modules mp, mp.utils, mp.msg, mp.options and
mp.input are available to JavaScript with identical APIs - including running
commands, getting/setting properties, registering events/key-bindings/hooks,
etc.
脚本初始化和生命周期与 Lua 相同,并且模块 mp 、 mp.utils 、 mp.msg 、 mp.options 和 mp.input 中的大多数 Lua 函数在 JavaScript 中可用,API 完全相同 - 包括运行命令、获取/设置属性、注册事件/按键绑定/钩子等。
Differences from Lua 与 Lua 的区别
No need to load modules. mp, mp.utils, mp.msg, mp.options and
mp.input are preloaded, and you can use e.g. var cwd =
mp.utils.getcwd(); without prior setup.
无需加载模块。 mp 、 mp.utils 、 mp.msg 、 mp.options 和 mp.input 已预加载,您可以使用例如 var cwd =
mp.utils.getcwd(); 而无需先进行设置。
Errors are slightly different. Where the Lua APIs return nil for error,
the JavaScript ones return undefined. Where Lua returns something, error
JavaScript returns only something - and makes error available via
mp.last_error(). Note that only some of the functions have this additional
error value - typically the same ones which have it in Lua.
错误略有不同。Lua API 返回 nil 错误,而 JavaScript API 返回 undefined 。Lua 返回 something, error 时,JavaScript 只返回 something - 并且通过 mp.last_error() 提供了 error 。请注意,只有一些函数有这个额外的 error 值 - 通常与 Lua 中具有相同值的函数相同。
Standard APIs are preferred. For instance setTimeout and JSON.stringify
are available, but mp.add_timeout and mp.utils.format_json are not.
推荐使用标准 API。例如, setTimeout 和 JSON.stringify 可用,但 mp.add_timeout 和 mp.utils.format_json 不可用。
No standard library. This means that interaction with anything outside of mpv is
limited to the available APIs, typically via mp.utils. However, some file
functions were added, and CommonJS require is available too - where the
loaded modules have the same privileges as normal scripts.
没有标准库。这意味着与 mpv 之外的所有交互都限于可用的 API,通常通过 mp.utils 进行。然而,添加了一些文件函数,并且也提供了 CommonJS require - 加载的模块具有与普通脚本相同的权限。
Language features - ECMAScript 5
语言特性 - ECMAScript 5
The scripting backend which mpv currently uses is MuJS - a compatible minimal
ES5 interpreter. As such, String.substring is implemented for instance,
while the common but non-standard String.substr is not. Please consult the
MuJS pages on language features and platform support - https://mujs.com .
mpv 当前使用的脚本后端是 MuJS - 一个兼容的最小 ES5 解释器。因此,例如实现了 String.substring ,而常见的但非标准的 String.substr 则没有实现。请参阅 MuJS 关于语言特性和平台支持的页面 - https://mujs.com 。
Unsupported Lua APIs and their JS alternatives
不支持的 Lua API 及其 JS 替代方案
mp.add_timeout(seconds, fn) JS: id = setTimeout(fn, ms)
mp.add_periodic_timer(seconds, fn) JS: id = setInterval(fn, ms)
utils.parse_json(str [, trail]) JS: JSON.parse(str)
utils.format_json(v) JS: JSON.stringify(v)
utils.to_string(v) see dump below. utils.to_string(v) 查看 dump 以下。
mp.get_next_timeout() see event loop below.
mp.get_next_timeout() 查看以下事件循环。
mp.dispatch_events([allow_wait]) see event loop below.
mp.dispatch_events([allow_wait]) 查看以下事件循环。
Scripting APIs - identical to Lua
脚本 API - 与 Lua 相同
(LE) - Last-Error, indicates that mp.last_error() can be used after the
call to test for success (empty string) or failure (non empty reason string).
Where the Lua APIs use nil to indicate error, JS APIs use undefined.
(LE) - 最后错误,表示在调用测试成功(空字符串)或失败(非空原因字符串)之后可以使用 mp.last_error() 。Lua API 使用 nil 来指示错误,JS API 使用 undefined 。
mp.command(string) (LE)
mp.commandv(arg1, arg2, ...) (LE)
mp.command_native(table [,def]) (LE)
id = mp.command_native_async(table [,fn]) (LE) Notes: id is true-thy on
success, error is empty string on success.
id = mp.command_native_async(table [,fn]) (LE) 备注: id 在成功时为真, error 在成功时为空字符串。
mp.abort_async_command(id)
mp.del_property(name) (LE)
mp.get_property(name [,def]) (LE)
mp.get_property_osd(name [,def]) (LE)
mp.get_property_bool(name [,def]) (LE)
mp.get_property_number(name [,def]) (LE)
mp.get_property_native(name [,def]) (LE)
mp.set_property(name, value) (LE)
mp.set_property_bool(name, value) (LE)
mp.set_property_number(name, value) (LE)
mp.set_property_native(name, value) (LE)
mp.get_time()
mp.add_key_binding(key, name|fn [,fn [,flags]])
mp.add_forced_key_binding(...)
mp.remove_key_binding(name)
mp.register_event(name, fn)
mp.unregister_event(fn)
mp.observe_property(name, type, fn)
mp.unobserve_property(fn)
mp.get_opt(key)
mp.get_script_name()
mp.get_script_directory()
mp.osd_message(text [,duration])
mp.get_wakeup_pipe()
mp.register_idle(fn)
mp.unregister_idle(fn)
mp.enable_messages(level)
mp.register_script_message(name, fn)
mp.unregister_script_message(name)
mp.create_osd_overlay(format)
mp.get_osd_size() (returned object has properties: width, height, aspect)
mp.get_osd_size() (返回对象具有属性:宽度,高度,纵横比)
mp.msg.log(level, ...)
mp.msg.fatal(...)
mp.msg.error(...)
mp.msg.warn(...)
mp.msg.info(...)
mp.msg.verbose(...)
mp.msg.debug(...)
mp.msg.trace(...)
mp.utils.getcwd() (LE)
mp.utils.readdir(path [, filter]) (LE)
mp.utils.file_info(path) (LE) Note: like lua - this does NOT expand
meta-paths like ~~/foo (other JS file functions do expand meta paths).
mp.utils.file_info(path) (LE) 注意:类似于 lua - 这 **不** 会展开元路径,如 ~~/foo (其他 JS 文件函数会展开元路径)。
mp.utils.split_path(path)
mp.utils.join_path(p1, p2)
mp.utils.subprocess(t)
mp.utils.subprocess_detached(t)
mp.utils.get_env_list()
mp.utils.getpid() (LE)
mp.add_hook(type, priority, fn(hook))
mp.options.read_options(obj [, identifier [, on_update]]) (types:
string/boolean/number)
mp.options.read_options(obj [, identifier [, on_update]]) (类型:string/boolean/number)
mp.input.get(obj)
mp.input.select(obj)
mp.input.terminate()
mp.input.log(message, style)
mp.input.log_error(message)
mp.input.set_log(log)
exit() (global) exit() (全局)
Additional utilities 附加实用工具
- mp.last_error()
- If used after an API call which updates last error, returns an empty string
if the API call succeeded, or a non-empty error reason string otherwise.
如果在使用更新最后错误的 API 调用之后使用,如果 API 调用成功,则返回空字符串,否则返回非空错误原因字符串。 - Error.stack (string) Error.stack (字符串)
- When using try { ... } catch(e) { ... }, then e.stack is the stack
trace of the error - if it was created using the Error(...) constructor.
当使用 try { ... } catch(e) { ... } 时, e.stack 是错误的堆栈跟踪 - 如果它是使用 Error(...) 构造函数创建的,则如此。 - print (global) print (全局)
- A convenient alias to mp.msg.info.
一个方便的别名到 mp.msg.info 。 - dump (global) dump (全局)
- Like print but also expands objects and arrays recursively.
类似于 print ,但还会递归地展开对象和数组。 - mp.utils.getenv(name)
- Returns the value of the host environment variable name, or
undefined if the variable is not defined.
返回主机环境变量 name 的值,如果变量未定义,则返回 undefined 。 - mp.utils.get_user_path(path)
- Trivial wrapper of the expand-path mpv command, returns a string.
read_file, write_file, append_file and require already
expand the path internally and accept mpv meta-paths like ~~desktop/foo.
简单的 expand-path mpv 命令包装器,返回一个字符串。 read_file , write_file , append_file 和 require 已经在内部扩展路径并接受 ~~desktop/foo 类型的 mpv 元路径。 - mp.utils.read_file(fname [,max])
- Returns the content of file fname as string. If max is provided and
not negative, limit the read to max bytes.
返回文件 fname 的内容作为字符串。如果提供了 max 且不为负数,则限制读取到 max 字节。 - mp.utils.write_file(fname, str)
- (Over)write file fname with text content str. fname must be
prefixed with file:// as simple protection against accidental arguments
switch, e.g. mp.utils.write_file("file://~/abc.txt", "hello world").
将文件 fname 使用文本内容 str (Over)写入。 fname 必须以 file:// 前缀,作为防止意外参数切换的简单保护,例如 mp.utils.write_file("file://~/abc.txt", "hello world") 。 - mp.utils.append_file(fname, str)
- Same as mp.utils.write_file if the file fname does not exist. If it
does exist then append instead of overwrite.
如果文件 fname 不存在,则与 mp.utils.write_file 相同。如果它存在,则追加而不是覆盖。
Note: read_file, write_file and append_file throw on errors, allow
text content only.
注意: read_file , write_file 和 append_file 在出错时抛出异常,仅允许文本内容。
- mp.get_time_ms()
- Same as mp.get_time() but in ms instead of seconds.
与 mp.get_time() 相同,但以毫秒为单位而不是秒。 - mp.get_script_file()
- Returns the file name of the current script.
返回当前脚本的文件名。 - mp.utils.compile_js(fname, content_str)
- Compiles the JS code content_str as file name fname (without loading
anything from the filesystem), and returns it as a function. Very similar
to a Function constructor, but shows at stack traces as fname.
将 JS 代码 content_str 编译为文件名 fname (不从文件系统中加载任何内容),并作为函数返回。非常类似于 Function 构造函数,但在堆栈跟踪中显示为 fname 。 - mp.module_paths
- Global modules search paths array for the require function (see below).
用于 require 函数的全局模块搜索路径数组(见下文)。
Timers (global) 定时器(全局)
The standard HTML/node.js timers are available:
标准 HTML/node.js 定时器可用:
id = setTimeout(fn [,duration [,arg1 [,arg2...]]])
id = setTimeout(code_string [,duration])
clearTimeout(id)
id = setInterval(fn [,duration [,arg1 [,arg2...]]])
id = setInterval(code_string [,duration])
clearInterval(id)
setTimeout and setInterval return id, and later call fn (or execute
code_string) after duration ms. Interval also repeat every duration.
setTimeout 和 setInterval 返回 id,之后在 duration 毫秒后调用 fn (或执行 code_string )。间隔也会每 duration 次重复。
duration has a minimum and default value of 0, code_string is
a plain string which is evaluated as JS code, and [,arg1 [,arg2..]] are used
as arguments (if provided) when calling back fn.
duration 有最小值和默认值 0, code_string 是一个被评估为 JS 代码的普通字符串, [,arg1 [,arg2..]] 用作调用回传时的参数(如果提供的话)。
The clear...(id) functions cancel timer id, and are irreversible.
clear...(id) 函数取消定时器 id ,且不可逆。
Note: timers always call back asynchronously, e.g. setTimeout(fn) will never
call fn before returning. fn will be called either at the end of this
event loop iteration or at a later event loop iteration. This is true also for
intervals - which also never call back twice at the same event loop iteration.
注意:定时器总是异步调用,例如 setTimeout(fn) 永远不会在返回之前调用 fn 。 fn 将在本次事件循环迭代结束时或后续的事件循环迭代中被调用。这也适用于间隔 - 它们也永远不会在相同的事件循环迭代中调用两次。
Additionally, timers are processed after the event queue is empty, so it's valid
to use setTimeout(fn) as a one-time idle observer.
此外,定时器在事件队列为空后处理,因此可以使用 setTimeout(fn) 作为一次性空闲观察者是有效的。
CommonJS modules and require(id) CommonJS 模块和 require(id)
CommonJS Modules are a standard system where scripts can export common functions
for use by other scripts. Specifically, a module is a script which adds
properties (functions, etc) to its pre-existing exports object, which
another script can access with require(module-id). This runs the module and
returns its exports object. Further calls to require for the same module
will return its cached exports object without running the module again.
CommonJS 模块是一个标准系统,其中脚本可以导出常用函数供其他脚本使用。具体来说,一个模块是一个脚本,它向其现有的 exports 对象添加属性(函数等),另一个脚本可以通过 require(module-id) 访问这些属性。这会运行模块并返回其 exports 对象。对同一模块的后续 require 调用将返回其缓存的 exports 对象,而无需再次运行模块。
Modules and require are supported, standard compliant, and generally similar
to node.js. However, most node.js modules won't run due to missing modules such
as fs, process, etc, but some node.js modules with minimal dependencies
do work. In general, this is for mpv modules and not a node.js replacement.
模块和 require 被支持,符合标准,通常与 node.js 类似。然而,由于缺少模块如 fs 、 process 等,大多数 node.js 模块无法运行,但一些具有最小依赖的 node.js 模块可以工作。总的来说,这是针对 mpv 模块,而不是 node.js 的替代品。
A .js file extension is always added to id, e.g. require("./foo")
will load the file ./foo.js and return its exports object.
总是为 id 添加一个 .js 文件扩展名,例如, require("./foo") 将加载文件 ./foo.js 并返回其 exports 对象。
An id which starts with ./ or ../ is relative to the script or module
which require it. Otherwise it's considered a top-level id (CommonJS term).
以 ./ 或 ../ 开头的 id 是相对于 require 的脚本或模块而言的。否则,它被视为顶级 id(CommonJS 术语)。
Top-level id is evaluated as absolute filesystem path if possible, e.g. /x/y
or ~/x. Otherwise it's considered a global module id and searched according
to mp.module_paths in normal array order, e.g. require("x") tries to
load x.js at one of the array paths, and id foo/x tries to load x.js
inside dir foo at one of the paths.
顶级 id 如果可能,将被评估为绝对文件系统路径,例如 /x/y 或 ~/x 。否则,它被视为全局模块 id,并按照 mp.module_paths 在正常数组顺序中搜索,例如 require("x") 尝试在数组路径之一加载 x.js ,而 id foo/x 尝试在路径之一 dir foo 内加载 x.js 。
The mp.module_paths array is empty by default except for scripts which are
loaded as a directory where it contains one item - <directory>/modules/ .
The array may be updated from a script (or using custom init - see below) which
will affect future calls to require for global module id's which are not
already loaded/cached.
默认情况下, mp.module_paths 数组为空,除非它作为目录加载的脚本,其中包含一个项目 - <directory>/modules/ 。该数组可以从脚本(或使用自定义初始化 - 见下文)更新,这将影响对尚未加载/缓存的全球模块 id 的未来调用 require 。
No global variable, but a module's this at its top lexical scope is the
global object - also in strict mode. If you have a module which needs global
as the global object, you could do this.global = this; before require.
没有 global 变量,但模块在其顶级词法作用域中的 this 是全局对象 - 严格模式下也是如此。如果您有一个需要 global 作为全局对象的模块,您可以在 require 之前执行 this.global = this; 。
Functions and variables declared at a module don't pollute the global object.
在模块中声明的函数和变量不会污染全局对象。
Custom initialization 自定义初始化
After mpv initializes the JavaScript environment for a script but before it
loads the script - it tries to run the file init.js at the root of the mpv
configuration directory. Code at this file can update the environment further
for all scripts. E.g. if it contains mp.module_paths.push("/foo") then
require at all scripts will search global module id's also at /foo
(do NOT do mp.module_paths = ["/foo"]; because this will remove existing
paths - like <script-dir>/modules for scripts which load from a directory).
在 mpv 为脚本初始化 JavaScript 环境之后,但在加载脚本之前 - 它会尝试运行位于 mpv 配置目录根部的文件 init.js 。此文件中的代码可以进一步更新所有脚本的环境。例如,如果它包含 mp.module_paths.push("/foo") ,则所有脚本中的 require 将也会搜索 /foo 的全局模块 ID(请不要执行 mp.module_paths = ["/foo"]; ,因为这将会移除现有路径 - 如 <script-dir>/modules 用于从目录加载脚本的脚本)。
The custom-init file is ignored if mpv is invoked with --no-config.
如果使用 --no-config 调用 mpv,则忽略自定义初始化文件。
Before mpv 0.34, the file name was .init.js (with dot) at the same dir.
在 mpv 0.34 之前,文件名是 .init.js (带点)在同一目录下。
The event loop 事件循环
The event loop poll/dispatch mpv events as long as the queue is not empty, then
processes the timers, then waits for the next event, and repeats this forever.
事件循环在队列不为空时轮询/派发 mpv 事件,然后处理定时器,然后等待下一个事件,并无限重复此过程。
You could put this code at your script to replace the built-in event loop, and
also print every event which mpv sends to your script:
您可以将此代码放入脚本中以替换内置的事件循环,并打印出 mpv 发送给脚本的每个事件:
function mp_event_loop() { var wait = 0; do { var e = mp.wait_event(wait); dump(e); // there could be a lot of prints... if (e.event != "none") { mp.dispatch_event(e); wait = 0; } else { wait = mp.process_timers() / 1000; if (wait != 0) { mp.notify_idle_observers(); wait = mp.peek_timers_wait() / 1000; } } } while (mp.keep_running); }
mp_event_loop is a name which mpv tries to call after the script loads.
The internal implementation is similar to this (without dump though..).
mp_event_loop 是 mpv 在脚本加载后尝试调用的名称。内部实现类似于此(但没有 dump )。
e = mp.wait_event(wait) returns when the next mpv event arrives, or after
wait seconds if positive and no mpv events arrived. wait value of 0
returns immediately (with e.event == "none" if the queue is empty).
e = mp.wait_event(wait) 在下一个 mpv 事件到达时返回,或者如果为正数且没有到达 mpv 事件,则在 wait 秒后返回。 wait 的值为 0 将立即返回(如果队列空,则与 e.event == "none" 一起返回)。
mp.dispatch_event(e) calls back the handlers registered for e.event,
if there are such (event handlers, property observers, script messages, etc).
mp.dispatch_event(e) 调用为 e.event 注册的处理程序,如果有这样的处理程序(事件处理程序、属性观察者、脚本消息等)。
mp.process_timers() calls back the already-added, non-canceled due timers,
and returns the duration in ms till the next due timer (possibly 0), or -1 if
there are no pending timers. Must not be called recursively.
mp.process_timers() 调用已添加且未取消的定时器,并返回下一个定时器到期的时间(可能是 0),如果没有挂起的定时器则返回-1。不得递归调用。
mp.notify_idle_observers() calls back the idle observers, which we do when
we're about to sleep (wait != 0), but the observers may add timers or take
non-negligible duration to complete, so we re-calculate wait afterwards.
mp.notify_idle_observers() 调用空闲观察者,我们在即将休眠(wait != 0)时这样做,但观察者可能会添加计时器或花费不可忽视的时间来完成,所以我们之后重新计算 wait 。
mp.peek_timers_wait() returns the same values as mp.process_timers()
but without doing anything. Invalid result if called from a timer callback.
mp.peek_timers_wait() 返回与 mp.process_timers() 相同的值,但什么都不做。如果从计时器回调中调用,则结果无效。
Note: exit() is also registered for the shutdown event, and its
implementation is a simple mp.keep_running = false.
注意: exit() 也注册了 shutdown 事件,并且其实现是一个简单的 mp.keep_running = false 。
JSON IPC
mpv can be controlled by external programs using the JSON-based IPC protocol.
It can be enabled by specifying the path to a unix socket or a named pipe using
the option --input-ipc-server, or the file descriptor number of a unix socket
or a named pipe using --input-ipc-client.
Clients can connect to this socket and send commands to the player or receive
events from it.
mpv 可以通过基于 JSON 的 IPC 协议由外部程序控制。可以通过指定 unix 套接字或命名管道的路径来启用,使用选项 --input-ipc-server ,或者使用 unix 套接字或命名管道的文件描述符编号来使用 --input-ipc-client 。客户端可以连接到此套接字并向播放器发送命令或从它接收事件。
Warning 警告
This is not intended to be a secure network protocol. It is explicitly
insecure: there is no authentication, no encryption, and the commands
themselves are insecure too. For example, the run command is exposed,
which can run arbitrary system commands. The use-case is controlling the
player locally. This is not different from the MPlayer slave protocol.
这并不是一个安全的网络协议。它明确是不安全的:没有身份验证,没有加密,命令本身也不安全。例如, run 命令是公开的,可以运行任意系统命令。用例是本地控制播放器。这与 MPlayer 从属协议没有区别。
Socat example Socat 示例
You can use the socat tool to send commands (and receive replies) from the
shell. Assuming mpv was started with:
您可以使用 socat 工具从 shell 发送命令(并接收回复)。假设 mpv 是以以下方式启动的:
mpv file.mkv --input-ipc-server=/tmp/mpvsocket
Then you can control it using socat:
然后您可以使用 socat 来控制它:
> echo '{ "command": ["get_property", "playback-time"] }' | socat - /tmp/mpvsocket {"data":190.482000,"error":"success"}
In this case, socat copies data between stdin/stdout and the mpv socket
connection.
在这种情况下,socat 会在 stdin/stdout 和 mpv 套接字连接之间复制数据。
See the --idle option how to make mpv start without exiting immediately or
playing a file.
查看 --idle 选项了解如何使 mpv 启动后不立即退出或播放文件。
It's also possible to send input.conf style text-only commands:
还可以发送类似 input.conf 风格的纯文本命令:
> echo 'show-text ${playback-time}' | socat - /tmp/mpvsocket
But you won't get a reply over the socket. (This particular command shows the
playback time on the player's OSD.)
但您不会通过套接字收到回复。(此特定命令显示播放器 OSD 上的播放时间。)
Command Prompt example 命令提示符示例
Unfortunately, it's not as easy to test the IPC protocol on Windows, since
Windows ports of socat (in Cygwin and MSYS2) don't understand named pipes. In
the absence of a simple tool to send and receive from bidirectional pipes, the
echo command can be used to send commands, but not receive replies from the
command prompt.
不幸的是,在 Windows 上测试 IPC 协议并不容易,因为 Cygwin 和 MSYS2 中的 socat Windows 版本不理解命名管道。在没有简单工具从双向管道发送和接收的情况下,可以使用 echo 命令发送命令,但不能从命令提示符接收回复。
Assuming mpv was started with:
假设 mpv 是以下方式启动的:
mpv file.mkv --input-ipc-server=\\.\pipe\mpvsocket
You can send commands from a command prompt:
您可以从命令提示符发送命令:
echo show-text ${playback-time} >\\.\pipe\mpvsocket
To be able to simultaneously read and write from the IPC pipe, like on Linux,
it's necessary to write an external program that uses overlapped file I/O (or
some wrapper like .NET's NamedPipeClientStream.)
为了能够像在 Linux 上一样同时从 IPC 管道读取和写入,需要编写一个使用重叠文件 I/O 的外部程序(或一些包装器,如.NET 的 NamedPipeClientStream。)
You can open the pipe in PuTTY as "serial" device. This is not very
comfortable, but gives a way to test interactively without having to write code.
您可以在 PuTTY 中将管道打开为“串行”设备。这并不非常舒适,但提供了一种无需编写代码即可交互式测试的方法。
Protocol 协议
The protocol uses UTF-8-only JSON as defined by RFC-8259. Unlike standard JSON,
"u" escape sequences are not allowed to construct surrogate pairs. To avoid
getting conflicts, encode all text characters including and above codepoint
U+0020 as UTF-8. mpv might output broken UTF-8 in corner cases (see "UTF-8"
section below).
该协议使用由 RFC-8259 定义的仅 UTF-8 的 JSON。与标准 JSON 不同,不允许使用“u”转义序列来构造代理对。为了避免冲突,将所有文本字符(包括并高于代码点 U+0020)编码为 UTF-8。mpv 可能在某些边缘情况下输出损坏的 UTF-8(见下文“UTF-8”部分)。
Clients can execute commands on the player by sending JSON messages of the
following form:
客户端可以通过发送以下形式的 JSON 消息在播放器上执行命令:
{ "command": ["command_name", "param1", "param2", ...] }
where command_name is the name of the command to be executed, followed by a
list of parameters. Parameters must be formatted as native JSON values
(integers, strings, booleans, ...). Every message must be terminated with
\n. Additionally, \n must not appear anywhere inside the message. In
practice this means that messages should be minified before being sent to mpv.
其中 command_name 是要执行的命令的名称,后跟参数列表。参数必须格式化为原生 JSON 值(整数、字符串、布尔值等)。每条消息都必须以 \n 结束。此外, \n 不得出现在消息的任何位置。在实践中,这意味着在发送给 mpv 之前,应该对消息进行压缩。
mpv will then send back a reply indicating whether the command was run
correctly, and an additional field holding the command-specific return data (it
can also be null).
然后 mpv 将发送回一个回复,指示命令是否正确运行,以及一个包含特定命令返回数据的附加字段(也可以为 null)。
{ "error": "success", "data": null }
mpv will also send events to clients with JSON messages of the following form:
mpv 还会将以下形式的 JSON 消息发送给客户端:
{ "event": "event_name" }
where event_name is the name of the event. Additional event-specific fields
can also be present. See List of events for a list of all supported events.
其中 event_name 是事件的名称。还可以存在其他特定事件的字段。请参阅事件列表以获取所有支持的事件列表。
Because events can occur at any time, it may be difficult at times to determine
which response goes with which command. Commands may optionally include a
request_id which, if provided in the command request, will be copied
verbatim into the response. mpv does not interpret the request_id in any
way; it is solely for the use of the requester. The only requirement is that
the request_id field must be an integer (a number without fractional parts
in the range -2^63..2^63-1). Using other types is deprecated and will
currently show a warning. In the future, this will raise an error.
由于事件可能在任何时候发生,有时可能难以确定哪个响应对应哪个命令。命令可以可选地包含一个 request_id ,如果命令请求中提供了,它将被原样复制到响应中。mpv 不会以任何方式解释 request_id ;它仅用于请求者。唯一的要求是 request_id 字段必须是一个整数(没有小数部分的数字,范围在 -2^63..2^63-1 内)。使用其他类型已被弃用,并且目前会显示警告。将来,这将引发错误。
For example, this request:
例如,这个请求:
{ "command": ["get_property", "time-pos"], "request_id": 100 }
Would generate this response:
将生成此响应:
{ "error": "success", "data": 1.468135, "request_id": 100 }
If you don't specify a request_id, command replies will set it to 0.
如果您没有指定 request_id ,命令回复将将其设置为 0。
All commands, replies, and events are separated from each other with a line
break character (\n).
所有命令、回复和事件都由换行符( \n )分隔。
If the first character (after skipping whitespace) is not {, the command
will be interpreted as non-JSON text command, as they are used in input.conf
(or mpv_command_string() in the client API). Additionally, lines starting
with # and empty lines are ignored.
如果第一个字符(跳过空白后)不是 { ,则命令将被解释为非 JSON 文本命令,因为它们用于 input.conf(或在客户端 API 中的 mpv_command_string() )。此外,以 # 开头的行和空行将被忽略。
Currently, embedded 0 bytes terminate the current line, but you should not
rely on this.
目前,嵌入的 0 字节用于终止当前行,但您不应依赖这一点。
Data flow 数据流
Currently, the mpv-side IPC implementation does not service the socket while a
command is executed and the reply is written. It is for example not possible
that other events, that happened during the execution of the command, are
written to the socket before the reply is written.
当前,mpv-side 的 IPC 实现无法在执行命令并写入回复时服务套接字。例如,在写入回复之前,无法将命令执行期间发生的其他事件写入套接字。
This might change in the future. The only guarantee is that replies to IPC
messages are sent in sequence.
这可能在将来改变。唯一保证的是 IPC 消息的回复是按顺序发送的。
Also, since socket I/O is inherently asynchronous, it is possible that you read
unrelated event messages from the socket, before you read the reply to the
previous command you sent. In this case, these events were queued by the mpv
side before it read and started processing your command message.
此外,由于套接字 I/O 本质上是异步的,你可能在读取之前发送的命令的回复之前,从套接字读取到不相关的消息。在这种情况下,这些事件在 mpv 读取并开始处理你的命令消息之前已被排队。
If the mpv-side IPC implementation switches away from blocking writes and
blocking command execution, it may attempt to send events at any time.
如果 mpv-side 的 IPC 实现从阻塞写入和阻塞命令执行切换,它可能会在任何时候尝试发送事件。
You can also use asynchronous commands, which can return in any order, and
which do not block IPC protocol interaction at all while the command is
executed in the background.
您还可以使用异步命令,这些命令可以以任何顺序返回,并且在命令在后台执行时不会阻塞 IPC 协议交互。
Asynchronous commands 异步命令
Command can be run asynchronously. This behaves exactly as with normal command
execution, except that execution is not blocking. Other commands can be sent
while it's executing, and command completion can be arbitrarily reordered.
命令可以异步运行。这的行为与正常命令执行完全相同,除了执行不是阻塞的。可以在执行时发送其他命令,并且命令完成可以任意重新排序。
The async field controls this. If present, it must be a boolean. If missing,
false is assumed.
字段 async 控制此功能。如果存在,它必须是一个布尔值。如果不存在,则假定 false 。
For example, this initiates an asynchronous command:
例如,这会启动一个异步命令:
{ "command": ["screenshot"], "request_id": 123, "async": true }
And this is the completion:
这是完成情况:
{"request_id":123,"error":"success","data":null}
By design, you will not get a confirmation that the command was started. If a
command is long running, sending the message will not lead to any reply until
much later when the command finishes.
按照设计,您将不会收到命令已启动的确认。如果命令执行时间较长,发送消息不会导致任何回复,直到命令完成很久之后。
Some commands execute synchronously, but these will behave like asynchronous
commands that finished execution immediately.
某些命令会同步执行,但它们将表现得像立即完成执行的异步命令。
Cancellation of asynchronous commands is available in the libmpv API, but has
not yet been implemented in the IPC protocol.
在 libmpv API 中提供了异步命令的取消功能,但尚未在 IPC 协议中实现。
Commands with named arguments
具有命名参数的命令
If the command field is a JSON object, named arguments are expected. This
is described in the C API mpv_command_node() documentation (the
MPV_FORMAT_NODE_MAP case). In some cases, this may make commands more
readable, while some obscure commands basically require using named arguments.
如果 command 字段是一个 JSON 对象,则期望命名参数。这在 C API mpv_command_node() 文档中有所描述(即 MPV_FORMAT_NODE_MAP 的情况)。在某些情况下,这可以使命令更易读,而一些晦涩的命令基本上需要使用命名参数。
Currently, only "proper" commands (as listed by List of Input Commands)
support named arguments.
目前,只有“正确”的命令(如输入命令列表中所示)支持命名参数。
Commands 命令
In addition to the commands described in List of Input Commands, a few
extra commands can also be used as part of the protocol:
除了输入命令列表中描述的命令外,还可以使用一些额外的命令作为协议的一部分:
- client_name
- Return the name of the client as string. This is the string ipc-N with
N being an integer number.
返回客户端名称作为字符串。这是字符串 ipc-N ,其中 N 是一个整数。 - get_time_us
- Return the current mpv internal time in microseconds as a number. This is
basically the system time, with an arbitrary offset.
返回当前 mpv 内部时间(微秒数)。这基本上是系统时间,加上一个任意偏移量。 - get_property
Return the value of the given property. The value will be sent in the data field of the replay message.
返回给定属性的值。该值将通过回放消息的数据字段发送。Example: 示例:
{ "command": ["get_property", "volume"] } { "data": 50.0, "error": "success" }
- get_property_string
Like get_property, but the resulting data will always be a string.
类似于 get_property ,但结果数据始终为字符串。Example: 示例:
{ "command": ["get_property_string", "volume"] } { "data": "50.000000", "error": "success" }
- set_property
Set the given property to the given value. See Properties for more information about properties.
将给定的属性设置为给定的值。有关属性的更多信息,请参阅属性。Example: 示例:
{ "command": ["set_property", "pause", true] } { "error": "success" }
- set_property_string
- Alias for set_property. Both commands accept native values and strings.
为 set_property 的别名。这两个命令都接受原生值和字符串。 - observe_property
Watch a property for changes. If the given property is changed, then an event of type property-change will be generated
监视属性的变化。如果给定的属性发生变化,则将生成类型为 property-change 的事件Example: 示例:
{ "command": ["observe_property", 1, "volume"] } { "error": "success" } { "event": "property-change", "id": 1, "data": 52.0, "name": "volume" }
Warning 警告
If the connection is closed, the IPC client is destroyed internally, and the observed properties are unregistered. This happens for example when sending commands to a socket with separate socat invocations. This can make it seem like property observation does not work. You must keep the IPC connection open to make it work.
如果连接关闭,IPC 客户端将内部销毁,并注销观察到的属性。例如,在向具有单独的 socat 调用的套接字发送命令时会发生这种情况。这可能会让人感觉属性观察不起作用。您必须保持 IPC 连接打开才能使其工作。- observe_property_string
Like observe_property, but the resulting data will always be a string.
类似于 observe_property ,但结果数据始终为字符串。Example: 示例:
{ "command": ["observe_property_string", 1, "volume"] } { "error": "success" } { "event": "property-change", "id": 1, "data": "52.000000", "name": "volume" }
- unobserve_property
Undo observe_property or observe_property_string. This requires the numeric id passed to the observed command as argument.
撤销 observe_property 或 observe_property_string 。这需要作为观察命令参数传递的数字 ID。Example: 示例:
{ "command": ["unobserve_property", 1] } { "error": "success" }
- request_log_messages
Enable output of mpv log messages. They will be received as events. The parameter to this command is the log-level (see mpv_request_log_messages C API function).
启用 mpv 日志消息的输出。它们将以事件的形式接收。此命令的参数是日志级别(见 mpv_request_log_messages C API 函数)。Log message output is meant for humans only (mostly for debugging). Attempting to retrieve information by parsing these messages will just lead to breakages with future mpv releases. Instead, make a feature request, and ask for a proper event that returns the information you need.
日志消息输出仅针对人类(主要用于调试)。尝试通过解析这些消息来检索信息将只会导致与未来 mpv 版本的未来中断。相反,请提出功能请求,并要求返回所需信息的适当事件。- enable_event, disable_event
Enables or disables the named event. Mirrors the mpv_request_event C API function. If the string all is used instead of an event name, all events are enabled or disabled.
启用或禁用指定事件。与 mpv_request_event C API 函数相对应。如果使用字符串 all 代替事件名称,则启用或禁用所有事件。By default, most events are enabled, and there is not much use for this command.
默认情况下,大多数事件都是启用的,此命令没有太多用途。- get_version
Returns the client API version the C API of the remote mpv instance provides.
返回远程 mpv 实例提供的 C API 的客户端 API 版本。See also: DOCS/client-api-changes.rst. 另请参阅: DOCS/client-api-changes.rst 。
UTF-8
Normally, all strings are in UTF-8. Sometimes it can happen that strings are
in some broken encoding (often happens with file tags and such, and filenames
on many Unixes are not required to be in UTF-8 either). This means that mpv
sometimes sends invalid JSON. If that is a problem for the client application's
parser, it should filter the raw data for invalid UTF-8 sequences and perform
the desired replacement, before feeding the data to its JSON parser.
通常,所有字符串都是 UTF-8 编码。有时可能会出现字符串在某种损坏的编码中(通常发生在文件标签等情况下,许多 Unix 系统上的文件名也不必是 UTF-8 编码)。这意味着 mpv 有时会发送无效的 JSON。如果这对客户端应用程序的解析器来说是个问题,它应该过滤原始数据中的无效 UTF-8 序列,并在将数据馈送到其 JSON 解析器之前执行所需的替换。
mpv will not attempt to construct invalid UTF-8 with broken "u" escape
sequences. This includes surrogate pairs.
mpv 不会尝试使用损坏的“u”转义序列构建无效的 UTF-8,这包括代理对。
JSON extensions JSON 扩展
The following non-standard extensions are supported:
以下非标准扩展得到支持:
- a list or object item can have a trailing ","
一个列表或对象项可以有尾随的 ","- object syntax accepts "=" in addition of ":"
对象语法除了 ":" 还接受 "="- object keys can be unquoted, if they start with a character in "A-Za-z_" and contain only characters in "A-Za-z0-9_"
对象键可以是未引用的,如果它们以 "A-Za-z_" 中的字符开头并且只包含 "A-Za-z0-9_" 中的字符- byte escapes with "xAB" are allowed (with AB being a 2 digit hex number)
允许使用 "xAB" 的字节转义(其中 AB 是一个两位十六进制数)
Example: 示例:
{ objkey = "value\x0A" }
Is equivalent to: 等价于:
{ "objkey": "value\n" }
Alternative ways of starting clients
启动客户端的替代方法
You can create an anonymous IPC connection without having to set
--input-ipc-server. This is achieved through a mpv pseudo scripting backend
that starts processes.
您可以在不设置 --input-ipc-server 的情况下创建一个匿名 IPC 连接。这是通过一个 mpv 伪脚本后端实现的,该后端启动进程。
You can put .run file extension in the mpv scripts directory in its config
directory (see the FILES section for details), or load them through other
means (see Script location). These scripts are simply executed with the OS
native mechanism (as if you ran them in the shell). They must have a proper
shebang and have the executable bit set.
您可以将 .run 文件扩展名放在 mpv 脚本目录中,该目录位于其配置目录中(有关详细信息,请参阅 FILE 部分),或者通过其他方式加载它们(请参阅脚本位置)。这些脚本将简单地通过操作系统原生机制执行(就像您在 shell 中运行它们一样)。它们必须有一个合适的 shebang 并设置可执行位。
When executed, a socket (the IPC connection) is passed to them through file
descriptor inheritance. The file descriptor is indicated as the special command
line argument --mpv-ipc-fd=N, where N is the numeric file descriptor.
当执行时,一个套接字(IPC 连接)将通过文件描述符继承传递给它们。文件描述符由特殊命令行参数 --mpv-ipc-fd=N 指示,其中 N 是数字文件描述符。
The rest is the same as with a normal --input-ipc-server IPC connection. mpv
does not attempt to observe or other interact with the started script process.
其余部分与正常 --input-ipc-server IPC 连接相同。mpv 不会尝试观察或与其他交互已启动的脚本进程。
This does not work in Windows yet.
此代码在 Windows 上尚不可用。
CHANGELOG 变更日志
There is no real changelog, but you can look at the following things:
实际上没有真正的变更日志,但您可以查看以下内容:
The release changelog, which should contain most user-visible changes, including new features and bug fixes:
发布变更日志,其中应包含大多数用户可见的更改,包括新功能和错误修复:The git log, which is the "real" changelog
git 日志,它是“真实”的变更日志The file https://github.com/mpv-player/mpv/blob/master/DOCS/interface-changes.rst documents changes to the command and user interface, such as options and properties.
文件 https://github.com/mpv-player/mpv/blob/master/DOCS/interface-changes.rst 记录了命令和用户界面的变更,例如选项和属性。C API changes are listed in https://github.com/mpv-player/mpv/blob/master/DOCS/client-api-changes.rst
C API 变更是列在 https://github.com/mpv-player/mpv/blob/master/DOCS/client-api-changes.rst 中的。The file mplayer-changes.rst in the DOCS sub directory on the git repository, which used to be in place of this section. It documents some changes that happened since mplayer2 forked off MPlayer. (Not updated anymore.)
git 仓库中 DOCS 子目录下的文件 mplayer-changes.rst ,它曾替代本节内容。它记录了自 mplayer2 从 MPlayer 分叉以来发生的一些变更。(不再更新。)
EMBEDDING INTO OTHER PROGRAMS (LIBMPV)
mpv can be embedded into other programs as video/audio playback backend. The
recommended way to do so is using libmpv. See include/mpv/client.h in the mpv
source code repository. This provides a C API. Bindings for other languages
might be available (see wiki).
mpv 可以嵌入到其他程序中作为视频/音频播放后端。推荐的做法是使用 libmpv。请参阅 mpv 源代码仓库中的 include/mpv/client.h 。这提供了一个 C API。可能还有其他语言的绑定可用(见 wiki)。
Since libmpv merely allows access to underlying mechanisms that can control
mpv, further documentation is spread over a few places:
由于 libmpv 仅仅允许访问可以控制 mpv 的底层机制,因此相关文档分散在几个地方:
C PLUGINS C 插件
You can write C plugins for mpv. These use the libmpv API, although they do not
use the libmpv library itself.
您可以为 mpv 编写 C 插件。这些插件使用 libmpv API,尽管它们不使用 libmpv 库本身。
They are enabled by default if compiler supports linking with the -rdynamic
flag on Linux/BSD platforms. On Windows the are always enabled.
默认情况下启用,如果编译器支持在 Linux/BSD 平台上使用 -rdynamic 标志进行链接。在 Windows 上始终启用。
C plugins location C 插件位置
C plugins are put into the mpv scripts directory in its config directory
(see the FILES section for details). They must have a .so or .dll
file extension. They can also be explicitly loaded with the --script option.
C 插件放置在 mpv 脚本目录中,位于其配置目录(有关详细信息,请参阅 FILE 部分)。它们必须具有 .so 或 .dll 文件扩展名。也可以使用 --script 选项显式加载。
API
A C plugin must export the following function:
一个 C 插件必须导出以下函数:
int mpv_open_cplugin(mpv_handle *handle)
The plugin function will be called on loading time. This function does not
return as long as your plugin is loaded (it runs in its own thread). The
handle will be deallocated as soon as the plugin function returns.
插件函数将在加载时被调用。只要您的插件被加载(它在自己的线程中运行),此函数就不会返回。当插件函数返回时, handle 将被释放。
The return value is interpreted as error status. A value of 0 is
interpreted as success, while -1 signals an error. In the latter case,
the player prints an uninformative error message that loading failed.
返回值被解释为错误状态。 0 的值被解释为成功,而 -1 表示错误。在后一种情况下,播放器将打印一个无用的错误消息,表明加载失败。
Return values other than 0 and -1 are reserved, and trigger undefined
behavior.
除了 0 和 -1 之外的其他返回值是保留的,并触发未定义的行为。
Within the plugin function, you can call libmpv API functions. The handle
is created by mpv_create_client() (or actually an internal equivalent),
and belongs to you. You can call mpv_wait_event() to wait for things
happening, and so on.
在插件函数内部,您可以调用 libmpv API 函数。 handle 是由 mpv_create_client() (或实际上是一个内部等效函数)创建的,属于您。您可以调用 mpv_wait_event() 来等待事件发生,等等。
Note that the player might block until your plugin calls mpv_wait_event()
for the first time. This gives you a chance to install initial hooks etc.
before playback begins.
请注意,播放器可能会在您的插件第一次调用 mpv_wait_event() 时阻塞。这给了您在播放开始之前安装初始钩子等的机会。
The details are quite similar to Lua scripts.
细节与 Lua 脚本相当相似。
Linkage to libmpv 链接到 libmpv
The current implementation requires that your plugins are not linked against
libmpv. What your plugins use are not symbols from a libmpv binary, but
symbols from the mpv host binary.
当前实现要求您的插件不要链接到 libmpv。您的插件使用的是来自 mpv 宿主二进制文件的符号,而不是来自 libmpv 二进制文件的符号。
On Windows to make symbols from the host binary available, you have to define
MPV_CPLUGIN_DYNAMIC_SYM when compiling cplugin. This will load symbols
dynamically, before calling mpv_open_cplugin().
在 Windows 上,为了使宿主二进制文件的符号可用,您必须在编译 cplugin 时定义 MPV_CPLUGIN_DYNAMIC_SYM。这将动态加载符号,在调用 mpv_open_cplugin() 之前。
ENVIRONMENT VARIABLES 环境变量
There are a number of environment variables that can be used to control the
behavior of mpv.
有多个环境变量可以用来控制 mpv 的行为。
- HOME, XDG_CONFIG_HOME
Used to determine mpv config directory. If XDG_CONFIG_HOME is not set, $HOME/.config/mpv is used.
用于确定 mpv 配置目录。如果 XDG_CONFIG_HOME 未设置,则使用 $HOME/.config/mpv 。$HOME/.mpv is always added to the list of config search paths with a lower priority.
$HOME/.mpv 总是添加到配置搜索路径列表中,优先级较低。- MPV_HOME
- Directory where mpv looks for user settings. Overrides HOME, and mpv
will try to load the config file as $MPV_HOME/mpv.conf.
mpv 查找用户设置的目录。覆盖 HOME ,并且 mpv 将尝试加载配置文件为 $MPV_HOME/mpv.conf 。 - MPV_VERBOSE (see also -v and --msg-level)
MPV_VERBOSE (另见 -v 和 --msg-level ) - Set the initial verbosity level across all message modules (default: 0).
This is an integer, and the resulting verbosity corresponds to the number
of --v options passed to the command line.
设置所有消息模块的初始详细程度(默认:0)。这是一个整数,最终的详细程度对应于传递给命令行的 --v 选项的数量。 - MPV_LEAK_REPORT
- If set to 1, enable internal talloc leak reporting. If set to another
value, disable leak reporting.
如果设置为 1 ,则启用内部 talloc 泄露报告。如果设置为其他值,则禁用泄露报告。 - LADSPA_PATH
- Specifies the search path for LADSPA plugins. If it is unset, fully
qualified path names must be used.
指定 LADSPA 插件的搜索路径。如果未设置,必须使用完全限定的路径名。 - DISPLAY
- Standard X11 display name to use.
使用标准 X11 显示名称。 - FFmpeg: FFmpeg:
This library accesses various environment variables. However, they are not centrally documented, and documenting them is not our job. Therefore, this list is incomplete.
此库访问各种环境变量。然而,它们没有集中记录,记录它们不是我们的工作。因此,此列表不完整。Notable environment variables:
显著的变量:- libdvdcss:
- DVDCSS_CACHE
- Specify a directory in which to store title key values. This will
speed up descrambling of DVDs which are in the cache. The
DVDCSS_CACHE directory is created if it does not exist, and a
subdirectory is created named after the DVD's title or manufacturing
date. If DVDCSS_CACHE is not set or is empty, libdvdcss will use
the default value which is ${HOME}/.dvdcss/ under Unix and
the roaming application data directory (%APPDATA%) under
Windows. The special value "off" disables caching.
"指定一个目录以存储标题密钥值。这将加快缓存中 DVD 的解密速度。如果不存在,将创建名为 DVDCSS_CACHE 的目录,并创建一个以 DVD 的标题或制造日期命名的子目录。如果 DVDCSS_CACHE 未设置或为空,libdvdcss 将使用默认值,在 Unix 下为 ${HOME}/.dvdcss/ ,在 Windows 下为漫游应用程序数据目录( %APPDATA% )。特殊值"off"将禁用缓存。 - DVDCSS_METHOD
Sets the authentication and decryption method that libdvdcss will use to read scrambled discs. Can be one of title, key or disc.
设置 libdvdcss 读取加密光盘时使用的身份验证和解密方法。可以是 title 、 key 或 disc 之一。- key
- is the default method. libdvdcss will use a set of calculated
player keys to try to get the disc key. This can fail if the drive
does not recognize any of the player keys.
是默认方法。libdvdcss 将使用一组计算出的播放器密钥来尝试获取光盘密钥。如果驱动器无法识别任何播放器密钥,则可能会失败。 - disc
- is a fallback method when key has failed. Instead of using player
keys, libdvdcss will crack the disc key using a brute force
algorithm. This process is CPU intensive and requires 64 MB of
memory to store temporary data.
是当密钥失败时的回退方法。而不是使用播放器密钥,libdvdcss 将使用暴力破解算法破解光盘密钥。这个过程非常占用 CPU 资源,并且需要 64 MB 的内存来存储临时数据。 - title 标题
- is the fallback when all other methods have failed. It does not
rely on a key exchange with the DVD drive, but rather uses a crypto
attack to guess the title key. On rare cases this may fail because
there is not enough encrypted data on the disc to perform a
statistical attack, but on the other hand it is the only way to
decrypt a DVD stored on a hard disc, or a DVD with the wrong region
on an RPC2 drive.
是当所有其他方法都失败时的后备方案。它不依赖于与 DVD 驱动器的密钥交换,而是使用加密攻击来猜测标题密钥。在罕见的情况下可能会失败,因为光盘上没有足够的加密数据来进行统计分析攻击,但另一方面,这是唯一解密硬盘上存储的 DVD 或 RPC2 驱动器上区域错误的 DVD 的方法。
- DVDCSS_RAW_DEVICE
- Specify the raw device to use. Exact usage will depend on your
operating system, the Linux utility to set up raw devices is raw(8)
for instance. Please note that on most operating systems, using a raw
device requires highly aligned buffers: Linux requires a 2048 bytes
alignment (which is the size of a DVD sector).
指定要使用的原始设备。具体用法将取决于您的操作系统,例如,Linux 中设置原始设备的实用程序是 raw(8)。请注意,在大多数操作系统中,使用原始设备需要高度对齐的缓冲区:Linux 需要 2048 字节的对齐(这是 DVD 扇区的大小)。 - DVDCSS_VERBOSE
Sets the libdvdcss verbosity level.
设置 libdvdcss 的详细程度级别。0: Outputs no messages at all.
完全不输出消息。1: Outputs error messages to stderr.
输出错误信息到 stderr。2: Outputs error messages and debug messages to stderr.
输出错误信息和调试信息到 stderr。- DVDREAD_NOKEYS
- Skip retrieving all keys on startup. Currently disabled.
启动时跳过检索所有键。目前已禁用。 - HOME
- FIXME: Document this. FIXME:记录此内容。
EXIT CODES 退出码
Normally mpv returns 0 as exit code after finishing playback successfully.
If errors happen, the following exit codes can be returned:
通常情况下,mpv 在成功完成播放后返回 0 作为退出代码。如果发生错误,可以返回以下退出代码:
1: Error initializing mpv. This is also returned if unknown options are passed to mpv.
初始化 mpv 时出错。如果向 mpv 传递了未知选项,也会返回此错误。2: The file passed to mpv couldn't be played. This is somewhat fuzzy: currently, playback of a file is considered to be successful if initialization was mostly successful, even if playback fails immediately after initialization.
传递给 mpv 的文件无法播放。这有点模糊:目前,如果初始化基本成功,则认为播放文件成功,即使播放在初始化后立即失败。3: There were some files that could be played, and some files which couldn't (using the definition of success from above).
有一些文件可以播放,而有些文件则不能(使用上述定义的成功标准)。4: Quit due to a signal, Ctrl+c in a VO window (by default), or from the default quit key bindings in encoding mode.
由于信号退出,在 VO 窗口中按 Ctrl+c(默认操作),或在编码模式中的默认退出键绑定中退出。
Note that quitting the player manually will always lead to exit code 0,
overriding the exit code that would be returned normally. Also, the quit
input command can take an exit code: in this case, that exit code is returned.
请注意,手动退出播放器将始终导致退出代码 0,覆盖正常情况下会返回的退出代码。此外, quit 输入命令可以接受一个退出代码:在这种情况下,返回该退出代码。
OPTICAL DRIVES 光驱
Depending on the OS, mpv will choose a different disc device by default.
This applies for all optical disc playback (CDDA, DVD, and BD).
根据操作系统,mpv 默认会选择不同的光盘设备。这适用于所有光盘播放(CDDA、DVD 和 BD)。
OS | Default Drive 默认驱动器 |
---|---|
Linux | /dev/sr0 |
Windows | D: |
macOS | /dev/disk1 |
FreeBSD | /dev/cd0 |
OpenBSD | /dev/rcd0c |
FILES 文件
Note that this section assumes Linux/BSD. On other platforms the paths may be different.
For Windows-specifics, see FILES ON WINDOWS section.
请注意,本节假定使用 Linux/BSD。在其他平台上,路径可能不同。有关 Windows 特定信息,请参阅“Windows 上的文件”部分。
All configuration files should be encoded in UTF-8.
所有配置文件应使用 UTF-8 编码。
- /usr/local/etc/mpv/mpv.conf
- mpv system-wide settings (depends on --prefix passed to configure - mpv
in default configuration will use /usr/local/etc/mpv/ as config
directory, while most Linux distributions will set it to /etc/mpv/).
mpv 系统级设置(取决于传递给 configure 的 --prefix ,默认配置下的 mpv 将使用 /usr/local/etc/mpv/ 作为配置目录,而大多数 Linux 发行版将设置为 /etc/mpv/ )。 - ~/.cache/mpv
The standard cache directory. Certain options within mpv may cause it to write cache files to disk. This can be overridden by environment variables, in ascending order:
标准缓存目录。mpv 中的某些选项可能会导致它将缓存文件写入磁盘。这可以通过环境变量覆盖,顺序如下:1: If $XDG_CACHE_HOME is set, then the derived cache directory will be $XDG_CACHE_HOME/mpv.
如果设置了 $XDG_CACHE_HOME ,则派生的缓存目录将为 $XDG_CACHE_HOME/mpv 。2: If $MPV_HOME is set, then the derived cache directory will be $MPV_HOME.
如果设置了 $MPV_HOME ,则派生的缓存目录将为 $MPV_HOME 。If the directory does not exist, mpv will try to create it automatically.
如果目录不存在,mpv 将尝试自动创建它。- ~/.config/mpv
The standard configuration directory. This can be overridden by environment variables, in ascending order:
标准配置目录。这可以通过环境变量覆盖,按顺序:1: If $XDG_CONFIG_HOME is set, then the derived configuration directory will be $XDG_CONFIG_HOME/mpv.
如果设置了 $XDG_CONFIG_HOME ,则派生配置目录将是 $XDG_CONFIG_HOME/mpv 。2: If $MPV_HOME is set, then the derived configuration directory will be $MPV_HOME.
如果设置了 $MPV_HOME ,则派生配置目录将是 $MPV_HOME 。If this directory, nor the original configuration directory (see below) do not exist, mpv tries to create this directory automatically.
如果此目录或原始配置目录(见下文)不存在,mpv 将尝试自动创建此目录。- ~/.mpv/
The original (pre 0.5.0) configuration directory. It will continue to be read if present. If this directory is present and the standard configuration directory is not present, then cache files and watch later config files will also be written to this directory.
原始(0.5.0 之前)配置目录。如果存在,将继续读取。如果此目录存在而标准配置目录不存在,则缓存文件和稍后配置文件也将写入此目录。If both this directory and the standard configuration directory are present, configuration will be read from both with the standard configuration directory content taking precedence. However, you should fully migrate to the standard directory and a warning will be shown in this situation.
如果此目录和标准配置目录都存在,配置将从两者中读取,标准配置目录的内容将优先。然而,您应完全迁移到标准目录,并且在这种情况下将显示警告。- ~/.config/mpv/mpv.conf
- mpv user settings (see CONFIGURATION FILES section)
mpv 用户设置(参见配置文件部分) - ~/.config/mpv/input.conf
- key bindings (see INPUT.CONF section)
键绑定(参见 INPUT.CONF 部分) - ~/.config/mpv/fonts.conf
Fontconfig fonts.conf that is customized for mpv. You should include system fonts.conf in this file or mpv would not know about fonts that you already have in the system.
为 mpv 定制的 Fontconfig fonts.conf 文件。您应该将系统 fonts.conf 文件包含在此文件中,否则 mpv 将不知道您已经在系统中安装的字体。Only available when libass is built with fontconfig.
仅在 libass 使用 fontconfig 构建时可用。- ~/.config/mpv/subfont.ttf
- fallback subtitle font 备用副标题字体
- ~/.config/mpv/fonts/
- Default location for --sub-fonts-dir (see Subtitles) and
--osd-fonts-dir (see OSD).
默认位置为 --sub-fonts-dir (见字幕)和 --osd-fonts-dir (见 OSD)。 - ~/.config/mpv/scripts/
All files in this directory are loaded as if they were passed to the --script option. They are loaded in alphabetical order.
此目录中的所有文件都按如果传递给 --script 选项的方式加载。它们按字母顺序加载。The --load-scripts=no option disables loading these files.
See Script location for details.
- ~/.local/state/mpv/watch_later/
Contains temporary config files needed for resuming playback of files with the watch later feature. See for example the Q key binding, or the quit-watch-later input command.
This can be overridden by environment variables, in ascending order:
1: If $XDG_STATE_HOME is set, then the derived watch later directory will be $XDG_STATE_HOME/mpv/watch_later.
如果 $XDG_STATE_HOME 已设置,则派生的稍后观看目录将是 $XDG_STATE_HOME/mpv/watch_later 。2: If $MPV_HOME is set, then the derived watch later directory will be $MPV_HOME/watch_later.
如果 $MPV_HOME 已设置,则派生的稍后观看目录将是 $MPV_HOME/watch_later 。Each file is a small config file which is loaded if the corresponding media file is loaded. It contains the playback position and some (not necessarily all) settings that were changed during playback. The filenames are hashed from the full paths of the media files. It's in general not possible to extract the media filename from this hash. However, you can set the --write-filename-in-watch-later-config option, and the player will add the media filename to the contents of the resume config file.
每个文件都是一个小的配置文件,如果加载了相应的媒体文件,则会加载。它包含播放位置以及播放过程中更改的一些(不一定全部)设置。文件名是从媒体文件的完整路径中哈希得到的。通常情况下,无法从该哈希中提取媒体文件名。但是,您可以设置 --write-filename-in-watch-later-config 选项,播放器将添加媒体文件名到恢复配置文件的内容中。- ~/.config/mpv/script-opts/osc.conf
This is loaded by the OSC script. See the ON SCREEN CONTROLLER docs for details.
此由 OSC 脚本加载。有关详细信息,请参阅屏幕控制器文档。Other files in this directory are specific to the corresponding scripts as well, and the mpv core doesn't touch them.
本目录中的其他文件也针对相应的脚本,而 mpv 核心不会修改它们。
FILES ON WINDOWS Windows 上的文件
On win32 (if compiled with MinGW, but not Cygwin), the default config file
locations are different. They are generally located under %APPDATA%/mpv/.
For example, the path to mpv.conf is %APPDATA%/mpv/mpv.conf, which maps to
a system and user-specific path, for example
在 win32(如果使用 MinGW 编译,但不是 Cygwin)上,默认配置文件的位置不同。它们通常位于 %APPDATA%/mpv/ 下。例如,mpv.conf 的路径是 %APPDATA%/mpv/mpv.conf ,它映射到系统和用户特定的路径,例如
C:\users\USERNAME\AppData\Roaming\mpv\mpv.conf
You can find the exact path by running echo %APPDATA%\mpv\mpv.conf in cmd.exe.
您可以通过在 cmd.exe 中运行 echo %APPDATA%\mpv\mpv.conf 来找到确切路径。
Other config files (such as input.conf) are in the same directory. See the
FILES section above.
其他配置文件(例如 input.conf )位于同一目录下。请参阅上面的 FILE 部分。
The cache directory is located at %LOCALAPPDATA%/mpv/cache.
缓存目录位于 %LOCALAPPDATA%/mpv/cache 。
The watch_later directory is located at %LOCALAPPDATA%/mpv/watch_later.
watch_later 目录位于 %LOCALAPPDATA%/mpv/watch_later 。
The environment variable $MPV_HOME completely overrides these, like on
UNIX.
环境变量 $MPV_HOME 完全覆盖了这些,就像在 UNIX 上一样。
If a directory named portable_config next to the mpv.exe exists, all
config will be loaded from this directory only. Watch later config files and
cache files are written to this directory as well. (This exists on Windows
only and is redundant with $MPV_HOME. However, since Windows is very
scripting unfriendly, a wrapper script just setting $MPV_HOME, like you
could do it on other systems, won't work. portable_config is provided for
convenience to get around this restriction.)
如果 mpv.exe 旁边存在名为 portable_config 的目录,所有配置将仅从此目录加载。watch_later 配置文件和缓存文件也将写入此目录。(这仅在 Windows 上存在,并且与 $MPV_HOME 重复。然而,由于 Windows 对脚本非常不友好,设置 $MPV_HOME 的包装脚本,就像在其他系统上那样,将不起作用。 portable_config 提供以方便绕过此限制。)
Config files located in the same directory as mpv.exe are loaded with
lower priority. Some config files are loaded only once, which means that
e.g. of 2 input.conf files located in two config directories, only the
one from the directory with higher priority will be loaded.
配置文件位于与 mpv.exe 相同目录中,优先级较低。一些配置文件只加载一次,这意味着例如位于两个配置目录中的 2 input.conf 文件,只有来自优先级较高的目录的那个会被加载。
A third config directory with the lowest priority is the directory named mpv
in the same directory as mpv.exe. This used to be the directory with the
highest priority, but is now discouraged to use and might be removed in the
future.
优先级最低的第三个配置目录是与 mpv.exe 相同目录下的名为 mpv 的目录。这曾经是优先级最高的目录,但现在不建议使用,未来可能会被移除。
Note that mpv likes to mix / and \ path separators for simplicity.
kernel32.dll accepts this, but cmd.exe does not.
请注意,mpv 喜欢为了简单起见混合使用 / 和 \ 路径分隔符。kernel32.dll 可以接受这一点,但 cmd.exe 不行。
FILES ON MACOS MACOS 上的文件
On macOS the watch later directory is located at ~/.config/mpv/watch_later/
and the cache directory is set to ~/Library/Caches/io.mpv/. These directories
can't be overwritten by environment variables.
Everything else is the same as FILES.
在 macOS 上,稍后观看目录位于 ~/.config/mpv/watch_later/ ,缓存目录设置为 ~/Library/Caches/io.mpv/ 。这些目录不能被环境变量覆盖。其他一切与 FILE 相同。