logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

mpv.1 (641728B)


  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH MPV 1 "" "" "multimedia"
  4. .SH NAME
  5. mpv \- a media player
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH SYNOPSIS
  34. .nf
  35. \fBmpv\fP [options] [file|URL|PLAYLIST|\-]
  36. \fBmpv\fP [options] files
  37. .fi
  38. .sp
  39. .SH DESCRIPTION
  40. .sp
  41. \fBmpv\fP is a media player based on MPlayer and mplayer2. It supports a wide variety of video
  42. file formats, audio and video codecs, and subtitle types. Special input URL
  43. types are available to read input from a variety of sources other than disk
  44. files. Depending on platform, a variety of different video and audio output
  45. methods are supported.
  46. .sp
  47. Usage examples to get you started quickly can be found at the end of this man
  48. page.
  49. .SH INTERACTIVE CONTROL
  50. .sp
  51. mpv has a fully configurable, command\-driven control layer which allows you
  52. to control mpv using keyboard, mouse, or remote control (there is no
  53. LIRC support \- configure remotes as input devices instead).
  54. .sp
  55. See the \fB\-\-input\-\fP options for ways to customize it.
  56. .sp
  57. The following listings are not necessarily complete. See \fBetc/input.conf\fP for
  58. a list of default bindings. User \fBinput.conf\fP files and Lua scripts can
  59. define additional key bindings.
  60. .SS Keyboard Control
  61. .INDENT 0.0
  62. .TP
  63. .B LEFT and RIGHT
  64. Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek
  65. (see \fB\-\-hr\-seek\fP).
  66. .TP
  67. .B UP and DOWN
  68. Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see
  69. \fB\-\-hr\-seek\fP).
  70. .TP
  71. .B Ctrl+LEFT and Ctrl+RIGHT
  72. Seek to the previous/next subtitle. Subject to some restrictions and
  73. might not always work; see \fBsub\-seek\fP command.
  74. .TP
  75. .B Ctrl+Shift+Left and Ctrl+Shift+Right
  76. Adjust subtitle delay so that the next or previous subtitle is displayed
  77. now. This is especially useful to sync subtitles to audio.
  78. .TP
  79. .B [ and ]
  80. Decrease/increase current playback speed by 10%.
  81. .TP
  82. .B { and }
  83. Halve/double current playback speed.
  84. .TP
  85. .B BACKSPACE
  86. Reset playback speed to normal.
  87. .TP
  88. .B Shift+BACKSPACE
  89. Undo the last seek. This works only if the playlist entry was not changed.
  90. Hitting it a second time will go back to the original position.
  91. See \fBrevert\-seek\fP command for details.
  92. .TP
  93. .B Shift+Ctrl+BACKSPACE
  94. Mark the current position. This will then be used by \fBShift+BACKSPACE\fP
  95. as revert position (once you seek back, the marker will be reset). You can
  96. use this to seek around in the file and then return to the exact position
  97. where you left off.
  98. .TP
  99. .B < and >
  100. Go backward/forward in the playlist.
  101. .TP
  102. .B ENTER
  103. Go forward in the playlist.
  104. .TP
  105. .B p / SPACE
  106. Pause (pressing again unpauses).
  107. .TP
  108. .B \&.
  109. Step forward. Pressing once will pause, every consecutive press will
  110. play one frame and then go into pause mode again.
  111. .UNINDENT
  112. .INDENT 0.0
  113. .TP
  114. .B ,
  115. Step backward. Pressing once will pause, every consecutive press will
  116. play one frame in reverse and then go into pause mode again.
  117. .TP
  118. .B q
  119. Stop playing and quit.
  120. .TP
  121. .B Q
  122. Like \fBq\fP, but store the current playback position. Playing the same file
  123. later will resume at the old playback position if possible.
  124. .TP
  125. .B / and *
  126. Decrease/increase volume.
  127. .TP
  128. .B 9 and 0
  129. Decrease/increase volume.
  130. .TP
  131. .B m
  132. Mute sound.
  133. .TP
  134. .B _
  135. Cycle through the available video tracks.
  136. .TP
  137. .B #
  138. Cycle through the available audio tracks.
  139. .TP
  140. .B f
  141. Toggle fullscreen (see also \fB\-\-fs\fP).
  142. .TP
  143. .B ESC
  144. Exit fullscreen mode.
  145. .TP
  146. .B T
  147. Toggle stay\-on\-top (see also \fB\-\-ontop\fP).
  148. .TP
  149. .B w and W
  150. Decrease/increase pan\-and\-scan range. The \fBe\fP key does the same as
  151. \fBW\fP currently, but use is discouraged.
  152. .TP
  153. .B o (also P)
  154. Show progression bar, elapsed time and total duration on the OSD.
  155. .TP
  156. .B O
  157. Toggle OSD states between normal and playback time/duration.
  158. .TP
  159. .B v
  160. Toggle subtitle visibility.
  161. .TP
  162. .B j and J
  163. Cycle through the available subtitles.
  164. .TP
  165. .B z and Z
  166. Adjust subtitle delay by +/\- 0.1 seconds. The \fBx\fP key does the same as
  167. \fBZ\fP currently, but use is discouraged.
  168. .TP
  169. .B l
  170. Set/clear A\-B loop points. See \fBab\-loop\fP command for details.
  171. .TP
  172. .B L
  173. Toggle infinite looping.
  174. .TP
  175. .B Ctrl + and Ctrl \-
  176. Adjust audio delay (A/V sync) by +/\- 0.1 seconds.
  177. .TP
  178. .B u
  179. Switch between applying no style overrides to SSA/ASS subtitles, and
  180. overriding them almost completely with the normal subtitle style. See
  181. \fB\-\-sub\-ass\-override\fP for more info.
  182. .TP
  183. .B V
  184. Toggle subtitle VSFilter aspect compatibility mode. See
  185. \fB\-\-sub\-ass\-vsfilter\-aspect\-compat\fP for more info.
  186. .TP
  187. .B r and R
  188. Move subtitles up/down. The \fBt\fP key does the same as \fBR\fP currently, but
  189. use is discouraged.
  190. .TP
  191. .B s
  192. Take a screenshot.
  193. .TP
  194. .B S
  195. Take a screenshot, without subtitles. (Whether this works depends on VO
  196. driver support.)
  197. .TP
  198. .B Ctrl s
  199. Take a screenshot, as the window shows it (with subtitles, OSD, and scaled
  200. video).
  201. .TP
  202. .B PGUP and PGDWN
  203. Seek to the beginning of the previous/next chapter. In most cases,
  204. "previous" will actually go to the beginning of the current chapter; see
  205. \fB\-\-chapter\-seek\-threshold\fP\&.
  206. .TP
  207. .B Shift+PGUP and Shift+PGDWN
  208. Seek backward or forward by 10 minutes. (This used to be mapped to
  209. PGUP/PGDWN without Shift.)
  210. .TP
  211. .B d
  212. Activate/deactivate deinterlacer.
  213. .TP
  214. .B A
  215. Cycle aspect ratio override.
  216. .TP
  217. .B Ctrl h
  218. Toggle hardware video decoding on/off.
  219. .TP
  220. .B Alt+LEFT, Alt+RIGHT, Alt+UP, Alt+DOWN
  221. Move the video rectangle (panning).
  222. .TP
  223. .B Alt + and Alt \-
  224. Combining \fBAlt\fP with the \fB+\fP or \fB\-\fP keys changes video zoom.
  225. .TP
  226. .B Alt+BACKSPACE
  227. Reset the pan/zoom settings.
  228. .TP
  229. .B F8
  230. Show the playlist and the current position in it (useful only if a UI window
  231. is used, broken on the terminal).
  232. .TP
  233. .B F9
  234. Show the list of audio and subtitle streams (useful only if a UI window is
  235. used, broken on the terminal).
  236. .TP
  237. .B i and I
  238. Show/toggle an overlay displaying statistics about the currently playing
  239. file such as codec, framerate, number of dropped frames and so on. See
  240. \fI\%STATS\fP for more information.
  241. .TP
  242. .B del
  243. Cycles visibility between never / auto (mouse\-move) / always
  244. .TP
  245. .B \(ga
  246. Show the console. (ESC closes it again. See \fI\%CONSOLE\fP\&.)
  247. .UNINDENT
  248. .sp
  249. (The following keys are valid only when using a video output that supports the
  250. corresponding adjustment.)
  251. .INDENT 0.0
  252. .TP
  253. .B 1 and 2
  254. Adjust contrast.
  255. .TP
  256. .B 3 and 4
  257. Adjust brightness.
  258. .TP
  259. .B 5 and 6
  260. Adjust gamma.
  261. .TP
  262. .B 7 and 8
  263. Adjust saturation.
  264. .TP
  265. .B Alt+0 (and command+0 on OSX)
  266. Resize video window to half its original size.
  267. .TP
  268. .B Alt+1 (and command+1 on OSX)
  269. Resize video window to its original size.
  270. .TP
  271. .B Alt+2 (and command+2 on OSX)
  272. Resize video window to double its original size.
  273. .TP
  274. .B command + f (OSX only)
  275. Toggle fullscreen (see also \fB\-\-fs\fP).
  276. .UNINDENT
  277. .sp
  278. (The following keys are valid if you have a keyboard with multimedia keys.)
  279. .INDENT 0.0
  280. .TP
  281. .B PAUSE
  282. Pause.
  283. .TP
  284. .B STOP
  285. Stop playing and quit.
  286. .TP
  287. .B PREVIOUS and NEXT
  288. Seek backward/forward 1 minute.
  289. .UNINDENT
  290. .sp
  291. If you miss some older key bindings, look at \fBetc/restore\-old\-bindings.conf\fP
  292. in the mpv git repository.
  293. .SS Mouse Control
  294. .INDENT 0.0
  295. .TP
  296. .B Left double click
  297. Toggle fullscreen on/off.
  298. .TP
  299. .B Right click
  300. Toggle pause on/off.
  301. .TP
  302. .B Forward/Back button
  303. Skip to next/previous entry in playlist.
  304. .TP
  305. .B Wheel up/down
  306. Seek forward/backward 10 seconds.
  307. .TP
  308. .B Wheel left/right
  309. Decrease/increase volume.
  310. .UNINDENT
  311. .SH USAGE
  312. .sp
  313. Command line arguments starting with \fB\-\fP are interpreted as options,
  314. everything else as filenames or URLs. All options except \fIflag\fP options (or
  315. choice options which include \fByes\fP) require a parameter in the form
  316. \fB\-\-option=value\fP\&.
  317. .sp
  318. One exception is the lone \fB\-\fP (without anything else), which means media data
  319. will be read from stdin. Also, \fB\-\-\fP (without anything else) will make the
  320. player interpret all following arguments as filenames, even if they start with
  321. \fB\-\fP\&. (To play a file named \fB\-\fP, you need to use \fB\&./\-\fP\&.)
  322. .sp
  323. Every \fIflag\fP option has a \fIno\-flag\fP counterpart, e.g. the opposite of the
  324. \fB\-\-fs\fP option is \fB\-\-no\-fs\fP\&. \fB\-\-fs=yes\fP is same as \fB\-\-fs\fP, \fB\-\-fs=no\fP
  325. is the same as \fB\-\-no\-fs\fP\&.
  326. .sp
  327. If an option is marked as \fI(XXX only)\fP, it will only work in combination with
  328. the \fIXXX\fP option or if \fIXXX\fP is compiled in.
  329. .SS Legacy option syntax
  330. .sp
  331. The \fB\-\-option=value\fP syntax is not strictly enforced, and the alternative
  332. legacy syntax \fB\-option value\fP and \fB\-option=value\fP will also work. This is
  333. mostly for compatibility with MPlayer. Using these should be avoided. Their
  334. semantics can change any time in the future.
  335. .sp
  336. For example, the alternative syntax will consider an argument following the
  337. option a filename. \fBmpv \-fs no\fP will attempt to play a file named \fBno\fP,
  338. because \fB\-\-fs\fP is a flag option that requires no parameter. If an option
  339. changes and its parameter becomes optional, then a command line using the
  340. alternative syntax will break.
  341. .sp
  342. Until mpv 0.31.0, there was no difference whether an option started with \fB\-\-\fP
  343. or a single \fB\-\fP\&. Newer mpv releases strictly expect that you pass the option
  344. value after a \fB=\fP\&. For example, before \fBmpv \-\-log\-file f.txt\fP would write
  345. a log to \fBf.txt\fP, but now this command line fails, as \fB\-\-log\-file\fP expects
  346. an option value, and \fBf.txt\fP is simply considered a normal file to be played
  347. (as in \fBmpv f.txt\fP).
  348. .sp
  349. The future plan is that \fB\-option value\fP will not work anymore, and options
  350. with a single \fB\-\fP behave the same as \fB\-\-\fP options.
  351. .SS Escaping spaces and other special characters
  352. .sp
  353. Keep in mind that the shell will partially parse and mangle the arguments you
  354. pass to mpv. For example, you might need to quote or escape options and
  355. filenames:
  356. .INDENT 0.0
  357. .INDENT 3.5
  358. \fBmpv "filename with spaces.mkv" \-\-title="window title"\fP
  359. .UNINDENT
  360. .UNINDENT
  361. .sp
  362. It gets more complicated if the suboption parser is involved. The suboption
  363. parser puts several options into a single string, and passes them to a
  364. component at once, instead of using multiple options on the level of the
  365. command line.
  366. .sp
  367. The suboption parser can quote strings with \fB"\fP and \fB[...]\fP\&.
  368. Additionally, there is a special form of quoting with \fB%n%\fP described below.
  369. .sp
  370. For example, assume the hypothetical \fBfoo\fP filter can take multiple options:
  371. .INDENT 0.0
  372. .INDENT 3.5
  373. \fBmpv test.mkv \-\-vf=foo:option1=value1:option2:option3=value3,bar\fP
  374. .UNINDENT
  375. .UNINDENT
  376. .sp
  377. This passes \fBoption1\fP and \fBoption3\fP to the \fBfoo\fP filter, with \fBoption2\fP
  378. as flag (implicitly \fBoption2=yes\fP), and adds a \fBbar\fP filter after that. If
  379. an option contains spaces or characters like \fB,\fP or \fB:\fP, you need to quote
  380. them:
  381. .INDENT 0.0
  382. .INDENT 3.5
  383. \fBmpv \(aq\-\-vf=foo:option1="option value with spaces",bar\(aq\fP
  384. .UNINDENT
  385. .UNINDENT
  386. .sp
  387. Shells may actually strip some quotes from the string passed to the commandline,
  388. so the example quotes the string twice, ensuring that mpv receives the \fB"\fP
  389. quotes.
  390. .sp
  391. The \fB[...]\fP form of quotes wraps everything between \fB[\fP and \fB]\fP\&. It\(aqs
  392. useful with shells that don\(aqt interpret these characters in the middle of
  393. an argument (like bash). These quotes are balanced (since mpv 0.9.0): the \fB[\fP
  394. and \fB]\fP nest, and the quote terminates on the last \fB]\fP that has no matching
  395. \fB[\fP within the string. (For example, \fB[a[b]c]\fP results in \fBa[b]c\fP\&.)
  396. .sp
  397. The fixed\-length quoting syntax is intended for use with external
  398. scripts and programs.
  399. .sp
  400. It is started with \fB%\fP and has the following format:
  401. .INDENT 0.0
  402. .INDENT 3.5
  403. .sp
  404. .nf
  405. .ft C
  406. %n%string_of_length_n
  407. .ft P
  408. .fi
  409. .UNINDENT
  410. .UNINDENT
  411. .INDENT 0.0
  412. .INDENT 3.5
  413. .IP "Examples"
  414. .sp
  415. \fBmpv \(aq\-\-vf=foo:option1=%11%quoted text\(aq test.avi\fP
  416. .sp
  417. Or in a script:
  418. .sp
  419. \fBmpv \-\-vf=foo:option1=%\(gaexpr length "$NAME"\(ga%"$NAME" test.avi\fP
  420. .UNINDENT
  421. .UNINDENT
  422. .sp
  423. Suboptions passed to the client API are also subject to escaping. Using
  424. \fBmpv_set_option_string()\fP is exactly like passing \fB\-\-name=data\fP to the
  425. command line (but without shell processing of the string). Some options
  426. support passing values in a more structured way instead of flat strings, and
  427. can avoid the suboption parsing mess. For example, \fB\-\-vf\fP supports
  428. \fBMPV_FORMAT_NODE\fP, which lets you pass suboptions as a nested data structure
  429. of maps and arrays.
  430. .SS Paths
  431. .sp
  432. Some care must be taken when passing arbitrary paths and filenames to mpv. For
  433. example, paths starting with \fB\-\fP will be interpreted as options. Likewise,
  434. if a path contains the sequence \fB://\fP, the string before that might be
  435. interpreted as protocol prefix, even though \fB://\fP can be part of a legal
  436. UNIX path. To avoid problems with arbitrary paths, you should be sure that
  437. absolute paths passed to mpv start with \fB/\fP, and prefix relative paths with
  438. \fB\&./\fP\&.
  439. .sp
  440. Using the \fBfile://\fP pseudo\-protocol is discouraged, because it involves
  441. strange URL unescaping rules.
  442. .sp
  443. The name \fB\-\fP itself is interpreted as stdin, and will cause mpv to disable
  444. console controls. (Which makes it suitable for playing data piped to stdin.)
  445. .sp
  446. The special argument \fB\-\-\fP can be used to stop mpv from interpreting the
  447. following arguments as options.
  448. .sp
  449. When using the client API, you should strictly avoid using \fBmpv_command_string\fP
  450. for invoking the \fBloadfile\fP command, and instead prefer e.g. \fBmpv_command\fP
  451. to avoid the need for filename escaping.
  452. .sp
  453. For paths passed to suboptions, the situation is further complicated by the
  454. need to escape special characters. To work this around, the path can be
  455. additionally wrapped in the fixed\-length syntax, e.g. \fB%n%string_of_length_n\fP
  456. (see above).
  457. .sp
  458. Some mpv options interpret paths starting with \fB~\fP\&. Currently, the prefix
  459. \fB~~/\fP expands to the mpv configuration directory (usually \fB~/.config/mpv/\fP).
  460. \fB~/\fP expands to the user\(aqs home directory. (The trailing \fB/\fP is always
  461. required.) There are the following paths as well:
  462. .TS
  463. center;
  464. |l|l|.
  465. _
  466. T{
  467. Name
  468. T} T{
  469. Meaning
  470. T}
  471. _
  472. T{
  473. \fB~~home/\fP
  474. T} T{
  475. same as \fB~~/\fP
  476. T}
  477. _
  478. T{
  479. \fB~~global/\fP
  480. T} T{
  481. the global config path, if available (not on win32)
  482. T}
  483. _
  484. T{
  485. \fB~~osxbundle/\fP
  486. T} T{
  487. the OSX bundle resource path (OSX only)
  488. T}
  489. _
  490. T{
  491. \fB~~desktop/\fP
  492. T} T{
  493. the path to the desktop (win32, OSX)
  494. T}
  495. _
  496. .TE
  497. .SS Per\-File Options
  498. .sp
  499. When playing multiple files, any option given on the command line usually
  500. affects all files. Example:
  501. .INDENT 0.0
  502. .INDENT 3.5
  503. .sp
  504. .nf
  505. .ft C
  506. mpv \-\-a file1.mkv \-\-b file2.mkv \-\-c
  507. .ft P
  508. .fi
  509. .UNINDENT
  510. .UNINDENT
  511. .TS
  512. center;
  513. |l|l|.
  514. _
  515. T{
  516. File
  517. T} T{
  518. Active options
  519. T}
  520. _
  521. T{
  522. file1.mkv
  523. T} T{
  524. \fB\-\-a \-\-b \-\-c\fP
  525. T}
  526. _
  527. T{
  528. file2.mkv
  529. T} T{
  530. \fB\-\-a \-\-b \-\-c\fP
  531. T}
  532. _
  533. .TE
  534. .sp
  535. (This is different from MPlayer and mplayer2.)
  536. .sp
  537. Also, if any option is changed at runtime (via input commands), they are not
  538. reset when a new file is played.
  539. .sp
  540. Sometimes, it is useful to change options per\-file. This can be achieved by
  541. adding the special per\-file markers \fB\-\-{\fP and \fB\-\-}\fP\&. (Note that you must
  542. escape these on some shells.) Example:
  543. .INDENT 0.0
  544. .INDENT 3.5
  545. .sp
  546. .nf
  547. .ft C
  548. mpv \-\-a file1.mkv \-\-b \-\-\e{ \-\-c file2.mkv \-\-d file3.mkv \-\-e \-\-\e} file4.mkv \-\-f
  549. .ft P
  550. .fi
  551. .UNINDENT
  552. .UNINDENT
  553. .TS
  554. center;
  555. |l|l|.
  556. _
  557. T{
  558. File
  559. T} T{
  560. Active options
  561. T}
  562. _
  563. T{
  564. file1.mkv
  565. T} T{
  566. \fB\-\-a \-\-b \-\-f\fP
  567. T}
  568. _
  569. T{
  570. file2.mkv
  571. T} T{
  572. \fB\-\-a \-\-b \-\-f \-\-c \-\-d \-\-e\fP
  573. T}
  574. _
  575. T{
  576. file3.mkv
  577. T} T{
  578. \fB\-\-a \-\-b \-\-f \-\-c \-\-d \-\-e\fP
  579. T}
  580. _
  581. T{
  582. file4.mkv
  583. T} T{
  584. \fB\-\-a \-\-b \-\-f\fP
  585. T}
  586. _
  587. .TE
  588. .sp
  589. Additionally, any file\-local option changed at runtime is reset when the current
  590. file stops playing. If option \fB\-\-c\fP is changed during playback of
  591. \fBfile2.mkv\fP, it is reset when advancing to \fBfile3.mkv\fP\&. This only affects
  592. file\-local options. The option \fB\-\-a\fP is never reset here.
  593. .SS List Options
  594. .sp
  595. Some options which store lists of option values can have action suffixes. For
  596. example, the \fB\-\-display\-tags\fP option takes a \fB,\fP\-separated list of tags, but
  597. the option also allows you to append a single tag with \fB\-\-display\-tags\-append\fP,
  598. and the tag name can for example contain a literal \fB,\fP without the need for
  599. escaping.
  600. .SS String list and path list options
  601. .sp
  602. String lists are separated by \fB,\fP\&. The strings are not parsed or interpreted
  603. by the option system itself. However, most
  604. .sp
  605. Path or file list options use \fB:\fP (Unix) or \fB;\fP (Windows) as separator,
  606. instead of \fB,\fP\&.
  607. .sp
  608. They support the following operations:
  609. .TS
  610. center;
  611. |l|l|.
  612. _
  613. T{
  614. Suffix
  615. T} T{
  616. Meaning
  617. T}
  618. _
  619. T{
  620. \-set
  621. T} T{
  622. Set a list of items (using the list separator, interprets escapes)
  623. T}
  624. _
  625. T{
  626. \-append
  627. T} T{
  628. Append single item (does not interpret escapes)
  629. T}
  630. _
  631. T{
  632. \-add
  633. T} T{
  634. Append 1 or more items (same syntax as \-set)
  635. T}
  636. _
  637. T{
  638. \-pre
  639. T} T{
  640. Prepend 1 or more items (same syntax as \-set)
  641. T}
  642. _
  643. T{
  644. \-clr
  645. T} T{
  646. Clear the option (remove all items)
  647. T}
  648. _
  649. T{
  650. \-remove
  651. T} T{
  652. Delete item if present (does not interpret escapes)
  653. T}
  654. _
  655. T{
  656. \-del
  657. T} T{
  658. Delete 1 or more items by integer index (deprecated)
  659. T}
  660. _
  661. T{
  662. \-toggle
  663. T} T{
  664. Append an item, or remove if if it already exists (no escapes)
  665. T}
  666. _
  667. .TE
  668. .sp
  669. \fB\-append\fP is meant as a simple way to append a single item without having
  670. to escape the argument (you may still need to escape on the shell level).
  671. .SS Key/value list options
  672. .sp
  673. A key/value list is a list of key/value string pairs. In programming languages,
  674. this type of data structure is often called a map or a dictionary. The order
  675. normally does not matter, although in some cases the order might matter.
  676. .sp
  677. They support the following operations:
  678. .TS
  679. center;
  680. |l|l|.
  681. _
  682. T{
  683. Suffix
  684. T} T{
  685. Meaning
  686. T}
  687. _
  688. T{
  689. \-set
  690. T} T{
  691. Set a list of items (using \fB,\fP as separator)
  692. T}
  693. _
  694. T{
  695. \-append
  696. T} T{
  697. Append a single item (escapes for the key, no escapes for the value)
  698. T}
  699. _
  700. T{
  701. \-add
  702. T} T{
  703. Append 1 or more items (same syntax as \-set)
  704. T}
  705. _
  706. T{
  707. \-remove
  708. T} T{
  709. Delete item by key if present (does not interpret escapes)
  710. T}
  711. _
  712. .TE
  713. .sp
  714. Keys are unique within the list. If an already present key is set, the existing
  715. key is removed before the new value is appended.
  716. .SS Filter options
  717. .sp
  718. This is a very complex option type for the \fB\-\-af\fP and \fB\-\-vf\fP options only.
  719. They often require complicated escaping. See \fI\%VIDEO FILTERS\fP for details. They
  720. support the following operations:
  721. .TS
  722. center;
  723. |l|l|.
  724. _
  725. T{
  726. Suffix
  727. T} T{
  728. Meaning
  729. T}
  730. _
  731. T{
  732. \-set
  733. T} T{
  734. Set a list of filters (using \fB,\fP as separator)
  735. T}
  736. _
  737. T{
  738. \-append
  739. T} T{
  740. Append single filter
  741. T}
  742. _
  743. T{
  744. \-add
  745. T} T{
  746. Append 1 or more filters (same syntax as \-set)
  747. T}
  748. _
  749. T{
  750. \-pre
  751. T} T{
  752. Prepend 1 or more filters (same syntax as \-set)
  753. T}
  754. _
  755. T{
  756. \-clr
  757. T} T{
  758. Clear the option (remove all filters)
  759. T}
  760. _
  761. T{
  762. \-remove
  763. T} T{
  764. Delete filter if present
  765. T}
  766. _
  767. T{
  768. \-del
  769. T} T{
  770. Delete 1 or more filters by integer index or filter label (deprecated)
  771. T}
  772. _
  773. T{
  774. \-toggle
  775. T} T{
  776. Append a filter, or remove if if it already exists
  777. T}
  778. _
  779. T{
  780. \-help
  781. T} T{
  782. Pseudo operation that prints a help text to the terminal
  783. T}
  784. _
  785. .TE
  786. .SS General
  787. .sp
  788. Without suffix, the operation used is normally \fB\-set\fP\&.
  789. .sp
  790. Although some operations allow specifying multiple items, using this is strongly
  791. discouraged and deprecated, except for \fB\-set\fP\&. There is a chance that
  792. operations like \fB\-add\fP and \fB\-pre\fP will work like \fB\-append\fP and accept a
  793. single, unescaped item only (so the \fB,\fP separator will not be interpreted and
  794. is passed on as part of the value).
  795. .sp
  796. Some options (like \fB\-\-sub\-file\fP, \fB\-\-audio\-file\fP, \fB\-\-glsl\-shader\fP) are
  797. aliases for the proper option with \fB\-append\fP action. For example,
  798. \fB\-\-sub\-file\fP is an alias for \fB\-\-sub\-files\-append\fP\&.
  799. .sp
  800. Options of this type can be changed at runtime using the \fBchange\-list\fP
  801. command, which takes the suffix (without the \fB\-\fP) as separate operation
  802. parameter.
  803. .SH CONFIGURATION FILES
  804. .SS Location and Syntax
  805. .sp
  806. You can put all of the options in configuration files which will be read every
  807. time mpv is run. The system\-wide configuration file \(aqmpv.conf\(aq is in your
  808. configuration directory (e.g. \fB/etc/mpv\fP or \fB/usr/local/etc/mpv\fP), the
  809. user\-specific one is \fB~/.config/mpv/mpv.conf\fP\&. For details and platform
  810. specifics (in particular Windows paths) see the \fI\%FILES\fP section.
  811. .sp
  812. User\-specific options override system\-wide options and options given on the
  813. command line override either. The syntax of the configuration files is
  814. \fBoption=value\fP\&. Everything after a \fI#\fP is considered a comment. Options
  815. that work without values can be enabled by setting them to \fIyes\fP and disabled by
  816. setting them to \fIno\fP\&. Even suboptions can be specified in this way.
  817. .INDENT 0.0
  818. .INDENT 3.5
  819. .IP "Example configuration file"
  820. .INDENT 0.0
  821. .INDENT 3.5
  822. .sp
  823. .nf
  824. .ft C
  825. # Use GPU\-accelerated video output by default.
  826. vo=gpu
  827. # Use quotes for text that can contain spaces:
  828. status\-msg="Time: ${time\-pos}"
  829. .ft P
  830. .fi
  831. .UNINDENT
  832. .UNINDENT
  833. .UNINDENT
  834. .UNINDENT
  835. .SS Escaping spaces and special characters
  836. .sp
  837. This is done like with command line options. The shell is not involved here,
  838. but option values still need to be quoted as a whole if it contains certain
  839. characters like spaces. A config entry can be quoted with \fB"\fP,
  840. as well as with the fixed\-length syntax (\fB%n%\fP) mentioned before. This is like
  841. passing the exact contents of the quoted string as command line option. C\-style
  842. escapes are currently _not_ interpreted on this level, although some options do
  843. this manually. (This is a mess and should probably be changed at some point.)
  844. .SS Putting Command Line Options into the Configuration File
  845. .sp
  846. Almost all command line options can be put into the configuration file. Here
  847. is a small guide:
  848. .TS
  849. center;
  850. |l|l|.
  851. _
  852. T{
  853. Option
  854. T} T{
  855. Configuration file entry
  856. T}
  857. _
  858. T{
  859. \fB\-\-flag\fP
  860. T} T{
  861. \fBflag\fP
  862. T}
  863. _
  864. T{
  865. \fB\-opt val\fP
  866. T} T{
  867. \fBopt=val\fP
  868. T}
  869. _
  870. T{
  871. \fB\-\-opt=val\fP
  872. T} T{
  873. \fBopt=val\fP
  874. T}
  875. _
  876. T{
  877. \fB\-opt "has spaces"\fP
  878. T} T{
  879. \fBopt="has spaces"\fP
  880. T}
  881. _
  882. .TE
  883. .SS File\-specific Configuration Files
  884. .sp
  885. You can also write file\-specific configuration files. If you wish to have a
  886. configuration file for a file called \(aqvideo.avi\(aq, create a file named
  887. \(aqvideo.avi.conf\(aq with the file\-specific options in it and put it in
  888. \fB~/.config/mpv/\fP\&. You can also put the configuration file in the same directory
  889. as the file to be played. Both require you to set the \fB\-\-use\-filedir\-conf\fP
  890. option (either on the command line or in your global config file). If a
  891. file\-specific configuration file is found in the same directory, no
  892. file\-specific configuration is loaded from \fB~/.config/mpv\fP\&. In addition, the
  893. \fB\-\-use\-filedir\-conf\fP option enables directory\-specific configuration files.
  894. For this, mpv first tries to load a mpv.conf from the same directory
  895. as the file played and then tries to load any file\-specific configuration.
  896. .SS Profiles
  897. .sp
  898. To ease working with different configurations, profiles can be defined in the
  899. configuration files. A profile starts with its name in square brackets,
  900. e.g. \fB[my\-profile]\fP\&. All following options will be part of the profile. A
  901. description (shown by \fB\-\-profile=help\fP) can be defined with the
  902. \fBprofile\-desc\fP option. To end the profile, start another one or use the
  903. profile name \fBdefault\fP to continue with normal options.
  904. .sp
  905. You can list profiles with \fB\-\-profile=help\fP, and show the contents of a
  906. profile with \fB\-\-show\-profile=<name>\fP (replace \fB<name>\fP with the profile
  907. name). You can apply profiles on start with the \fB\-\-profile=<name>\fP option,
  908. or at runtime with the \fBapply\-profile <name>\fP command.
  909. .INDENT 0.0
  910. .INDENT 3.5
  911. .IP "Example mpv config file with profiles"
  912. .INDENT 0.0
  913. .INDENT 3.5
  914. .sp
  915. .nf
  916. .ft C
  917. # normal top\-level option
  918. fullscreen=yes
  919. # a profile that can be enabled with \-\-profile=big\-cache
  920. [big\-cache]
  921. cache=yes
  922. demuxer\-max\-bytes=123400KiB
  923. demuxer\-readahead\-secs=20
  924. [slow]
  925. profile\-desc="some profile name"
  926. # reference a builtin profile
  927. profile=gpu\-hq
  928. [fast]
  929. vo=vdpau
  930. # using a profile again extends it
  931. [slow]
  932. framedrop=no
  933. # you can also include other profiles
  934. profile=big\-cache
  935. .ft P
  936. .fi
  937. .UNINDENT
  938. .UNINDENT
  939. .UNINDENT
  940. .UNINDENT
  941. .SS Auto profiles
  942. .sp
  943. Some profiles are loaded automatically. The following example demonstrates this:
  944. .INDENT 0.0
  945. .INDENT 3.5
  946. .IP "Auto profile loading"
  947. .INDENT 0.0
  948. .INDENT 3.5
  949. .sp
  950. .nf
  951. .ft C
  952. [extension.mkv]
  953. profile\-desc="profile for .mkv files"
  954. vf=flip
  955. .ft P
  956. .fi
  957. .UNINDENT
  958. .UNINDENT
  959. .UNINDENT
  960. .UNINDENT
  961. .sp
  962. The profile name follows the schema \fBtype.name\fP, where type can be
  963. \fBprotocol\fP for the input/output protocol in use (see \fB\-\-list\-protocols\fP),
  964. and \fBextension\fP for the extension of the path of the currently played file
  965. (\fInot\fP the file format).
  966. .sp
  967. This feature is very limited, and there are no other auto profiles.
  968. .SH USING MPV FROM OTHER PROGRAMS OR SCRIPTS
  969. .sp
  970. There are three choices for using mpv from other programs or scripts:
  971. .INDENT 0.0
  972. .INDENT 3.5
  973. .INDENT 0.0
  974. .IP 1. 3
  975. Calling it as UNIX process. If you do this, \fIdo not parse terminal output\fP\&.
  976. The terminal output is intended for humans, and may change any time. In
  977. addition, terminal behavior itself may change any time. Compatibility
  978. cannot be guaranteed.
  979. .sp
  980. Your code should work even if you pass \fB\-\-no\-terminal\fP\&. Do not attempt
  981. to simulate user input by sending terminal control codes to mpv\(aqs stdin.
  982. If you need interactive control, using \fB\-\-input\-ipc\-server\fP is
  983. recommended. This gives you access to the \fI\%JSON IPC\fP over unix domain
  984. sockets (or named pipes on Windows).
  985. .sp
  986. Depending on what you do, passing \fB\-\-no\-config\fP or \fB\-\-config\-dir\fP may
  987. be a good idea to avoid conflicts with the normal mpv user configuration
  988. intended for CLI playback.
  989. .sp
  990. Using \fB\-\-input\-ipc\-server\fP is also suitable for purposes like remote
  991. control (however, the IPC protocol itself is not "secure" and not
  992. intended to be so).
  993. .IP 2. 3
  994. Using libmpv. This is generally recommended when mpv is used as playback
  995. backend for a completely different application. The provided C API is
  996. very close to CLI mechanisms and the scripting API.
  997. .sp
  998. Note that even though libmpv has different defaults, it can be configured
  999. to work exactly like the CLI player (except command line parsing is
  1000. unavailable).
  1001. .sp
  1002. See \fI\%EMBEDDING INTO OTHER PROGRAMS (LIBMPV)\fP\&.
  1003. .IP 3. 3
  1004. As a user script (\fI\%LUA SCRIPTING\fP, \fI\%JAVASCRIPT\fP, \fI\%C PLUGINS\fP). This is
  1005. recommended when the goal is to "enhance" the CLI player. Scripts get
  1006. access to the entire client API of mpv.
  1007. .sp
  1008. This is the standard way to create third\-party extensions for the player.
  1009. .UNINDENT
  1010. .UNINDENT
  1011. .UNINDENT
  1012. .sp
  1013. All these access the client API, which is the sum of the various mechanisms
  1014. provided by the player core, as documented here: \fI\%OPTIONS\fP,
  1015. \fI\%List of Input Commands\fP, \fI\%Properties\fP, \fI\%List of events\fP (also see C API),
  1016. \fI\%Hooks\fP\&.
  1017. .SH TAKING SCREENSHOTS
  1018. .sp
  1019. Screenshots of the currently played file can be taken using the \(aqscreenshot\(aq
  1020. input mode command, which is by default bound to the \fBs\fP key. Files named
  1021. \fBmpv\-shotNNNN.jpg\fP will be saved in the working directory, using the first
  1022. available number \- no files will be overwritten. In pseudo\-GUI mode, the
  1023. screenshot will be saved somewhere else. See \fI\%PSEUDO GUI MODE\fP\&.
  1024. .sp
  1025. A screenshot will usually contain the unscaled video contents at the end of the
  1026. video filter chain and subtitles. By default, \fBS\fP takes screenshots without
  1027. subtitles, while \fBs\fP includes subtitles.
  1028. .sp
  1029. Unlike with MPlayer, the \fBscreenshot\fP video filter is not required. This
  1030. filter was never required in mpv, and has been removed.
  1031. .SH TERMINAL STATUS LINE
  1032. .sp
  1033. During playback, mpv shows the playback status on the terminal. It looks like
  1034. something like this:
  1035. .INDENT 0.0
  1036. .INDENT 3.5
  1037. \fBAV: 00:03:12 / 00:24:25 (13%) A\-V: \-0.000\fP
  1038. .UNINDENT
  1039. .UNINDENT
  1040. .sp
  1041. The status line can be overridden with the \fB\-\-term\-status\-msg\fP option.
  1042. .sp
  1043. The following is a list of things that can show up in the status line. Input
  1044. properties, that can be used to get the same information manually, are also
  1045. listed.
  1046. .INDENT 0.0
  1047. .IP \(bu 2
  1048. \fBAV:\fP or \fBV:\fP (video only) or \fBA:\fP (audio only)
  1049. .IP \(bu 2
  1050. The current time position in \fBHH:MM:SS\fP format (\fBplayback\-time\fP property)
  1051. .IP \(bu 2
  1052. The total file duration (absent if unknown) (\fBlength\fP property)
  1053. .IP \(bu 2
  1054. Playback speed, e.g. \(ga\(ga x2.0\(ga\(ga. Only visible if the speed is not normal. This
  1055. is the user\-requested speed, and not the actual speed (usually they should
  1056. be the same, unless playback is too slow). (\fBspeed\fP property.)
  1057. .IP \(bu 2
  1058. Playback percentage, e.g. \fB(13%)\fP\&. How much of the file has been played.
  1059. Normally calculated out of playback position and duration, but can fallback
  1060. to other methods (like byte position) if these are not available.
  1061. (\fBpercent\-pos\fP property.)
  1062. .IP \(bu 2
  1063. The audio/video sync as \fBA\-V: 0.000\fP\&. This is the difference between
  1064. audio and video time. Normally it should be 0 or close to 0. If it\(aqs growing,
  1065. it might indicate a playback problem. (\fBavsync\fP property.)
  1066. .IP \(bu 2
  1067. Total A/V sync change, e.g. \fBct: \-0.417\fP\&. Normally invisible. Can show up
  1068. if there is audio "missing", or not enough frames can be dropped. Usually
  1069. this will indicate a problem. (\fBtotal\-avsync\-change\fP property.)
  1070. .IP \(bu 2
  1071. Encoding state in \fB{...}\fP, only shown in encoding mode.
  1072. .IP \(bu 2
  1073. Display sync state. If display sync is active (\fBdisplay\-sync\-active\fP
  1074. property), this shows \fBDS: 2.500/13\fP, where the first number is average
  1075. number of vsyncs per video frame (e.g. 2.5 when playing 24Hz videos on 60Hz
  1076. screens), which might jitter if the ratio doesn\(aqt round off, or there are
  1077. mistimed frames (\fBvsync\-ratio\fP), and the second number of estimated number
  1078. of vsyncs which took too long (\fBvo\-delayed\-frame\-count\fP property). The
  1079. latter is a heuristic, as it\(aqs generally not possible to determine this with
  1080. certainty.
  1081. .IP \(bu 2
  1082. Dropped frames, e.g. \fBDropped: 4\fP\&. Shows up only if the count is not 0. Can
  1083. grow if the video framerate is higher than that of the display, or if video
  1084. rendering is too slow. May also be incremented on "hiccups" and when the video
  1085. frame couldn\(aqt be displayed on time. (\fBvo\-drop\-frame\-count\fP property.)
  1086. If the decoder drops frames, the number of decoder\-dropped frames is appended
  1087. to the display as well, e.g.: \fBDropped: 4/34\fP\&. This happens only if
  1088. decoder frame dropping is enabled with the \fB\-\-framedrop\fP options.
  1089. (\fBdrop\-frame\-count\fP property.)
  1090. .IP \(bu 2
  1091. Cache state, e.g. \fBCache: 2s/134KB\fP\&. Visible if the stream cache is enabled.
  1092. The first value shows the amount of video buffered in the demuxer in seconds,
  1093. the second value shows the estimated size of the buffered amount in kilobytes.
  1094. (\fBdemuxer\-cache\-duration\fP and \fBdemuxer\-cache\-state\fP properties.)
  1095. .UNINDENT
  1096. .SH LOW LATENCY PLAYBACK
  1097. .sp
  1098. mpv is optimized for normal video playback, meaning it actually tries to buffer
  1099. as much data as it seems to make sense. This will increase latency. Reducing
  1100. latency is possible only by specifically disabling features which increase
  1101. latency.
  1102. .sp
  1103. The builtin \fBlow\-latency\fP profile tries to apply some of the options which can
  1104. reduce latency. You can use \fB\-\-profile=low\-latency\fP to apply all of them. You
  1105. can list the contents with \fB\-\-show\-profile=low\-latency\fP (some of the options
  1106. are quite obscure, and may change every mpv release).
  1107. .sp
  1108. Be aware that some of the options can reduce playback quality.
  1109. .sp
  1110. Most latency is actually caused by inconvenient timing behavior. You can disable
  1111. this with \fB\-\-untimed\fP, but it will likely break, unless the stream has no
  1112. audio, and the input feeds data to the player at a constant rate.
  1113. .sp
  1114. Another common problem is with MJPEG streams. These do not signal the correct
  1115. framerate. Using \fB\-\-untimed\fP or \fB\-\-no\-correct\-pts \-\-fps=60\fP might help.
  1116. .sp
  1117. For livestreams, data can build up due to pausing the stream, due to slightly
  1118. lower playback rate, or "buffering" pauses. If the demuxer cache is enabled,
  1119. these can be skipped manually. The experimental \fBdrop\-buffers\fP command can
  1120. be used to discard any buffered data, though it\(aqs very disruptive.
  1121. .sp
  1122. In some cases, manually tuning TCP buffer sizes and such can help to reduce
  1123. latency.
  1124. .sp
  1125. Additional options that can be tried:
  1126. .INDENT 0.0
  1127. .IP \(bu 2
  1128. \fB\-\-opengl\-glfinish=yes\fP, can reduce buffering in the graphics driver
  1129. .IP \(bu 2
  1130. \fB\-\-opengl\-swapinterval=0\fP, same
  1131. .IP \(bu 2
  1132. \fB\-\-vo=xv\fP, same
  1133. .IP \(bu 2
  1134. without audio \fB\-\-framedrop=no \-\-speed=1.01\fP may help for live sources
  1135. (results can be mixed)
  1136. .UNINDENT
  1137. .SH PROTOCOLS
  1138. .sp
  1139. \fBhttp://...\fP, \fBhttps://\fP, ...
  1140. .INDENT 0.0
  1141. .INDENT 3.5
  1142. Many network protocols are supported, but the protocol prefix must always
  1143. be specified. mpv will never attempt to guess whether a filename is
  1144. actually a network address. A protocol prefix is always required.
  1145. .sp
  1146. Note that not all prefixes are documented here. Undocumented prefixes are
  1147. either aliases to documented protocols, or are just redirections to
  1148. protocols implemented and documented in FFmpeg.
  1149. .sp
  1150. \fBdata:\fP is supported in FFmpeg (not in Libav), but needs to be in the
  1151. format \fBdata://\fP\&. This is done to avoid ambiguity with filenames. You
  1152. can also prefix it with \fBlavf://\fP or \fBffmpeg://\fP\&.
  1153. .UNINDENT
  1154. .UNINDENT
  1155. .sp
  1156. \fBytdl://...\fP
  1157. .INDENT 0.0
  1158. .INDENT 3.5
  1159. By default, the youtube\-dl hook script only looks at http(s) URLs. Prefixing
  1160. an URL with \fBytdl://\fP forces it to be always processed by the script. This
  1161. can also be used to invoke special youtube\-dl functionality like playing a
  1162. video by ID or invoking search.
  1163. .sp
  1164. Keep in mind that you can\(aqt pass youtube\-dl command line options by this,
  1165. and you have to use \fB\-\-ytdl\-raw\-options\fP instead.
  1166. .UNINDENT
  1167. .UNINDENT
  1168. .sp
  1169. \fB\-\fP
  1170. .INDENT 0.0
  1171. .INDENT 3.5
  1172. Play data from stdin.
  1173. .UNINDENT
  1174. .UNINDENT
  1175. .sp
  1176. \fBsmb://PATH\fP
  1177. .INDENT 0.0
  1178. .INDENT 3.5
  1179. Play a path from Samba share.
  1180. .UNINDENT
  1181. .UNINDENT
  1182. .sp
  1183. \fBbd://[title][/device]\fP \fB\-\-bluray\-device=PATH\fP
  1184. .INDENT 0.0
  1185. .INDENT 3.5
  1186. Play a Blu\-ray disc. Since libbluray 1.0.1, you can read from ISO files
  1187. by passing them to \fB\-\-bluray\-device\fP\&.
  1188. .sp
  1189. \fBtitle\fP can be: \fBlongest\fP or \fBfirst\fP (selects the default
  1190. playlist); \fBmpls/<number>\fP (selects <number>.mpls playlist);
  1191. \fB<number>\fP (select playlist with the same index). mpv will list
  1192. the available playlists on loading.
  1193. .sp
  1194. \fBbluray://\fP is an alias.
  1195. .UNINDENT
  1196. .UNINDENT
  1197. .sp
  1198. \fBdvd://[title][/device]\fP \fB\-\-dvd\-device=PATH\fP
  1199. .INDENT 0.0
  1200. .INDENT 3.5
  1201. Play a DVD. DVD menus are not supported. If no title is given, the longest
  1202. title is auto\-selected. Without \fB\-\-dvd\-device\fP, it will probably try
  1203. to open an actual optical drive, if available and implemented for the OS.
  1204. .sp
  1205. \fBdvdnav://\fP is an old alias for \fBdvd://\fP and does exactly the same
  1206. thing.
  1207. .UNINDENT
  1208. .UNINDENT
  1209. .sp
  1210. \fBdvb://[cardnumber@]channel\fP \fB\-\-dvbin\-...\fP
  1211. .INDENT 0.0
  1212. .INDENT 3.5
  1213. Digital TV via DVB. (Linux only.)
  1214. .UNINDENT
  1215. .UNINDENT
  1216. .sp
  1217. \fBmf://[filemask|@listfile]\fP \fB\-\-mf\-...\fP
  1218. .INDENT 0.0
  1219. .INDENT 3.5
  1220. Play a series of images as video.
  1221. .UNINDENT
  1222. .UNINDENT
  1223. .sp
  1224. \fBcdda://[device]\fP \fB\-\-cdrom\-device=PATH\fP \fB\-\-cdda\-...\fP
  1225. .INDENT 0.0
  1226. .INDENT 3.5
  1227. Play CD.
  1228. .UNINDENT
  1229. .UNINDENT
  1230. .sp
  1231. \fBlavf://...\fP
  1232. .INDENT 0.0
  1233. .INDENT 3.5
  1234. Access any FFmpeg/Libav libavformat protocol. Basically, this passed the
  1235. string after the \fB//\fP directly to libavformat.
  1236. .UNINDENT
  1237. .UNINDENT
  1238. .sp
  1239. \fBav://type:options\fP
  1240. .INDENT 0.0
  1241. .INDENT 3.5
  1242. This is intended for using libavdevice inputs. \fBtype\fP is the libavdevice
  1243. demuxer name, and \fBoptions\fP is the (pseudo\-)filename passed to the
  1244. demuxer.
  1245. .INDENT 0.0
  1246. .INDENT 3.5
  1247. .IP "Example"
  1248. .INDENT 0.0
  1249. .INDENT 3.5
  1250. .sp
  1251. .nf
  1252. .ft C
  1253. mpv av://v4l2:/dev/video0 \-\-profile=low\-latency \-\-untimed
  1254. .ft P
  1255. .fi
  1256. .UNINDENT
  1257. .UNINDENT
  1258. .sp
  1259. This plays video from the first v4l input with nearly the lowest latency
  1260. possible. It\(aqs a good replacement for the removed \fBtv://\fP input.
  1261. Using \fB\-\-untimed\fP is a hack to output a captured frame immediately,
  1262. instead of respecting the input framerate. (There may be better ways to
  1263. handle this in the future.)
  1264. .UNINDENT
  1265. .UNINDENT
  1266. .sp
  1267. \fBavdevice://\fP is an alias.
  1268. .UNINDENT
  1269. .UNINDENT
  1270. .sp
  1271. \fBfile://PATH\fP
  1272. .INDENT 0.0
  1273. .INDENT 3.5
  1274. A local path as URL. Might be useful in some special use\-cases. Note that
  1275. \fBPATH\fP itself should start with a third \fB/\fP to make the path an
  1276. absolute path.
  1277. .UNINDENT
  1278. .UNINDENT
  1279. .sp
  1280. \fBappending://PATH\fP
  1281. .INDENT 0.0
  1282. .INDENT 3.5
  1283. Play a local file, but assume it\(aqs being appended to. This is useful for
  1284. example for files that are currently being downloaded to disk. This will
  1285. block playback, and stop playback only if no new data was appended after
  1286. a timeout of about 2 seconds.
  1287. .sp
  1288. Using this is still a bit of a bad idea, because there is no way to detect
  1289. if a file is actually being appended, or if it\(aqs still written. If you\(aqre
  1290. trying to play the output of some program, consider using a pipe
  1291. (\fBsomething | mpv \-\fP). If it really has to be a file on disk, use tail to
  1292. make it wait forever, e.g. \fBtail \-f \-c +0 file.mkv | mpv \-\fP\&.
  1293. .UNINDENT
  1294. .UNINDENT
  1295. .sp
  1296. \fBfd://123\fP
  1297. .INDENT 0.0
  1298. .INDENT 3.5
  1299. Read data from the given file descriptor (for example 123). This is similar
  1300. to piping data to stdin via \fB\-\fP, but can use an arbitrary file descriptor.
  1301. mpv may modify some file descriptor properties when the stream layer "opens"
  1302. it.
  1303. .UNINDENT
  1304. .UNINDENT
  1305. .sp
  1306. \fBfdclose://123\fP
  1307. .INDENT 0.0
  1308. .INDENT 3.5
  1309. Like \fBfd://\fP, but the file descriptor is closed after use. When using this
  1310. you need to ensure that the same fd URL will only be used once.
  1311. .UNINDENT
  1312. .UNINDENT
  1313. .sp
  1314. \fBedl://[edl specification as in edl\-mpv.rst]\fP
  1315. .INDENT 0.0
  1316. .INDENT 3.5
  1317. Stitch together parts of multiple files and play them.
  1318. .UNINDENT
  1319. .UNINDENT
  1320. .sp
  1321. \fBnull://\fP
  1322. .INDENT 0.0
  1323. .INDENT 3.5
  1324. Simulate an empty file. If opened for writing, it will discard all data.
  1325. The \fBnull\fP demuxer will specifically pass autoprobing if this protocol
  1326. is used (while it\(aqs not automatically invoked for empty files).
  1327. .UNINDENT
  1328. .UNINDENT
  1329. .sp
  1330. \fBmemory://data\fP
  1331. .INDENT 0.0
  1332. .INDENT 3.5
  1333. Use the \fBdata\fP part as source data.
  1334. .UNINDENT
  1335. .UNINDENT
  1336. .sp
  1337. \fBhex://data\fP
  1338. .INDENT 0.0
  1339. .INDENT 3.5
  1340. Like \fBmemory://\fP, but the string is interpreted as hexdump.
  1341. .UNINDENT
  1342. .UNINDENT
  1343. .SH PSEUDO GUI MODE
  1344. .sp
  1345. mpv has no official GUI, other than the OSC (\fI\%ON SCREEN CONTROLLER\fP), which
  1346. is not a full GUI and is not meant to be. However, to compensate for the lack
  1347. of expected GUI behavior, mpv will in some cases start with some settings
  1348. changed to behave slightly more like a GUI mode.
  1349. .sp
  1350. Currently this happens only in the following cases:
  1351. .INDENT 0.0
  1352. .IP \(bu 2
  1353. if started using the \fBmpv.desktop\fP file on Linux (e.g. started from menus
  1354. or file associations provided by desktop environments)
  1355. .IP \(bu 2
  1356. if started from explorer.exe on Windows (technically, if it was started on
  1357. Windows, and all of the stdout/stderr/stdin handles are unset)
  1358. .IP \(bu 2
  1359. started out of the bundle on OSX
  1360. .IP \(bu 2
  1361. if you manually use \fB\-\-player\-operation\-mode=pseudo\-gui\fP on the command line
  1362. .UNINDENT
  1363. .sp
  1364. This mode applies options from the builtin profile \fBbuiltin\-pseudo\-gui\fP, but
  1365. only if these haven\(aqt been set in the user\(aqs config file or on the command line.
  1366. Also, for compatibility with the old pseudo\-gui behavior, the options in the
  1367. \fBpseudo\-gui\fP profile are applied unconditionally. In addition, the profile
  1368. makes sure to enable the pseudo\-GUI mode, so that \fB\-\-profile=pseudo\-gui\fP
  1369. works like in older mpv releases. The profiles are currently defined as follows:
  1370. .INDENT 0.0
  1371. .INDENT 3.5
  1372. .sp
  1373. .nf
  1374. .ft C
  1375. [builtin\-pseudo\-gui]
  1376. terminal=no
  1377. force\-window=yes
  1378. idle=once
  1379. screenshot\-directory=~~desktop/
  1380. [pseudo\-gui]
  1381. player\-operation\-mode=pseudo\-gui
  1382. .ft P
  1383. .fi
  1384. .UNINDENT
  1385. .UNINDENT
  1386. .sp
  1387. \fBWARNING:\fP
  1388. .INDENT 0.0
  1389. .INDENT 3.5
  1390. Currently, you can extend the \fBpseudo\-gui\fP profile in the config file the
  1391. normal way. This is deprecated. In future mpv releases, the behavior might
  1392. change, and not apply your additional settings, and/or use a different
  1393. profile name.
  1394. .UNINDENT
  1395. .UNINDENT
  1396. .SH OPTIONS
  1397. .SS Track Selection
  1398. .INDENT 0.0
  1399. .TP
  1400. .B \fB\-\-alang=<languagecode[,languagecode,...]>\fP
  1401. Specify a priority list of audio languages to use. Different container
  1402. formats employ different language codes. DVDs use ISO 639\-1 two\-letter
  1403. language codes, Matroska, MPEG\-TS and NUT use ISO 639\-2 three\-letter
  1404. language codes, while OGM uses a free\-form identifier. See also \fB\-\-aid\fP\&.
  1405. .sp
  1406. This is a string list option. See \fI\%List Options\fP for details.
  1407. .INDENT 7.0
  1408. .INDENT 3.5
  1409. .IP "Examples"
  1410. .INDENT 0.0
  1411. .IP \(bu 2
  1412. \fBmpv dvd://1 \-\-alang=hu,en\fP chooses the Hungarian language track
  1413. on a DVD and falls back on English if Hungarian is not available.
  1414. .IP \(bu 2
  1415. \fBmpv \-\-alang=jpn example.mkv\fP plays a Matroska file with Japanese
  1416. audio.
  1417. .UNINDENT
  1418. .UNINDENT
  1419. .UNINDENT
  1420. .TP
  1421. .B \fB\-\-slang=<languagecode[,languagecode,...]>\fP
  1422. Specify a priority list of subtitle languages to use. Different container
  1423. formats employ different language codes. DVDs use ISO 639\-1 two letter
  1424. language codes, Matroska uses ISO 639\-2 three letter language codes while
  1425. OGM uses a free\-form identifier. See also \fB\-\-sid\fP\&.
  1426. .sp
  1427. This is a string list option. See \fI\%List Options\fP for details.
  1428. .INDENT 7.0
  1429. .INDENT 3.5
  1430. .IP "Examples"
  1431. .INDENT 0.0
  1432. .IP \(bu 2
  1433. \fBmpv dvd://1 \-\-slang=hu,en\fP chooses the Hungarian subtitle track on
  1434. a DVD and falls back on English if Hungarian is not available.
  1435. .IP \(bu 2
  1436. \fBmpv \-\-slang=jpn example.mkv\fP plays a Matroska file with Japanese
  1437. subtitles.
  1438. .UNINDENT
  1439. .UNINDENT
  1440. .UNINDENT
  1441. .TP
  1442. .B \fB\-\-vlang=<...>\fP
  1443. Equivalent to \fB\-\-alang\fP and \fB\-\-slang\fP, for video tracks.
  1444. .sp
  1445. This is a string list option. See \fI\%List Options\fP for details.
  1446. .TP
  1447. .B \fB\-\-aid=<ID|auto|no>\fP
  1448. Select audio track. \fBauto\fP selects the default, \fBno\fP disables audio.
  1449. See also \fB\-\-alang\fP\&. mpv normally prints available audio tracks on the
  1450. terminal when starting playback of a file.
  1451. .sp
  1452. \fB\-\-audio\fP is an alias for \fB\-\-aid\fP\&.
  1453. .sp
  1454. \fB\-\-aid=no\fP or \fB\-\-audio=no\fP or \fB\-\-no\-audio\fP disables audio playback.
  1455. (The latter variant does not work with the client API.)
  1456. .TP
  1457. .B \fB\-\-sid=<ID|auto|no>\fP
  1458. Display the subtitle stream specified by \fB<ID>\fP\&. \fBauto\fP selects
  1459. the default, \fBno\fP disables subtitles.
  1460. .sp
  1461. \fB\-\-sub\fP is an alias for \fB\-\-sid\fP\&.
  1462. .sp
  1463. \fB\-\-sid=no\fP or \fB\-\-sub=no\fP or \fB\-\-no\-sub\fP disables subtitle decoding.
  1464. (The latter variant does not work with the client API.)
  1465. .TP
  1466. .B \fB\-\-vid=<ID|auto|no>\fP
  1467. Select video channel. \fBauto\fP selects the default, \fBno\fP disables video.
  1468. .sp
  1469. \fB\-\-video\fP is an alias for \fB\-\-vid\fP\&.
  1470. .sp
  1471. \fB\-\-vid=no\fP or \fB\-\-video=no\fP or \fB\-\-no\-video\fP disables video playback.
  1472. (The latter variant does not work with the client API.)
  1473. .sp
  1474. If video is disabled, mpv will try to download the audio only if media is
  1475. streamed with youtube\-dl, because it saves bandwidth. This is done by
  1476. setting the ytdl_format to "bestaudio/best" in the ytdl_hook.lua script.
  1477. .TP
  1478. .B \fB\-\-edition=<ID|auto>\fP
  1479. (Matroska files only)
  1480. Specify the edition (set of chapters) to use, where 0 is the first. If set
  1481. to \fBauto\fP (the default), mpv will choose the first edition declared as a
  1482. default, or if there is no default, the first edition defined.
  1483. .TP
  1484. .B \fB\-\-track\-auto\-selection=<yes|no>\fP
  1485. Enable the default track auto\-selection (default: yes). Enabling this will
  1486. make the player select streams according to \fB\-\-aid\fP, \fB\-\-alang\fP, and
  1487. others. If it is disabled, no tracks are selected. In addition, the player
  1488. will not exit if no tracks are selected, and wait instead (this wait mode
  1489. is similar to pausing, but the pause option is not set).
  1490. .sp
  1491. This is useful with \fB\-\-lavfi\-complex\fP: you can start playback in this
  1492. mode, and then set select tracks at runtime by setting the filter graph.
  1493. Note that if \fB\-\-lavfi\-complex\fP is set before playback is started, the
  1494. referenced tracks are always selected.
  1495. .UNINDENT
  1496. .SS Playback Control
  1497. .INDENT 0.0
  1498. .TP
  1499. .B \fB\-\-start=<relative time>\fP
  1500. Seek to given time position.
  1501. .sp
  1502. The general format for times is \fB[+|\-][[hh:]mm:]ss[.ms]\fP\&. If the time is
  1503. prefixed with \fB\-\fP, the time is considered relative from the end of the
  1504. file (as signaled by the demuxer/the file). A \fB+\fP is usually ignored (but
  1505. see below).
  1506. .sp
  1507. The following alternative time specifications are recognized:
  1508. .sp
  1509. \fBpp%\fP seeks to percent position pp (0\-100).
  1510. .sp
  1511. \fB#c\fP seeks to chapter number c. (Chapters start from 1.)
  1512. .sp
  1513. \fBnone\fP resets any previously set option (useful for libmpv).
  1514. .sp
  1515. If \fB\-\-rebase\-start\-time=no\fP is given, then prefixing times with \fB+\fP
  1516. makes the time relative to the start of the file. A timestamp without
  1517. prefix is considered an absolute time, i.e. should seek to a frame with a
  1518. timestamp as the file contains it. As a bug, but also a hidden feature,
  1519. putting 1 or more spaces before the \fB+\fP or \fB\-\fP always interprets the
  1520. time as absolute, which can be used to seek to negative timestamps (useful
  1521. for debugging at most).
  1522. .INDENT 7.0
  1523. .INDENT 3.5
  1524. .IP "Examples"
  1525. .INDENT 0.0
  1526. .TP
  1527. .B \fB\-\-start=+56\fP, \fB\-\-start=00:56\fP
  1528. Seeks to the start time + 56 seconds.
  1529. .TP
  1530. .B \fB\-\-start=\-56\fP, \fB\-\-start=\-00:56\fP
  1531. Seeks to the end time \- 56 seconds.
  1532. .TP
  1533. .B \fB\-\-start=01:10:00\fP
  1534. Seeks to 1 hour 10 min.
  1535. .TP
  1536. .B \fB\-\-start=50%\fP
  1537. Seeks to the middle of the file.
  1538. .TP
  1539. .B \fB\-\-start=30 \-\-end=40\fP
  1540. Seeks to 30 seconds, plays 10 seconds, and exits.
  1541. .TP
  1542. .B \fB\-\-start=\-3:20 \-\-length=10\fP
  1543. Seeks to 3 minutes and 20 seconds before the end of the file, plays
  1544. 10 seconds, and exits.
  1545. .TP
  1546. .B \fB\-\-start=\(aq#2\(aq \-\-end=\(aq#4\(aq\fP
  1547. Plays chapters 2 and 3, and exits.
  1548. .UNINDENT
  1549. .UNINDENT
  1550. .UNINDENT
  1551. .TP
  1552. .B \fB\-\-end=<relative time>\fP
  1553. Stop at given time. Use \fB\-\-length\fP if the time should be relative
  1554. to \fB\-\-start\fP\&. See \fB\-\-start\fP for valid option values and examples.
  1555. .TP
  1556. .B \fB\-\-length=<relative time>\fP
  1557. Stop after a given time relative to the start time.
  1558. See \fB\-\-start\fP for valid option values and examples.
  1559. .sp
  1560. If both \fB\-\-end\fP and \fB\-\-length\fP are provided, playback will stop when it
  1561. reaches either of the two endpoints.
  1562. .sp
  1563. Obscurity note: this does not work correctly if \fB\-\-rebase\-start\-time=no\fP,
  1564. and the specified time is not an "absolute" time, as defined in the
  1565. \fB\-\-start\fP option description.
  1566. .TP
  1567. .B \fB\-\-rebase\-start\-time=<yes|no>\fP
  1568. Whether to move the file start time to \fB00:00:00\fP (default: yes). This
  1569. is less awkward for files which start at a random timestamp, such as
  1570. transport streams. On the other hand, if there are timestamp resets, the
  1571. resulting behavior can be rather weird. For this reason, and in case you
  1572. are actually interested in the real timestamps, this behavior can be
  1573. disabled with \fBno\fP\&.
  1574. .TP
  1575. .B \fB\-\-speed=<0.01\-100>\fP
  1576. Slow down or speed up playback by the factor given as parameter.
  1577. .sp
  1578. If \fB\-\-audio\-pitch\-correction\fP (on by default) is used, playing with a
  1579. speed higher than normal automatically inserts the \fBscaletempo\fP audio
  1580. filter.
  1581. .TP
  1582. .B \fB\-\-pause\fP
  1583. Start the player in paused state.
  1584. .TP
  1585. .B \fB\-\-shuffle\fP
  1586. Play files in random order.
  1587. .TP
  1588. .B \fB\-\-playlist\-start=<auto|index>\fP
  1589. Set which file on the internal playlist to start playback with. The index
  1590. is an integer, with 0 meaning the first file. The value \fBauto\fP means that
  1591. the selection of the entry to play is left to the playback resume mechanism
  1592. (default). If an entry with the given index doesn\(aqt exist, the behavior is
  1593. unspecified and might change in future mpv versions. The same applies if
  1594. the playlist contains further playlists (don\(aqt expect any reasonable
  1595. behavior). Passing a playlist file to mpv should work with this option,
  1596. though. E.g. \fBmpv playlist.m3u \-\-playlist\-start=123\fP will work as expected,
  1597. as long as \fBplaylist.m3u\fP does not link to further playlists.
  1598. .sp
  1599. The value \fBno\fP is a deprecated alias for \fBauto\fP\&.
  1600. .TP
  1601. .B \fB\-\-playlist=<filename>\fP
  1602. Play files according to a playlist file (Supports some common formats. If
  1603. no format is detected, it will be treated as list of files, separated by
  1604. newline characters. Note that XML playlist formats are not supported.)
  1605. .sp
  1606. You can play playlists directly and without this option, however, this
  1607. option disables any security mechanisms that might be in place. You may
  1608. also need this option to load plaintext files as playlist.
  1609. .sp
  1610. \fBWARNING:\fP
  1611. .INDENT 7.0
  1612. .INDENT 3.5
  1613. The way mpv uses playlist files via \fB\-\-playlist\fP is not safe against
  1614. maliciously constructed files. Such files may trigger harmful actions.
  1615. This has been the case for all mpv and MPlayer versions, but
  1616. unfortunately this fact was not well documented earlier, and some people
  1617. have even misguidedly recommended use of \fB\-\-playlist\fP with untrusted
  1618. sources. Do NOT use \fB\-\-playlist\fP with random internet sources or files
  1619. you do not trust!
  1620. .sp
  1621. Playlist can contain entries using other protocols, such as local files,
  1622. or (most severely), special protocols like \fBavdevice://\fP, which are
  1623. inherently unsafe.
  1624. .UNINDENT
  1625. .UNINDENT
  1626. .TP
  1627. .B \fB\-\-chapter\-merge\-threshold=<number>\fP
  1628. Threshold for merging almost consecutive ordered chapter parts in
  1629. milliseconds (default: 100). Some Matroska files with ordered chapters
  1630. have inaccurate chapter end timestamps, causing a small gap between the
  1631. end of one chapter and the start of the next one when they should match.
  1632. If the end of one playback part is less than the given threshold away from
  1633. the start of the next one then keep playing video normally over the
  1634. chapter change instead of doing a seek.
  1635. .TP
  1636. .B \fB\-\-chapter\-seek\-threshold=<seconds>\fP
  1637. Distance in seconds from the beginning of a chapter within which a backward
  1638. chapter seek will go to the previous chapter (default: 5.0). Past this
  1639. threshold, a backward chapter seek will go to the beginning of the current
  1640. chapter instead. A negative value means always go back to the previous
  1641. chapter.
  1642. .TP
  1643. .B \fB\-\-hr\-seek=<no|absolute|yes>\fP
  1644. Select when to use precise seeks that are not limited to keyframes. Such
  1645. seeks require decoding video from the previous keyframe up to the target
  1646. position and so can take some time depending on decoding performance. For
  1647. some video formats, precise seeks are disabled. This option selects the
  1648. default choice to use for seeks; it is possible to explicitly override that
  1649. default in the definition of key bindings and in input commands.
  1650. .INDENT 7.0
  1651. .TP
  1652. .B no
  1653. Never use precise seeks.
  1654. .TP
  1655. .B absolute
  1656. Use precise seeks if the seek is to an absolute position in the
  1657. file, such as a chapter seek, but not for relative seeks like
  1658. the default behavior of arrow keys (default).
  1659. .TP
  1660. .B yes
  1661. Use precise seeks whenever possible.
  1662. .TP
  1663. .B always
  1664. Same as \fByes\fP (for compatibility).
  1665. .UNINDENT
  1666. .TP
  1667. .B \fB\-\-hr\-seek\-demuxer\-offset=<seconds>\fP
  1668. This option exists to work around failures to do precise seeks (as in
  1669. \fB\-\-hr\-seek\fP) caused by bugs or limitations in the demuxers for some file
  1670. formats. Some demuxers fail to seek to a keyframe before the given target
  1671. position, going to a later position instead. The value of this option is
  1672. subtracted from the time stamp given to the demuxer. Thus, if you set this
  1673. option to 1.5 and try to do a precise seek to 60 seconds, the demuxer is
  1674. told to seek to time 58.5, which hopefully reduces the chance that it
  1675. erroneously goes to some time later than 60 seconds. The downside of
  1676. setting this option is that precise seeks become slower, as video between
  1677. the earlier demuxer position and the real target may be unnecessarily
  1678. decoded.
  1679. .TP
  1680. .B \fB\-\-hr\-seek\-framedrop=<yes|no>\fP
  1681. Allow the video decoder to drop frames during seek, if these frames are
  1682. before the seek target. If this is enabled, precise seeking can be faster,
  1683. but if you\(aqre using video filters which modify timestamps or add new
  1684. frames, it can lead to precise seeking skipping the target frame. This
  1685. e.g. can break frame backstepping when deinterlacing is enabled.
  1686. .sp
  1687. Default: \fByes\fP
  1688. .TP
  1689. .B \fB\-\-index=<mode>\fP
  1690. Controls how to seek in files. Note that if the index is missing from a
  1691. file, it will be built on the fly by default, so you don\(aqt need to change
  1692. this. But it might help with some broken files.
  1693. .INDENT 7.0
  1694. .TP
  1695. .B default
  1696. use an index if the file has one, or build it if missing
  1697. .TP
  1698. .B recreate
  1699. don\(aqt read or use the file\(aqs index
  1700. .UNINDENT
  1701. .sp
  1702. \fBNOTE:\fP
  1703. .INDENT 7.0
  1704. .INDENT 3.5
  1705. This option only works if the underlying media supports seeking
  1706. (i.e. not with stdin, pipe, etc).
  1707. .UNINDENT
  1708. .UNINDENT
  1709. .TP
  1710. .B \fB\-\-load\-unsafe\-playlists\fP
  1711. Load URLs from playlists which are considered unsafe (default: no). This
  1712. includes special protocols and anything that doesn\(aqt refer to normal files.
  1713. Local files and HTTP links on the other hand are always considered safe.
  1714. .sp
  1715. In addition, if a playlist is loaded while this is set, the added playlist
  1716. entries are not marked as originating from network or potentially unsafe
  1717. location. (Instead, the behavior is as if the playlist entries were provided
  1718. directly to mpv command line or \fBloadfile\fP command.)
  1719. .sp
  1720. Note that \fB\-\-playlist\fP always loads all entries, so you use that instead
  1721. if you really have the need for this functionality.
  1722. .TP
  1723. .B \fB\-\-access\-references=<yes|no>\fP
  1724. Follow any references in the file being opened (default: yes). Disabling
  1725. this is helpful if the file is automatically scanned (e.g. thumbnail
  1726. generation). If the thumbnail scanner for example encounters a playlist
  1727. file, which contains network URLs, and the scanner should not open these,
  1728. enabling this option will prevent it. This option also disables ordered
  1729. chapters, mov reference files, opening of archives, and a number of other
  1730. features.
  1731. .sp
  1732. On older FFmpeg versions, this will not work in some cases. Some FFmpeg
  1733. demuxers might not respect this option.
  1734. .sp
  1735. This option does not prevent opening of paired subtitle files and such. Use
  1736. \fB\-\-autoload\-files=no\fP to prevent this.
  1737. .sp
  1738. This option does not always work if you open non\-files (for example using
  1739. \fBdvd://directory\fP would open a whole bunch of files in the given
  1740. directory). Prefixing the filename with \fB\&./\fP if it doesn\(aqt start with
  1741. a \fB/\fP will avoid this.
  1742. .TP
  1743. .B \fB\-\-loop\-playlist=<N|inf|force|no>\fP, \fB\-\-loop\-playlist\fP
  1744. Loops playback \fBN\fP times. A value of \fB1\fP plays it one time (default),
  1745. \fB2\fP two times, etc. \fBinf\fP means forever. \fBno\fP is the same as \fB1\fP and
  1746. disables looping. If several files are specified on command line, the
  1747. entire playlist is looped. \fB\-\-loop\-playlist\fP is the same as
  1748. \fB\-\-loop\-playlist=inf\fP\&.
  1749. .sp
  1750. The \fBforce\fP mode is like \fBinf\fP, but does not skip playlist entries
  1751. which have been marked as failing. This means the player might waste CPU
  1752. time trying to loop a file that doesn\(aqt exist. But it might be useful for
  1753. playing webradios under very bad network conditions.
  1754. .TP
  1755. .B \fB\-\-loop\-file=<N|inf|no>\fP, \fB\-\-loop=<N|inf|no>\fP
  1756. Loop a single file N times. \fBinf\fP means forever, \fBno\fP means normal
  1757. playback. For compatibility, \fB\-\-loop\-file\fP and \fB\-\-loop\-file=yes\fP are
  1758. also accepted, and are the same as \fB\-\-loop\-file=inf\fP\&.
  1759. .sp
  1760. The difference to \fB\-\-loop\-playlist\fP is that this doesn\(aqt loop the playlist,
  1761. just the file itself. If the playlist contains only a single file, the
  1762. difference between the two option is that this option performs a seek on
  1763. loop, instead of reloading the file.
  1764. .sp
  1765. \fB\-\-loop\fP is an alias for this option.
  1766. .TP
  1767. .B \fB\-\-ab\-loop\-a=<time>\fP, \fB\-\-ab\-loop\-b=<time>\fP
  1768. Set loop points. If playback passes the \fBb\fP timestamp, it will seek to
  1769. the \fBa\fP timestamp. Seeking past the \fBb\fP point doesn\(aqt loop (this is
  1770. intentional).
  1771. .sp
  1772. If \fBa\fP is after \fBb\fP, the behavior is as if the points were given in
  1773. the right order, and the player will seek to \fBb\fP after crossing through
  1774. \fBa\fP\&. This is different from old behavior, where looping was disabled (and
  1775. as a bug, looped back to \fBa\fP on the end of the file).
  1776. .sp
  1777. If either options are set to \fBno\fP (or unset), looping is disabled. This
  1778. is different from old behavior, where an unset \fBa\fP implied the start of
  1779. the file, and an unset \fBb\fP the end of the file.
  1780. .sp
  1781. The loop\-points can be adjusted at runtime with the corresponding
  1782. properties. See also \fBab\-loop\fP command.
  1783. .TP
  1784. .B \fB\-\-ordered\-chapters\fP, \fB\-\-no\-ordered\-chapters\fP
  1785. Enabled by default.
  1786. Disable support for Matroska ordered chapters. mpv will not load or
  1787. search for video segments from other files, and will also ignore any
  1788. chapter order specified for the main file.
  1789. .TP
  1790. .B \fB\-\-ordered\-chapters\-files=<playlist\-file>\fP
  1791. Loads the given file as playlist, and tries to use the files contained in
  1792. it as reference files when opening a Matroska file that uses ordered
  1793. chapters. This overrides the normal mechanism for loading referenced
  1794. files by scanning the same directory the main file is located in.
  1795. .sp
  1796. Useful for loading ordered chapter files that are not located on the local
  1797. filesystem, or if the referenced files are in different directories.
  1798. .sp
  1799. Note: a playlist can be as simple as a text file containing filenames
  1800. separated by newlines.
  1801. .TP
  1802. .B \fB\-\-chapters\-file=<filename>\fP
  1803. Load chapters from this file, instead of using the chapter metadata found
  1804. in the main file.
  1805. .sp
  1806. This accepts a media file (like mkv) or even a pseudo\-format like ffmetadata
  1807. and uses its chapters to replace the current file\(aqs chapters. This doesn\(aqt
  1808. work with OGM or XML chapters directly.
  1809. .TP
  1810. .B \fB\-\-sstep=<sec>\fP
  1811. Skip <sec> seconds after every frame.
  1812. .sp
  1813. \fBNOTE:\fP
  1814. .INDENT 7.0
  1815. .INDENT 3.5
  1816. Without \fB\-\-hr\-seek\fP, skipping will snap to keyframes.
  1817. .UNINDENT
  1818. .UNINDENT
  1819. .TP
  1820. .B \fB\-\-stop\-playback\-on\-init\-failure=<yes|no>\fP
  1821. Stop playback if either audio or video fails to initialize (default: no).
  1822. With \fBno\fP, playback will continue in video\-only or audio\-only mode if one
  1823. of them fails. This doesn\(aqt affect playback of audio\-only or video\-only
  1824. files.
  1825. .TP
  1826. .B \fB\-\-play\-dir=<forward|+|backward|\->\fP
  1827. Control the playback direction (default: forward). Setting \fBbackward\fP
  1828. will attempt to play the file in reverse direction, with decreasing
  1829. playback time. If this is set on playback starts, playback will start from
  1830. the end of the file. If this is changed at during playback, a hr\-seek will
  1831. be issued to change the direction.
  1832. .sp
  1833. \fB+\fP and \fB\-\fP are aliases for \fBforward\fP and \fBbackward\fP\&.
  1834. .sp
  1835. The rest of this option description pertains to the \fBbackward\fP mode.
  1836. .sp
  1837. \fBNOTE:\fP
  1838. .INDENT 7.0
  1839. .INDENT 3.5
  1840. Backward playback is extremely fragile. It may not always work, is much
  1841. slower than forward playback, and breaks certain other features. How
  1842. well it works depends mainly on the file being played. Generally, it
  1843. will show good results (or results at all) only if the stars align.
  1844. .UNINDENT
  1845. .UNINDENT
  1846. .sp
  1847. mpv, as well as most media formats, were designed for forward playback
  1848. only. Backward playback is bolted on top of mpv, and tries to make a medium
  1849. effort to make backward playback work. Depending on your use\-case, another
  1850. tool may work much better.
  1851. .sp
  1852. Backward playback is not exactly a 1st class feature. Implementation
  1853. tradeoffs were made, that are bad for backward playback, but in turn do not
  1854. cause disadvantages for normal playback. Various possible optimizations are
  1855. not implemented in order to keep the complexity down. Normally, a media
  1856. player is highly pipelined (future data is prepared in separate threads, so
  1857. it is available in realtime when the next stage needs it), but backward
  1858. playback will essentially stall the pipeline at various random points.
  1859. .sp
  1860. For example, for intra\-only codecs are trivially backward playable, and
  1861. tools built around them may make efficient use of them (consider video
  1862. editors or camera viewers). mpv won\(aqt be efficient in this case, because it
  1863. uses its generic backward playback algorithm, that on top of it is not very
  1864. optimized.
  1865. .sp
  1866. If you just want to quickly go backward through the video and just show
  1867. "keyframes", just use forward playback, and hold down the left cursor key
  1868. (which on CLI with default config sends many small relative seek commands).
  1869. .sp
  1870. The implementation consists of mostly 3 parts:
  1871. .INDENT 7.0
  1872. .IP \(bu 2
  1873. Backward demuxing. This relies on the demuxer cache, so the demuxer cache
  1874. should (or must, didn\(aqt test it) be enabled, and its size will affect
  1875. performance. If the cache is too small or too large, quadratic runtime
  1876. behavior may result.
  1877. .IP \(bu 2
  1878. Backward decoding. The decoder library used (libavcodec) does not support
  1879. this. It is emulated by feeding bits of data in forward, putting the
  1880. result in a queue, returning the queue data to the VO in reverse, and
  1881. then starting over at an earlier position. This can require buffering an
  1882. extreme amount of decoded data, and also completely breaks pipelining.
  1883. .IP \(bu 2
  1884. Backward output. This is relatively simple, because the decoder returns
  1885. the frames in the needed order. However, this may cause various problems
  1886. because filters see audio and video going backward.
  1887. .UNINDENT
  1888. .sp
  1889. Known problems:
  1890. .INDENT 7.0
  1891. .IP \(bu 2
  1892. It\(aqs fragile. If anything doesn\(aqt work, random non\-useful behavior may
  1893. occur. In simple cases, the player will just play nonsense and artifacts.
  1894. In other cases, it may get stuck or heat the CPU. (Exceeding memory usage
  1895. significantly beyond the user\-set limits would be a bug, though.)
  1896. .IP \(bu 2
  1897. Performance and resource usage isn\(aqt good. In part this is inherent to
  1898. backward playback of normal media formats, and in parts due to
  1899. implementation choices and tradeoffs.
  1900. .IP \(bu 2
  1901. This is extremely reliant on good demuxer behavior. Although backward
  1902. demuxing requires no special demuxer support, it is required that the
  1903. demuxer performs seeks reliably, fulfills some specific requirements
  1904. about packet metadata, and has deterministic behavior.
  1905. .IP \(bu 2
  1906. Starting playback exactly from the end may or may not work, depending on
  1907. seeking behavior and file duration detection.
  1908. .IP \(bu 2
  1909. Some container formats, audio, and video codecs are not supported due to
  1910. their behavior. There is no list, and the player usually does not detect
  1911. them. Certain live streams (including TV captures) may exhibit problems
  1912. in particular, as well as some lossy audio codecs. h264 intra\-refresh is
  1913. known not to work due to problems with libavcodec. WAV and some other raw
  1914. audio formats tend to have problems \- there are hacks for dealing with
  1915. them, which may or may not work.
  1916. .IP \(bu 2
  1917. Backward demuxing of subtitles is not supported. Subtitle display still
  1918. works for some external text subtitle formats. (These are fully read into
  1919. memory, and only backward display is needed.) Text subtitles that are
  1920. cached in the subtitle renderer also have a chance to be displayed
  1921. correctly.
  1922. .IP \(bu 2
  1923. Some features dealing with playback of broken or hard to deal with files
  1924. will not work fully (such as timestamp correction).
  1925. .IP \(bu 2
  1926. If demuxer low level seeks (i.e. seeking the actual demuxer instead of
  1927. just within the demuxer cache) are performed by backward playback, the
  1928. created seek ranges may not join, because not enough overlap is achieved.
  1929. .IP \(bu 2
  1930. Trying to use this with hardware video decoding will probably exhaust all
  1931. your GPU memory and then crash a thing or two. Or it will fail because
  1932. \fB\-\-hwdec\-extra\-frames\fP will certainly be set too low.
  1933. .IP \(bu 2
  1934. Stream recording is broken. \fB\-\-stream\-record\fP may keep working if you
  1935. backward play within a cached region only.
  1936. .IP \(bu 2
  1937. Relative seeks may behave weird. Small seeks backward (towards smaller
  1938. time, i.e. \fBseek \-1\fP) may not really seek properly, and audio will
  1939. remain muted for a while. Using hr\-seek is recommended, which should have
  1940. none of these problems.
  1941. .IP \(bu 2
  1942. Some things are just weird. For example, while seek commands manipulate
  1943. playback time in the expected way (provided they work correctly), the
  1944. framestep commands are transposed. Backstepping will perform very
  1945. expensive work to step forward by 1 frame.
  1946. .UNINDENT
  1947. .sp
  1948. Tuning:
  1949. .INDENT 7.0
  1950. .IP \(bu 2
  1951. Remove all \fB\-\-vf\fP/\fB\-\-af\fP filters you have set. Disable hardware
  1952. decoding. Disable idiotic nonsense like SPDIF passthrough.
  1953. .IP \(bu 2
  1954. Increasing \fB\-\-video\-reversal\-buffer\fP might help if reversal queue
  1955. overflow is reported, which may happen in high bitrate video, or video
  1956. with large GOP. Hardware decoding mostly ignores this, and you need to
  1957. increase \fB\-\-hwdec\-extra\-frames\fP instead (until you get playback without
  1958. logged errors).
  1959. .IP \(bu 2
  1960. The demuxer cache is essential for backward demuxing. Make sure to set
  1961. \fB\-\-demuxer\-seekable\-cache\fP (or just use \fB\-\-cache\fP). The cache size
  1962. might matter. If it\(aqs too small, a queue overflow will be logged, and
  1963. backward playback cannot continue, or it performs too many low level
  1964. seeks. If it\(aqs too large, implementation tradeoffs may cause general
  1965. performance issues. Use \fB\-\-demuxer\-max\-bytes\fP to potentially increase
  1966. the amount of packets the demuxer layer can queue for reverse demuxing
  1967. (basically it\(aqs the \fB\-\-video\-reversal\-buffer\fP equivalent for the
  1968. demuxer layer).
  1969. .IP \(bu 2
  1970. \fB\-\-demuxer\-backward\-playback\-step\fP also factors into how many seeks may
  1971. be performed, and whether backward demuxing could break due to queue
  1972. overflow. If it\(aqs set too high, the backstep operation needs to search
  1973. through more packets all the time, even if the cache is large enough.
  1974. .IP \(bu 2
  1975. Setting \fB\-\-demuxer\-cache\-wait\fP may be useful to cache the entire file
  1976. into the demuxer cache. Set \fB\-\-demuxer\-max\-bytes\fP to a large size to
  1977. make sure it can read the entire cache; \fB\-\-demuxer\-max\-back\-bytes\fP
  1978. should also be set to a large size to prevent that tries to trim the
  1979. cache.
  1980. .IP \(bu 2
  1981. If audio artifacts are audible, even though the AO does not underrun,
  1982. increasing \fB\-\-audio\-backward\-overlap\fP might help in some cases.
  1983. .UNINDENT
  1984. .TP
  1985. .B \fB\-\-video\-reversal\-buffer=<bytesize>\fP, \fB\-\-audio\-reversal\-buffer=<bytesize>\fP
  1986. For backward decoding. Backward decoding decodes forward in steps, and then
  1987. reverses the decoder output. These options control the approximate maximum
  1988. amount of bytes that can be buffered. The main use of this is to avoid
  1989. unbounded resource usage; during normal backward playback, it\(aqs not supposed
  1990. to hit the limit, and if it does, it will drop frames and complain about it.
  1991. .sp
  1992. Use this option if you get reversal queue overflow errors during backward
  1993. playback. Increase the size until the warning disappears. Usually, the video
  1994. buffer will overflow first, especially if it\(aqs high resolution video.
  1995. .sp
  1996. This does not work correctly if video hardware decoding is used. The video
  1997. frame size will not include the referenced GPU and driver memory. Some
  1998. hardware decoders may also be limited by \fB\-\-hwdec\-extra\-frames\fP\&.
  1999. .sp
  2000. How large the queue size needs to be depends entirely on the way the media
  2001. was encoded. Audio typically requires a very small buffer, while video can
  2002. require excessively large buffers.
  2003. .sp
  2004. (Technically, this allows the last frame to exceed the limit. Also, this
  2005. does not account for other buffered frames, such as inside the decoder or
  2006. the video output.)
  2007. .sp
  2008. This does not affect demuxer cache behavior at all.
  2009. .sp
  2010. See \fB\-\-list\-options\fP for defaults and value range. \fB<bytesize>\fP options
  2011. accept suffixes such as \fBKiB\fP and \fBMiB\fP\&.
  2012. .TP
  2013. .B \fB\-\-video\-backward\-overlap=<auto|number>\fP, \fB\-\-audio\-backward\-overlap=<auto|number>\fP
  2014. Number of overlapping keyframe ranges to use for backward decoding (default:
  2015. auto) ("keyframe" to be understood as in the mpv/ffmpeg specific meaning).
  2016. Backward decoding works by forward decoding in small steps. Some codecs
  2017. cannot restart decoding from any packet (even if it\(aqs marked as seek point),
  2018. which becomes noticeable with backward decoding (in theory this is a problem
  2019. with seeking too, but \fB\-\-hr\-seek\-demuxer\-offset\fP can fix it for seeking).
  2020. In particular, MDCT based audio codecs are affected.
  2021. .sp
  2022. The solution is to feed a previous packet to the decoder each time, and then
  2023. discard the output. This option controls how many packets to feed. The
  2024. \fBauto\fP choice is currently hardcoded to 0 for video, and uses 1 for lossy
  2025. audio, 0 for lossless audio. For some specific lossy audio codecs, this is
  2026. set to 2.
  2027. .sp
  2028. \fB\-\-video\-backward\-overlap\fP can potentially handle intra\-refresh video,
  2029. depending on the exact conditions. You may have to use the
  2030. \fB\-\-vd\-lavc\-show\-all\fP option as well.
  2031. .TP
  2032. .B \fB\-\-video\-backward\-batch=<number>\fP, \fB\-\-audio\-backward\-batch=<number>\fP
  2033. Number of keyframe ranges to decode at once when backward decoding (default:
  2034. 1 for video, 10 for audio). Another pointless tuning parameter nobody should
  2035. use. This should affect performance only. In theory, setting a number higher
  2036. than 1 for audio will reduce overhead due to less frequent backstep
  2037. operations and less redundant decoding work due to fewer decoded overlap
  2038. frames (see \fB\-\-audio\-backward\-overlap\fP). On the other hand, it requires
  2039. a larger reversal buffer, and could make playback less smooth due to
  2040. breaking pipelining (e.g. by decoding a lot, and then doing nothing for a
  2041. while).
  2042. .sp
  2043. It probably never makes sense to set \fB\-\-video\-backward\-batch\fP\&. But in
  2044. theory, it could help with intra\-only video codecs by reducing backstep
  2045. operations.
  2046. .TP
  2047. .B \fB\-\-demuxer\-backward\-playback\-step=<seconds>\fP
  2048. Number of seconds the demuxer should seek back to get new packets during
  2049. backward playback (default: 60). This is useful for tuning backward
  2050. playback, see \fB\-\-play\-dir\fP for details.
  2051. .sp
  2052. Setting this to a very low value or 0 may make the player think seeking is
  2053. broken, or may make it perform multiple seeks.
  2054. .sp
  2055. Setting this to a high value may lead to quadratic runtime behavior.
  2056. .UNINDENT
  2057. .SS Program Behavior
  2058. .INDENT 0.0
  2059. .TP
  2060. .B \fB\-\-help\fP, \fB\-\-h\fP
  2061. Show short summary of options.
  2062. .sp
  2063. You can also pass a string to this option, which will list all top\-level
  2064. options which contain the string in the name, e.g. \fB\-\-h=scale\fP for all
  2065. options that contain the word \fBscale\fP\&. The special string \fB*\fP lists
  2066. all top\-level options.
  2067. .TP
  2068. .B \fB\-v\fP
  2069. Increment verbosity level, one level for each \fB\-v\fP found on the command
  2070. line.
  2071. .TP
  2072. .B \fB\-\-version, \-V\fP
  2073. Print version string and exit.
  2074. .TP
  2075. .B \fB\-\-no\-config\fP
  2076. Do not load default configuration files. This prevents loading of both the
  2077. user\-level and system\-wide \fBmpv.conf\fP and \fBinput.conf\fP files. Other
  2078. configuration files are blocked as well, such as resume playback files.
  2079. .sp
  2080. \fBNOTE:\fP
  2081. .INDENT 7.0
  2082. .INDENT 3.5
  2083. Files explicitly requested by command line options, like
  2084. \fB\-\-include\fP or \fB\-\-use\-filedir\-conf\fP, will still be loaded.
  2085. .UNINDENT
  2086. .UNINDENT
  2087. .sp
  2088. See also: \fB\-\-config\-dir\fP\&.
  2089. .TP
  2090. .B \fB\-\-list\-options\fP
  2091. Prints all available options.
  2092. .TP
  2093. .B \fB\-\-list\-properties\fP
  2094. Print a list of the available properties.
  2095. .TP
  2096. .B \fB\-\-list\-protocols\fP
  2097. Print a list of the supported protocols.
  2098. .TP
  2099. .B \fB\-\-log\-file=<path>\fP
  2100. Opens the given path for writing, and print log messages to it. Existing
  2101. files will be truncated. The log level is at least \fB\-v \-v\fP, but
  2102. can be raised via \fB\-\-msg\-level\fP (the option cannot lower it below the
  2103. forced minimum log level).
  2104. .TP
  2105. .B \fB\-\-config\-dir=<path>\fP
  2106. Force a different configuration directory. If this is set, the given
  2107. directory is used to load configuration files, and all other configuration
  2108. directories are ignored. This means the global mpv configuration directory
  2109. as well as per\-user directories are ignored, and overrides through
  2110. environment variables (\fBMPV_HOME\fP) are also ignored.
  2111. .sp
  2112. Note that the \fB\-\-no\-config\fP option takes precedence over this option.
  2113. .TP
  2114. .B \fB\-\-save\-position\-on\-quit\fP
  2115. Always save the current playback position on quit. When this file is
  2116. played again later, the player will seek to the old playback position on
  2117. start. This does not happen if playback of a file is stopped in any other
  2118. way than quitting. For example, going to the next file in the playlist
  2119. will not save the position, and start playback at beginning the next time
  2120. the file is played.
  2121. .sp
  2122. This behavior is disabled by default, but is always available when quitting
  2123. the player with Shift+Q.
  2124. .TP
  2125. .B \fB\-\-watch\-later\-directory=<path>\fP
  2126. The directory in which to store the "watch later" temporary files.
  2127. .sp
  2128. The default is a subdirectory named "watch_later" underneath the
  2129. config directory (usually \fB~/.config/mpv/\fP).
  2130. .TP
  2131. .B \fB\-\-dump\-stats=<filename>\fP
  2132. Write certain statistics to the given file. The file is truncated on
  2133. opening. The file will contain raw samples, each with a timestamp. To
  2134. make this file into a readable, the script \fBTOOLS/stats\-conv.py\fP can be
  2135. used (which currently displays it as a graph).
  2136. .sp
  2137. This option is useful for debugging only.
  2138. .TP
  2139. .B \fB\-\-idle=<no|yes|once>\fP
  2140. Makes mpv wait idly instead of quitting when there is no file to play.
  2141. Mostly useful in input mode, where mpv can be controlled through input
  2142. commands. (Default: \fBno\fP)
  2143. .sp
  2144. \fBonce\fP will only idle at start and let the player close once the
  2145. first playlist has finished playing back.
  2146. .TP
  2147. .B \fB\-\-include=<configuration\-file>\fP
  2148. Specify configuration file to be parsed after the default ones.
  2149. .TP
  2150. .B \fB\-\-load\-scripts=<yes|no>\fP
  2151. If set to \fBno\fP, don\(aqt auto\-load scripts from the \fBscripts\fP
  2152. configuration subdirectory (usually \fB~/.config/mpv/scripts/\fP).
  2153. (Default: \fByes\fP)
  2154. .TP
  2155. .B \fB\-\-script=<filename>\fP, \fB\-\-scripts=file1.lua:file2.lua:...\fP
  2156. Load a Lua script. The second option allows you to load multiple scripts by
  2157. separating them with the path separator (\fB:\fP on Unix, \fB;\fP on Windows).
  2158. .sp
  2159. \fB\-\-scripts\fP is a path list option. See \fI\%List Options\fP for details.
  2160. .TP
  2161. .B \fB\-\-script\-opts=key1=value1,key2=value2,...\fP
  2162. Set options for scripts. A script can query an option by key. If an
  2163. option is used and what semantics the option value has depends entirely on
  2164. the loaded scripts. Values not claimed by any scripts are ignored.
  2165. .sp
  2166. This is a key/value list option. See \fI\%List Options\fP for details.
  2167. .TP
  2168. .B \fB\-\-merge\-files\fP
  2169. Pretend that all files passed to mpv are concatenated into a single, big
  2170. file. This uses timeline/EDL support internally.
  2171. .TP
  2172. .B \fB\-\-no\-resume\-playback\fP
  2173. Do not restore playback position from the \fBwatch_later\fP configuration
  2174. subdirectory (usually \fB~/.config/mpv/watch_later/\fP).
  2175. See \fBquit\-watch\-later\fP input command.
  2176. .TP
  2177. .B \fB\-\-resume\-playback\-check\-mtime\fP
  2178. Only restore the playback position from the \fBwatch_later\fP configuration
  2179. subdirectory (usually \fB~/.config/mpv/watch_later/\fP) if the file\(aqs
  2180. modification time is the same as at the time of saving. This may prevent
  2181. skipping forward in files with the same name which have different content.
  2182. (Default: \fBno\fP)
  2183. .TP
  2184. .B \fB\-\-profile=<profile1,profile2,...>\fP
  2185. Use the given profile(s), \fB\-\-profile=help\fP displays a list of the
  2186. defined profiles.
  2187. .TP
  2188. .B \fB\-\-reset\-on\-next\-file=<all|option1,option2,...>\fP
  2189. Normally, mpv will try to keep all settings when playing the next file on
  2190. the playlist, even if they were changed by the user during playback. (This
  2191. behavior is the opposite of MPlayer\(aqs, which tries to reset all settings
  2192. when starting next file.)
  2193. .sp
  2194. Default: Do not reset anything.
  2195. .sp
  2196. This can be changed with this option. It accepts a list of options, and
  2197. mpv will reset the value of these options on playback start to the initial
  2198. value. The initial value is either the default value, or as set by the
  2199. config file or command line.
  2200. .sp
  2201. In some cases, this might not work as expected. For example, \fB\-\-volume\fP
  2202. will only be reset if it is explicitly set in the config file or the
  2203. command line.
  2204. .sp
  2205. The special name \fBall\fP resets as many options as possible.
  2206. .sp
  2207. This is a string list option. See \fI\%List Options\fP for details.
  2208. .INDENT 7.0
  2209. .INDENT 3.5
  2210. .IP "Examples"
  2211. .INDENT 0.0
  2212. .IP \(bu 2
  2213. \fB\-\-reset\-on\-next\-file=pause\fP
  2214. Reset pause mode when switching to the next file.
  2215. .IP \(bu 2
  2216. \fB\-\-reset\-on\-next\-file=fullscreen,speed\fP
  2217. Reset fullscreen and playback speed settings if they were changed
  2218. during playback.
  2219. .IP \(bu 2
  2220. \fB\-\-reset\-on\-next\-file=all\fP
  2221. Try to reset all settings that were changed during playback.
  2222. .UNINDENT
  2223. .UNINDENT
  2224. .UNINDENT
  2225. .TP
  2226. .B \fB\-\-write\-filename\-in\-watch\-later\-config\fP
  2227. Prepend the watch later config files with the name of the file they refer
  2228. to. This is simply written as comment on the top of the file.
  2229. .sp
  2230. \fBWARNING:\fP
  2231. .INDENT 7.0
  2232. .INDENT 3.5
  2233. This option may expose privacy\-sensitive information and is thus
  2234. disabled by default.
  2235. .UNINDENT
  2236. .UNINDENT
  2237. .TP
  2238. .B \fB\-\-ignore\-path\-in\-watch\-later\-config\fP
  2239. Ignore path (i.e. use filename only) when using watch later feature.
  2240. (Default: disabled)
  2241. .TP
  2242. .B \fB\-\-show\-profile=<profile>\fP
  2243. Show the description and content of a profile. Lists all profiles if no
  2244. parameter is provided.
  2245. .TP
  2246. .B \fB\-\-use\-filedir\-conf\fP
  2247. Look for a file\-specific configuration file in the same directory as the
  2248. file that is being played. See \fI\%File\-specific Configuration Files\fP\&.
  2249. .sp
  2250. \fBWARNING:\fP
  2251. .INDENT 7.0
  2252. .INDENT 3.5
  2253. May be dangerous if playing from untrusted media.
  2254. .UNINDENT
  2255. .UNINDENT
  2256. .TP
  2257. .B \fB\-\-ytdl\fP, \fB\-\-no\-ytdl\fP
  2258. Enable the youtube\-dl hook\-script. It will look at the input URL, and will
  2259. play the video located on the website. This works with many streaming sites,
  2260. not just the one that the script is named after. This requires a recent
  2261. version of youtube\-dl to be installed on the system. (Enabled by default.)
  2262. .sp
  2263. If the script can\(aqt do anything with an URL, it will do nothing.
  2264. .sp
  2265. The \fBtry_ytdl_first\fP script option accepts a boolean \(aqyes\(aq or \(aqno\(aq, and if
  2266. \(aqyes\(aq will try parsing the URL with youtube\-dl first, instead of the default
  2267. where it\(aqs only after mpv failed to open it. This mostly depends on whether
  2268. most of your URLs need youtube\-dl parsing.
  2269. .sp
  2270. The \fBexclude\fP script option accepts a \fB|\fP\-separated list of URL patterns
  2271. which mpv should not use with youtube\-dl. The patterns are matched after
  2272. the \fBhttp(s)://\fP part of the URL.
  2273. .sp
  2274. \fB^\fP matches the beginning of the URL, \fB$\fP matches its end, and you
  2275. should use \fB%\fP before any of the characters \fB^$()%|,.[]*+\-?\fP to match
  2276. that character.
  2277. .INDENT 7.0
  2278. .INDENT 3.5
  2279. .IP "Examples"
  2280. .INDENT 0.0
  2281. .IP \(bu 2
  2282. \fB\-\-script\-opts=ytdl_hook\-exclude=\(aq^youtube%.com\(aq\fP
  2283. will exclude any URL that starts with \fBhttp://youtube.com\fP or
  2284. \fBhttps://youtube.com\fP\&.
  2285. .IP \(bu 2
  2286. \fB\-\-script\-opts=ytdl_hook\-exclude=\(aq%.mkv$|%.mp4$\(aq\fP
  2287. will exclude any URL that ends with \fB\&.mkv\fP or \fB\&.mp4\fP\&.
  2288. .UNINDENT
  2289. .UNINDENT
  2290. .UNINDENT
  2291. .sp
  2292. See more lua patterns here: \fI\%https://www.lua.org/manual/5.1/manual.html#5.4.1\fP
  2293. .sp
  2294. The \fBuse_manifests\fP script option makes mpv use the master manifest URL for
  2295. formats like HLS and DASH, if available, allowing for video/audio selection
  2296. in runtime. It\(aqs disabled ("no") by default for performance reasons.
  2297. .TP
  2298. .B \fB\-\-ytdl\-format=<best|worst|mp4|webm|...>\fP
  2299. Video format/quality that is directly passed to youtube\-dl. The possible
  2300. values are specific to the website and the video, for a given url the
  2301. available formats can be found with the command
  2302. \fByoutube\-dl \-\-list\-formats URL\fP\&. See youtube\-dl\(aqs documentation for
  2303. available aliases.
  2304. (Default: youtube\-dl\(aqs default, currently \fBbestvideo+bestaudio/best\fP)
  2305. .TP
  2306. .B \fB\-\-ytdl\-raw\-options=<key>=<value>[,<key>=<value>[,...]]\fP
  2307. Pass arbitrary options to youtube\-dl. Parameter and argument should be
  2308. passed as a key\-value pair. Options without argument must include \fB=\fP\&.
  2309. .sp
  2310. There is no sanity checking so it\(aqs possible to break things (i.e.
  2311. passing invalid parameters to youtube\-dl).
  2312. .sp
  2313. A proxy URL can be passed for youtube\-dl to use it in parsing the website.
  2314. This is useful for geo\-restricted URLs. After youtube\-dl parsing, some
  2315. URLs also require a proxy for playback, so this can pass that proxy
  2316. information to mpv. Take note that SOCKS proxies aren\(aqt supported and
  2317. https URLs also bypass the proxy. This is a limitation in FFmpeg.
  2318. .sp
  2319. This is a key/value list option. See \fI\%List Options\fP for details.
  2320. .INDENT 7.0
  2321. .INDENT 3.5
  2322. .IP "Example"
  2323. .INDENT 0.0
  2324. .IP \(bu 2
  2325. \fB\-\-ytdl\-raw\-options=username=user,password=pass\fP
  2326. .IP \(bu 2
  2327. \fB\-\-ytdl\-raw\-options=force\-ipv6=\fP
  2328. .IP \(bu 2
  2329. \fB\-\-ytdl\-raw\-options=proxy=[http://127.0.0.1:3128]\fP
  2330. .IP \(bu 2
  2331. \fB\-\-ytdl\-raw\-options\-append=proxy=http://127.0.0.1:3128\fP
  2332. .UNINDENT
  2333. .UNINDENT
  2334. .UNINDENT
  2335. .TP
  2336. .B \fB\-\-load\-stats\-overlay=<yes|no>\fP
  2337. Enable the builtin script that shows useful playback information on a key
  2338. binding (default: yes). By default, the \fBi\fP key is used (\fBI\fP to make
  2339. the overlay permanent).
  2340. .TP
  2341. .B \fB\-\-load\-osd\-console=<yes|no>\fP
  2342. Enable the builtin script that shows a console on a key binding and lets
  2343. you enter commands (default: yes). By default,. The \fB\'\fP key is used to
  2344. show the console, and \fBESC\fP to hide it again. (This is based on a user
  2345. script called \fBrepl.lua\fP\&.)
  2346. .TP
  2347. .B \fB\-\-player\-operation\-mode=<cplayer|pseudo\-gui>\fP
  2348. For enabling "pseudo GUI mode", which means that the defaults for some
  2349. options are changed. This option should not normally be used directly, but
  2350. only by mpv internally, or mpv\-provided scripts, config files, or .desktop
  2351. files.
  2352. .UNINDENT
  2353. .SS Video
  2354. .INDENT 0.0
  2355. .TP
  2356. .B \fB\-\-vo=<driver>\fP
  2357. Specify the video output backend to be used. See \fI\%VIDEO OUTPUT DRIVERS\fP for
  2358. details and descriptions of available drivers.
  2359. .TP
  2360. .B \fB\-\-vd=<...>\fP
  2361. Specify a priority list of video decoders to be used, according to their
  2362. family and name. See \fB\-\-ad\fP for further details. Both of these options
  2363. use the same syntax and semantics; the only difference is that they
  2364. operate on different codec lists.
  2365. .sp
  2366. \fBNOTE:\fP
  2367. .INDENT 7.0
  2368. .INDENT 3.5
  2369. See \fB\-\-vd=help\fP for a full list of available decoders.
  2370. .UNINDENT
  2371. .UNINDENT
  2372. .TP
  2373. .B \fB\-\-vf=<filter1[=parameter1:parameter2:...],filter2,...>\fP
  2374. Specify a list of video filters to apply to the video stream. See
  2375. \fI\%VIDEO FILTERS\fP for details and descriptions of the available filters.
  2376. The option variants \fB\-\-vf\-add\fP, \fB\-\-vf\-pre\fP, \fB\-\-vf\-del\fP and
  2377. \fB\-\-vf\-clr\fP exist to modify a previously specified list, but you
  2378. should not need these for typical use.
  2379. .TP
  2380. .B \fB\-\-untimed\fP
  2381. Do not sleep when outputting video frames. Useful for benchmarks when used
  2382. with \fB\-\-no\-audio.\fP
  2383. .TP
  2384. .B \fB\-\-framedrop=<mode>\fP
  2385. Skip displaying some frames to maintain A/V sync on slow systems, or
  2386. playing high framerate video on video outputs that have an upper framerate
  2387. limit.
  2388. .sp
  2389. The argument selects the drop methods, and can be one of the following:
  2390. .INDENT 7.0
  2391. .TP
  2392. .B <no>
  2393. Disable any frame dropping. Not recommended, for testing only.
  2394. .TP
  2395. .B <vo>
  2396. Drop late frames on video output (default). This still decodes and
  2397. filters all frames, but doesn\(aqt render them on the VO. Drops are
  2398. indicated in the terminal status line as \fBDropped:\fP field.
  2399. .sp
  2400. In audio sync. mode, this drops frames that are outdated at the time of
  2401. display. If the decoder is too slow, in theory all frames would have to
  2402. be dropped (because all frames are too late) \- to avoid this, frame
  2403. dropping stops if the effective framerate is below 10 FPS.
  2404. .sp
  2405. In display\-sync. modes (see \fB\-\-video\-sync\fP), this affects only how
  2406. A/V drops or repeats frames. If this mode is disabled, A/V desync will
  2407. in theory not affect video scheduling anymore (much like the
  2408. \fBdisplay\-resample\-desync\fP mode). However, even if disabled, frames
  2409. will still be skipped (i.e. dropped) according to the ratio between
  2410. video and display frequencies.
  2411. .sp
  2412. This is the recommended mode, and the default.
  2413. .TP
  2414. .B <decoder>
  2415. Old, decoder\-based framedrop mode. (This is the same as \fB\-\-framedrop=yes\fP
  2416. in mpv 0.5.x and before.) This tells the decoder to skip frames (unless
  2417. they are needed to decode future frames). May help with slow systems,
  2418. but can produce unwatchable choppy output, or even freeze the display
  2419. completely.
  2420. .sp
  2421. This uses a heuristic which may not make sense, and in general cannot
  2422. achieve good results, because the decoder\(aqs frame dropping cannot be
  2423. controlled in a predictable manner. Not recommended.
  2424. .sp
  2425. Even if you want to use this, prefer \fBdecoder+vo\fP for better results.
  2426. .sp
  2427. The \fB\-\-vd\-lavc\-framedrop\fP option controls what frames to drop.
  2428. .TP
  2429. .B <decoder+vo>
  2430. Enable both modes. Not recommended. Better than just \fBdecoder\fP mode.
  2431. .UNINDENT
  2432. .sp
  2433. \fBNOTE:\fP
  2434. .INDENT 7.0
  2435. .INDENT 3.5
  2436. \fB\-\-vo=vdpau\fP has its own code for the \fBvo\fP framedrop mode. Slight
  2437. differences to other VOs are possible.
  2438. .UNINDENT
  2439. .UNINDENT
  2440. .TP
  2441. .B \fB\-\-video\-latency\-hacks=<yes|no>\fP
  2442. Enable some things which tend to reduce video latency by 1 or 2 frames
  2443. (default: no). Note that this option might be removed without notice once
  2444. the player\(aqs timing code does not inherently need to do these things
  2445. anymore.
  2446. .sp
  2447. This does:
  2448. .INDENT 7.0
  2449. .IP \(bu 2
  2450. Use the demuxer reported FPS for frame dropping. This avoids that the
  2451. player needs to decode 1 frame in advance, lowering total latency in
  2452. effect. This also means that if the demuxer reported FPS is wrong, or
  2453. the video filter chain changes FPS (e.g. deinterlacing), then it could
  2454. drop too many or not enough frames.
  2455. .IP \(bu 2
  2456. Disable waiting for the first video frame. Normally the player waits for
  2457. the first video frame to be fully rendered before starting playback
  2458. properly. Some VOs will lazily initialize stuff when rendering the first
  2459. frame, so if this is not done, there is some likeliness that the VO has
  2460. to drop some frames if rendering the first frame takes longer than needed.
  2461. .UNINDENT
  2462. .TP
  2463. .B \fB\-\-override\-display\-fps=<fps>\fP
  2464. Set the display FPS used with the \fB\-\-video\-sync=display\-*\fP modes. By
  2465. default, a detected value is used. Keep in mind that setting an incorrect
  2466. value (even if slightly incorrect) can ruin video playback. On multi\-monitor
  2467. systems, there is a chance that the detected value is from the wrong
  2468. monitor.
  2469. .sp
  2470. Set this option only if you have reason to believe the automatically
  2471. determined value is wrong.
  2472. .TP
  2473. .B \fB\-\-display\-fps=<fps>\fP
  2474. Deprecated alias for \fB\-\-override\-display\-fps\fP\&.
  2475. .TP
  2476. .B \fB\-\-hwdec=<api>\fP
  2477. Specify the hardware video decoding API that should be used if possible.
  2478. Whether hardware decoding is actually done depends on the video codec. If
  2479. hardware decoding is not possible, mpv will fall back on software decoding.
  2480. .sp
  2481. Hardware decoding is not enabled by default, because it is typically an
  2482. additional source of errors. It is worth using only if your CPU is too
  2483. slow to decode a specific video.
  2484. .sp
  2485. \fBNOTE:\fP
  2486. .INDENT 7.0
  2487. .INDENT 3.5
  2488. Use the \fBCtrl+h\fP shortcut to toggle hardware decoding at runtime. It
  2489. toggles this option between \fBauto\fP and \fBno\fP\&.
  2490. .sp
  2491. Always enabling HW decoding by putting it into the config file is
  2492. discouraged. If you use the Ubuntu package, delete \fB/etc/mpv/mpv.conf\fP,
  2493. as the package tries to enable HW decoding by default by setting
  2494. \fBhwdec=vaapi\fP (which is less than ideal, and may even cause
  2495. sub\-optimal wrappers to be used). Or at least change it to
  2496. \fBhwdec=auto\-safe\fP\&.
  2497. .UNINDENT
  2498. .UNINDENT
  2499. .sp
  2500. Use one of the auto modes if you want to enable hardware decoding.
  2501. Explicitly selecting the mode is mostly meant for testing and debugging.
  2502. It\(aqs a bad idea to put explicit selection into the config file if you
  2503. want thing to just keep working after updates and so on.
  2504. .sp
  2505. \fBNOTE:\fP
  2506. .INDENT 7.0
  2507. .INDENT 3.5
  2508. Even if enabled, hardware decoding is still only white\-listed for some
  2509. codecs. See \fB\-\-hwdec\-codecs\fP to enable hardware decoding in more cases.
  2510. .UNINDENT
  2511. .UNINDENT
  2512. .INDENT 7.0
  2513. .INDENT 3.5
  2514. .IP "Which method to choose?"
  2515. .INDENT 0.0
  2516. .IP \(bu 2
  2517. If you only want to enable hardware decoding at runtime, don\(aqt set the
  2518. parameter, or put \fBhwdec=no\fP into your \fBmpv.conf\fP (relevant on
  2519. distros which force\-enable it by default, such as on Ubuntu). Use the
  2520. \fBCtrl+h\fP default binding to enable it at runtime.
  2521. .IP \(bu 2
  2522. If you\(aqre not sure, but want hardware decoding always enabled by
  2523. default, put \fBhwdec=auto\-safe\fP into your \fBmpv.conf\fP, and
  2524. acknowledge that this use case is not "really" supported and may cause
  2525. problems.
  2526. .IP \(bu 2
  2527. If you want to test available hardware decoding methods, pass
  2528. \fB\-\-hwdec=auto \-\-hwdec\-codecs=all\fP and look at the terminal output.
  2529. .IP \(bu 2
  2530. If you\(aqre a developer, or want to perform elaborate tests, you may
  2531. need any of the other possible option values.
  2532. .UNINDENT
  2533. .UNINDENT
  2534. .UNINDENT
  2535. .sp
  2536. \fB<api>\fP can be one of the following:
  2537. .INDENT 7.0
  2538. .TP
  2539. .B no
  2540. always use software decoding (default)
  2541. .TP
  2542. .B auto
  2543. forcibly enable any hw decoder found (see below)
  2544. .TP
  2545. .B yes
  2546. exactly the same as \fBauto\fP
  2547. .TP
  2548. .B auto\-safe
  2549. enable any whitelisted hw decoder (see below)
  2550. .TP
  2551. .B auto\-copy
  2552. enable best hw decoder with copy\-back (see below)
  2553. .TP
  2554. .B vdpau
  2555. requires \fB\-\-vo=gpu\fP with X11, or \fB\-\-vo=vdpau\fP (Linux only)
  2556. .TP
  2557. .B vdpau\-copy
  2558. copies video back into system RAM (Linux with some GPUs only)
  2559. .TP
  2560. .B vaapi
  2561. requires \fB\-\-vo=gpu\fP or \fB\-\-vo=vaapi\fP (Linux only)
  2562. .TP
  2563. .B vaapi\-copy
  2564. copies video back into system RAM (Linux with some GPUs only)
  2565. .TP
  2566. .B videotoolbox
  2567. requires \fB\-\-vo=gpu\fP (OS X 10.8 and up),
  2568. or \fB\-\-vo=libmpv\fP (iOS 9.0 and up)
  2569. .TP
  2570. .B videotoolbox\-copy
  2571. copies video back into system RAM (OS X 10.8 or iOS 9.0 and up)
  2572. .TP
  2573. .B dxva2
  2574. requires \fB\-\-vo=gpu\fP with \fB\-\-gpu\-context=d3d11\fP,
  2575. \fB\-\-gpu\-context=angle\fP or \fB\-\-gpu\-context=dxinterop\fP
  2576. (Windows only)
  2577. .TP
  2578. .B dxva2\-copy
  2579. copies video back to system RAM (Windows only)
  2580. .TP
  2581. .B d3d11va
  2582. requires \fB\-\-vo=gpu\fP with \fB\-\-gpu\-context=d3d11\fP or
  2583. \fB\-\-gpu\-context=angle\fP (Windows 8+ only)
  2584. .TP
  2585. .B d3d11va\-copy
  2586. copies video back to system RAM (Windows 8+ only)
  2587. .TP
  2588. .B mediacodec
  2589. requires \fB\-\-vo=mediacodec_embed\fP (Android only)
  2590. .TP
  2591. .B mediacodec\-copy
  2592. copies video back to system RAM (Android only)
  2593. .TP
  2594. .B mmal
  2595. requires \fB\-\-vo=gpu\fP (Raspberry Pi only \- default if available)
  2596. .TP
  2597. .B mmal\-copy
  2598. copies video back to system RAM (Raspberry Pi only)
  2599. .TP
  2600. .B nvdec
  2601. requires \fB\-\-vo=gpu\fP (Any platform CUDA is available)
  2602. .TP
  2603. .B nvdec\-copy
  2604. copies video back to system RAM (Any platform CUDA is available)
  2605. .TP
  2606. .B cuda
  2607. requires \fB\-\-vo=gpu\fP (Any platform CUDA is available)
  2608. .TP
  2609. .B cuda\-copy
  2610. copies video back to system RAM (Any platform CUDA is available)
  2611. .TP
  2612. .B crystalhd
  2613. copies video back to system RAM (Any platform supported by hardware)
  2614. .TP
  2615. .B rkmpp
  2616. requires \fB\-\-vo=gpu\fP (some RockChip devices only)
  2617. .UNINDENT
  2618. .sp
  2619. \fBauto\fP tries to automatically enable hardware decoding using the first
  2620. available method. This still depends what VO you are using. For example,
  2621. if you are not using \fB\-\-vo=gpu\fP or \fB\-\-vo=vdpau\fP, vdpau decoding will
  2622. never be enabled. Also note that if the first found method doesn\(aqt actually
  2623. work, it will always fall back to software decoding, instead of trying the
  2624. next method (might matter on some Linux systems).
  2625. .sp
  2626. \fBauto\-safe\fP is similar to \fBauto\fP, but allows only whitelisted methods
  2627. that are considered "safe". This is supposed to be a reasonable way to
  2628. enable hardware decdoding by default in a config file (even though you
  2629. shouldn\(aqt do that anyway; prefer runtime enabling with \fBCtrl+h\fP). Unlike
  2630. \fBauto\fP, this will not try to enable unknown or known\-to\-be\-bad methods. In
  2631. addition, this may disable hardware decoding in other situations when it\(aqs
  2632. known to cause problems, but currently this mechanism is quite primitive.
  2633. (As an example for something that still causes problems: certain
  2634. combinations of HEVC and Intel chips on Windows tend to cause mpv to crash,
  2635. most likely due to driver bugs.)
  2636. .sp
  2637. \fBauto\-copy\-safe\fP selects the union of methods selected with \fBauto\-safe\fP
  2638. and \fBauto\-copy\fP\&.
  2639. .sp
  2640. \fBauto\-copy\fP selects only modes that copy the video data back to system
  2641. memory after decoding. This selects modes like \fBvaapi\-copy\fP (and so on).
  2642. If none of these work, hardware decoding is disabled. This mode is usually
  2643. guaranteed to incur no additional quality loss compared to software
  2644. decoding (assuming modern codecs and an error free video stream), and will
  2645. allow CPU processing with video filters. This mode works with all video
  2646. filters and VOs.
  2647. .sp
  2648. Because these copy the decoded video back to system RAM, they\(aqre often less
  2649. efficient than the direct modes, and may not help too much over software
  2650. decoding.
  2651. .sp
  2652. \fBNOTE:\fP
  2653. .INDENT 7.0
  2654. .INDENT 3.5
  2655. Most non\-copy methods only work with the OpenGL GPU backend. Currently,
  2656. only the \fBvaapi\fP, \fBnvdec\fP and \fBcuda\fP methods work with Vulkan.
  2657. .UNINDENT
  2658. .UNINDENT
  2659. .sp
  2660. The \fBvaapi\fP mode, if used with \fB\-\-vo=gpu\fP, requires Mesa 11, and most
  2661. likely works with Intel and AMD GPUs only. It also requires the opengl EGL
  2662. backend.
  2663. .sp
  2664. \fBnvdec\fP and \fBnvdec\-copy\fP are the newest, and recommended method to do
  2665. hardware decoding on Nvidia GPUs.
  2666. .sp
  2667. \fBcuda\fP and \fBcuda\-copy\fP are an older implementation of hardware decoding
  2668. on Nvidia GPUs that uses Nvidia\(aqs bitstream parsers rather than FFmpeg\(aqs.
  2669. This can lead to feature deficiencies, such as incorrect playback of HDR
  2670. content, and \fBnvdec\fP/\fBnvdec\-copy\fP should always be preferred unless you
  2671. specifically need Nvidia\(aqs deinterlacing algorithms. To use this
  2672. deinterlacing you must pass the option:
  2673. \fBvd\-lavc\-o=deint=[weave|bob|adaptive]\fP\&.
  2674. Pass \fBweave\fP (or leave the option unset) to not attempt any
  2675. deinterlacing.
  2676. .INDENT 7.0
  2677. .INDENT 3.5
  2678. .IP "Quality reduction with hardware decoding"
  2679. .sp
  2680. In theory, hardware decoding does not reduce video quality (at least
  2681. for the codecs h264 and HEVC). However, due to restrictions in video
  2682. output APIs, as well as bugs in the actual hardware decoders, there can
  2683. be some loss, or even blatantly incorrect results.
  2684. .sp
  2685. In some cases, RGB conversion is forced, which means the RGB conversion
  2686. is performed by the hardware decoding API, instead of the shaders
  2687. used by \fB\-\-vo=gpu\fP\&. This means certain colorspaces may not display
  2688. correctly, and certain filtering (such as debanding) cannot be applied
  2689. in an ideal way. This will also usually force the use of low quality
  2690. chroma scalers instead of the one specified by \fB\-\-cscale\fP\&. In other
  2691. cases, hardware decoding can also reduce the bit depth of the decoded
  2692. image, which can introduce banding or precision loss for 10\-bit files.
  2693. .sp
  2694. \fBvdpau\fP always does RGB conversion in hardware, which does not
  2695. support newer colorspaces like BT.2020 correctly. However, \fBvdpau\fP
  2696. doesn\(aqt support 10 bit or HDR encodings, so these limitations are
  2697. unlikely to be relevant.
  2698. .sp
  2699. \fBvaapi\fP and \fBd3d11va\fP are safe. Enabling deinterlacing (or simply
  2700. their respective post\-processing filters) will possibly at least reduce
  2701. color quality by converting the output to a 8 bit format.
  2702. .sp
  2703. \fBdxva2\fP is not safe. It appears to always use BT.601 for forced RGB
  2704. conversion, but actual behavior depends on the GPU drivers. Some drivers
  2705. appear to convert to limited range RGB, which gives a faded appearance.
  2706. In addition to driver\-specific behavior, global system settings might
  2707. affect this additionally. This can give incorrect results even with
  2708. completely ordinary video sources.
  2709. .sp
  2710. \fBrpi\fP always uses the hardware overlay renderer, even with
  2711. \fB\-\-vo=gpu\fP\&.
  2712. .sp
  2713. \fBcuda\fP should usually be safe, but depending on how a file/stream
  2714. has been mixed, it has been reported to corrupt the timestamps causing
  2715. glitched, flashing frames. It can also sometimes cause massive
  2716. framedrops for unknown reasons. Caution is advised, and \fBnvdec\fP
  2717. should always be preferred.
  2718. .sp
  2719. \fBcrystalhd\fP is not safe. It always converts to 4:2:2 YUV, which
  2720. may be lossy, depending on how chroma sub\-sampling is done during
  2721. conversion. It also discards the top left pixel of each frame for
  2722. some reason.
  2723. .sp
  2724. All other methods, in particular the copy\-back methods (like
  2725. \fBdxva2\-copy\fP etc.) should hopefully be safe, although they can still
  2726. cause random decoding issues. At the very least, they shouldn\(aqt affect
  2727. the colors of the image.
  2728. .sp
  2729. In particular, \fBauto\-copy\fP will only select "safe" modes
  2730. (although potentially slower than other methods), but there\(aqs still no
  2731. guarantee the chosen hardware decoder will actually work correctly.
  2732. .sp
  2733. In general, it\(aqs very strongly advised to avoid hardware decoding
  2734. unless \fBabsolutely\fP necessary, i.e. if your CPU is insufficient to
  2735. decode the file in questions. If you run into any weird decoding issues,
  2736. frame glitches or discoloration, and you have \fB\-\-hwdec\fP turned on,
  2737. the first thing you should try is disabling it.
  2738. .UNINDENT
  2739. .UNINDENT
  2740. .TP
  2741. .B \fB\-\-gpu\-hwdec\-interop=<auto|all|no|name>\fP
  2742. This option is for troubleshooting hwdec interop issues. Since it\(aqs a
  2743. debugging option, its semantics may change at any time.
  2744. .sp
  2745. This is useful for the \fBgpu\fP and \fBlibmpv\fP VOs for selecting which
  2746. hwdec interop context to use exactly. Effectively it also can be used
  2747. to block loading of certain backends.
  2748. .sp
  2749. If set to \fBauto\fP (default), the behavior depends on the VO: for \fBgpu\fP,
  2750. it does nothing, and the interop context is loaded on demand (when the
  2751. decoder probes for \fB\-\-hwdec\fP support). For \fBlibmpv\fP, which has
  2752. has no on\-demand loading, this is equivalent to \fBall\fP\&.
  2753. .sp
  2754. The empty string is equivalent to \fBauto\fP\&.
  2755. .sp
  2756. If set to \fBall\fP, it attempts to load all interop contexts at GL context
  2757. creation time.
  2758. .sp
  2759. Other than that, a specific backend can be set, and the list of them can
  2760. be queried with \fBhelp\fP (mpv CLI only).
  2761. .sp
  2762. Runtime changes to this are ignored (the current option value is used
  2763. whenever the renderer is created).
  2764. .sp
  2765. The old aliases \fB\-\-opengl\-hwdec\-interop\fP and \fB\-\-hwdec\-preload\fP are
  2766. barely related to this anymore, but will be somewhat compatible in some
  2767. cases.
  2768. .TP
  2769. .B \fB\-\-hwdec\-extra\-frames=<N>\fP
  2770. Number of GPU frames hardware decoding should preallocate (default: see
  2771. \fB\-\-list\-options\fP output). If this is too low, frame allocation may fail
  2772. during decoding, and video frames might get dropped and/or corrupted.
  2773. Setting it too high simply wastes GPU memory and has no advantages.
  2774. .sp
  2775. This value is used only for hardware decoding APIs which require
  2776. preallocating surfaces (known examples include \fBd3d11va\fP and \fBvaapi\fP).
  2777. For other APIs, frames are allocated as needed. The details depend on the
  2778. libavcodec implementations of the hardware decoders.
  2779. .sp
  2780. The required number of surfaces depends on dynamic runtime situations. The
  2781. default is a fixed value that is thought to be sufficient for most uses. But
  2782. in certain situations, it may not be enough.
  2783. .TP
  2784. .B \fB\-\-hwdec\-image\-format=<name>\fP
  2785. Set the internal pixel format used by hardware decoding via \fB\-\-hwdec\fP
  2786. (default \fBno\fP). The special value \fBno\fP selects an implementation
  2787. specific standard format. Most decoder implementations support only one
  2788. format, and will fail to initialize if the format is not supported.
  2789. .sp
  2790. Some implementations might support multiple formats. In particular,
  2791. videotoolbox is known to require \fBuyvy422\fP for good performance on some
  2792. older hardware. d3d11va can always use \fByuv420p\fP, which uses an opaque
  2793. format, with likely no advantages.
  2794. .TP
  2795. .B \fB\-\-cuda\-decode\-device=<auto|0..>\fP
  2796. Choose the GPU device used for decoding when using the \fBcuda\fP or
  2797. \fBnvdec\fP hwdecs with the OpenGL GPU backend, and with the \fBcuda\-copy\fP
  2798. or \fBnvdec\-copy\fP hwdecs in all cases.
  2799. .sp
  2800. For the OpenGL GPU backend, the default device used for decoding is the one
  2801. being used to provide \fBgpu\fP output (and in the vast majority of cases,
  2802. only one GPU will be present).
  2803. .sp
  2804. For the \fBcopy\fP hwdecs, the default device will be the first device
  2805. enumerated by the CUDA libraries \- however that is done.
  2806. .sp
  2807. For the Vulkan GPU backend, decoding must always happen on the display
  2808. device, and this option has no effect.
  2809. .TP
  2810. .B \fB\-\-vaapi\-device=<device file>\fP
  2811. Choose the DRM device for \fBvaapi\-copy\fP\&. This should be the path to a
  2812. DRM device file. (Default: \fB/dev/dri/renderD128\fP)
  2813. .TP
  2814. .B \fB\-\-panscan=<0.0\-1.0>\fP
  2815. Enables pan\-and\-scan functionality (cropping the sides of e.g. a 16:9
  2816. video to make it fit a 4:3 display without black bands). The range
  2817. controls how much of the image is cropped. May not work with all video
  2818. output drivers.
  2819. .sp
  2820. This option has no effect if \fB\-\-video\-unscaled\fP option is used.
  2821. .TP
  2822. .B \fB\-\-video\-aspect\-override=<ratio|no>\fP
  2823. Override video aspect ratio, in case aspect information is incorrect or
  2824. missing in the file being played.
  2825. .sp
  2826. These values have special meaning:
  2827. .INDENT 7.0
  2828. .TP
  2829. .B 0
  2830. disable aspect ratio handling, pretend the video has square pixels
  2831. .TP
  2832. .B no
  2833. same as \fB0\fP
  2834. .TP
  2835. .B \-1
  2836. use the video stream or container aspect (default)
  2837. .UNINDENT
  2838. .sp
  2839. But note that handling of these special values might change in the future.
  2840. .INDENT 7.0
  2841. .INDENT 3.5
  2842. .IP "Examples"
  2843. .INDENT 0.0
  2844. .IP \(bu 2
  2845. \fB\-\-video\-aspect\-override=4:3\fP or \fB\-\-video\-aspect\-override=1.3333\fP
  2846. .IP \(bu 2
  2847. \fB\-\-video\-aspect\-override=16:9\fP or \fB\-\-video\-aspect\-override=1.7777\fP
  2848. .IP \(bu 2
  2849. \fB\-\-no\-video\-aspect\-override\fP or \fB\-\-video\-aspect\-override=no\fP
  2850. .UNINDENT
  2851. .UNINDENT
  2852. .UNINDENT
  2853. .TP
  2854. .B \fB\-\-video\-aspect\-method=<bitstream|container>\fP
  2855. This sets the default video aspect determination method (if the aspect is
  2856. _not_ overridden by the user with \fB\-\-video\-aspect\-override\fP or others).
  2857. .INDENT 7.0
  2858. .TP
  2859. .B container
  2860. Strictly prefer the container aspect ratio. This is apparently
  2861. the default behavior with VLC, at least with Matroska. Note that
  2862. if the container has no aspect ratio set, the behavior is the
  2863. same as with bitstream.
  2864. .TP
  2865. .B bitstream
  2866. Strictly prefer the bitstream aspect ratio, unless the bitstream
  2867. aspect ratio is not set. This is apparently the default behavior
  2868. with XBMC/kodi, at least with Matroska.
  2869. .UNINDENT
  2870. .sp
  2871. The current default for mpv is \fBcontainer\fP\&.
  2872. .sp
  2873. Normally you should not set this. Try the various choices if you encounter
  2874. video that has the wrong aspect ratio in mpv, but seems to be correct in
  2875. other players.
  2876. .TP
  2877. .B \fB\-\-video\-unscaled=<no|yes|downscale\-big>\fP
  2878. Disable scaling of the video. If the window is larger than the video,
  2879. black bars are added. Otherwise, the video is cropped, unless the option
  2880. is set to \fBdownscale\-big\fP, in which case the video is fit to window. The
  2881. video still can be influenced by the other \fB\-\-video\-...\fP options. This
  2882. option disables the effect of \fB\-\-panscan\fP\&.
  2883. .sp
  2884. Note that the scaler algorithm may still be used, even if the video isn\(aqt
  2885. scaled. For example, this can influence chroma conversion. The video will
  2886. also still be scaled in one dimension if the source uses non\-square pixels
  2887. (e.g. anamorphic widescreen DVDs).
  2888. .sp
  2889. This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
  2890. .TP
  2891. .B \fB\-\-video\-pan\-x=<value>\fP, \fB\-\-video\-pan\-y=<value>\fP
  2892. Moves the displayed video rectangle by the given value in the X or Y
  2893. direction. The unit is in fractions of the size of the scaled video (the
  2894. full size, even if parts of the video are not visible due to panscan or
  2895. other options).
  2896. .sp
  2897. For example, displaying a 1280x720 video fullscreen on a 1680x1050 screen
  2898. with \fB\-\-video\-pan\-x=\-0.1\fP would move the video 168 pixels to the left
  2899. (making 128 pixels of the source video invisible).
  2900. .sp
  2901. This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
  2902. .TP
  2903. .B \fB\-\-video\-rotate=<0\-359|no>\fP
  2904. Rotate the video clockwise, in degrees. Currently supports 90° steps only.
  2905. If \fBno\fP is given, the video is never rotated, even if the file has
  2906. rotation metadata. (The rotation value is added to the rotation metadata,
  2907. which means the value \fB0\fP would rotate the video according to the
  2908. rotation metadata.)
  2909. .TP
  2910. .B \fB\-\-video\-zoom=<value>\fP
  2911. Adjust the video display scale factor by the given value. The parameter is
  2912. given log 2. For example, \fB\-\-video\-zoom=0\fP is unscaled,
  2913. \fB\-\-video\-zoom=1\fP is twice the size, \fB\-\-video\-zoom=\-2\fP is one fourth of
  2914. the size, and so on.
  2915. .sp
  2916. This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
  2917. .TP
  2918. .B \fB\-\-video\-align\-x=<\-1\-1>\fP, \fB\-\-video\-align\-y=<\-1\-1>\fP
  2919. Moves the video rectangle within the black borders, which are usually added
  2920. to pad the video to screen if video and screen aspect ratios are different.
  2921. \fB\-\-video\-align\-y=\-1\fP would move the video to the top of the screen
  2922. (leaving a border only on the bottom), a value of \fB0\fP centers it
  2923. (default), and a value of \fB1\fP would put the video at the bottom of the
  2924. screen.
  2925. .sp
  2926. If video and screen aspect match perfectly, these options do nothing.
  2927. .sp
  2928. This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
  2929. .TP
  2930. .B \fB\-\-video\-margin\-ratio\-left=<val>\fP, \fB\-\-video\-margin\-ratio\-right=<val>\fP, \fB\-\-video\-margin\-ratio\-top=<val>\fP, \fB\-\-video\-margin\-ratio\-bottom=<val>\fP
  2931. Set extra video margins on each border (default: 0). Each value is a ratio
  2932. of the window size, using a range 0.0\-1.0. For example, setting the option
  2933. \fB\-\-video\-margin\-ratio\-right=0.2\fP at a window size of 1000 pixels will add
  2934. a 200 pixels border on the right side of the window.
  2935. .sp
  2936. The video is "boxed" by these margins. The window size is not changed. In
  2937. particular it does not enlarge the window, and the margins will cause the
  2938. video to be downscaled by default. This may or may not change in the future.
  2939. .sp
  2940. The margins are applied after 90° video rotation, but before any other video
  2941. transformations.
  2942. .sp
  2943. This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
  2944. .sp
  2945. Subtitles still may use the margins, depending on \fB\-\-sub\-use\-margins\fP and
  2946. similar options.
  2947. .sp
  2948. These options were created for the OSC. Some odd decisions, such as making
  2949. the margin values a ratio (instead of pixels), were made for the sake of
  2950. the OSC. It\(aqs possible that these options may be replaced by ones that are
  2951. more generally useful. The behavior of these options may change to fit
  2952. OSC requirements better, too.
  2953. .TP
  2954. .B \fB\-\-correct\-pts\fP, \fB\-\-no\-correct\-pts\fP
  2955. \fB\-\-no\-correct\-pts\fP switches mpv to a mode where video timing is
  2956. determined using a fixed framerate value (either using the \fB\-\-fps\fP
  2957. option, or using file information). Sometimes, files with very broken
  2958. timestamps can be played somewhat well in this mode. Note that video
  2959. filters, subtitle rendering, seeking (including hr\-seeks and backstepping),
  2960. and audio synchronization can be completely broken in this mode.
  2961. .TP
  2962. .B \fB\-\-fps=<float>\fP
  2963. Override video framerate. Useful if the original value is wrong or missing.
  2964. .sp
  2965. \fBNOTE:\fP
  2966. .INDENT 7.0
  2967. .INDENT 3.5
  2968. Works in \fB\-\-no\-correct\-pts\fP mode only.
  2969. .UNINDENT
  2970. .UNINDENT
  2971. .TP
  2972. .B \fB\-\-deinterlace=<yes|no>\fP
  2973. Enable or disable interlacing (default: no).
  2974. Interlaced video shows ugly comb\-like artifacts, which are visible on
  2975. fast movement. Enabling this typically inserts the yadif video filter in
  2976. order to deinterlace the video, or lets the video output apply deinterlacing
  2977. if supported.
  2978. .sp
  2979. This behaves exactly like the \fBdeinterlace\fP input property (usually
  2980. mapped to \fBd\fP).
  2981. .sp
  2982. Keep in mind that this \fBwill\fP conflict with manually inserted
  2983. deinterlacing filters, unless you take care. (Since mpv 0.27.0, even the
  2984. hardware deinterlace filters will conflict. Also since that version,
  2985. \fB\-\-deinterlace=auto\fP was removed, which used to mean that the default
  2986. interlacing option of possibly inserted video filters was used.)
  2987. .sp
  2988. Note that this will make video look worse if it\(aqs not actually interlaced.
  2989. .TP
  2990. .B \fB\-\-frames=<number>\fP
  2991. Play/convert only first \fB<number>\fP video frames, then quit.
  2992. .sp
  2993. \fB\-\-frames=0\fP loads the file, but immediately quits before initializing
  2994. playback. (Might be useful for scripts which just want to determine some
  2995. file properties.)
  2996. .sp
  2997. For audio\-only playback, any value greater than 0 will quit playback
  2998. immediately after initialization. The value 0 works as with video.
  2999. .TP
  3000. .B \fB\-\-video\-output\-levels=<outputlevels>\fP
  3001. RGB color levels used with YUV to RGB conversion. Normally, output devices
  3002. such as PC monitors use full range color levels. However, some TVs and
  3003. video monitors expect studio RGB levels. Providing full range output to a
  3004. device expecting studio level input results in crushed blacks and whites,
  3005. the reverse in dim gray blacks and dim whites.
  3006. .sp
  3007. Not all VOs support this option. Some will silently ignore it.
  3008. .sp
  3009. Available color ranges are:
  3010. .INDENT 7.0
  3011. .TP
  3012. .B auto
  3013. automatic selection (equals to full range) (default)
  3014. .TP
  3015. .B limited
  3016. limited range (16\-235 per component), studio levels
  3017. .TP
  3018. .B full
  3019. full range (0\-255 per component), PC levels
  3020. .UNINDENT
  3021. .sp
  3022. \fBNOTE:\fP
  3023. .INDENT 7.0
  3024. .INDENT 3.5
  3025. It is advisable to use your graphics driver\(aqs color range option
  3026. instead, if available.
  3027. .UNINDENT
  3028. .UNINDENT
  3029. .TP
  3030. .B \fB\-\-hwdec\-codecs=<codec1,codec2,...|all>\fP
  3031. Allow hardware decoding for a given list of codecs only. The special value
  3032. \fBall\fP always allows all codecs.
  3033. .sp
  3034. You can get the list of allowed codecs with \fBmpv \-\-vd=help\fP\&. Remove the
  3035. prefix, e.g. instead of \fBlavc:h264\fP use \fBh264\fP\&.
  3036. .sp
  3037. By default, this is set to \fBh264,vc1,hevc,vp9\fP\&. Note that
  3038. the hardware acceleration special codecs like \fBh264_vdpau\fP are not
  3039. relevant anymore, and in fact have been removed from Libav in this form.
  3040. .sp
  3041. This is usually only needed with broken GPUs, where a codec is reported
  3042. as supported, but decoding causes more problems than it solves.
  3043. .INDENT 7.0
  3044. .INDENT 3.5
  3045. .IP "Example"
  3046. .INDENT 0.0
  3047. .TP
  3048. .B \fBmpv \-\-hwdec=vdpau \-\-vo=vdpau \-\-hwdec\-codecs=h264,mpeg2video\fP
  3049. Enable vdpau decoding for h264 and mpeg2 only.
  3050. .UNINDENT
  3051. .UNINDENT
  3052. .UNINDENT
  3053. .TP
  3054. .B \fB\-\-vd\-lavc\-check\-hw\-profile=<yes|no>\fP
  3055. Check hardware decoder profile (default: yes). If \fBno\fP is set, the
  3056. highest profile of the hardware decoder is unconditionally selected, and
  3057. decoding is forced even if the profile of the video is higher than that.
  3058. The result is most likely broken decoding, but may also help if the
  3059. detected or reported profiles are somehow incorrect.
  3060. .TP
  3061. .B \fB\-\-vd\-lavc\-software\-fallback=<yes|no|N>\fP
  3062. Fallback to software decoding if the hardware\-accelerated decoder fails
  3063. (default: 3). If this is a number, then fallback will be triggered if
  3064. N frames fail to decode in a row. 1 is equivalent to \fByes\fP\&.
  3065. .sp
  3066. Setting this to a higher number might break the playback start fallback: if
  3067. a fallback happens, parts of the file will be skipped, approximately by to
  3068. the number of packets that could not be decoded. Values below an unspecified
  3069. count will not have this problem, because mpv retains the packets.
  3070. .TP
  3071. .B \fB\-\-vd\-lavc\-dr=<yes|no>\fP
  3072. Enable direct rendering (default: yes). If this is set to \fByes\fP, the
  3073. video will be decoded directly to GPU video memory (or staging buffers).
  3074. This can speed up video upload, and may help with large resolutions or
  3075. slow hardware. This works only with the following VOs:
  3076. .INDENT 7.0
  3077. .INDENT 3.5
  3078. .INDENT 0.0
  3079. .IP \(bu 2
  3080. \fBgpu\fP: requires at least OpenGL 4.4 or Vulkan.
  3081. .UNINDENT
  3082. .UNINDENT
  3083. .UNINDENT
  3084. .sp
  3085. (In particular, this can\(aqt be made work with \fBopengl\-cb\fP, but the libmpv
  3086. render API has optional support.)
  3087. .sp
  3088. Using video filters of any kind that write to the image data (or output
  3089. newly allocated frames) will silently disable the DR code path.
  3090. .TP
  3091. .B \fB\-\-vd\-lavc\-bitexact\fP
  3092. Only use bit\-exact algorithms in all decoding steps (for codec testing).
  3093. .TP
  3094. .B \fB\-\-vd\-lavc\-fast\fP (MPEG\-2, MPEG\-4, and H.264 only)
  3095. Enable optimizations which do not comply with the format specification and
  3096. potentially cause problems, like simpler dequantization, simpler motion
  3097. compensation, assuming use of the default quantization matrix, assuming YUV
  3098. 4:2:0 and skipping a few checks to detect damaged bitstreams.
  3099. .TP
  3100. .B \fB\-\-vd\-lavc\-o=<key>=<value>[,<key>=<value>[,...]]\fP
  3101. Pass AVOptions to libavcodec decoder. Note, a patch to make the \fBo=\fP
  3102. unneeded and pass all unknown options through the AVOption system is
  3103. welcome. A full list of AVOptions can be found in the FFmpeg manual.
  3104. .sp
  3105. Some options which used to be direct options can be set with this
  3106. mechanism, like \fBbug\fP, \fBgray\fP, \fBidct\fP, \fBec\fP, \fBvismv\fP,
  3107. \fBskip_top\fP (was \fBst\fP), \fBskip_bottom\fP (was \fBsb\fP), \fBdebug\fP\&.
  3108. .sp
  3109. This is a key/value list option. See \fI\%List Options\fP for details.
  3110. .INDENT 7.0
  3111. .INDENT 3.5
  3112. .IP "Example"
  3113. .sp
  3114. \fB\-\-vd\-lavc\-o=debug=pict\fP
  3115. .UNINDENT
  3116. .UNINDENT
  3117. .TP
  3118. .B \fB\-\-vd\-lavc\-show\-all=<yes|no>\fP
  3119. Show even broken/corrupt frames (default: no). If this option is set to
  3120. no, libavcodec won\(aqt output frames that were either decoded before an
  3121. initial keyframe was decoded, or frames that are recognized as corrupted.
  3122. .TP
  3123. .B \fB\-\-vd\-lavc\-skiploopfilter=<skipvalue> (H.264 only)\fP
  3124. Skips the loop filter (AKA deblocking) during H.264 decoding. Since
  3125. the filtered frame is supposed to be used as reference for decoding
  3126. dependent frames, this has a worse effect on quality than not doing
  3127. deblocking on e.g. MPEG\-2 video. But at least for high bitrate HDTV,
  3128. this provides a big speedup with little visible quality loss.
  3129. .sp
  3130. \fB<skipvalue>\fP can be one of the following:
  3131. .INDENT 7.0
  3132. .TP
  3133. .B none
  3134. Never skip.
  3135. .TP
  3136. .B default
  3137. Skip useless processing steps (e.g. 0 size packets in AVI).
  3138. .TP
  3139. .B nonref
  3140. Skip frames that are not referenced (i.e. not used for
  3141. decoding other frames, the error cannot "build up").
  3142. .TP
  3143. .B bidir
  3144. Skip B\-Frames.
  3145. .TP
  3146. .B nonkey
  3147. Skip all frames except keyframes.
  3148. .TP
  3149. .B all
  3150. Skip all frames.
  3151. .UNINDENT
  3152. .TP
  3153. .B \fB\-\-vd\-lavc\-skipidct=<skipvalue> (MPEG\-1/2 only)\fP
  3154. Skips the IDCT step. This degrades quality a lot in almost all cases
  3155. (see skiploopfilter for available skip values).
  3156. .TP
  3157. .B \fB\-\-vd\-lavc\-skipframe=<skipvalue>\fP
  3158. Skips decoding of frames completely. Big speedup, but jerky motion and
  3159. sometimes bad artifacts (see skiploopfilter for available skip values).
  3160. .TP
  3161. .B \fB\-\-vd\-lavc\-framedrop=<skipvalue>\fP
  3162. Set framedropping mode used with \fB\-\-framedrop\fP (see skiploopfilter for
  3163. available skip values).
  3164. .TP
  3165. .B \fB\-\-vd\-lavc\-threads=<N>\fP
  3166. Number of threads to use for decoding. Whether threading is actually
  3167. supported depends on codec (default: 0). 0 means autodetect number of cores
  3168. on the machine and use that, up to the maximum of 16. You can set more than
  3169. 16 threads manually.
  3170. .TP
  3171. .B \fB\-\-vd\-lavc\-assume\-old\-x264=<yes|no>\fP
  3172. Assume the video was encoded by an old, buggy x264 version (default: no).
  3173. Normally, this is autodetected by libavcodec. But if the bitstream contains
  3174. no x264 version info (or it was somehow skipped), and the stream was in fact
  3175. encoded by an old x264 version (build 150 or earlier), and if the stream
  3176. uses \fB4:4:4\fP chroma, then libavcodec will by default show corrupted video.
  3177. This option sets the libavcodec \fBx264_build\fP option to \fB150\fP, which
  3178. means that if the stream contains no version info, or was not encoded by
  3179. x264 at all, it assumes it was encoded by the old version. Enabling this
  3180. option is pretty safe if you want your broken files to work, but in theory
  3181. this can break on streams not encoded by x264, or if a stream encoded by a
  3182. newer x264 version contains no version info.
  3183. .TP
  3184. .B \fB\-\-swapchain\-depth=<N>\fP
  3185. Allow up to N in\-flight frames. This essentially controls the frame
  3186. latency. Increasing the swapchain depth can improve pipelining and prevent
  3187. missed vsyncs, but increases visible latency. This option only mandates an
  3188. upper limit, the implementation can use a lower latency than requested
  3189. internally. A setting of 1 means that the VO will wait for every frame to
  3190. become visible before starting to render the next frame. (Default: 3)
  3191. .UNINDENT
  3192. .SS Audio
  3193. .INDENT 0.0
  3194. .TP
  3195. .B \fB\-\-audio\-pitch\-correction=<yes|no>\fP
  3196. If this is enabled (default), playing with a speed different from normal
  3197. automatically inserts the \fBscaletempo\fP audio filter. For details, see
  3198. audio filter section.
  3199. .TP
  3200. .B \fB\-\-audio\-device=<name>\fP
  3201. Use the given audio device. This consists of the audio output name, e.g.
  3202. \fBalsa\fP, followed by \fB/\fP, followed by the audio output specific device
  3203. name. The default value for this option is \fBauto\fP, which tries every audio
  3204. output in preference order with the default device.
  3205. .sp
  3206. You can list audio devices with \fB\-\-audio\-device=help\fP\&. This outputs the
  3207. device name in quotes, followed by a description. The device name is what
  3208. you have to pass to the \fB\-\-audio\-device\fP option. The list of audio devices
  3209. can be retrieved by API by using the \fBaudio\-device\-list\fP property.
  3210. .sp
  3211. While the option normally takes one of the strings as indicated by the
  3212. methods above, you can also force the device for most AOs by building it
  3213. manually. For example \fBname/foobar\fP forces the AO \fBname\fP to use the
  3214. device \fBfoobar\fP\&. However, the \fB\-\-ao\fP option will strictly force a
  3215. specific AO. To avoid confusion, don\(aqt use \fB\-\-ao\fP and \fB\-\-audio\-device\fP
  3216. together.
  3217. .INDENT 7.0
  3218. .INDENT 3.5
  3219. .IP "Example for ALSA"
  3220. .sp
  3221. MPlayer and mplayer2 required you to replace any \(aq,\(aq with \(aq.\(aq and
  3222. any \(aq:\(aq with \(aq=\(aq in the ALSA device name. For example, to use the
  3223. device named \fBdmix:default\fP, you had to do:
  3224. .INDENT 0.0
  3225. .INDENT 3.5
  3226. \fB\-ao alsa:device=dmix=default\fP
  3227. .UNINDENT
  3228. .UNINDENT
  3229. .sp
  3230. In mpv you could instead use:
  3231. .INDENT 0.0
  3232. .INDENT 3.5
  3233. \fB\-\-audio\-device=alsa/dmix:default\fP
  3234. .UNINDENT
  3235. .UNINDENT
  3236. .UNINDENT
  3237. .UNINDENT
  3238. .TP
  3239. .B \fB\-\-audio\-exclusive=<yes|no>\fP
  3240. Enable exclusive output mode. In this mode, the system is usually locked
  3241. out, and only mpv will be able to output audio.
  3242. .sp
  3243. This only works for some audio outputs, such as \fBwasapi\fP and
  3244. \fBcoreaudio\fP\&. Other audio outputs silently ignore this options. They either
  3245. have no concept of exclusive mode, or the mpv side of the implementation is
  3246. missing.
  3247. .TP
  3248. .B \fB\-\-audio\-fallback\-to\-null=<yes|no>\fP
  3249. If no audio device can be opened, behave as if \fB\-\-ao=null\fP was given. This
  3250. is useful in combination with \fB\-\-audio\-device\fP: instead of causing an
  3251. error if the selected device does not exist, the client API user (or a
  3252. Lua script) could let playback continue normally, and check the
  3253. \fBcurrent\-ao\fP and \fBaudio\-device\-list\fP properties to make high\-level
  3254. decisions about how to continue.
  3255. .TP
  3256. .B \fB\-\-ao=<driver>\fP
  3257. Specify the audio output drivers to be used. See \fI\%AUDIO OUTPUT DRIVERS\fP for
  3258. details and descriptions of available drivers.
  3259. .TP
  3260. .B \fB\-\-af=<filter1[=parameter1:parameter2:...],filter2,...>\fP
  3261. Specify a list of audio filters to apply to the audio stream. See
  3262. \fI\%AUDIO FILTERS\fP for details and descriptions of the available filters.
  3263. The option variants \fB\-\-af\-add\fP, \fB\-\-af\-pre\fP, \fB\-\-af\-del\fP and
  3264. \fB\-\-af\-clr\fP exist to modify a previously specified list, but you
  3265. should not need these for typical use.
  3266. .TP
  3267. .B \fB\-\-audio\-spdif=<codecs>\fP
  3268. List of codecs for which compressed audio passthrough should be used. This
  3269. works for both classic S/PDIF and HDMI.
  3270. .sp
  3271. Possible codecs are \fBac3\fP, \fBdts\fP, \fBdts\-hd\fP, \fBeac3\fP, \fBtruehd\fP\&.
  3272. Multiple codecs can be specified by separating them with \fB,\fP\&. \fBdts\fP
  3273. refers to low bitrate DTS core, while \fBdts\-hd\fP refers to DTS MA (receiver
  3274. and OS support varies). If both \fBdts\fP and \fBdts\-hd\fP are specified, it
  3275. behaves equivalent to specifying \fBdts\-hd\fP only.
  3276. .sp
  3277. In earlier mpv versions you could use \fB\-\-ad\fP to force the spdif wrapper.
  3278. This does not work anymore.
  3279. .INDENT 7.0
  3280. .INDENT 3.5
  3281. .IP "Warning"
  3282. .sp
  3283. There is not much reason to use this. HDMI supports uncompressed
  3284. multichannel PCM, and mpv supports lossless DTS\-HD decoding via
  3285. FFmpeg\(aqs new DCA decoder (based on libdcadec).
  3286. .UNINDENT
  3287. .UNINDENT
  3288. .TP
  3289. .B \fB\-\-ad=<decoder1,decoder2,...[\-]>\fP
  3290. Specify a priority list of audio decoders to be used, according to their
  3291. decoder name. When determining which decoder to use, the first decoder that
  3292. matches the audio format is selected. If that is unavailable, the next
  3293. decoder is used. Finally, it tries all other decoders that are not
  3294. explicitly selected or rejected by the option.
  3295. .sp
  3296. \fB\-\fP at the end of the list suppresses fallback on other available
  3297. decoders not on the \fB\-\-ad\fP list. \fB+\fP in front of an entry forces the
  3298. decoder. Both of these should not normally be used, because they break
  3299. normal decoder auto\-selection! Both of these methods are deprecated.
  3300. .INDENT 7.0
  3301. .INDENT 3.5
  3302. .IP "Examples"
  3303. .INDENT 0.0
  3304. .TP
  3305. .B \fB\-\-ad=mp3float\fP
  3306. Prefer the FFmpeg/Libav \fBmp3float\fP decoder over all other MP3
  3307. decoders.
  3308. .TP
  3309. .B \fB\-\-ad=help\fP
  3310. List all available decoders.
  3311. .UNINDENT
  3312. .UNINDENT
  3313. .UNINDENT
  3314. .INDENT 7.0
  3315. .INDENT 3.5
  3316. .IP "Warning"
  3317. .sp
  3318. Enabling compressed audio passthrough (AC3 and DTS via SPDIF/HDMI) with
  3319. this option is not possible. Use \fB\-\-audio\-spdif\fP instead.
  3320. .UNINDENT
  3321. .UNINDENT
  3322. .TP
  3323. .B \fB\-\-volume=<value>\fP
  3324. Set the startup volume. 0 means silence, 100 means no volume reduction or
  3325. amplification. Negative values can be passed for compatibility, but are
  3326. treated as 0.
  3327. .sp
  3328. Since mpv 0.18.1, this always controls the internal mixer (aka "softvol").
  3329. .TP
  3330. .B \fB\-\-replaygain=<no|track|album>\fP
  3331. Adjust volume gain according to replaygain values stored in the file
  3332. metadata. With \fB\-\-replaygain=no\fP (the default), perform no adjustment.
  3333. With \fB\-\-replaygain=track\fP, apply track gain. With \fB\-\-replaygain=album\fP,
  3334. apply album gain if present and fall back to track gain otherwise.
  3335. .TP
  3336. .B \fB\-\-replaygain\-preamp=<db>\fP
  3337. Pre\-amplification gain in dB to apply to the selected replaygain gain
  3338. (default: 0).
  3339. .TP
  3340. .B \fB\-\-replaygain\-clip=<yes|no>\fP
  3341. Prevent clipping caused by replaygain by automatically lowering the
  3342. gain (default). Use \fB\-\-replaygain\-clip=no\fP to disable this.
  3343. .TP
  3344. .B \fB\-\-replaygain\-fallback=<db>\fP
  3345. Gain in dB to apply if the file has no replay gain tags. This option
  3346. is always applied if the replaygain logic is somehow inactive. If this
  3347. is applied, no other replaygain options are applied.
  3348. .TP
  3349. .B \fB\-\-audio\-delay=<sec>\fP
  3350. Audio delay in seconds (positive or negative float value). Positive values
  3351. delay the audio, and negative values delay the video.
  3352. .TP
  3353. .B \fB\-\-mute=<yes|no|auto>\fP
  3354. Set startup audio mute status (default: no).
  3355. .sp
  3356. \fBauto\fP is a deprecated possible value that is equivalent to \fBno\fP\&.
  3357. .sp
  3358. See also: \fB\-\-volume\fP\&.
  3359. .TP
  3360. .B \fB\-\-softvol=<no|yes|auto>\fP
  3361. Deprecated/unfunctional. Before mpv 0.18.1, this used to control whether
  3362. to use the volume controls of the audio output driver or the internal mpv
  3363. volume filter.
  3364. .sp
  3365. The current behavior is that softvol is always enabled, i.e. as if this
  3366. option is set to \fByes\fP\&. The other behaviors are not available anymore,
  3367. although \fBauto\fP almost matches current behavior in most cases.
  3368. .sp
  3369. The \fBno\fP behavior is still partially available through the \fBao\-volume\fP
  3370. and \fBao\-mute\fP properties. But there are no options to reset these.
  3371. .TP
  3372. .B \fB\-\-audio\-demuxer=<[+]name>\fP
  3373. Use this audio demuxer type when using \fB\-\-audio\-file\fP\&. Use a \(aq+\(aq before
  3374. the name to force it; this will skip some checks. Give the demuxer name as
  3375. printed by \fB\-\-audio\-demuxer=help\fP\&.
  3376. .TP
  3377. .B \fB\-\-ad\-lavc\-ac3drc=<level>\fP
  3378. Select the Dynamic Range Compression level for AC\-3 audio streams.
  3379. \fB<level>\fP is a float value ranging from 0 to 1, where 0 means no
  3380. compression (which is the default) and 1 means full compression (make loud
  3381. passages more silent and vice versa). Values up to 6 are also accepted, but
  3382. are purely experimental. This option only shows an effect if the AC\-3 stream
  3383. contains the required range compression information.
  3384. .sp
  3385. The standard mandates that DRC is enabled by default, but mpv (and some
  3386. other players) ignore this for the sake of better audio quality.
  3387. .TP
  3388. .B \fB\-\-ad\-lavc\-downmix=<yes|no>\fP
  3389. Whether to request audio channel downmixing from the decoder (default: yes).
  3390. Some decoders, like AC\-3, AAC and DTS, can remix audio on decoding. The
  3391. requested number of output channels is set with the \fB\-\-audio\-channels\fP option.
  3392. Useful for playing surround audio on a stereo system.
  3393. .TP
  3394. .B \fB\-\-ad\-lavc\-threads=<0\-16>\fP
  3395. Number of threads to use for decoding. Whether threading is actually
  3396. supported depends on codec. As of this writing, it\(aqs supported for some
  3397. lossless codecs only. 0 means autodetect number of cores on the
  3398. machine and use that, up to the maximum of 16 (default: 1).
  3399. .TP
  3400. .B \fB\-\-ad\-lavc\-o=<key>=<value>[,<key>=<value>[,...]]\fP
  3401. Pass AVOptions to libavcodec decoder. Note, a patch to make the o=
  3402. unneeded and pass all unknown options through the AVOption system is
  3403. welcome. A full list of AVOptions can be found in the FFmpeg manual.
  3404. .sp
  3405. This is a key/value list option. See \fI\%List Options\fP for details.
  3406. .TP
  3407. .B \fB\-\-ad\-spdif\-dtshd=<yes|no>\fP, \fB\-\-dtshd\fP, \fB\-\-no\-dtshd\fP
  3408. If DTS is passed through, use DTS\-HD.
  3409. .INDENT 7.0
  3410. .INDENT 3.5
  3411. .IP "Warning"
  3412. .sp
  3413. This and enabling passthrough via \fB\-\-ad\fP are deprecated in favor of
  3414. using \fB\-\-audio\-spdif=dts\-hd\fP\&.
  3415. .UNINDENT
  3416. .UNINDENT
  3417. .TP
  3418. .B \fB\-\-audio\-channels=<auto\-safe|auto|layouts>\fP
  3419. Control which audio channels are output (e.g. surround vs. stereo). There
  3420. are the following possibilities:
  3421. .INDENT 7.0
  3422. .IP \(bu 2
  3423. .INDENT 2.0
  3424. .TP
  3425. .B \fB\-\-audio\-channels=auto\-safe\fP
  3426. Use the system\(aqs preferred channel layout. If there is none (such
  3427. as when accessing a hardware device instead of the system mixer),
  3428. force stereo. Some audio outputs might simply accept any layout and
  3429. do downmixing on their own.
  3430. .sp
  3431. This is the default.
  3432. .UNINDENT
  3433. .IP \(bu 2
  3434. .INDENT 2.0
  3435. .TP
  3436. .B \fB\-\-audio\-channels=auto\fP
  3437. Send the audio device whatever it accepts, preferring the audio\(aqs
  3438. original channel layout. Can cause issues with HDMI (see the warning
  3439. below).
  3440. .UNINDENT
  3441. .IP \(bu 2
  3442. .INDENT 2.0
  3443. .TP
  3444. .B \fB\-\-audio\-channels=layout1,layout2,...\fP
  3445. List of \fB,\fP\-separated channel layouts which should be allowed.
  3446. Technically, this only adjusts the filter chain output to the best
  3447. matching layout in the list, and passes the result to the audio API.
  3448. It\(aqs possible that the audio API will select a different channel
  3449. layout.
  3450. .sp
  3451. Using this mode is recommended for direct hardware output, especially
  3452. over HDMI (see HDMI warning below).
  3453. .UNINDENT
  3454. .IP \(bu 2
  3455. .INDENT 2.0
  3456. .TP
  3457. .B \fB\-\-audio\-channels=stereo\fP
  3458. Force a plain stereo downmix. This is a special\-case of the previous
  3459. item. (See paragraphs below for implications.)
  3460. .UNINDENT
  3461. .UNINDENT
  3462. .sp
  3463. If a list of layouts is given, each item can be either an explicit channel
  3464. layout name (like \fB5.1\fP), or a channel number. Channel numbers refer to
  3465. default layouts, e.g. 2 channels refer to stereo, 6 refers to 5.1.
  3466. .sp
  3467. See \fB\-\-audio\-channels=help\fP output for defined default layouts. This also
  3468. lists speaker names, which can be used to express arbitrary channel
  3469. layouts (e.g. \fBfl\-fr\-lfe\fP is 2.1).
  3470. .sp
  3471. If the list of channel layouts has only 1 item, the decoder is asked to
  3472. produce according output. This sometimes triggers decoder\-downmix, which
  3473. might be different from the normal mpv downmix. (Only some decoders support
  3474. remixing audio, like AC\-3, AAC or DTS. You can use \fB\-\-ad\-lavc\-downmix=no\fP
  3475. to make the decoder always output its native layout.) One consequence is
  3476. that \fB\-\-audio\-channels=stereo\fP triggers decoder downmix, while \fBauto\fP
  3477. or \fBauto\-safe\fP never will, even if they end up selecting stereo. This
  3478. happens because the decision whether to use decoder downmix happens long
  3479. before the audio device is opened.
  3480. .sp
  3481. If the channel layout of the media file (i.e. the decoder) and the AO\(aqs
  3482. channel layout don\(aqt match, mpv will attempt to insert a conversion filter.
  3483. You may need to change the channel layout of the system mixer to achieve
  3484. your desired output as mpv does not have control over it. Another
  3485. work\-around for this on some AOs is to use \fB\-\-audio\-exclusive=yes\fP to
  3486. circumvent the system mixer entirely.
  3487. .INDENT 7.0
  3488. .INDENT 3.5
  3489. .IP "Warning"
  3490. .sp
  3491. Using \fBauto\fP can cause issues when using audio over HDMI. The OS will
  3492. typically report all channel layouts that _can_ go over HDMI, even if
  3493. the receiver does not support them. If a receiver gets an unsupported
  3494. channel layout, random things can happen, such as dropping the
  3495. additional channels, or adding noise.
  3496. .sp
  3497. You are recommended to set an explicit whitelist of the layouts you
  3498. want. For example, most A/V receivers connected via HDMI and that can
  3499. do 7.1 would be served by: \fB\-\-audio\-channels=7.1,5.1,stereo\fP
  3500. .UNINDENT
  3501. .UNINDENT
  3502. .TP
  3503. .B \fB\-\-audio\-display=<no|attachment>\fP
  3504. Setting this option to \fBattachment\fP (default) will display image
  3505. attachments (e.g. album cover art) when playing audio files. It will
  3506. display the first image found, and additional images are available as
  3507. video tracks.
  3508. .sp
  3509. Setting this option to \fBno\fP disables display of video entirely when
  3510. playing audio files.
  3511. .sp
  3512. This option has no influence on files with normal video tracks.
  3513. .TP
  3514. .B \fB\-\-audio\-files=<files>\fP
  3515. Play audio from an external file while viewing a video.
  3516. .sp
  3517. This is a path list option. See \fI\%List Options\fP for details.
  3518. .TP
  3519. .B \fB\-\-audio\-file=<file>\fP
  3520. CLI/config file only alias for \fB\-\-audio\-files\-append\fP\&. Each use of this
  3521. option will add a new audio track. The details are similar to how
  3522. \fB\-\-sub\-file\fP works.
  3523. .TP
  3524. .B \fB\-\-audio\-format=<format>\fP
  3525. Select the sample format used for output from the audio filter layer to
  3526. the sound card. The values that \fB<format>\fP can adopt are listed below in
  3527. the description of the \fBformat\fP audio filter.
  3528. .TP
  3529. .B \fB\-\-audio\-samplerate=<Hz>\fP
  3530. Select the output sample rate to be used (of course sound cards have
  3531. limits on this). If the sample frequency selected is different from that
  3532. of the current media, the lavrresample audio filter will be inserted into
  3533. the audio filter layer to compensate for the difference.
  3534. .TP
  3535. .B \fB\-\-gapless\-audio=<no|yes|weak>\fP
  3536. Try to play consecutive audio files with no silence or disruption at the
  3537. point of file change. Default: \fBweak\fP\&.
  3538. .INDENT 7.0
  3539. .TP
  3540. .B no
  3541. Disable gapless audio.
  3542. .TP
  3543. .B yes
  3544. The audio device is opened using parameters chosen for the first
  3545. file played and is then kept open for gapless playback. This
  3546. means that if the first file for example has a low sample rate, then
  3547. the following files may get resampled to the same low sample rate,
  3548. resulting in reduced sound quality. If you play files with different
  3549. parameters, consider using options such as \fB\-\-audio\-samplerate\fP
  3550. and \fB\-\-audio\-format\fP to explicitly select what the shared output
  3551. format will be.
  3552. .TP
  3553. .B weak
  3554. Normally, the audio device is kept open (using the format it was
  3555. first initialized with). If the audio format the decoder output
  3556. changes, the audio device is closed and reopened. This means that
  3557. you will normally get gapless audio with files that were encoded
  3558. using the same settings, but might not be gapless in other cases.
  3559. The exact conditions under which the audio device is kept open is
  3560. an implementation detail, and can change from version to version.
  3561. Currently, the device is kept even if the sample format changes,
  3562. but the sample formats are convertible.
  3563. If video is still going on when there is still audio, trying to use
  3564. gapless is also explicitly given up.
  3565. .UNINDENT
  3566. .sp
  3567. \fBNOTE:\fP
  3568. .INDENT 7.0
  3569. .INDENT 3.5
  3570. This feature is implemented in a simple manner and relies on audio
  3571. output device buffering to continue playback while moving from one file
  3572. to another. If playback of the new file starts slowly, for example
  3573. because it is played from a remote network location or because you have
  3574. specified cache settings that require time for the initial cache fill,
  3575. then the buffered audio may run out before playback of the new file
  3576. can start.
  3577. .UNINDENT
  3578. .UNINDENT
  3579. .TP
  3580. .B \fB\-\-initial\-audio\-sync\fP, \fB\-\-no\-initial\-audio\-sync\fP
  3581. When starting a video file or after events such as seeking, mpv will by
  3582. default modify the audio stream to make it start from the same timestamp
  3583. as video, by either inserting silence at the start or cutting away the
  3584. first samples. Disabling this option makes the player behave like older
  3585. mpv versions did: video and audio are both started immediately even if
  3586. their start timestamps differ, and then video timing is gradually adjusted
  3587. if necessary to reach correct synchronization later.
  3588. .TP
  3589. .B \fB\-\-volume\-max=<100.0\-1000.0>\fP, \fB\-\-softvol\-max=<...>\fP
  3590. Set the maximum amplification level in percent (default: 130). A value of
  3591. 130 will allow you to adjust the volume up to about double the normal level.
  3592. .sp
  3593. \fB\-\-softvol\-max\fP is a deprecated alias and should not be used.
  3594. .TP
  3595. .B \fB\-\-audio\-file\-auto=<no|exact|fuzzy|all>\fP, \fB\-\-no\-audio\-file\-auto\fP
  3596. Load additional audio files matching the video filename. The parameter
  3597. specifies how external audio files are matched.
  3598. .INDENT 7.0
  3599. .TP
  3600. .B no
  3601. Don\(aqt automatically load external audio files (default).
  3602. .TP
  3603. .B exact
  3604. Load the media filename with audio file extension.
  3605. .TP
  3606. .B fuzzy
  3607. Load all audio files containing media filename.
  3608. .TP
  3609. .B all
  3610. Load all audio files in the current and \fB\-\-audio\-file\-paths\fP
  3611. directories.
  3612. .UNINDENT
  3613. .TP
  3614. .B \fB\-\-audio\-file\-paths=<path1:path2:...>\fP
  3615. Equivalent to \fB\-\-sub\-file\-paths\fP option, but for auto\-loaded audio files.
  3616. .sp
  3617. This is a path list option. See \fI\%List Options\fP for details.
  3618. .TP
  3619. .B \fB\-\-audio\-client\-name=<name>\fP
  3620. The application name the player reports to the audio API. Can be useful
  3621. if you want to force a different audio profile (e.g. with PulseAudio),
  3622. or to set your own application name when using libmpv.
  3623. .TP
  3624. .B \fB\-\-audio\-buffer=<seconds>\fP
  3625. Set the audio output minimum buffer. The audio device might actually create
  3626. a larger buffer if it pleases. If the device creates a smaller buffer,
  3627. additional audio is buffered in an additional software buffer.
  3628. .sp
  3629. Making this larger will make soft\-volume and other filters react slower,
  3630. introduce additional issues on playback speed change, and block the
  3631. player on audio format changes. A smaller buffer might lead to audio
  3632. dropouts.
  3633. .sp
  3634. This option should be used for testing only. If a non\-default value helps
  3635. significantly, the mpv developers should be contacted.
  3636. .sp
  3637. Default: 0.2 (200 ms).
  3638. .TP
  3639. .B \fB\-\-audio\-stream\-silence=<yes|no>\fP
  3640. Cash\-grab consumer audio hardware (such as A/V receivers) often ignore
  3641. initial audio sent over HDMI. This can happen every time audio over HDMI
  3642. is stopped and resumed. In order to compensate for this, you can enable
  3643. this option to not to stop and restart audio on seeks, and fill the gaps
  3644. with silence. Likewise, when pausing playback, audio is not stopped, and
  3645. silence is played while paused. Note that if no audio track is selected,
  3646. the audio device will still be closed immediately.
  3647. .sp
  3648. Not all AOs support this.
  3649. .TP
  3650. .B \fB\-\-audio\-wait\-open=<secs>\fP
  3651. This makes sense for use with \fB\-\-audio\-stream\-silence=yes\fP\&. If this option
  3652. is given, the player will wait for the given amount of seconds after opening
  3653. the audio device before sending actual audio data to it. Useful if your
  3654. expensive hardware discards the first 1 or 2 seconds of audio data sent to
  3655. it. If \fB\-\-audio\-stream\-silence=yes\fP is not set, this option will likely
  3656. just waste time.
  3657. .UNINDENT
  3658. .SS Subtitles
  3659. .sp
  3660. \fBNOTE:\fP
  3661. .INDENT 0.0
  3662. .INDENT 3.5
  3663. Changing styling and position does not work with all subtitles. Image\-based
  3664. subtitles (DVD, Bluray/PGS, DVB) cannot changed for fundamental reasons.
  3665. Subtitles in ASS format are normally not changed intentionally, but
  3666. overriding them can be controlled with \fB\-\-sub\-ass\-override\fP\&.
  3667. .sp
  3668. Previously some options working on text subtitles were called
  3669. \fB\-\-sub\-text\-*\fP, they are now named \fB\-\-sub\-*\fP, and those specifically
  3670. for ASS have been renamed from \fB\-\-ass\-*\fP to \fB\-\-sub\-ass\-*\fP\&.
  3671. They are now all in this section.
  3672. .UNINDENT
  3673. .UNINDENT
  3674. .INDENT 0.0
  3675. .TP
  3676. .B \fB\-\-sub\-demuxer=<[+]name>\fP
  3677. Force subtitle demuxer type for \fB\-\-sub\-file\fP\&. Give the demuxer name as
  3678. printed by \fB\-\-sub\-demuxer=help\fP\&.
  3679. .TP
  3680. .B \fB\-\-sub\-delay=<sec>\fP
  3681. Delays subtitles by \fB<sec>\fP seconds. Can be negative.
  3682. .TP
  3683. .B \fB\-\-sub\-files=<file\-list>\fP, \fB\-\-sub\-file=<filename>\fP
  3684. Add a subtitle file to the list of external subtitles.
  3685. .sp
  3686. If you use \fB\-\-sub\-file\fP only once, this subtitle file is displayed by
  3687. default.
  3688. .sp
  3689. If \fB\-\-sub\-file\fP is used multiple times, the subtitle to use can be
  3690. switched at runtime by cycling subtitle tracks. It\(aqs possible to show
  3691. two subtitles at once: use \fB\-\-sid\fP to select the first subtitle index,
  3692. and \fB\-\-secondary\-sid\fP to select the second index. (The index is printed
  3693. on the terminal output after the \fB\-\-sid=\fP in the list of streams.)
  3694. .sp
  3695. \fB\-\-sub\-files\fP is a path list option (see \fI\%List Options\fP for details), and
  3696. can take multiple file names separated by \fB:\fP (Unix) or \fB;\fP (Windows),
  3697. while \fB\-\-sub\-file\fP takes a single filename, but can be used multiple
  3698. times to add multiple files. Technically, \fB\-\-sub\-file\fP is a CLI/config
  3699. file only alias for \fB\-\-sub\-files\-append\fP\&.
  3700. .TP
  3701. .B \fB\-\-secondary\-sid=<ID|auto|no>\fP
  3702. Select a secondary subtitle stream. This is similar to \fB\-\-sid\fP\&. If a
  3703. secondary subtitle is selected, it will be rendered as toptitle (i.e. on
  3704. the top of the screen) alongside the normal subtitle, and provides a way
  3705. to render two subtitles at once.
  3706. .sp
  3707. There are some caveats associated with this feature. For example, bitmap
  3708. subtitles will always be rendered in their usual position, so selecting a
  3709. bitmap subtitle as secondary subtitle will result in overlapping subtitles.
  3710. Secondary subtitles are never shown on the terminal if video is disabled.
  3711. .sp
  3712. \fBNOTE:\fP
  3713. .INDENT 7.0
  3714. .INDENT 3.5
  3715. Styling and interpretation of any formatting tags is disabled for the
  3716. secondary subtitle. Internally, the same mechanism as \fB\-\-no\-sub\-ass\fP
  3717. is used to strip the styling.
  3718. .UNINDENT
  3719. .UNINDENT
  3720. .sp
  3721. \fBNOTE:\fP
  3722. .INDENT 7.0
  3723. .INDENT 3.5
  3724. If the main subtitle stream contains formatting tags which display the
  3725. subtitle at the top of the screen, it will overlap with the secondary
  3726. subtitle. To prevent this, you could use \fB\-\-no\-sub\-ass\fP to disable
  3727. styling in the main subtitle stream.
  3728. .UNINDENT
  3729. .UNINDENT
  3730. .TP
  3731. .B \fB\-\-sub\-scale=<0\-100>\fP
  3732. Factor for the text subtitle font size (default: 1).
  3733. .sp
  3734. \fBNOTE:\fP
  3735. .INDENT 7.0
  3736. .INDENT 3.5
  3737. This affects ASS subtitles as well, and may lead to incorrect subtitle
  3738. rendering. Use with care, or use \fB\-\-sub\-font\-size\fP instead.
  3739. .UNINDENT
  3740. .UNINDENT
  3741. .TP
  3742. .B \fB\-\-sub\-scale\-by\-window=<yes|no>\fP
  3743. Whether to scale subtitles with the window size (default: yes). If this is
  3744. disabled, changing the window size won\(aqt change the subtitle font size.
  3745. .sp
  3746. Like \fB\-\-sub\-scale\fP, this can break ASS subtitles.
  3747. .TP
  3748. .B \fB\-\-sub\-scale\-with\-window=<yes|no>\fP
  3749. Make the subtitle font size relative to the window, instead of the video.
  3750. This is useful if you always want the same font size, even if the video
  3751. doesn\(aqt cover the window fully, e.g. because screen aspect and window
  3752. aspect mismatch (and the player adds black bars).
  3753. .sp
  3754. Default: yes.
  3755. .sp
  3756. This option is misnamed. The difference to the confusingly similar sounding
  3757. option \fB\-\-sub\-scale\-by\-window\fP is that \fB\-\-sub\-scale\-with\-window\fP still
  3758. scales with the approximate window size, while the other option disables
  3759. this scaling.
  3760. .sp
  3761. Affects plain text subtitles only (or ASS if \fB\-\-sub\-ass\-override\fP is set
  3762. high enough).
  3763. .TP
  3764. .B \fB\-\-sub\-ass\-scale\-with\-window=<yes|no>\fP
  3765. Like \fB\-\-sub\-scale\-with\-window\fP, but affects subtitles in ASS format only.
  3766. Like \fB\-\-sub\-scale\fP, this can break ASS subtitles.
  3767. .sp
  3768. Default: no.
  3769. .TP
  3770. .B \fB\-\-embeddedfonts=<yes|no>\fP
  3771. Use fonts embedded in Matroska container files and ASS scripts (default:
  3772. yes). These fonts can be used for SSA/ASS subtitle rendering.
  3773. .TP
  3774. .B \fB\-\-sub\-pos=<0\-100>\fP
  3775. Specify the position of subtitles on the screen. The value is the vertical
  3776. position of the subtitle in % of the screen height.
  3777. .sp
  3778. \fBNOTE:\fP
  3779. .INDENT 7.0
  3780. .INDENT 3.5
  3781. This affects ASS subtitles as well, and may lead to incorrect subtitle
  3782. rendering. Use with care, or use \fB\-\-sub\-margin\-y\fP instead.
  3783. .UNINDENT
  3784. .UNINDENT
  3785. .TP
  3786. .B \fB\-\-sub\-speed=<0.1\-10.0>\fP
  3787. Multiply the subtitle event timestamps with the given value. Can be used
  3788. to fix the playback speed for frame\-based subtitle formats. Affects text
  3789. subtitles only.
  3790. .INDENT 7.0
  3791. .INDENT 3.5
  3792. .IP "Example"
  3793. .sp
  3794. \fB\-\-sub\-speed=25/23.976\fP plays frame based subtitles which have been
  3795. loaded assuming a framerate of 23.976 at 25 FPS.
  3796. .UNINDENT
  3797. .UNINDENT
  3798. .TP
  3799. .B \fB\-\-sub\-ass\-force\-style=<[Style.]Param=Value[,...]>\fP
  3800. Override some style or script info parameters.
  3801. .sp
  3802. This is a string list option. See \fI\%List Options\fP for details.
  3803. .INDENT 7.0
  3804. .INDENT 3.5
  3805. .IP "Examples"
  3806. .INDENT 0.0
  3807. .IP \(bu 2
  3808. \fB\-\-sub\-ass\-force\-style=FontName=Arial,Default.Bold=1\fP
  3809. .IP \(bu 2
  3810. \fB\-\-sub\-ass\-force\-style=PlayResY=768\fP
  3811. .UNINDENT
  3812. .UNINDENT
  3813. .UNINDENT
  3814. .sp
  3815. \fBNOTE:\fP
  3816. .INDENT 7.0
  3817. .INDENT 3.5
  3818. Using this option may lead to incorrect subtitle rendering.
  3819. .UNINDENT
  3820. .UNINDENT
  3821. .TP
  3822. .B \fB\-\-sub\-ass\-hinting=<none|light|normal|native>\fP
  3823. Set font hinting type. <type> can be:
  3824. .INDENT 7.0
  3825. .TP
  3826. .B none
  3827. no hinting (default)
  3828. .TP
  3829. .B light
  3830. FreeType autohinter, light mode
  3831. .TP
  3832. .B normal
  3833. FreeType autohinter, normal mode
  3834. .TP
  3835. .B native
  3836. font native hinter
  3837. .UNINDENT
  3838. .INDENT 7.0
  3839. .INDENT 3.5
  3840. .IP "Warning"
  3841. .sp
  3842. Enabling hinting can lead to mispositioned text (in situations it\(aqs
  3843. supposed to match up video background), or reduce the smoothness
  3844. of animations with some badly authored ASS scripts. It is recommended
  3845. to not use this option, unless really needed.
  3846. .UNINDENT
  3847. .UNINDENT
  3848. .TP
  3849. .B \fB\-\-sub\-ass\-line\-spacing=<value>\fP
  3850. Set line spacing value for SSA/ASS renderer.
  3851. .TP
  3852. .B \fB\-\-sub\-ass\-shaper=<simple|complex>\fP
  3853. Set the text layout engine used by libass.
  3854. .INDENT 7.0
  3855. .TP
  3856. .B simple
  3857. uses Fribidi only, fast, doesn\(aqt render some languages correctly
  3858. .TP
  3859. .B complex
  3860. uses HarfBuzz, slower, wider language support
  3861. .UNINDENT
  3862. .sp
  3863. \fBcomplex\fP is the default. If libass hasn\(aqt been compiled against HarfBuzz,
  3864. libass silently reverts to \fBsimple\fP\&.
  3865. .TP
  3866. .B \fB\-\-sub\-ass\-styles=<filename>\fP
  3867. Load all SSA/ASS styles found in the specified file and use them for
  3868. rendering text subtitles. The syntax of the file is exactly like the \fB[V4
  3869. Styles]\fP / \fB[V4+ Styles]\fP section of SSA/ASS.
  3870. .sp
  3871. \fBNOTE:\fP
  3872. .INDENT 7.0
  3873. .INDENT 3.5
  3874. Using this option may lead to incorrect subtitle rendering.
  3875. .UNINDENT
  3876. .UNINDENT
  3877. .TP
  3878. .B \fB\-\-sub\-ass\-override=<yes|no|force|scale|strip>\fP
  3879. Control whether user style overrides should be applied. Note that all of
  3880. these overrides try to be somewhat smart about figuring out whether or not
  3881. a subtitle is considered a "sign".
  3882. .INDENT 7.0
  3883. .TP
  3884. .B no
  3885. Render subtitles as specified by the subtitle scripts, without
  3886. overrides.
  3887. .TP
  3888. .B yes
  3889. Apply all the \fB\-\-sub\-ass\-*\fP style override options. Changing the
  3890. default for any of these options can lead to incorrect subtitle
  3891. rendering (default).
  3892. .TP
  3893. .B force
  3894. Like \fByes\fP, but also force all \fB\-\-sub\-*\fP options. Can break
  3895. rendering easily.
  3896. .TP
  3897. .B scale
  3898. Like \fByes\fP, but also apply \fB\-\-sub\-scale\fP\&.
  3899. .TP
  3900. .B strip
  3901. Radically strip all ASS tags and styles from the subtitle. This
  3902. is equivalent to the old \fB\-\-no\-ass\fP / \fB\-\-no\-sub\-ass\fP options.
  3903. .UNINDENT
  3904. .sp
  3905. This also controls some bitmap subtitle overrides, as well as HTML tags in
  3906. formats like SRT, despite the name of the option.
  3907. .TP
  3908. .B \fB\-\-sub\-ass\-force\-margins\fP
  3909. Enables placing toptitles and subtitles in black borders when they are
  3910. available, if the subtitles are in the ASS format.
  3911. .sp
  3912. Default: no.
  3913. .TP
  3914. .B \fB\-\-sub\-use\-margins\fP
  3915. Enables placing toptitles and subtitles in black borders when they are
  3916. available, if the subtitles are in a plain text format (or ASS if
  3917. \fB\-\-sub\-ass\-override\fP is set high enough).
  3918. .sp
  3919. Default: yes.
  3920. .sp
  3921. Renamed from \fB\-\-sub\-ass\-use\-margins\fP\&. To place ASS subtitles in the borders
  3922. too (like the old option did), also add \fB\-\-sub\-ass\-force\-margins\fP\&.
  3923. .TP
  3924. .B \fB\-\-sub\-ass\-vsfilter\-aspect\-compat=<yes|no>\fP
  3925. Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility
  3926. with traditional VSFilter behavior. This switch has no effect when the
  3927. video is stored with square pixels.
  3928. .sp
  3929. The renderer historically most commonly used for the SSA/ASS subtitle
  3930. formats, VSFilter, had questionable behavior that resulted in subtitles
  3931. being stretched too if the video was stored in anamorphic format that
  3932. required scaling for display. This behavior is usually undesirable and
  3933. newer VSFilter versions may behave differently. However, many existing
  3934. scripts compensate for the stretching by modifying things in the opposite
  3935. direction. Thus, if such scripts are displayed "correctly", they will not
  3936. appear as intended. This switch enables emulation of the old VSFilter
  3937. behavior (undesirable but expected by many existing scripts).
  3938. .sp
  3939. Enabled by default.
  3940. .TP
  3941. .B \fB\-\-sub\-ass\-vsfilter\-blur\-compat=<yes|no>\fP
  3942. Scale \fB\eblur\fP tags by video resolution instead of script resolution
  3943. (enabled by default). This is bug in VSFilter, which according to some,
  3944. can\(aqt be fixed anymore in the name of compatibility.
  3945. .sp
  3946. Note that this uses the actual video resolution for calculating the
  3947. offset scale factor, not what the video filter chain or the video output
  3948. use.
  3949. .TP
  3950. .B \fB\-\-sub\-ass\-vsfilter\-color\-compat=<basic|full|force\-601|no>\fP
  3951. Mangle colors like (xy\-)vsfilter do (default: basic). Historically, VSFilter
  3952. was not color space aware. This was no problem as long as the color space
  3953. used for SD video (BT.601) was used. But when everything switched to HD
  3954. (BT.709), VSFilter was still converting RGB colors to BT.601, rendered
  3955. them into the video frame, and handled the frame to the video output, which
  3956. would use BT.709 for conversion to RGB. The result were mangled subtitle
  3957. colors. Later on, bad hacks were added on top of the ASS format to control
  3958. how colors are to be mangled.
  3959. .INDENT 7.0
  3960. .TP
  3961. .B basic
  3962. Handle only BT.601\->BT.709 mangling, if the subtitles seem to
  3963. indicate that this is required (default).
  3964. .TP
  3965. .B full
  3966. Handle the full \fBYCbCr Matrix\fP header with all video color spaces
  3967. supported by libass and mpv. This might lead to bad breakages in
  3968. corner cases and is not strictly needed for compatibility
  3969. (hopefully), which is why this is not default.
  3970. .TP
  3971. .B force\-601
  3972. Force BT.601\->BT.709 mangling, regardless of subtitle headers
  3973. or video color space.
  3974. .TP
  3975. .B no
  3976. Disable color mangling completely. All colors are RGB.
  3977. .UNINDENT
  3978. .sp
  3979. Choosing anything other than \fBno\fP will make the subtitle color depend on
  3980. the video color space, and it\(aqs for example in theory not possible to reuse
  3981. a subtitle script with another video file. The \fB\-\-sub\-ass\-override\fP
  3982. option doesn\(aqt affect how this option is interpreted.
  3983. .TP
  3984. .B \fB\-\-stretch\-dvd\-subs=<yes|no>\fP
  3985. Stretch DVD subtitles when playing anamorphic videos for better looking
  3986. fonts on badly mastered DVDs. This switch has no effect when the
  3987. video is stored with square pixels \- which for DVD input cannot be the case
  3988. though.
  3989. .sp
  3990. Many studios tend to use bitmap fonts designed for square pixels when
  3991. authoring DVDs, causing the fonts to look stretched on playback on DVD
  3992. players. This option fixes them, however at the price of possibly
  3993. misaligning some subtitles (e.g. sign translations).
  3994. .sp
  3995. Disabled by default.
  3996. .TP
  3997. .B \fB\-\-stretch\-image\-subs\-to\-screen=<yes|no>\fP
  3998. Stretch DVD and other image subtitles to the screen, ignoring the video
  3999. margins. This has a similar effect as \fB\-\-sub\-use\-margins\fP for text
  4000. subtitles, except that the text itself will be stretched, not only just
  4001. repositioned. (At least in general it is unavoidable, as an image bitmap
  4002. can in theory consist of a single bitmap covering the whole screen, and
  4003. the player won\(aqt know where exactly the text parts are located.)
  4004. .sp
  4005. This option does not display subtitles correctly. Use with care.
  4006. .sp
  4007. Disabled by default.
  4008. .TP
  4009. .B \fB\-\-image\-subs\-video\-resolution=<yes|no>\fP
  4010. Override the image subtitle resolution with the video resolution
  4011. (default: no). Normally, the subtitle canvas is fit into the video canvas
  4012. (e.g. letterboxed). Setting this option uses the video size as subtitle
  4013. canvas size. Can be useful to test broken subtitles, which often happen
  4014. when the video was trancoded, while attempting to keep the old subtitles.
  4015. .TP
  4016. .B \fB\-\-sub\-ass\fP, \fB\-\-no\-sub\-ass\fP
  4017. Render ASS subtitles natively (enabled by default).
  4018. .sp
  4019. \fBNOTE:\fP
  4020. .INDENT 7.0
  4021. .INDENT 3.5
  4022. This has been deprecated by \fB\-\-sub\-ass\-override=strip\fP\&. You also
  4023. may need \fB\-\-embeddedfonts=no\fP to get the same behavior. Also,
  4024. using \fB\-\-sub\-ass\-override=style\fP should give better results
  4025. without breaking subtitles too much.
  4026. .UNINDENT
  4027. .UNINDENT
  4028. .sp
  4029. If \fB\-\-no\-sub\-ass\fP is specified, all tags and style declarations are
  4030. stripped and ignored on display. The subtitle renderer uses the font style
  4031. as specified by the \fB\-\-sub\-\fP options instead.
  4032. .sp
  4033. \fBNOTE:\fP
  4034. .INDENT 7.0
  4035. .INDENT 3.5
  4036. Using \fB\-\-no\-sub\-ass\fP may lead to incorrect or completely broken
  4037. rendering of ASS/SSA subtitles. It can sometimes be useful to forcibly
  4038. override the styling of ASS subtitles, but should be avoided in general.
  4039. .UNINDENT
  4040. .UNINDENT
  4041. .TP
  4042. .B \fB\-\-sub\-auto=<no|exact|fuzzy|all>\fP, \fB\-\-no\-sub\-auto\fP
  4043. Load additional subtitle files matching the video filename. The parameter
  4044. specifies how external subtitle files are matched. \fBexact\fP is enabled by
  4045. default.
  4046. .INDENT 7.0
  4047. .TP
  4048. .B no
  4049. Don\(aqt automatically load external subtitle files.
  4050. .TP
  4051. .B exact
  4052. Load the media filename with subtitle file extension (default).
  4053. .TP
  4054. .B fuzzy
  4055. Load all subs containing media filename.
  4056. .TP
  4057. .B all
  4058. Load all subs in the current and \fB\-\-sub\-file\-paths\fP directories.
  4059. .UNINDENT
  4060. .TP
  4061. .B \fB\-\-sub\-codepage=<codepage>\fP
  4062. You can use this option to specify the subtitle codepage. uchardet will be
  4063. used to guess the charset. (If mpv was not compiled with uchardet, then
  4064. \fButf\-8\fP is the effective default.)
  4065. .sp
  4066. The default value for this option is \fBauto\fP, which enables autodetection.
  4067. .sp
  4068. The following steps are taken to determine the final codepage, in order:
  4069. .INDENT 7.0
  4070. .IP \(bu 2
  4071. if the specific codepage has a \fB+\fP, use that codepage
  4072. .IP \(bu 2
  4073. if the data looks like UTF\-8, assume it is UTF\-8
  4074. .IP \(bu 2
  4075. if \fB\-\-sub\-codepage\fP is set to a specific codepage, use that
  4076. .IP \(bu 2
  4077. run uchardet, and if successful, use that
  4078. .IP \(bu 2
  4079. otherwise, use \fBUTF\-8\-BROKEN\fP
  4080. .UNINDENT
  4081. .INDENT 7.0
  4082. .INDENT 3.5
  4083. .IP "Examples"
  4084. .INDENT 0.0
  4085. .IP \(bu 2
  4086. \fB\-\-sub\-codepage=latin2\fP Use Latin 2 if input is not UTF\-8.
  4087. .IP \(bu 2
  4088. \fB\-\-sub\-codepage=+cp1250\fP Always force recoding to cp1250.
  4089. .UNINDENT
  4090. .UNINDENT
  4091. .UNINDENT
  4092. .sp
  4093. The pseudo codepage \fBUTF\-8\-BROKEN\fP is used internally. If it\(aqs set,
  4094. subtitles are interpreted as UTF\-8 with "Latin 1" as fallback for bytes
  4095. which are not valid UTF\-8 sequences. iconv is never involved in this mode.
  4096. .sp
  4097. This option changed in mpv 0.23.0. Support for the old syntax was fully
  4098. removed in mpv 0.24.0.
  4099. .TP
  4100. .B \fB\-\-sub\-fix\-timing=<yes|no>\fP
  4101. Adjust subtitle timing is to remove minor gaps or overlaps between
  4102. subtitles (if the difference is smaller than 210 ms, the gap or overlap
  4103. is removed).
  4104. .TP
  4105. .B \fB\-\-sub\-forced\-only\fP
  4106. Display only forced subtitles for the DVD subtitle stream selected by e.g.
  4107. \fB\-\-slang\fP\&.
  4108. .TP
  4109. .B \fB\-\-sub\-fps=<rate>\fP
  4110. Specify the framerate of the subtitle file (default: video fps). Affects
  4111. text subtitles only.
  4112. .sp
  4113. \fBNOTE:\fP
  4114. .INDENT 7.0
  4115. .INDENT 3.5
  4116. \fB<rate>\fP > video fps speeds the subtitles up for frame\-based
  4117. subtitle files and slows them down for time\-based ones.
  4118. .UNINDENT
  4119. .UNINDENT
  4120. .sp
  4121. See also: \fB\-\-sub\-speed\fP\&.
  4122. .TP
  4123. .B \fB\-\-sub\-gauss=<0.0\-3.0>\fP
  4124. Apply Gaussian blur to image subtitles (default: 0). This can help to make
  4125. pixelated DVD/Vobsubs look nicer. A value other than 0 also switches to
  4126. software subtitle scaling. Might be slow.
  4127. .sp
  4128. \fBNOTE:\fP
  4129. .INDENT 7.0
  4130. .INDENT 3.5
  4131. Never applied to text subtitles.
  4132. .UNINDENT
  4133. .UNINDENT
  4134. .TP
  4135. .B \fB\-\-sub\-gray\fP
  4136. Convert image subtitles to grayscale. Can help to make yellow DVD/Vobsubs
  4137. look nicer.
  4138. .sp
  4139. \fBNOTE:\fP
  4140. .INDENT 7.0
  4141. .INDENT 3.5
  4142. Never applied to text subtitles.
  4143. .UNINDENT
  4144. .UNINDENT
  4145. .TP
  4146. .B \fB\-\-sub\-paths=<path1:path2:...>\fP
  4147. Deprecated, use \fB\-\-sub\-file\-paths\fP\&.
  4148. .TP
  4149. .B \fB\-\-sub\-file\-paths=<path\-list>\fP
  4150. Specify extra directories to search for subtitles matching the video.
  4151. Multiple directories can be separated by ":" (";" on Windows).
  4152. Paths can be relative or absolute. Relative paths are interpreted relative
  4153. to video file directory.
  4154. If the file is a URL, only absolute paths and \fBsub\fP configuration
  4155. subdirectory will be scanned.
  4156. .INDENT 7.0
  4157. .INDENT 3.5
  4158. .IP "Example"
  4159. .sp
  4160. Assuming that \fB/path/to/video/video.avi\fP is played and
  4161. \fB\-\-sub\-file\-paths=sub:subtitles\fP is specified, mpv
  4162. searches for subtitle files in these directories:
  4163. .INDENT 0.0
  4164. .IP \(bu 2
  4165. \fB/path/to/video/\fP
  4166. .IP \(bu 2
  4167. \fB/path/to/video/sub/\fP
  4168. .IP \(bu 2
  4169. \fB/path/to/video/subtitles/\fP
  4170. .IP \(bu 2
  4171. the \fBsub\fP configuration subdirectory (usually \fB~/.config/mpv/sub/\fP)
  4172. .UNINDENT
  4173. .UNINDENT
  4174. .UNINDENT
  4175. .sp
  4176. This is a path list option. See \fI\%List Options\fP for details.
  4177. .TP
  4178. .B \fB\-\-sub\-visibility\fP, \fB\-\-no\-sub\-visibility\fP
  4179. Can be used to disable display of subtitles, but still select and decode
  4180. them.
  4181. .TP
  4182. .B \fB\-\-sub\-clear\-on\-seek\fP
  4183. (Obscure, rarely useful.) Can be used to play broken mkv files with
  4184. duplicate ReadOrder fields. ReadOrder is the first field in a
  4185. Matroska\-style ASS subtitle packets. It should be unique, and libass
  4186. uses it for fast elimination of duplicates. This option disables caching
  4187. of subtitles across seeks, so after a seek libass can\(aqt eliminate subtitle
  4188. packets with the same ReadOrder as earlier packets.
  4189. .TP
  4190. .B \fB\-\-teletext\-page=<1\-999>\fP
  4191. This works for \fBdvb_teletext\fP subtitle streams, and if FFmpeg has been
  4192. compiled with support for it.
  4193. .TP
  4194. .B \fB\-\-sub\-font=<name>\fP
  4195. Specify font to use for subtitles that do not themselves
  4196. specify a particular font. The default is \fBsans\-serif\fP\&.
  4197. .INDENT 7.0
  4198. .INDENT 3.5
  4199. .IP "Examples"
  4200. .INDENT 0.0
  4201. .IP \(bu 2
  4202. \fB\-\-sub\-font=\(aqBitstream Vera Sans\(aq\fP
  4203. .IP \(bu 2
  4204. \fB\-\-sub\-font=\(aqComic Sans MS\(aq\fP
  4205. .UNINDENT
  4206. .UNINDENT
  4207. .UNINDENT
  4208. .sp
  4209. \fBNOTE:\fP
  4210. .INDENT 7.0
  4211. .INDENT 3.5
  4212. The \fB\-\-sub\-font\fP option (and many other style related \fB\-\-sub\-\fP
  4213. options) are ignored when ASS\-subtitles are rendered, unless the
  4214. \fB\-\-no\-sub\-ass\fP option is specified.
  4215. .sp
  4216. This used to support fontconfig patterns. Starting with libass 0.13.0,
  4217. this stopped working.
  4218. .UNINDENT
  4219. .UNINDENT
  4220. .TP
  4221. .B \fB\-\-sub\-font\-size=<size>\fP
  4222. Specify the sub font size. The unit is the size in scaled pixels at a
  4223. window height of 720. The actual pixel size is scaled with the window
  4224. height: if the window height is larger or smaller than 720, the actual size
  4225. of the text increases or decreases as well.
  4226. .sp
  4227. Default: 55.
  4228. .TP
  4229. .B \fB\-\-sub\-back\-color=<color>\fP
  4230. See \fB\-\-sub\-color\fP\&. Color used for sub text background. You can use
  4231. \fB\-\-sub\-shadow\-offset\fP to change its size relative to the text.
  4232. .TP
  4233. .B \fB\-\-sub\-blur=<0..20.0>\fP
  4234. Gaussian blur factor. 0 means no blur applied (default).
  4235. .TP
  4236. .B \fB\-\-sub\-bold=<yes|no>\fP
  4237. Format text on bold.
  4238. .TP
  4239. .B \fB\-\-sub\-italic=<yes|no>\fP
  4240. Format text on italic.
  4241. .TP
  4242. .B \fB\-\-sub\-border\-color=<color>\fP
  4243. See \fB\-\-sub\-color\fP\&. Color used for the sub font border.
  4244. .sp
  4245. \fBNOTE:\fP
  4246. .INDENT 7.0
  4247. .INDENT 3.5
  4248. ignored when \fB\-\-sub\-back\-color\fP is
  4249. specified (or more exactly: when that option is not set to completely
  4250. transparent).
  4251. .UNINDENT
  4252. .UNINDENT
  4253. .TP
  4254. .B \fB\-\-sub\-border\-size=<size>\fP
  4255. Size of the sub font border in scaled pixels (see \fB\-\-sub\-font\-size\fP
  4256. for details). A value of 0 disables borders.
  4257. .sp
  4258. Default: 3.
  4259. .TP
  4260. .B \fB\-\-sub\-color=<color>\fP
  4261. Specify the color used for unstyled text subtitles.
  4262. .sp
  4263. The color is specified in the form \fBr/g/b\fP, where each color component
  4264. is specified as number in the range 0.0 to 1.0. It\(aqs also possible to
  4265. specify the transparency by using \fBr/g/b/a\fP, where the alpha value 0
  4266. means fully transparent, and 1.0 means opaque. If the alpha component is
  4267. not given, the color is 100% opaque.
  4268. .sp
  4269. Passing a single number to the option sets the sub to gray, and the form
  4270. \fBgray/a\fP lets you specify alpha additionally.
  4271. .INDENT 7.0
  4272. .INDENT 3.5
  4273. .IP "Examples"
  4274. .INDENT 0.0
  4275. .IP \(bu 2
  4276. \fB\-\-sub\-color=1.0/0.0/0.0\fP set sub to opaque red
  4277. .IP \(bu 2
  4278. \fB\-\-sub\-color=1.0/0.0/0.0/0.75\fP set sub to opaque red with 75% alpha
  4279. .IP \(bu 2
  4280. \fB\-\-sub\-color=0.5/0.75\fP set sub to 50% gray with 75% alpha
  4281. .UNINDENT
  4282. .UNINDENT
  4283. .UNINDENT
  4284. .sp
  4285. Alternatively, the color can be specified as a RGB hex triplet in the form
  4286. \fB#RRGGBB\fP, where each 2\-digit group expresses a color value in the
  4287. range 0 (\fB00\fP) to 255 (\fBFF\fP). For example, \fB#FF0000\fP is red.
  4288. This is similar to web colors. Alpha is given with \fB#AARRGGBB\fP\&.
  4289. .INDENT 7.0
  4290. .INDENT 3.5
  4291. .IP "Examples"
  4292. .INDENT 0.0
  4293. .IP \(bu 2
  4294. \fB\-\-sub\-color=\(aq#FF0000\(aq\fP set sub to opaque red
  4295. .IP \(bu 2
  4296. \fB\-\-sub\-color=\(aq#C0808080\(aq\fP set sub to 50% gray with 75% alpha
  4297. .UNINDENT
  4298. .UNINDENT
  4299. .UNINDENT
  4300. .TP
  4301. .B \fB\-\-sub\-margin\-x=<size>\fP
  4302. Left and right screen margin for the subs in scaled pixels (see
  4303. \fB\-\-sub\-font\-size\fP for details).
  4304. .sp
  4305. This option specifies the distance of the sub to the left, as well as at
  4306. which distance from the right border long sub text will be broken.
  4307. .sp
  4308. Default: 25.
  4309. .TP
  4310. .B \fB\-\-sub\-margin\-y=<size>\fP
  4311. Top and bottom screen margin for the subs in scaled pixels (see
  4312. \fB\-\-sub\-font\-size\fP for details).
  4313. .sp
  4314. This option specifies the vertical margins of unstyled text subtitles.
  4315. If you just want to raise the vertical subtitle position, use \fB\-\-sub\-pos\fP\&.
  4316. .sp
  4317. Default: 22.
  4318. .TP
  4319. .B \fB\-\-sub\-align\-x=<left|center|right>\fP
  4320. Control to which corner of the screen text subtitles should be
  4321. aligned to (default: \fBcenter\fP).
  4322. .sp
  4323. Never applied to ASS subtitles, except in \fB\-\-no\-sub\-ass\fP mode. Likewise,
  4324. this does not apply to image subtitles.
  4325. .TP
  4326. .B \fB\-\-sub\-align\-y=<top|center|bottom>\fP
  4327. Vertical position (default: \fBbottom\fP).
  4328. Details see \fB\-\-sub\-align\-x\fP\&.
  4329. .TP
  4330. .B \fB\-\-sub\-justify=<auto|left|center|right>\fP
  4331. Control how multi line subs are justified irrespective of where they
  4332. are aligned (default: \fBauto\fP which justifies as defined by
  4333. \fB\-\-sub\-align\-y\fP).
  4334. Left justification is recommended to make the subs easier to read
  4335. as it is easier for the eyes.
  4336. .TP
  4337. .B \fB\-\-sub\-ass\-justify=<yes|no>\fP
  4338. Applies justification as defined by \fB\-\-sub\-justify\fP on ASS subtitles
  4339. if \fB\-\-sub\-ass\-override\fP is not set to \fBno\fP\&.
  4340. Default: \fBno\fP\&.
  4341. .TP
  4342. .B \fB\-\-sub\-shadow\-color=<color>\fP
  4343. See \fB\-\-sub\-color\fP\&. Color used for sub text shadow.
  4344. .TP
  4345. .B \fB\-\-sub\-shadow\-offset=<size>\fP
  4346. Displacement of the sub text shadow in scaled pixels (see
  4347. \fB\-\-sub\-font\-size\fP for details). A value of 0 disables shadows.
  4348. .sp
  4349. Default: 0.
  4350. .TP
  4351. .B \fB\-\-sub\-spacing=<size>\fP
  4352. Horizontal sub font spacing in scaled pixels (see \fB\-\-sub\-font\-size\fP
  4353. for details). This value is added to the normal letter spacing. Negative
  4354. values are allowed.
  4355. .sp
  4356. Default: 0.
  4357. .TP
  4358. .B \fB\-\-sub\-filter\-sdh=<yes|no>\fP
  4359. Applies filter removing subtitle additions for the deaf or hard\-of\-hearing (SDH).
  4360. This is intended for English, but may in part work for other languages too.
  4361. The intention is that it can be always enabled so may not remove
  4362. all parts added.
  4363. It removes speaker labels (like MAN:), upper case text in parentheses and
  4364. any text in brackets.
  4365. .sp
  4366. Default: \fBno\fP\&.
  4367. .TP
  4368. .B \fB\-\-sub\-filter\-sdh\-harder=<yes|no>\fP
  4369. Do harder SDH filtering (if enabled by \fB\-\-sub\-filter\-sdh\fP).
  4370. Will also remove speaker labels and text within parentheses using both
  4371. lower and upper case letters.
  4372. .sp
  4373. Default: \fBno\fP\&.
  4374. .TP
  4375. .B \fB\-\-sub\-create\-cc\-track=<yes|no>\fP
  4376. For every video stream, create a closed captions track (default: no). The
  4377. only purpose is to make the track available for selection at the start of
  4378. playback, instead of creating it lazily. This applies only to
  4379. \fBATSC A53 Part 4 Closed Captions\fP (displayed by mpv as subtitle tracks
  4380. using the codec \fBeia_608\fP). The CC track is marked "default" and selected
  4381. according to the normal subtitle track selection rules. You can then use
  4382. \fB\-\-sid\fP to explicitly select the correct track too.
  4383. .sp
  4384. If the video stream contains no closed captions, or if no video is being
  4385. decoded, the CC track will remain empty and will not show any text.
  4386. .TP
  4387. .B \fB\-\-sub\-font\-provider=<auto|none|fontconfig>\fP
  4388. Which libass font provider backend to use (default: auto). \fBauto\fP will
  4389. attempt to use the native font provider: fontconfig on Linux, CoreText on
  4390. OSX, DirectWrite on Windows. \fBfontconfig\fP forces fontconfig, if libass
  4391. was built with support (if not, it behaves like \fBnone\fP).
  4392. .sp
  4393. The \fBnone\fP font provider effectively disables system fonts. It will still
  4394. attempt to use embedded fonts (unless \fB\-\-embeddedfonts=no\fP is set; this is
  4395. the same behavior as with all other font providers), \fBsubfont.ttf\fP if
  4396. provided, and fonts in the \fBfonts\fP sub\-directory if provided. (The
  4397. fallback is more strict than that of other font providers, and if a font
  4398. name does not match, it may prefer not to render any text that uses the
  4399. missing font.)
  4400. .UNINDENT
  4401. .SS Window
  4402. .INDENT 0.0
  4403. .TP
  4404. .B \fB\-\-title=<string>\fP
  4405. Set the window title. This is used for the video window, and if possible,
  4406. also sets the audio stream title.
  4407. .sp
  4408. Properties are expanded. (See \fI\%Property Expansion\fP\&.)
  4409. .sp
  4410. \fBWARNING:\fP
  4411. .INDENT 7.0
  4412. .INDENT 3.5
  4413. There is a danger of this causing significant CPU usage, depending on
  4414. the properties used. Changing the window title is often a slow
  4415. operation, and if the title changes every frame, playback can be ruined.
  4416. .UNINDENT
  4417. .UNINDENT
  4418. .TP
  4419. .B \fB\-\-screen=<default|0\-32>\fP
  4420. In multi\-monitor configurations (i.e. a single desktop that spans across
  4421. multiple displays), this option tells mpv which screen to display the
  4422. video on.
  4423. .INDENT 7.0
  4424. .INDENT 3.5
  4425. .IP "Note (X11)"
  4426. .sp
  4427. This option does not work properly with all window managers. In these
  4428. cases, you can try to use \fB\-\-geometry\fP to position the window
  4429. explicitly. It\(aqs also possible that the window manager provides native
  4430. features to control which screens application windows should use.
  4431. .UNINDENT
  4432. .UNINDENT
  4433. .sp
  4434. See also \fB\-\-fs\-screen\fP\&.
  4435. .TP
  4436. .B \fB\-\-fullscreen\fP, \fB\-\-fs\fP
  4437. Fullscreen playback.
  4438. .TP
  4439. .B \fB\-\-fs\-screen=<all|current|0\-32>\fP
  4440. In multi\-monitor configurations (i.e. a single desktop that spans across
  4441. multiple displays), this option tells mpv which screen to go fullscreen to.
  4442. If \fBcurrent\fP is used mpv will fallback on what the user provided with
  4443. the \fBscreen\fP option.
  4444. .INDENT 7.0
  4445. .INDENT 3.5
  4446. .IP "Note (X11)"
  4447. .sp
  4448. This option works properly only with window managers which
  4449. understand the EWMH \fB_NET_WM_FULLSCREEN_MONITORS\fP hint.
  4450. .UNINDENT
  4451. .UNINDENT
  4452. .INDENT 7.0
  4453. .INDENT 3.5
  4454. .IP "Note (OS X)"
  4455. .sp
  4456. \fBall\fP does not work on OS X and will behave like \fBcurrent\fP\&.
  4457. .UNINDENT
  4458. .UNINDENT
  4459. .sp
  4460. See also \fB\-\-screen\fP\&.
  4461. .TP
  4462. .B \fB\-\-keep\-open=<yes|no|always>\fP
  4463. Do not terminate when playing or seeking beyond the end of the file, and
  4464. there is not next file to be played (and \fB\-\-loop\fP is not used).
  4465. Instead, pause the player. When trying to seek beyond end of the file, the
  4466. player will attempt to seek to the last frame.
  4467. .sp
  4468. Normally, this will act like \fBset pause yes\fP on EOF, unless the
  4469. \fB\-\-keep\-open\-pause=no\fP option is set.
  4470. .sp
  4471. The following arguments can be given:
  4472. .INDENT 7.0
  4473. .TP
  4474. .B no
  4475. If the current file ends, go to the next file or terminate.
  4476. (Default.)
  4477. .TP
  4478. .B yes
  4479. Don\(aqt terminate if the current file is the last playlist entry.
  4480. Equivalent to \fB\-\-keep\-open\fP without arguments.
  4481. .TP
  4482. .B always
  4483. Like \fByes\fP, but also applies to files before the last playlist
  4484. entry. This means playback will never automatically advance to
  4485. the next file.
  4486. .UNINDENT
  4487. .sp
  4488. \fBNOTE:\fP
  4489. .INDENT 7.0
  4490. .INDENT 3.5
  4491. This option is not respected when using \fB\-\-frames\fP\&. Explicitly
  4492. skipping to the next file if the binding uses \fBforce\fP will terminate
  4493. playback as well.
  4494. .sp
  4495. Also, if errors or unusual circumstances happen, the player can quit
  4496. anyway.
  4497. .UNINDENT
  4498. .UNINDENT
  4499. .sp
  4500. Since mpv 0.6.0, this doesn\(aqt pause if there is a next file in the playlist,
  4501. or the playlist is looped. Approximately, this will pause when the player
  4502. would normally exit, but in practice there are corner cases in which this
  4503. is not the case (e.g. \fBmpv \-\-keep\-open file.mkv /dev/null\fP will play
  4504. file.mkv normally, then fail to open \fB/dev/null\fP, then exit). (In
  4505. mpv 0.8.0, \fBalways\fP was introduced, which restores the old behavior.)
  4506. .TP
  4507. .B \fB\-\-keep\-open\-pause=<yes|no>\fP
  4508. If set to \fBno\fP, instead of pausing when \fB\-\-keep\-open\fP is active, just
  4509. stop at end of file and continue playing forward when you seek backwards
  4510. until end where it stops again. Default: \fByes\fP\&.
  4511. .TP
  4512. .B \fB\-\-image\-display\-duration=<seconds|inf>\fP
  4513. If the current file is an image, play the image for the given amount of
  4514. seconds (default: 1). \fBinf\fP means the file is kept open forever (until
  4515. the user stops playback manually).
  4516. .sp
  4517. Unlike \fB\-\-keep\-open\fP, the player is not paused, but simply continues
  4518. playback until the time has elapsed. (It should not use any resources
  4519. during "playback".)
  4520. .sp
  4521. This affects image files, which are defined as having only 1 video frame
  4522. and no audio. The player may recognize certain non\-images as images, for
  4523. example if \fB\-\-length\fP is used to reduce the length to 1 frame, or if
  4524. you seek to the last frame.
  4525. .sp
  4526. This option does not affect the framerate used for \fBmf://\fP or
  4527. \fB\-\-merge\-files\fP\&. For that, use \fB\-\-mf\-fps\fP instead.
  4528. .sp
  4529. Setting \fB\-\-image\-display\-duration\fP hides the OSC and does not track
  4530. playback time on the command\-line output, and also does not duplicate
  4531. the image frame when encoding. To force the player into "dumb mode"
  4532. and actually count out seconds, or to duplicate the image when
  4533. encoding, you need to use \fB\-\-demuxer=lavf \-\-demuxer\-lavf\-o=loop=1\fP,
  4534. and use \fB\-\-length\fP or \fB\-\-frames\fP to stop after a particular time.
  4535. .TP
  4536. .B \fB\-\-force\-window=<yes|no|immediate>\fP
  4537. Create a video output window even if there is no video. This can be useful
  4538. when pretending that mpv is a GUI application. Currently, the window
  4539. always has the size 640x480, and is subject to \fB\-\-geometry\fP,
  4540. \fB\-\-autofit\fP, and similar options.
  4541. .sp
  4542. \fBWARNING:\fP
  4543. .INDENT 7.0
  4544. .INDENT 3.5
  4545. The window is created only after initialization (to make sure default
  4546. window placement still works if the video size is different from the
  4547. \fB\-\-force\-window\fP default window size). This can be a problem if
  4548. initialization doesn\(aqt work perfectly, such as when opening URLs with
  4549. bad network connection, or opening broken video files. The \fBimmediate\fP
  4550. mode can be used to create the window always on program start, but this
  4551. may cause other issues.
  4552. .UNINDENT
  4553. .UNINDENT
  4554. .TP
  4555. .B \fB\-\-taskbar\-progress\fP, \fB\-\-no\-taskbar\-progress\fP
  4556. (Windows only)
  4557. Enable/disable playback progress rendering in taskbar (Windows 7 and above).
  4558. .sp
  4559. Enabled by default.
  4560. .TP
  4561. .B \fB\-\-snap\-window\fP
  4562. (Windows only) Snap the player window to screen edges.
  4563. .TP
  4564. .B \fB\-\-ontop\fP
  4565. Makes the player window stay on top of other windows.
  4566. .sp
  4567. On Windows, if combined with fullscreen mode, this causes mpv to be
  4568. treated as exclusive fullscreen window that bypasses the Desktop Window
  4569. Manager.
  4570. .TP
  4571. .B \fB\-\-ontop\-level=<window|system|level>\fP
  4572. (OS X only)
  4573. Sets the level of an ontop window (default: window).
  4574. .INDENT 7.0
  4575. .TP
  4576. .B window
  4577. On top of all other windows.
  4578. .TP
  4579. .B system
  4580. On top of system elements like Taskbar, Menubar and Dock.
  4581. .TP
  4582. .B level
  4583. A level as integer.
  4584. .UNINDENT
  4585. .TP
  4586. .B \fB\-\-border\fP, \fB\-\-no\-border\fP
  4587. Play video with window border and decorations. Since this is on by
  4588. default, use \fB\-\-no\-border\fP to disable the standard window decorations.
  4589. .TP
  4590. .B \fB\-\-fit\-border\fP, \fB\-\-no\-fit\-border\fP
  4591. (Windows only) Fit the whole window with border and decorations on the
  4592. screen. Since this is on by default, use \fB\-\-no\-fit\-border\fP to make mpv
  4593. try to only fit client area with video on the screen. This behavior only
  4594. applied to window/video with size exceeding size of the screen.
  4595. .TP
  4596. .B \fB\-\-on\-all\-workspaces\fP
  4597. (X11 only)
  4598. Show the video window on all virtual desktops.
  4599. .TP
  4600. .B \fB\-\-geometry=<[W[xH]][+\-x+\-y]>\fP, \fB\-\-geometry=<x:y>\fP
  4601. Adjust the initial window position or size. \fBW\fP and \fBH\fP set the window
  4602. size in pixels. \fBx\fP and \fBy\fP set the window position, measured in pixels
  4603. from the top\-left corner of the screen to the top\-left corner of the image
  4604. being displayed. If a percentage sign (\fB%\fP) is given after the argument,
  4605. it turns the value into a percentage of the screen size in that direction.
  4606. Positions are specified similar to the standard X11 \fB\-\-geometry\fP option
  4607. format, in which e.g. +10\-50 means "place 10 pixels from the left border and
  4608. 50 pixels from the lower border" and "\-\-20+\-10" means "place 20 pixels
  4609. beyond the right and 10 pixels beyond the top border".
  4610. .sp
  4611. If an external window is specified using the \fB\-\-wid\fP option, this
  4612. option is ignored.
  4613. .sp
  4614. The coordinates are relative to the screen given with \fB\-\-screen\fP for the
  4615. video output drivers that fully support \fB\-\-screen\fP\&.
  4616. .sp
  4617. \fBNOTE:\fP
  4618. .INDENT 7.0
  4619. .INDENT 3.5
  4620. Generally only supported by GUI VOs. Ignored for encoding.
  4621. .UNINDENT
  4622. .UNINDENT
  4623. .\" admonition: Note (OS X)
  4624. .\"
  4625. .\" On Mac OS X the origin of the screen coordinate system is located on the
  4626. .\" bottom-left corner. For instance, ``0:0`` will place the window at the
  4627. .\" bottom-left of the screen.
  4628. .
  4629. .INDENT 7.0
  4630. .INDENT 3.5
  4631. .IP "Note (X11)"
  4632. .sp
  4633. This option does not work properly with all window managers.
  4634. .UNINDENT
  4635. .UNINDENT
  4636. .INDENT 7.0
  4637. .INDENT 3.5
  4638. .IP "Examples"
  4639. .INDENT 0.0
  4640. .TP
  4641. .B \fB50:40\fP
  4642. Places the window at x=50, y=40.
  4643. .TP
  4644. .B \fB50%:50%\fP
  4645. Places the window in the middle of the screen.
  4646. .TP
  4647. .B \fB100%:100%\fP
  4648. Places the window at the bottom right corner of the screen.
  4649. .TP
  4650. .B \fB50%\fP
  4651. Sets the window width to half the screen width. Window height is set
  4652. so that the window has the video aspect ratio.
  4653. .TP
  4654. .B \fB50%x50%\fP
  4655. Forces the window width and height to half the screen width and
  4656. height. Will show black borders to compensate for the video aspect
  4657. ratio (with most VOs and without \fB\-\-no\-keepaspect\fP).
  4658. .TP
  4659. .B \fB50%+10+10\fP
  4660. Sets the window to half the screen widths, and positions it 10
  4661. pixels below/left of the top left corner of the screen.
  4662. .UNINDENT
  4663. .UNINDENT
  4664. .UNINDENT
  4665. .sp
  4666. See also \fB\-\-autofit\fP and \fB\-\-autofit\-larger\fP for fitting the window into
  4667. a given size without changing aspect ratio.
  4668. .TP
  4669. .B \fB\-\-autofit=<[W[xH]]>\fP
  4670. Set the initial window size to a maximum size specified by \fBWxH\fP, without
  4671. changing the window\(aqs aspect ratio. The size is measured in pixels, or if
  4672. a number is followed by a percentage sign (\fB%\fP), in percents of the
  4673. screen size.
  4674. .sp
  4675. This option never changes the aspect ratio of the window. If the aspect
  4676. ratio mismatches, the window\(aqs size is reduced until it fits into the
  4677. specified size.
  4678. .sp
  4679. Window position is not taken into account, nor is it modified by this
  4680. option (the window manager still may place the window differently depending
  4681. on size). Use \fB\-\-geometry\fP to change the window position. Its effects
  4682. are applied after this option.
  4683. .sp
  4684. See \fB\-\-geometry\fP for details how this is handled with multi\-monitor
  4685. setups.
  4686. .sp
  4687. Use \fB\-\-autofit\-larger\fP instead if you just want to limit the maximum size
  4688. of the window, rather than always forcing a window size.
  4689. .sp
  4690. Use \fB\-\-geometry\fP if you want to force both window width and height to a
  4691. specific size.
  4692. .sp
  4693. \fBNOTE:\fP
  4694. .INDENT 7.0
  4695. .INDENT 3.5
  4696. Generally only supported by GUI VOs. Ignored for encoding.
  4697. .UNINDENT
  4698. .UNINDENT
  4699. .INDENT 7.0
  4700. .INDENT 3.5
  4701. .IP "Examples"
  4702. .INDENT 0.0
  4703. .TP
  4704. .B \fB70%\fP
  4705. Make the window width 70% of the screen size, keeping aspect ratio.
  4706. .TP
  4707. .B \fB1000\fP
  4708. Set the window width to 1000 pixels, keeping aspect ratio.
  4709. .TP
  4710. .B \fB70%x60%\fP
  4711. Make the window as large as possible, without being wider than 70%
  4712. of the screen width, or higher than 60% of the screen height.
  4713. .UNINDENT
  4714. .UNINDENT
  4715. .UNINDENT
  4716. .TP
  4717. .B \fB\-\-autofit\-larger=<[W[xH]]>\fP
  4718. This option behaves exactly like \fB\-\-autofit\fP, except the window size is
  4719. only changed if the window would be larger than the specified size.
  4720. .INDENT 7.0
  4721. .INDENT 3.5
  4722. .IP "Example"
  4723. .INDENT 0.0
  4724. .TP
  4725. .B \fB90%x80%\fP
  4726. If the video is larger than 90% of the screen width or 80% of the
  4727. screen height, make the window smaller until either its width is 90%
  4728. of the screen, or its height is 80% of the screen.
  4729. .UNINDENT
  4730. .UNINDENT
  4731. .UNINDENT
  4732. .TP
  4733. .B \fB\-\-autofit\-smaller=<[W[xH]]>\fP
  4734. This option behaves exactly like \fB\-\-autofit\fP, except that it sets the
  4735. minimum size of the window (just as \fB\-\-autofit\-larger\fP sets the maximum).
  4736. .INDENT 7.0
  4737. .INDENT 3.5
  4738. .IP "Example"
  4739. .INDENT 0.0
  4740. .TP
  4741. .B \fB500x500\fP
  4742. Make the window at least 500 pixels wide and 500 pixels high
  4743. (depending on the video aspect ratio, the width or height will be
  4744. larger than 500 in order to keep the aspect ratio the same).
  4745. .UNINDENT
  4746. .UNINDENT
  4747. .UNINDENT
  4748. .TP
  4749. .B \fB\-\-window\-scale=<factor>\fP
  4750. Resize the video window to a multiple (or fraction) of the video size. This
  4751. option is applied before \fB\-\-autofit\fP and other options are applied (so
  4752. they override this option).
  4753. .sp
  4754. For example, \fB\-\-window\-scale=0.5\fP would show the window at half the
  4755. video size.
  4756. .TP
  4757. .B \fB\-\-window\-minimized=<yes|no>\fP
  4758. Whether the video window is minimized or not. Setting this will minimize,
  4759. or unminimze, the video window if the current VO supports it. Note that
  4760. some VOs may support minimization while not supporting unminimization
  4761. (eg: Wayland).
  4762. .sp
  4763. Whether this option and \fB\-\-window\-maximized\fP work on program start or
  4764. at runtime, and whether they\(aqre (at runtime) updated to reflect the actual
  4765. window state, heavily depends on the VO and the windowing system. Some VOs
  4766. simply do not implement them or parts of them, while other VOs may be
  4767. restricted by the windowing systems (especially Wayland).
  4768. .TP
  4769. .B \fB\-\-window\-maximized=<yes|no>\fP
  4770. Whether the video window is maximized or not. Setting this will maximize,
  4771. or unmaximize, the video window if the current VO supports it. See
  4772. \fB\-\-window\-minimized\fP for further remarks.
  4773. .TP
  4774. .B \fB\-\-cursor\-autohide=<number|no|always>\fP
  4775. Make mouse cursor automatically hide after given number of milliseconds.
  4776. \fBno\fP will disable cursor autohide. \fBalways\fP means the cursor will stay
  4777. hidden.
  4778. .TP
  4779. .B \fB\-\-cursor\-autohide\-fs\-only\fP
  4780. If this option is given, the cursor is always visible in windowed mode. In
  4781. fullscreen mode, the cursor is shown or hidden according to
  4782. \fB\-\-cursor\-autohide\fP\&.
  4783. .TP
  4784. .B \fB\-\-no\-fixed\-vo\fP, \fB\-\-fixed\-vo\fP
  4785. \fB\-\-no\-fixed\-vo\fP enforces closing and reopening the video window for
  4786. multiple files (one (un)initialization for each file).
  4787. .TP
  4788. .B \fB\-\-force\-rgba\-osd\-rendering\fP
  4789. Change how some video outputs render the OSD and text subtitles. This
  4790. does not change appearance of the subtitles and only has performance
  4791. implications. For VOs which support native ASS rendering (like \fBgpu\fP,
  4792. \fBvdpau\fP, \fBdirect3d\fP), this can be slightly faster or slower,
  4793. depending on GPU drivers and hardware. For other VOs, this just makes
  4794. rendering slower.
  4795. .TP
  4796. .B \fB\-\-force\-window\-position\fP
  4797. Forcefully move mpv\(aqs video output window to default location whenever
  4798. there is a change in video parameters, video stream or file. This used to
  4799. be the default behavior. Currently only affects X11 VOs.
  4800. .TP
  4801. .B \fB\-\-no\-keepaspect\fP, \fB\-\-keepaspect\fP
  4802. \fB\-\-no\-keepaspect\fP will always stretch the video to window size, and will
  4803. disable the window manager hints that force the window aspect ratio.
  4804. (Ignored in fullscreen mode.)
  4805. .TP
  4806. .B \fB\-\-no\-keepaspect\-window\fP, \fB\-\-keepaspect\-window\fP
  4807. \fB\-\-keepaspect\-window\fP (the default) will lock the window size to the
  4808. video aspect. \fB\-\-no\-keepaspect\-window\fP disables this behavior, and will
  4809. instead add black bars if window aspect and video aspect mismatch. Whether
  4810. this actually works depends on the VO backend.
  4811. (Ignored in fullscreen mode.)
  4812. .TP
  4813. .B \fB\-\-monitoraspect=<ratio>\fP
  4814. Set the aspect ratio of your monitor or TV screen. A value of 0 disables a
  4815. previous setting (e.g. in the config file). Overrides the
  4816. \fB\-\-monitorpixelaspect\fP setting if enabled.
  4817. .sp
  4818. See also \fB\-\-monitorpixelaspect\fP and \fB\-\-video\-aspect\-override\fP\&.
  4819. .INDENT 7.0
  4820. .INDENT 3.5
  4821. .IP "Examples"
  4822. .INDENT 0.0
  4823. .IP \(bu 2
  4824. \fB\-\-monitoraspect=4:3\fP or \fB\-\-monitoraspect=1.3333\fP
  4825. .IP \(bu 2
  4826. \fB\-\-monitoraspect=16:9\fP or \fB\-\-monitoraspect=1.7777\fP
  4827. .UNINDENT
  4828. .UNINDENT
  4829. .UNINDENT
  4830. .TP
  4831. .B \fB\-\-hidpi\-window\-scale\fP, \fB\-\-no\-hidpi\-window\-scale\fP
  4832. (OS X, X11, and Wayland only)
  4833. Scale the window size according to the backing scale factor (default: yes).
  4834. On regular HiDPI resolutions the window opens with double the size but appears
  4835. as having the same size as on none\-HiDPI resolutions. This is the default OS X
  4836. behavior.
  4837. .TP
  4838. .B \fB\-\-native\-fs\fP, \fB\-\-no\-native\-fs\fP
  4839. (OS X only)
  4840. Uses the native fullscreen mechanism of the OS (default: yes).
  4841. .TP
  4842. .B \fB\-\-monitorpixelaspect=<ratio>\fP
  4843. Set the aspect of a single pixel of your monitor or TV screen (default:
  4844. 1). A value of 1 means square pixels (correct for (almost?) all LCDs). See
  4845. also \fB\-\-monitoraspect\fP and \fB\-\-video\-aspect\-override\fP\&.
  4846. .TP
  4847. .B \fB\-\-stop\-screensaver\fP, \fB\-\-no\-stop\-screensaver\fP
  4848. Turns off the screensaver (or screen blanker and similar mechanisms) at
  4849. startup and turns it on again on exit (default: yes). The screensaver is
  4850. always re\-enabled when the player is paused.
  4851. .sp
  4852. This is not supported on all video outputs or platforms. Sometimes it is
  4853. implemented, but does not work (especially with Linux "desktops").
  4854. .TP
  4855. .B \fB\-\-wid=<ID>\fP
  4856. This tells mpv to attach to an existing window. If a VO is selected that
  4857. supports this option, it will use that window for video output. mpv will
  4858. scale the video to the size of this window, and will add black bars to
  4859. compensate if the aspect ratio of the video is different.
  4860. .sp
  4861. On X11, the ID is interpreted as a \fBWindow\fP on X11. Unlike
  4862. MPlayer/mplayer2, mpv always creates its own window, and sets the wid
  4863. window as parent. The window will always be resized to cover the parent
  4864. window fully. The value \fB0\fP is interpreted specially, and mpv will
  4865. draw directly on the root window.
  4866. .sp
  4867. On win32, the ID is interpreted as \fBHWND\fP\&. Pass it as value cast to
  4868. \fBintptr_t\fP\&. mpv will create its own window, and set the wid window as
  4869. parent, like with X11.
  4870. .sp
  4871. On OSX/Cocoa, the ID is interpreted as \fBNSView*\fP\&. Pass it as value cast
  4872. to \fBintptr_t\fP\&. mpv will create its own sub\-view. Because OSX does not
  4873. support window embedding of foreign processes, this works only with libmpv,
  4874. and will crash when used from the command line.
  4875. .sp
  4876. On Android, the ID is interpreted as \fBandroid.view.Surface\fP\&. Pass it as a
  4877. value cast to \fBintptr_t\fP\&. Use with \fB\-\-vo=mediacodec_embed\fP and
  4878. \fB\-\-hwdec=mediacodec\fP for direct rendering using MediaCodec, or with
  4879. \fB\-\-vo=gpu \-\-gpu\-context=android\fP (with or without \fB\-\-hwdec=mediacodec\-copy\fP).
  4880. .TP
  4881. .B \fB\-\-no\-window\-dragging\fP
  4882. Don\(aqt move the window when clicking on it and moving the mouse pointer.
  4883. .TP
  4884. .B \fB\-\-x11\-name\fP
  4885. Set the window class name for X11\-based video output methods.
  4886. .TP
  4887. .B \fB\-\-x11\-netwm=<yes|no|auto>\fP
  4888. (X11 only)
  4889. Control the use of NetWM protocol features.
  4890. .sp
  4891. This may or may not help with broken window managers. This provides some
  4892. functionality that was implemented by the now removed \fB\-\-fstype\fP option.
  4893. Actually, it is not known to the developers to which degree this option
  4894. was needed, so feedback is welcome.
  4895. .sp
  4896. Specifically, \fByes\fP will force use of NetWM fullscreen support, even if
  4897. not advertised by the WM. This can be useful for WMs that are broken on
  4898. purpose, like XMonad. (XMonad supposedly doesn\(aqt advertise fullscreen
  4899. support, because Flash uses it. Apparently, applications which want to
  4900. use fullscreen anyway are supposed to either ignore the NetWM support hints,
  4901. or provide a workaround. Shame on XMonad for deliberately breaking X
  4902. protocols (as if X isn\(aqt bad enough already).
  4903. .sp
  4904. By default, NetWM support is autodetected (\fBauto\fP).
  4905. .sp
  4906. This option might be removed in the future.
  4907. .TP
  4908. .B \fB\-\-x11\-bypass\-compositor=<yes|no|fs\-only|never>\fP
  4909. If set to \fByes\fP, then ask the compositor to unredirect the mpv window
  4910. (default: \fBfs\-only\fP). This uses the \fB_NET_WM_BYPASS_COMPOSITOR\fP hint.
  4911. .sp
  4912. \fBfs\-only\fP asks the window manager to disable the compositor only in
  4913. fullscreen mode.
  4914. .sp
  4915. \fBno\fP sets \fB_NET_WM_BYPASS_COMPOSITOR\fP to 0, which is the default value
  4916. as declared by the EWMH specification, i.e. no change is done.
  4917. .sp
  4918. \fBnever\fP asks the window manager to never disable the compositor.
  4919. .UNINDENT
  4920. .SS Disc Devices
  4921. .INDENT 0.0
  4922. .TP
  4923. .B \fB\-\-cdrom\-device=<path>\fP
  4924. Specify the CD\-ROM device (default: \fB/dev/cdrom\fP).
  4925. .TP
  4926. .B \fB\-\-dvd\-device=<path>\fP
  4927. Specify the DVD device or .iso filename (default: \fB/dev/dvd\fP). You can
  4928. also specify a directory that contains files previously copied directly
  4929. from a DVD (with e.g. vobcopy).
  4930. .INDENT 7.0
  4931. .INDENT 3.5
  4932. .IP "Example"
  4933. .sp
  4934. \fBmpv dvd:// \-\-dvd\-device=/path/to/dvd/\fP
  4935. .UNINDENT
  4936. .UNINDENT
  4937. .TP
  4938. .B \fB\-\-bluray\-device=<path>\fP
  4939. (Blu\-ray only)
  4940. Specify the Blu\-ray disc location. Must be a directory with Blu\-ray
  4941. structure.
  4942. .INDENT 7.0
  4943. .INDENT 3.5
  4944. .IP "Example"
  4945. .sp
  4946. \fBmpv bd:// \-\-bluray\-device=/path/to/bd/\fP
  4947. .UNINDENT
  4948. .UNINDENT
  4949. .TP
  4950. .B \fB\-\-cdda\-...\fP
  4951. These options can be used to tune the CD Audio reading feature of mpv.
  4952. .TP
  4953. .B \fB\-\-cdda\-speed=<value>\fP
  4954. Set CD spin speed.
  4955. .TP
  4956. .B \fB\-\-cdda\-paranoia=<0\-2>\fP
  4957. Set paranoia level. Values other than 0 seem to break playback of
  4958. anything but the first track.
  4959. .INDENT 7.0
  4960. .TP
  4961. .B 0
  4962. disable checking (default)
  4963. .TP
  4964. .B 1
  4965. overlap checking only
  4966. .TP
  4967. .B 2
  4968. full data correction and verification
  4969. .UNINDENT
  4970. .TP
  4971. .B \fB\-\-cdda\-sector\-size=<value>\fP
  4972. Set atomic read size.
  4973. .TP
  4974. .B \fB\-\-cdda\-overlap=<value>\fP
  4975. Force minimum overlap search during verification to <value> sectors.
  4976. .TP
  4977. .B \fB\-\-cdda\-toc\-bias\fP
  4978. Assume that the beginning offset of track 1 as reported in the TOC
  4979. will be addressed as LBA 0. Some discs need this for getting track
  4980. boundaries correctly.
  4981. .TP
  4982. .B \fB\-\-cdda\-toc\-offset=<value>\fP
  4983. Add \fB<value>\fP sectors to the values reported when addressing tracks.
  4984. May be negative.
  4985. .TP
  4986. .B \fB\-\-cdda\-skip=<yes|no>\fP
  4987. (Never) accept imperfect data reconstruction.
  4988. .TP
  4989. .B \fB\-\-cdda\-cdtext=<yes|no>\fP
  4990. Print CD text. This is disabled by default, because it ruins performance
  4991. with CD\-ROM drives for unknown reasons.
  4992. .TP
  4993. .B \fB\-\-dvd\-speed=<speed>\fP
  4994. Try to limit DVD speed (default: 0, no change). DVD base speed is 1385
  4995. kB/s, so an 8x drive can read at speeds up to 11080 kB/s. Slower speeds
  4996. make the drive more quiet. For watching DVDs, 2700 kB/s should be quiet and
  4997. fast enough. mpv resets the speed to the drive default value on close.
  4998. Values of at least 100 mean speed in kB/s. Values less than 100 mean
  4999. multiples of 1385 kB/s, i.e. \fB\-\-dvd\-speed=8\fP selects 11080 kB/s.
  5000. .sp
  5001. \fBNOTE:\fP
  5002. .INDENT 7.0
  5003. .INDENT 3.5
  5004. You need write access to the DVD device to change the speed.
  5005. .UNINDENT
  5006. .UNINDENT
  5007. .TP
  5008. .B \fB\-\-dvd\-angle=<ID>\fP
  5009. Some DVDs contain scenes that can be viewed from multiple angles.
  5010. This option tells mpv which angle to use (default: 1).
  5011. .UNINDENT
  5012. .SS Equalizer
  5013. .INDENT 0.0
  5014. .TP
  5015. .B \fB\-\-brightness=<\-100\-100>\fP
  5016. Adjust the brightness of the video signal (default: 0). Not supported by
  5017. all video output drivers.
  5018. .TP
  5019. .B \fB\-\-contrast=<\-100\-100>\fP
  5020. Adjust the contrast of the video signal (default: 0). Not supported by all
  5021. video output drivers.
  5022. .TP
  5023. .B \fB\-\-saturation=<\-100\-100>\fP
  5024. Adjust the saturation of the video signal (default: 0). You can get
  5025. grayscale output with this option. Not supported by all video output
  5026. drivers.
  5027. .TP
  5028. .B \fB\-\-gamma=<\-100\-100>\fP
  5029. Adjust the gamma of the video signal (default: 0). Not supported by all
  5030. video output drivers.
  5031. .TP
  5032. .B \fB\-\-hue=<\-100\-100>\fP
  5033. Adjust the hue of the video signal (default: 0). You can get a colored
  5034. negative of the image with this option. Not supported by all video output
  5035. drivers.
  5036. .UNINDENT
  5037. .SS Demuxer
  5038. .INDENT 0.0
  5039. .TP
  5040. .B \fB\-\-demuxer=<[+]name>\fP
  5041. Force demuxer type. Use a \(aq+\(aq before the name to force it; this will skip
  5042. some checks. Give the demuxer name as printed by \fB\-\-demuxer=help\fP\&.
  5043. .TP
  5044. .B \fB\-\-demuxer\-lavf\-analyzeduration=<value>\fP
  5045. Maximum length in seconds to analyze the stream properties.
  5046. .TP
  5047. .B \fB\-\-demuxer\-lavf\-probe\-info=<yes|no|auto|nostreams>\fP
  5048. Whether to probe stream information (default: auto). Technically, this
  5049. controls whether libavformat\(aqs \fBavformat_find_stream_info()\fP function
  5050. is called. Usually it\(aqs safer to call it, but it can also make startup
  5051. slower.
  5052. .sp
  5053. The \fBauto\fP choice (the default) tries to skip this for a few know\-safe
  5054. whitelisted formats, while calling it for everything else.
  5055. .sp
  5056. The \fBnostreams\fP choice only calls it if and only if the file seems to
  5057. contain no streams after opening (helpful in cases when calling the function
  5058. is needed to detect streams at all, such as with FLV files).
  5059. .TP
  5060. .B \fB\-\-demuxer\-lavf\-probescore=<1\-100>\fP
  5061. Minimum required libavformat probe score. Lower values will require
  5062. less data to be loaded (makes streams start faster), but makes file
  5063. format detection less reliable. Can be used to force auto\-detected
  5064. libavformat demuxers, even if libavformat considers the detection not
  5065. reliable enough. (Default: 26.)
  5066. .TP
  5067. .B \fB\-\-demuxer\-lavf\-allow\-mimetype=<yes|no>\fP
  5068. Allow deriving the format from the HTTP MIME type (default: yes). Set
  5069. this to no in case playing things from HTTP mysteriously fails, even
  5070. though the same files work from local disk.
  5071. .sp
  5072. This is default in order to reduce latency when opening HTTP streams.
  5073. .TP
  5074. .B \fB\-\-demuxer\-lavf\-format=<name>\fP
  5075. Force a specific libavformat demuxer.
  5076. .TP
  5077. .B \fB\-\-demuxer\-lavf\-hacks=<yes|no>\fP
  5078. By default, some formats will be handled differently from other formats
  5079. by explicitly checking for them. Most of these compensate for weird or
  5080. imperfect behavior from libavformat demuxers. Passing \fBno\fP disables
  5081. these. For debugging and testing only.
  5082. .TP
  5083. .B \fB\-\-demuxer\-lavf\-o=<key>=<value>[,<key>=<value>[,...]]\fP
  5084. Pass AVOptions to libavformat demuxer.
  5085. .sp
  5086. Note, a patch to make the \fIo=\fP unneeded and pass all unknown options
  5087. through the AVOption system is welcome. A full list of AVOptions can
  5088. be found in the FFmpeg manual. Note that some options may conflict
  5089. with mpv options.
  5090. .sp
  5091. This is a key/value list option. See \fI\%List Options\fP for details.
  5092. .INDENT 7.0
  5093. .INDENT 3.5
  5094. .IP "Example"
  5095. .sp
  5096. \fB\-\-demuxer\-lavf\-o=fflags=+ignidx\fP
  5097. .UNINDENT
  5098. .UNINDENT
  5099. .TP
  5100. .B \fB\-\-demuxer\-lavf\-probesize=<value>\fP
  5101. Maximum amount of data to probe during the detection phase. In the
  5102. case of MPEG\-TS this value identifies the maximum number of TS packets
  5103. to scan.
  5104. .TP
  5105. .B \fB\-\-demuxer\-lavf\-buffersize=<value>\fP
  5106. Size of the stream read buffer allocated for libavformat in bytes
  5107. (default: 32768). Lowering the size could lower latency. Note that
  5108. libavformat might reallocate the buffer internally, or not fully use all
  5109. of it.
  5110. .TP
  5111. .B \fB\-\-demuxer\-lavf\-linearize\-timestamps=<yes|no|auto>\fP
  5112. Attempt to linearize timestamp resets in demuxed streams (default: auto).
  5113. This was tested only for single audio streams. It\(aqs unknown whether it
  5114. works correctly for video (but likely won\(aqt). Note that the implementation
  5115. is slightly incorrect either way, and will introduce a discontinuity by
  5116. about 1 codec frame size.
  5117. .sp
  5118. The \fBauto\fP mode enables this for OGG audio stream. This covers the common
  5119. and annoying case of OGG web radio streams. Some of these will reset
  5120. timestamps to 0 every time a new song begins. This breaks the mpv seekable
  5121. cache, which can\(aqt deal with timestamp resets. Note that FFmpeg/libavformat\(aqs
  5122. seeking API can\(aqt deal with this either; it\(aqs likely that if this option
  5123. breaks this even more, while if it\(aqs disabled, you can at least seek within
  5124. the first song in the stream. Well, you won\(aqt get anything useful either
  5125. way if the seek is outside of mpv\(aqs cache.
  5126. .TP
  5127. .B \fB\-\-demuxer\-lavf\-propagate\-opts=<yes|no>\fP
  5128. Propagate FFmpeg\-level options to recursively opened connections (default:
  5129. yes). This is needed because FFmpeg will apply these settings to nested
  5130. AVIO contexts automatically. On the other hand, this could break in certain
  5131. situations \- it\(aqs the FFmpeg API, you just can\(aqt win.
  5132. .sp
  5133. This affects in particular the \fB\-\-timeout\fP option and anything passed
  5134. with \fB\-\-demuxer\-lavf\-o\fP\&.
  5135. .sp
  5136. If this option is deemed unnecessary at some point in the future, it will
  5137. be removed without notice.
  5138. .TP
  5139. .B \fB\-\-demuxer\-mkv\-subtitle\-preroll=<yes|index|no>\fP, \fB\-\-mkv\-subtitle\-preroll\fP
  5140. Try harder to show embedded soft subtitles when seeking somewhere. Normally,
  5141. it can happen that the subtitle at the seek target is not shown due to how
  5142. some container file formats are designed. The subtitles appear only if
  5143. seeking before or exactly to the position a subtitle first appears. To
  5144. make this worse, subtitles are often timed to appear a very small amount
  5145. before the associated video frame, so that seeking to the video frame
  5146. typically does not demux the subtitle at that position.
  5147. .sp
  5148. Enabling this option makes the demuxer start reading data a bit before the
  5149. seek target, so that subtitles appear correctly. Note that this makes
  5150. seeking slower, and is not guaranteed to always work. It only works if the
  5151. subtitle is close enough to the seek target.
  5152. .sp
  5153. Works with the internal Matroska demuxer only. Always enabled for absolute
  5154. and hr\-seeks, and this option changes behavior with relative or imprecise
  5155. seeks only.
  5156. .sp
  5157. You can use the \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs\fP option to specify
  5158. how much data the demuxer should pre\-read at most in order to find subtitle
  5159. packets that may overlap. Setting this to 0 will effectively disable this
  5160. preroll mechanism. Setting a very large value can make seeking very slow,
  5161. and an extremely large value would completely reread the entire file from
  5162. start to seek target on every seek \- seeking can become slower towards the
  5163. end of the file. The details are messy, and the value is actually rounded
  5164. down to the cluster with the previous video keyframe.
  5165. .sp
  5166. Some files, especially files muxed with newer mkvmerge versions, have
  5167. information embedded that can be used to determine what subtitle packets
  5168. overlap with a seek target. In these cases, mpv will reduce the amount
  5169. of data read to a minimum. (Although it will still read \fIall\fP data between
  5170. the cluster that contains the first wanted subtitle packet, and the seek
  5171. target.) If the \fBindex\fP choice (which is the default) is specified, then
  5172. prerolling will be done only if this information is actually available. If
  5173. this method is used, the maximum amount of data to skip can be additionally
  5174. controlled by \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs\-index\fP (it still uses
  5175. the value of the option without \fB\-index\fP if that is higher).
  5176. .sp
  5177. See also \fB\-\-hr\-seek\-demuxer\-offset\fP option. This option can achieve a
  5178. similar effect, but only if hr\-seek is active. It works with any demuxer,
  5179. but makes seeking much slower, as it has to decode audio and video data
  5180. instead of just skipping over it.
  5181. .sp
  5182. \fB\-\-mkv\-subtitle\-preroll\fP is a deprecated alias.
  5183. .TP
  5184. .B \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs=<value>\fP
  5185. See \fB\-\-demuxer\-mkv\-subtitle\-preroll\fP\&.
  5186. .TP
  5187. .B \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs\-index=<value>\fP
  5188. See \fB\-\-demuxer\-mkv\-subtitle\-preroll\fP\&.
  5189. .TP
  5190. .B \fB\-\-demuxer\-mkv\-probe\-video\-duration=<yes|no|full>\fP
  5191. When opening the file, seek to the end of it, and check what timestamp the
  5192. last video packet has, and report that as file duration. This is strictly
  5193. for compatibility with Haali only. In this mode, it\(aqs possible that opening
  5194. will be slower (especially when playing over http), or that behavior with
  5195. broken files is much worse. So don\(aqt use this option.
  5196. .sp
  5197. The \fByes\fP mode merely uses the index and reads a small number of blocks
  5198. from the end of the file. The \fBfull\fP mode actually traverses the entire
  5199. file and can make a reliable estimate even without an index present (such
  5200. as partial files).
  5201. .TP
  5202. .B \fB\-\-demuxer\-rawaudio\-channels=<value>\fP
  5203. Number of channels (or channel layout) if \fB\-\-demuxer=rawaudio\fP is used
  5204. (default: stereo).
  5205. .TP
  5206. .B \fB\-\-demuxer\-rawaudio\-format=<value>\fP
  5207. Sample format for \fB\-\-demuxer=rawaudio\fP (default: s16le).
  5208. Use \fB\-\-demuxer\-rawaudio\-format=help\fP to get a list of all formats.
  5209. .TP
  5210. .B \fB\-\-demuxer\-rawaudio\-rate=<value>\fP
  5211. Sample rate for \fB\-\-demuxer=rawaudio\fP (default: 44 kHz).
  5212. .TP
  5213. .B \fB\-\-demuxer\-rawvideo\-fps=<value>\fP
  5214. Rate in frames per second for \fB\-\-demuxer=rawvideo\fP (default: 25.0).
  5215. .TP
  5216. .B \fB\-\-demuxer\-rawvideo\-w=<value>\fP, \fB\-\-demuxer\-rawvideo\-h=<value>\fP
  5217. Image dimension in pixels for \fB\-\-demuxer=rawvideo\fP\&.
  5218. .INDENT 7.0
  5219. .INDENT 3.5
  5220. .IP "Example"
  5221. .sp
  5222. Play a raw YUV sample:
  5223. .INDENT 0.0
  5224. .INDENT 3.5
  5225. .sp
  5226. .nf
  5227. .ft C
  5228. mpv sample\-720x576.yuv \-\-demuxer=rawvideo \e
  5229. \-\-demuxer\-rawvideo\-w=720 \-\-demuxer\-rawvideo\-h=576
  5230. .ft P
  5231. .fi
  5232. .UNINDENT
  5233. .UNINDENT
  5234. .UNINDENT
  5235. .UNINDENT
  5236. .TP
  5237. .B \fB\-\-demuxer\-rawvideo\-format=<value>\fP
  5238. Color space (fourcc) in hex or string for \fB\-\-demuxer=rawvideo\fP
  5239. (default: \fBYV12\fP).
  5240. .TP
  5241. .B \fB\-\-demuxer\-rawvideo\-mp\-format=<value>\fP
  5242. Color space by internal video format for \fB\-\-demuxer=rawvideo\fP\&. Use
  5243. \fB\-\-demuxer\-rawvideo\-mp\-format=help\fP for a list of possible formats.
  5244. .TP
  5245. .B \fB\-\-demuxer\-rawvideo\-codec=<value>\fP
  5246. Set the video codec instead of selecting the rawvideo codec when using
  5247. \fB\-\-demuxer=rawvideo\fP\&. This uses the same values as codec names in
  5248. \fB\-\-vd\fP (but it does not accept decoder names).
  5249. .TP
  5250. .B \fB\-\-demuxer\-rawvideo\-size=<value>\fP
  5251. Frame size in bytes when using \fB\-\-demuxer=rawvideo\fP\&.
  5252. .TP
  5253. .B \fB\-\-demuxer\-cue\-codepage=<codepage>\fP
  5254. Specify the CUE sheet codepage. (See \fB\-\-sub\-codepage\fP for details.)
  5255. .TP
  5256. .B \fB\-\-demuxer\-max\-bytes=<bytesize>\fP
  5257. This controls how much the demuxer is allowed to buffer ahead. The demuxer
  5258. will normally try to read ahead as much as necessary, or as much is
  5259. requested with \fB\-\-demuxer\-readahead\-secs\fP\&. The option can be used to
  5260. restrict the maximum readahead. This limits excessive readahead in case of
  5261. broken files or desynced playback. The demuxer will stop reading additional
  5262. packets as soon as one of the limits is reached. (The limits still can be
  5263. slightly overstepped due to technical reasons.)
  5264. .sp
  5265. Set these limits higher if you get a packet queue overflow warning, and
  5266. you think normal playback would be possible with a larger packet queue.
  5267. .sp
  5268. See \fB\-\-list\-options\fP for defaults and value range. \fB<bytesize>\fP options
  5269. accept suffixes such as \fBKiB\fP and \fBMiB\fP\&.
  5270. .TP
  5271. .B \fB\-\-demuxer\-max\-back\-bytes=<bytesize>\fP
  5272. This controls how much past data the demuxer is allowed to preserve. This
  5273. is useful only if the \fB\-\-demuxer\-seekable\-cache\fP option is enabled.
  5274. Unlike the forward cache, there is no control how many seconds are actually
  5275. cached \- it will simply use as much memory this option allows. Setting this
  5276. option to 0 will strictly disable any back buffer, but this will lead to
  5277. the situation that the forward seek range starts after the current playback
  5278. position (as it removes past packets that are seek points).
  5279. .sp
  5280. If the end of the file is reached, the remaining unused forward buffer space
  5281. is "donated" to the backbuffer (unless the backbuffer size is set to 0).
  5282. This still limits the total cache usage to the sum of the forward and
  5283. backward cache, and effectively makes better use of the total allowed memory
  5284. budget. (The opposite does not happen: free backward buffer is never
  5285. "donated" to the forward buffer.)
  5286. .sp
  5287. Keep in mind that other buffers in the player (like decoders) will cause the
  5288. demuxer to cache "future" frames in the back buffer, which can skew the
  5289. impression about how much data the backbuffer contains.
  5290. .sp
  5291. See \fB\-\-list\-options\fP for defaults and value range.
  5292. .TP
  5293. .B \fB\-\-demuxer\-seekable\-cache=<yes|no|auto>\fP
  5294. This controls whether seeking can use the demuxer cache (default: auto). If
  5295. enabled, short seek offsets will not trigger a low level demuxer seek
  5296. (which means for example that slow network round trips or FFmpeg seek bugs
  5297. can be avoided). If a seek cannot happen within the cached range, a low
  5298. level seek will be triggered. Seeking outside of the cache will start a new
  5299. cached range, but can discard the old cache range if the demuxer exhibits
  5300. certain unsupported behavior.
  5301. .sp
  5302. Keep in mind that some events can flush the cache or force a low level
  5303. seek anyway, such as switching tracks, or attempting to seek before the
  5304. start or after the end of the file.
  5305. .sp
  5306. The special value \fBauto\fP means \fByes\fP in the same situation as
  5307. \fB\-\-cache\-secs\fP is used (i.e. when the stream appears to be a network
  5308. stream or the stream cache is enabled).
  5309. .TP
  5310. .B \fB\-\-demuxer\-thread=<yes|no>\fP
  5311. Run the demuxer in a separate thread, and let it prefetch a certain amount
  5312. of packets (default: yes). Having this enabled leads to smoother playback,
  5313. enables features like prefetching, and prevents that stuck network freezes
  5314. the player. On the other hand, it can add overhead, or the background
  5315. prefetching can hog CPU resources.
  5316. .sp
  5317. Disabling this option is not recommended. Use it for debugging only.
  5318. .TP
  5319. .B \fB\-\-demuxer\-termination\-timeout=<seconds>\fP
  5320. Number of seconds the player should wait to shutdown the demuxer (default:
  5321. 0.1). The player will wait up to this much time before it closes the
  5322. stream layer forcefully. Forceful closing usually means the network I/O is
  5323. given no chance to close its connections gracefully (of course the OS can
  5324. still close TCP connections properly), and might result in annoying messages
  5325. being logged, and in some cases, confused remote servers.
  5326. .sp
  5327. This timeout is usually only applied when loading has finished properly. If
  5328. loading is aborted by the user, or in some corner cases like removing
  5329. external tracks sourced from network during playback, forceful closing is
  5330. always used.
  5331. .TP
  5332. .B \fB\-\-demuxer\-readahead\-secs=<seconds>\fP
  5333. If \fB\-\-demuxer\-thread\fP is enabled, this controls how much the demuxer
  5334. should buffer ahead in seconds (default: 1). As long as no packet has
  5335. a timestamp difference higher than the readahead amount relative to the
  5336. last packet returned to the decoder, the demuxer keeps reading.
  5337. .sp
  5338. Note that the \fB\-\-cache\-secs\fP option will override this value if a cache
  5339. is enabled, and the value is larger.
  5340. .sp
  5341. (This value tends to be fuzzy, because many file formats don\(aqt store linear
  5342. timestamps.)
  5343. .TP
  5344. .B \fB\-\-prefetch\-playlist=<yes|no>\fP
  5345. Prefetch next playlist entry while playback of the current entry is ending
  5346. (default: no). This merely opens the URL of the next playlist entry as soon
  5347. as the current URL is fully read.
  5348. .sp
  5349. This does \fBnot\fP work with URLs resolved by the \fByoutube\-dl\fP wrapper,
  5350. and it won\(aqt.
  5351. .sp
  5352. This does not affect HLS (\fB\&.m3u8\fP URLs) \- HLS prefetching depends on the
  5353. demuxer cache settings and is on by default.
  5354. .sp
  5355. This can give subtly wrong results if per\-file options are used, or if
  5356. options are changed in the time window between prefetching start and next
  5357. file played.
  5358. .sp
  5359. This can occasionally make wrong prefetching decisions. For example, it
  5360. can\(aqt predict whether you go backwards in the playlist, and assumes you
  5361. won\(aqt edit the playlist.
  5362. .sp
  5363. Highly experimental.
  5364. .TP
  5365. .B \fB\-\-force\-seekable=<yes|no>\fP
  5366. If the player thinks that the media is not seekable (e.g. playing from a
  5367. pipe, or it\(aqs an http stream with a server that doesn\(aqt support range
  5368. requests), seeking will be disabled. This option can forcibly enable it.
  5369. For seeks within the cache, there\(aqs a good chance of success.
  5370. .TP
  5371. .B \fB\-\-demuxer\-cache\-wait=<yes|no>\fP
  5372. Before starting playback, read data until either the end of the file was
  5373. reached, or the demuxer cache has reached maximum capacity. Only once this
  5374. is done, playback starts. This intentionally happens before the initial
  5375. seek triggered with \fB\-\-start\fP\&. This does not change any runtime behavior
  5376. after the initial caching. This option is useless if the file cannot be
  5377. cached completely.
  5378. .TP
  5379. .B \fB\-\-rar\-list\-all\-volumes=<yes|no>\fP
  5380. When opening multi\-volume rar files, open all volumes to create a full list
  5381. of contained files (default: no). If disabled, only the archive entries
  5382. whose headers are located within the first volume are listed (and thus
  5383. played when opening a .rar file with mpv). Doing so speeds up opening, and
  5384. the typical idiotic use\-case of playing uncompressed multi\-volume rar files
  5385. that contain a single media file is made faster.
  5386. .sp
  5387. Opening is still slow, because for unknown, idiotic, and unnecessary reasons
  5388. libarchive opens all volumes anyway when playing the main file, even though
  5389. mpv iterated no archive entries yet.
  5390. .UNINDENT
  5391. .SS Input
  5392. .INDENT 0.0
  5393. .TP
  5394. .B \fB\-\-native\-keyrepeat\fP
  5395. Use system settings for keyrepeat delay and rate, instead of
  5396. \fB\-\-input\-ar\-delay\fP and \fB\-\-input\-ar\-rate\fP\&. (Whether this applies
  5397. depends on the VO backend and how it handles keyboard input. Does not
  5398. apply to terminal input.)
  5399. .TP
  5400. .B \fB\-\-input\-ar\-delay\fP
  5401. Delay in milliseconds before we start to autorepeat a key (0 to disable).
  5402. .TP
  5403. .B \fB\-\-input\-ar\-rate\fP
  5404. Number of key presses to generate per second on autorepeat.
  5405. .TP
  5406. .B \fB\-\-input\-conf=<filename>\fP
  5407. Specify input configuration file other than the default location in the mpv
  5408. configuration directory (usually \fB~/.config/mpv/input.conf\fP).
  5409. .TP
  5410. .B \fB\-\-no\-input\-default\-bindings\fP
  5411. Disable mpv default (built\-in) key bindings.
  5412. .TP
  5413. .B \fB\-\-input\-cmdlist\fP
  5414. Prints all commands that can be bound to keys.
  5415. .TP
  5416. .B \fB\-\-input\-doubleclick\-time=<milliseconds>\fP
  5417. Time in milliseconds to recognize two consecutive button presses as a
  5418. double\-click (default: 300).
  5419. .TP
  5420. .B \fB\-\-input\-keylist\fP
  5421. Prints all keys that can be bound to commands.
  5422. .TP
  5423. .B \fB\-\-input\-key\-fifo\-size=<2\-65000>\fP
  5424. Specify the size of the FIFO that buffers key events (default: 7). If it
  5425. is too small, some events may be lost. The main disadvantage of setting it
  5426. to a very large value is that if you hold down a key triggering some
  5427. particularly slow command then the player may be unresponsive while it
  5428. processes all the queued commands.
  5429. .TP
  5430. .B \fB\-\-input\-test\fP
  5431. Input test mode. Instead of executing commands on key presses, mpv
  5432. will show the keys and the bound commands on the OSD. Has to be used
  5433. with a dummy video, and the normal ways to quit the player will not
  5434. work (key bindings that normally quit will be shown on OSD only, just
  5435. like any other binding). See \fI\%INPUT.CONF\fP\&.
  5436. .TP
  5437. .B \fB\-\-input\-file=<filename>\fP
  5438. Deprecated. Use \fB\-\-input\-ipc\-server\fP\&.
  5439. .sp
  5440. Read commands from the given file. Mostly useful with a FIFO. Since
  5441. mpv 0.7.0 also understands JSON commands (see \fI\%JSON IPC\fP), but you can\(aqt
  5442. get replies or events. Use \fB\-\-input\-ipc\-server\fP for something
  5443. bi\-directional. On MS Windows, JSON commands are not available.
  5444. .sp
  5445. This can also specify a direct file descriptor with \fBfd://N\fP (UNIX only).
  5446. In this case, JSON replies will be written if the FD is writable.
  5447. .sp
  5448. \fBNOTE:\fP
  5449. .INDENT 7.0
  5450. .INDENT 3.5
  5451. When the given file is a FIFO mpv opens both ends, so you can do several
  5452. \fIecho "seek 10" > mp_pipe\fP and the pipe will stay valid.
  5453. .UNINDENT
  5454. .UNINDENT
  5455. .TP
  5456. .B \fB\-\-input\-terminal\fP, \fB\-\-no\-input\-terminal\fP
  5457. \fB\-\-no\-input\-terminal\fP prevents the player from reading key events from
  5458. standard input. Useful when reading data from standard input. This is
  5459. automatically enabled when \fB\-\fP is found on the command line. There are
  5460. situations where you have to set it manually, e.g. if you open
  5461. \fB/dev/stdin\fP (or the equivalent on your system), use stdin in a playlist
  5462. or intend to read from stdin later on via the loadfile or loadlist input
  5463. commands.
  5464. .TP
  5465. .B \fB\-\-input\-ipc\-server=<filename>\fP
  5466. Enable the IPC support and create the listening socket at the given path.
  5467. .sp
  5468. On Linux and Unix, the given path is a regular filesystem path. On Windows,
  5469. named pipes are used, so the path refers to the pipe namespace
  5470. (\fB\e\e.\epipe\e<name>\fP). If the \fB\e\e.\epipe\e\fP prefix is missing, mpv will add
  5471. it automatically before creating the pipe, so
  5472. \fB\-\-input\-ipc\-server=/tmp/mpv\-socket\fP and
  5473. \fB\-\-input\-ipc\-server=\e\e.\epipe\etmp\empv\-socket\fP are equivalent for IPC on
  5474. Windows.
  5475. .sp
  5476. See \fI\%JSON IPC\fP for details.
  5477. .TP
  5478. .B \fB\-\-input\-gamepad=<yes|no>\fP
  5479. Enable/disable SDL2 Gamepad support. Disabled by default.
  5480. .TP
  5481. .B \fB\-\-input\-cursor\fP, \fB\-\-no\-input\-cursor\fP
  5482. Permit mpv to receive pointer events reported by the video output
  5483. driver. Necessary to use the OSC, or to select the buttons in DVD menus.
  5484. Support depends on the VO in use.
  5485. .TP
  5486. .B \fB\-\-input\-media\-keys=<yes|no>\fP
  5487. (OS X and Windows only)
  5488. Enable/disable media keys support. Enabled by default (except for libmpv).
  5489. .TP
  5490. .B \fB\-\-input\-right\-alt\-gr\fP, \fB\-\-no\-input\-right\-alt\-gr\fP
  5491. (Cocoa and Windows only)
  5492. Use the right Alt key as Alt Gr to produce special characters. If disabled,
  5493. count the right Alt as an Alt modifier key. Enabled by default.
  5494. .TP
  5495. .B \fB\-\-input\-vo\-keyboard=<yes|no>\fP
  5496. Disable all keyboard input on for VOs which can\(aqt participate in proper
  5497. keyboard input dispatching. May not affect all VOs. Generally useful for
  5498. embedding only.
  5499. .sp
  5500. On X11, a sub\-window with input enabled grabs all keyboard input as long
  5501. as it is 1. a child of a focused window, and 2. the mouse is inside of
  5502. the sub\-window. It can steal away all keyboard input from the
  5503. application embedding the mpv window, and on the other hand, the mpv
  5504. window will receive no input if the mouse is outside of the mpv window,
  5505. even though mpv has focus. Modern toolkits work around this weird X11
  5506. behavior, but naively embedding foreign windows breaks it.
  5507. .sp
  5508. The only way to handle this reasonably is using the XEmbed protocol, which
  5509. was designed to solve these problems. GTK provides \fBGtkSocket\fP, which
  5510. supports XEmbed. Qt doesn\(aqt seem to provide anything working in newer
  5511. versions.
  5512. .sp
  5513. If the embedder supports XEmbed, input should work with default settings
  5514. and with this option disabled. Note that \fBinput\-default\-bindings\fP is
  5515. disabled by default in libmpv as well \- it should be enabled if you want
  5516. the mpv default key bindings.
  5517. .sp
  5518. (This option was renamed from \fB\-\-input\-x11\-keyboard\fP\&.)
  5519. .UNINDENT
  5520. .SS OSD
  5521. .INDENT 0.0
  5522. .TP
  5523. .B \fB\-\-osc\fP, \fB\-\-no\-osc\fP
  5524. Whether to load the on\-screen\-controller (default: yes).
  5525. .TP
  5526. .B \fB\-\-no\-osd\-bar\fP, \fB\-\-osd\-bar\fP
  5527. Disable display of the OSD bar.
  5528. .sp
  5529. You can configure this on a per\-command basis in input.conf using \fBosd\-\fP
  5530. prefixes, see \fBInput Command Prefixes\fP\&. If you want to disable the OSD
  5531. completely, use \fB\-\-osd\-level=0\fP\&.
  5532. .TP
  5533. .B \fB\-\-osd\-on\-seek=<no,bar,msg,msg\-bar>\fP
  5534. Set what is displayed on the OSD during seeks. The default is \fBbar\fP\&.
  5535. .sp
  5536. You can configure this on a per\-command basis in input.conf using \fBosd\-\fP
  5537. prefixes, see \fBInput Command Prefixes\fP\&.
  5538. .TP
  5539. .B \fB\-\-osd\-duration=<time>\fP
  5540. Set the duration of the OSD messages in ms (default: 1000).
  5541. .TP
  5542. .B \fB\-\-osd\-font=<name>\fP
  5543. Specify font to use for OSD. The default is \fBsans\-serif\fP\&.
  5544. .INDENT 7.0
  5545. .INDENT 3.5
  5546. .IP "Examples"
  5547. .INDENT 0.0
  5548. .IP \(bu 2
  5549. \fB\-\-osd\-font=\(aqBitstream Vera Sans\(aq\fP
  5550. .IP \(bu 2
  5551. \fB\-\-osd\-font=\(aqComic Sans MS\(aq\fP
  5552. .UNINDENT
  5553. .UNINDENT
  5554. .UNINDENT
  5555. .TP
  5556. .B \fB\-\-osd\-font\-size=<size>\fP
  5557. Specify the OSD font size. See \fB\-\-sub\-font\-size\fP for details.
  5558. .sp
  5559. Default: 55.
  5560. .TP
  5561. .B \fB\-\-osd\-msg1=<string>\fP
  5562. Show this string as message on OSD with OSD level 1 (visible by default).
  5563. The message will be visible by default, and as long as no other message
  5564. covers it, and the OSD level isn\(aqt changed (see \fB\-\-osd\-level\fP).
  5565. Expands properties; see \fI\%Property Expansion\fP\&.
  5566. .TP
  5567. .B \fB\-\-osd\-msg2=<string>\fP
  5568. Similar to \fB\-\-osd\-msg1\fP, but for OSD level 2. If this is an empty string
  5569. (default), then the playback time is shown.
  5570. .TP
  5571. .B \fB\-\-osd\-msg3=<string>\fP
  5572. Similar to \fB\-\-osd\-msg1\fP, but for OSD level 3. If this is an empty string
  5573. (default), then the playback time, duration, and some more information is
  5574. shown.
  5575. .sp
  5576. This is used for the \fBshow\-progress\fP command (by default mapped to \fBP\fP),
  5577. and when seeking if enabled with \fB\-\-osd\-on\-seek\fP or by \fBosd\-\fP prefixes
  5578. in input.conf (see \fBInput Command Prefixes\fP).
  5579. .sp
  5580. \fB\-\-osd\-status\-msg\fP is a legacy equivalent (but with a minor difference).
  5581. .TP
  5582. .B \fB\-\-osd\-status\-msg=<string>\fP
  5583. Show a custom string during playback instead of the standard status text.
  5584. This overrides the status text used for \fB\-\-osd\-level=3\fP, when using the
  5585. \fBshow\-progress\fP command (by default mapped to \fBP\fP), and when seeking if
  5586. enabled with \fB\-\-osd\-on\-seek\fP or \fBosd\-\fP prefixes in input.conf (see
  5587. \fBInput Command Prefixes\fP). Expands properties. See \fI\%Property Expansion\fP\&.
  5588. .sp
  5589. This option has been replaced with \fB\-\-osd\-msg3\fP\&. The only difference is
  5590. that this option implicitly includes \fB${osd\-sym\-cc}\fP\&. This option is
  5591. ignored if \fB\-\-osd\-msg3\fP is not empty.
  5592. .TP
  5593. .B \fB\-\-osd\-playing\-msg=<string>\fP
  5594. Show a message on OSD when playback starts. The string is expanded for
  5595. properties, e.g. \fB\-\-osd\-playing\-msg=\(aqfile: ${filename}\(aq\fP will show the
  5596. message \fBfile:\fP followed by a space and the currently played filename.
  5597. .sp
  5598. See \fI\%Property Expansion\fP\&.
  5599. .TP
  5600. .B \fB\-\-osd\-bar\-align\-x=<\-1\-1>\fP
  5601. Position of the OSD bar. \-1 is far left, 0 is centered, 1 is far right.
  5602. Fractional values (like 0.5) are allowed.
  5603. .TP
  5604. .B \fB\-\-osd\-bar\-align\-y=<\-1\-1>\fP
  5605. Position of the OSD bar. \-1 is top, 0 is centered, 1 is bottom.
  5606. Fractional values (like 0.5) are allowed.
  5607. .TP
  5608. .B \fB\-\-osd\-bar\-w=<1\-100>\fP
  5609. Width of the OSD bar, in percentage of the screen width (default: 75).
  5610. A value of 50 means the bar is half the screen wide.
  5611. .TP
  5612. .B \fB\-\-osd\-bar\-h=<0.1\-50>\fP
  5613. Height of the OSD bar, in percentage of the screen height (default: 3.125).
  5614. .TP
  5615. .B \fB\-\-osd\-back\-color=<color>\fP
  5616. See \fB\-\-osd\-color\fP\&. Color used for OSD text background.
  5617. .TP
  5618. .B \fB\-\-osd\-blur=<0..20.0>\fP
  5619. Gaussian blur factor. 0 means no blur applied (default).
  5620. .TP
  5621. .B \fB\-\-osd\-bold=<yes|no>\fP
  5622. Format text on bold.
  5623. .TP
  5624. .B \fB\-\-osd\-italic=<yes|no>\fP
  5625. Format text on italic.
  5626. .TP
  5627. .B \fB\-\-osd\-border\-color=<color>\fP
  5628. See \fB\-\-osd\-color\fP\&. Color used for the OSD font border.
  5629. .sp
  5630. \fBNOTE:\fP
  5631. .INDENT 7.0
  5632. .INDENT 3.5
  5633. ignored when \fB\-\-osd\-back\-color\fP is
  5634. specified (or more exactly: when that option is not set to completely
  5635. transparent).
  5636. .UNINDENT
  5637. .UNINDENT
  5638. .TP
  5639. .B \fB\-\-osd\-border\-size=<size>\fP
  5640. Size of the OSD font border in scaled pixels (see \fB\-\-sub\-font\-size\fP
  5641. for details). A value of 0 disables borders.
  5642. .sp
  5643. Default: 3.
  5644. .TP
  5645. .B \fB\-\-osd\-color=<color>\fP
  5646. Specify the color used for OSD.
  5647. See \fB\-\-sub\-color\fP for details.
  5648. .TP
  5649. .B \fB\-\-osd\-fractions\fP
  5650. Show OSD times with fractions of seconds (in millisecond precision). Useful
  5651. to see the exact timestamp of a video frame.
  5652. .TP
  5653. .B \fB\-\-osd\-level=<0\-3>\fP
  5654. Specifies which mode the OSD should start in.
  5655. .INDENT 7.0
  5656. .TP
  5657. .B 0
  5658. OSD completely disabled (subtitles only)
  5659. .TP
  5660. .B 1
  5661. enabled (shows up only on user interaction)
  5662. .TP
  5663. .B 2
  5664. enabled + current time visible by default
  5665. .TP
  5666. .B 3
  5667. enabled + \fB\-\-osd\-status\-msg\fP (current time and status by default)
  5668. .UNINDENT
  5669. .TP
  5670. .B \fB\-\-osd\-margin\-x=<size>\fP
  5671. Left and right screen margin for the OSD in scaled pixels (see
  5672. \fB\-\-sub\-font\-size\fP for details).
  5673. .sp
  5674. This option specifies the distance of the OSD to the left, as well as at
  5675. which distance from the right border long OSD text will be broken.
  5676. .sp
  5677. Default: 25.
  5678. .TP
  5679. .B \fB\-\-osd\-margin\-y=<size>\fP
  5680. Top and bottom screen margin for the OSD in scaled pixels (see
  5681. \fB\-\-sub\-font\-size\fP for details).
  5682. .sp
  5683. This option specifies the vertical margins of the OSD.
  5684. .sp
  5685. Default: 22.
  5686. .TP
  5687. .B \fB\-\-osd\-align\-x=<left|center|right>\fP
  5688. Control to which corner of the screen OSD should be
  5689. aligned to (default: \fBleft\fP).
  5690. .TP
  5691. .B \fB\-\-osd\-align\-y=<top|center|bottom>\fP
  5692. Vertical position (default: \fBtop\fP).
  5693. Details see \fB\-\-osd\-align\-x\fP\&.
  5694. .TP
  5695. .B \fB\-\-osd\-scale=<factor>\fP
  5696. OSD font size multiplier, multiplied with \fB\-\-osd\-font\-size\fP value.
  5697. .TP
  5698. .B \fB\-\-osd\-scale\-by\-window=<yes|no>\fP
  5699. Whether to scale the OSD with the window size (default: yes). If this is
  5700. disabled, \fB\-\-osd\-font\-size\fP and other OSD options that use scaled pixels
  5701. are always in actual pixels. The effect is that changing the window size
  5702. won\(aqt change the OSD font size.
  5703. .TP
  5704. .B \fB\-\-osd\-shadow\-color=<color>\fP
  5705. See \fB\-\-sub\-color\fP\&. Color used for OSD shadow.
  5706. .TP
  5707. .B \fB\-\-osd\-shadow\-offset=<size>\fP
  5708. Displacement of the OSD shadow in scaled pixels (see
  5709. \fB\-\-sub\-font\-size\fP for details). A value of 0 disables shadows.
  5710. .sp
  5711. Default: 0.
  5712. .TP
  5713. .B \fB\-\-osd\-spacing=<size>\fP
  5714. Horizontal OSD/sub font spacing in scaled pixels (see \fB\-\-sub\-font\-size\fP
  5715. for details). This value is added to the normal letter spacing. Negative
  5716. values are allowed.
  5717. .sp
  5718. Default: 0.
  5719. .TP
  5720. .B \fB\-\-video\-osd=<yes|no>\fP
  5721. Enabled OSD rendering on the video window (default: yes). This can be used
  5722. in situations where terminal OSD is preferred. If you just want to disable
  5723. all OSD rendering, use \fB\-\-osd\-level=0\fP\&.
  5724. .sp
  5725. It does not affect subtitles or overlays created by scripts (in particular,
  5726. the OSC needs to be disabled with \fB\-\-no\-osc\fP).
  5727. .sp
  5728. This option is somewhat experimental and could be replaced by another
  5729. mechanism in the future.
  5730. .TP
  5731. .B \fB\-\-osd\-font\-provider=<...>\fP
  5732. See \fB\-\-sub\-font\-provider\fP for details and accepted values. Note that
  5733. unlike subtitles, OSD never uses embedded fonts from media files.
  5734. .UNINDENT
  5735. .SS Screenshot
  5736. .INDENT 0.0
  5737. .TP
  5738. .B \fB\-\-screenshot\-format=<type>\fP
  5739. Set the image file type used for saving screenshots.
  5740. .sp
  5741. Available choices:
  5742. .INDENT 7.0
  5743. .TP
  5744. .B png
  5745. PNG
  5746. .TP
  5747. .B jpg
  5748. JPEG (default)
  5749. .TP
  5750. .B jpeg
  5751. JPEG (alias for jpg)
  5752. .TP
  5753. .B webp
  5754. WebP
  5755. .UNINDENT
  5756. .TP
  5757. .B \fB\-\-screenshot\-tag\-colorspace=<yes|no>\fP
  5758. Tag screenshots with the appropriate colorspace.
  5759. .sp
  5760. Note that not all formats are supported.
  5761. .sp
  5762. Default: \fBno\fP\&.
  5763. .TP
  5764. .B \fB\-\-screenshot\-high\-bit\-depth=<yes|no>\fP
  5765. If possible, write screenshots with a bit depth similar to the source
  5766. video (default: yes). This is interesting in particular for PNG, as this
  5767. sometimes triggers writing 16 bit PNGs with huge file sizes. This will also
  5768. include an unused alpha channel in the resulting files if 16 bit is used.
  5769. .TP
  5770. .B \fB\-\-screenshot\-template=<template>\fP
  5771. Specify the filename template used to save screenshots. The template
  5772. specifies the filename without file extension, and can contain format
  5773. specifiers, which will be substituted when taking a screenshot.
  5774. By default, the template is \fBmpv\-shot%n\fP, which results in filenames like
  5775. \fBmpv\-shot0012.png\fP for example.
  5776. .sp
  5777. The template can start with a relative or absolute path, in order to
  5778. specify a directory location where screenshots should be saved.
  5779. .sp
  5780. If the final screenshot filename points to an already existing file, the
  5781. file will not be overwritten. The screenshot will either not be saved, or if
  5782. the template contains \fB%n\fP, saved using different, newly generated
  5783. filename.
  5784. .sp
  5785. Allowed format specifiers:
  5786. .INDENT 7.0
  5787. .TP
  5788. .B \fB%[#][0X]n\fP
  5789. A sequence number, padded with zeros to length X (default: 04). E.g.
  5790. passing the format \fB%04n\fP will yield \fB0012\fP on the 12th screenshot.
  5791. The number is incremented every time a screenshot is taken or if the
  5792. file already exists. The length \fBX\fP must be in the range 0\-9. With
  5793. the optional # sign, mpv will use the lowest available number. For
  5794. example, if you take three screenshots\-\-0001, 0002, 0003\-\-and delete
  5795. the first two, the next two screenshots will not be 0004 and 0005, but
  5796. 0001 and 0002 again.
  5797. .TP
  5798. .B \fB%f\fP
  5799. Filename of the currently played video.
  5800. .TP
  5801. .B \fB%F\fP
  5802. Same as \fB%f\fP, but strip the file extension, including the dot.
  5803. .TP
  5804. .B \fB%x\fP
  5805. Directory path of the currently played video. If the video is not on
  5806. the filesystem (but e.g. \fBhttp://\fP), this expand to an empty string.
  5807. .TP
  5808. .B \fB%X{fallback}\fP
  5809. Same as \fB%x\fP, but if the video file is not on the filesystem, return
  5810. the fallback string inside the \fB{...}\fP\&.
  5811. .TP
  5812. .B \fB%p\fP
  5813. Current playback time, in the same format as used in the OSD. The
  5814. result is a string of the form "HH:MM:SS". For example, if the video is
  5815. at the time position 5 minutes and 34 seconds, \fB%p\fP will be replaced
  5816. with "00:05:34".
  5817. .TP
  5818. .B \fB%P\fP
  5819. Similar to \fB%p\fP, but extended with the playback time in milliseconds.
  5820. It is formatted as "HH:MM:SS.mmm", with "mmm" being the millisecond
  5821. part of the playback time.
  5822. .sp
  5823. \fBNOTE:\fP
  5824. .INDENT 7.0
  5825. .INDENT 3.5
  5826. This is a simple way for getting unique per\-frame timestamps. (Frame
  5827. numbers would be more intuitive, but are not easily implementable
  5828. because container formats usually use time stamps for identifying
  5829. frames.)
  5830. .UNINDENT
  5831. .UNINDENT
  5832. .TP
  5833. .B \fB%wX\fP
  5834. Specify the current playback time using the format string \fBX\fP\&.
  5835. \fB%p\fP is like \fB%wH:%wM:%wS\fP, and \fB%P\fP is like \fB%wH:%wM:%wS.%wT\fP\&.
  5836. .INDENT 7.0
  5837. .TP
  5838. .B Valid format specifiers:
  5839. .INDENT 7.0
  5840. .TP
  5841. .B \fB%wH\fP
  5842. hour (padded with 0 to two digits)
  5843. .TP
  5844. .B \fB%wh\fP
  5845. hour (not padded)
  5846. .TP
  5847. .B \fB%wM\fP
  5848. minutes (00\-59)
  5849. .TP
  5850. .B \fB%wm\fP
  5851. total minutes (includes hours, unlike \fB%wM\fP)
  5852. .TP
  5853. .B \fB%wS\fP
  5854. seconds (00\-59)
  5855. .TP
  5856. .B \fB%ws\fP
  5857. total seconds (includes hours and minutes)
  5858. .TP
  5859. .B \fB%wf\fP
  5860. like \fB%ws\fP, but as float
  5861. .TP
  5862. .B \fB%wT\fP
  5863. milliseconds (000\-999)
  5864. .UNINDENT
  5865. .UNINDENT
  5866. .TP
  5867. .B \fB%tX\fP
  5868. Specify the current local date/time using the format \fBX\fP\&. This format
  5869. specifier uses the UNIX \fBstrftime()\fP function internally, and inserts
  5870. the result of passing "%X" to \fBstrftime\fP\&. For example, \fB%tm\fP will
  5871. insert the number of the current month as number. You have to use
  5872. multiple \fB%tX\fP specifiers to build a full date/time string.
  5873. .TP
  5874. .B \fB%{prop[:fallback text]}\fP
  5875. Insert the value of the input property \(aqprop\(aq. E.g. \fB%{filename}\fP is
  5876. the same as \fB%f\fP\&. If the property does not exist or is not available,
  5877. an error text is inserted, unless a fallback is specified.
  5878. .TP
  5879. .B \fB%%\fP
  5880. Replaced with the \fB%\fP character itself.
  5881. .UNINDENT
  5882. .TP
  5883. .B \fB\-\-screenshot\-directory=<path>\fP
  5884. Store screenshots in this directory. This path is joined with the filename
  5885. generated by \fB\-\-screenshot\-template\fP\&. If the template filename is already
  5886. absolute, the directory is ignored.
  5887. .sp
  5888. If the directory does not exist, it is created on the first screenshot. If
  5889. it is not a directory, an error is generated when trying to write a
  5890. screenshot.
  5891. .sp
  5892. This option is not set by default, and thus will write screenshots to the
  5893. directory from which mpv was started. In pseudo\-gui mode
  5894. (see \fI\%PSEUDO GUI MODE\fP), this is set to the desktop.
  5895. .TP
  5896. .B \fB\-\-screenshot\-jpeg\-quality=<0\-100>\fP
  5897. Set the JPEG quality level. Higher means better quality. The default is 90.
  5898. .TP
  5899. .B \fB\-\-screenshot\-jpeg\-source\-chroma=<yes|no>\fP
  5900. Write JPEG files with the same chroma subsampling as the video
  5901. (default: yes). If disabled, the libjpeg default is used.
  5902. .TP
  5903. .B \fB\-\-screenshot\-png\-compression=<0\-9>\fP
  5904. Set the PNG compression level. Higher means better compression. This will
  5905. affect the file size of the written screenshot file and the time it takes
  5906. to write a screenshot. Too high compression might occupy enough CPU time to
  5907. interrupt playback. The default is 7.
  5908. .TP
  5909. .B \fB\-\-screenshot\-png\-filter=<0\-5>\fP
  5910. Set the filter applied prior to PNG compression. 0 is none, 1 is "sub", 2 is
  5911. "up", 3 is "average", 4 is "Paeth", and 5 is "mixed". This affects the level
  5912. of compression that can be achieved. For most images, "mixed" achieves the
  5913. best compression ratio, hence it is the default.
  5914. .TP
  5915. .B \fB\-\-screenshot\-webp\-lossless=<yes|no>\fP
  5916. Write lossless WebP files. \fB\-\-screenshot\-webp\-quality\fP is ignored if this
  5917. is set. The default is no.
  5918. .TP
  5919. .B \fB\-\-screenshot\-webp\-quality=<0\-100>\fP
  5920. Set the WebP quality level. Higher means better quality. The default is 75.
  5921. .TP
  5922. .B \fB\-\-screenshot\-webp\-compression=<0\-6>\fP
  5923. Set the WebP compression level. Higher means better compression, but takes
  5924. more CPU time. Note that this also affects the screenshot quality when used
  5925. with lossy WebP files. The default is 4.
  5926. .UNINDENT
  5927. .SS Software Scaler
  5928. .INDENT 0.0
  5929. .TP
  5930. .B \fB\-\-sws\-scaler=<name>\fP
  5931. Specify the software scaler algorithm to be used with \fB\-\-vf=scale\fP\&. This
  5932. also affects video output drivers which lack hardware acceleration,
  5933. e.g. \fBx11\fP\&. See also \fB\-\-vf=scale\fP\&.
  5934. .sp
  5935. To get a list of available scalers, run \fB\-\-sws\-scaler=help\fP\&.
  5936. .sp
  5937. Default: \fBbicubic\fP\&.
  5938. .TP
  5939. .B \fB\-\-sws\-lgb=<0\-100>\fP
  5940. Software scaler Gaussian blur filter (luma). See \fB\-\-sws\-scaler\fP\&.
  5941. .TP
  5942. .B \fB\-\-sws\-cgb=<0\-100>\fP
  5943. Software scaler Gaussian blur filter (chroma). See \fB\-\-sws\-scaler\fP\&.
  5944. .TP
  5945. .B \fB\-\-sws\-ls=<\-100\-100>\fP
  5946. Software scaler sharpen filter (luma). See \fB\-\-sws\-scaler\fP\&.
  5947. .TP
  5948. .B \fB\-\-sws\-cs=<\-100\-100>\fP
  5949. Software scaler sharpen filter (chroma). See \fB\-\-sws\-scaler\fP\&.
  5950. .TP
  5951. .B \fB\-\-sws\-chs=<h>\fP
  5952. Software scaler chroma horizontal shifting. See \fB\-\-sws\-scaler\fP\&.
  5953. .TP
  5954. .B \fB\-\-sws\-cvs=<v>\fP
  5955. Software scaler chroma vertical shifting. See \fB\-\-sws\-scaler\fP\&.
  5956. .TP
  5957. .B \fB\-\-sws\-bitexact=<yes|no>\fP
  5958. Unknown functionality (default: no). Consult libswscale source code. The
  5959. primary purpose of this, as far as libswscale API goes), is to produce
  5960. exactly the same output for the same input on all platforms (output has the
  5961. same "bits" everywhere, thus "bitexact"). Typically disables optimizations.
  5962. .TP
  5963. .B \fB\-\-sws\-fast=<yes|no>\fP
  5964. Allow optimizations that help with performance, but reduce quality (default:
  5965. no).
  5966. .sp
  5967. VOs like \fBdrm\fP and \fBx11\fP will benefit a lot from using \fB\-\-sws\-fast\fP\&.
  5968. You may need to set other options, like \fB\-\-sws\-scaler\fP\&. The builtin
  5969. \fBsws\-fast\fP profile sets this option and some others to gain performance
  5970. for reduced quality.
  5971. .TP
  5972. .B \fB\-\-sws\-allow\-zimg=<yes|no>\fP
  5973. Allow using zimg (if the component using the internal swscale wrapper
  5974. explicitly allows so). In this case, zimg \fImay\fP be used, if the internal
  5975. zimg wrapper supports the input and output formats. It will silently
  5976. fall back to libswscale if one of these conditions does not apply.
  5977. .sp
  5978. If zimg is used, the other \fB\-\-sws\-\fP options are ignored, and the
  5979. \fB\-\-zimg\-\fP options are used instead.
  5980. .sp
  5981. If the internal component using the swscale wrapper hooks up logging
  5982. correctly, a verbose priority log message will indicate whether zimg is
  5983. being used.
  5984. .sp
  5985. Most things which need software conversion can make use of this.
  5986. .TP
  5987. .B \fB\-\-zimg\-scaler=<point|bilinear|bicubic|spline16|spline36|lanczos>\fP
  5988. Zimg luma scaler to use (default: lanczos).
  5989. .TP
  5990. .B \fB\-\-zimg\-scaler\-param\-a=<default|float>\fP, \fB\-\-zimg\-scaler\-param\-b=<default|float>\fP
  5991. Set scaler parameters. By default, these are set to the special string
  5992. \fBdefault\fP, which maps to a scaler\-specific default value. Ignored if the
  5993. scaler is not tunable.
  5994. .INDENT 7.0
  5995. .TP
  5996. .B \fBlanczos\fP
  5997. \fB\-\-zimg\-scaler\-param\-a\fP is the number of taps.
  5998. .TP
  5999. .B \fBbicubic\fP
  6000. a and b are the bicubic b and c parameters.
  6001. .UNINDENT
  6002. .TP
  6003. .B \fB\-\-zimg\-scaler\-chroma=...\fP
  6004. Same as \fB\-\-zimg\-scaler\fP, for for chroma interpolation (default: bilinear).
  6005. .TP
  6006. .B \fB\-\-zimg\-scaler\-chroma\-param\-a\fP, \fB\-\-zimg\-scaler\-chroma\-param\-b\fP
  6007. Same as \fB\-\-zimg\-scaler\-param\-a\fP / \fB\-\-zimg\-scaler\-param\-b\fP, for chroma.
  6008. .TP
  6009. .B \fB\-\-zimg\-dither=<no|ordered|random|error\-diffusion>\fP
  6010. Dithering (default: random).
  6011. .TP
  6012. .B \fB\-\-zimg\-fast=<yes|no>\fP
  6013. Allow optimizations that help with performance, but reduce quality (default:
  6014. yes). Currently, this may simplify gamma conversion operations.
  6015. .UNINDENT
  6016. .SS Audio Resampler
  6017. .sp
  6018. This controls the default options of any resampling done by mpv (but not within
  6019. libavfilter, within the system audio API resampler, or any other places).
  6020. .sp
  6021. It also sets the defaults for the \fBlavrresample\fP audio filter.
  6022. .INDENT 0.0
  6023. .TP
  6024. .B \fB\-\-audio\-resample\-filter\-size=<length>\fP
  6025. Length of the filter with respect to the lower sampling rate. (default:
  6026. 16)
  6027. .TP
  6028. .B \fB\-\-audio\-resample\-phase\-shift=<count>\fP
  6029. Log2 of the number of polyphase entries. (..., 10\->1024, 11\->2048,
  6030. 12\->4096, ...) (default: 10\->1024)
  6031. .TP
  6032. .B \fB\-\-audio\-resample\-cutoff=<cutoff>\fP
  6033. Cutoff frequency (0.0\-1.0), default set depending upon filter length.
  6034. .TP
  6035. .B \fB\-\-audio\-resample\-linear=<yes|no>\fP
  6036. If set then filters will be linearly interpolated between polyphase
  6037. entries. (default: no)
  6038. .TP
  6039. .B \fB\-\-audio\-normalize\-downmix=<yes|no>\fP
  6040. Enable/disable normalization if surround audio is downmixed to stereo
  6041. (default: no). If this is disabled, downmix can cause clipping. If it\(aqs
  6042. enabled, the output might be too quiet. It depends on the source audio.
  6043. .sp
  6044. Technically, this changes the \fBnormalize\fP suboption of the
  6045. \fBlavrresample\fP audio filter, which performs the downmixing.
  6046. .sp
  6047. If downmix happens outside of mpv for some reason, or in the decoder
  6048. (decoder downmixing), or in the audio output (system mixer), this has no
  6049. effect.
  6050. .TP
  6051. .B \fB\-\-audio\-resample\-max\-output\-size=<length>\fP
  6052. Limit maximum size of audio frames filtered at once, in ms (default: 40).
  6053. The output size size is limited in order to make resample speed changes
  6054. react faster. This is necessary especially if decoders or filters output
  6055. very large frame sizes (like some lossless codecs or some DRC filters).
  6056. This option does not affect the resampling algorithm in any way.
  6057. .sp
  6058. For testing/debugging only. Can be removed or changed any time.
  6059. .TP
  6060. .B \fB\-\-audio\-swresample\-o=<string>\fP
  6061. Set AVOptions on the SwrContext or AVAudioResampleContext. These should
  6062. be documented by FFmpeg or Libav.
  6063. .sp
  6064. This is a key/value list option. See \fI\%List Options\fP for details.
  6065. .UNINDENT
  6066. .SS Terminal
  6067. .INDENT 0.0
  6068. .TP
  6069. .B \fB\-\-quiet\fP
  6070. Make console output less verbose; in particular, prevents the status line
  6071. (i.e. AV: 3.4 (00:00:03.37) / 5320.6 ...) from being displayed.
  6072. Particularly useful on slow terminals or broken ones which do not properly
  6073. handle carriage return (i.e. \fB\er\fP).
  6074. .sp
  6075. See also: \fB\-\-really\-quiet\fP and \fB\-\-msg\-level\fP\&.
  6076. .TP
  6077. .B \fB\-\-really\-quiet\fP
  6078. Display even less output and status messages than with \fB\-\-quiet\fP\&.
  6079. .TP
  6080. .B \fB\-\-no\-terminal\fP, \fB\-\-terminal\fP
  6081. Disable any use of the terminal and stdin/stdout/stderr. This completely
  6082. silences any message output.
  6083. .sp
  6084. Unlike \fB\-\-really\-quiet\fP, this disables input and terminal initialization
  6085. as well.
  6086. .TP
  6087. .B \fB\-\-no\-msg\-color\fP
  6088. Disable colorful console output on terminals.
  6089. .TP
  6090. .B \fB\-\-msg\-level=<module1=level1,module2=level2,...>\fP
  6091. Control verbosity directly for each module. The \fBall\fP module changes the
  6092. verbosity of all the modules. The verbosity changes from this option are
  6093. applied in order from left to right, and each item can override a previous
  6094. one.
  6095. .sp
  6096. Run mpv with \fB\-\-msg\-level=all=trace\fP to see all messages mpv outputs. You
  6097. can use the module names printed in the output (prefixed to each line in
  6098. \fB[...]\fP) to limit the output to interesting modules.
  6099. .sp
  6100. This also affects \fB\-\-log\-file\fP, and in certain cases libmpv API logging.
  6101. .sp
  6102. \fBNOTE:\fP
  6103. .INDENT 7.0
  6104. .INDENT 3.5
  6105. Some messages are printed before the command line is parsed and are
  6106. therefore not affected by \fB\-\-msg\-level\fP\&. To control these messages,
  6107. you have to use the \fBMPV_VERBOSE\fP environment variable; see
  6108. \fI\%ENVIRONMENT VARIABLES\fP for details.
  6109. .UNINDENT
  6110. .UNINDENT
  6111. .sp
  6112. Available levels:
  6113. .INDENT 7.0
  6114. .INDENT 3.5
  6115. .INDENT 0.0
  6116. .TP
  6117. .B no
  6118. complete silence
  6119. .TP
  6120. .B fatal
  6121. fatal messages only
  6122. .TP
  6123. .B error
  6124. error messages
  6125. .TP
  6126. .B warn
  6127. warning messages
  6128. .TP
  6129. .B info
  6130. informational messages
  6131. .TP
  6132. .B status
  6133. status messages (default)
  6134. .TP
  6135. .B v
  6136. verbose messages
  6137. .TP
  6138. .B debug
  6139. debug messages
  6140. .TP
  6141. .B trace
  6142. very noisy debug messages
  6143. .UNINDENT
  6144. .UNINDENT
  6145. .UNINDENT
  6146. .INDENT 7.0
  6147. .INDENT 3.5
  6148. .IP "Example"
  6149. .INDENT 0.0
  6150. .INDENT 3.5
  6151. .sp
  6152. .nf
  6153. .ft C
  6154. mpv \-\-msg\-level=ao/sndio=no
  6155. .ft P
  6156. .fi
  6157. .UNINDENT
  6158. .UNINDENT
  6159. .sp
  6160. Completely silences the output of ao_sndio, which uses the log
  6161. prefix \fB[ao/sndio]\fP\&.
  6162. .INDENT 0.0
  6163. .INDENT 3.5
  6164. .sp
  6165. .nf
  6166. .ft C
  6167. mpv \-\-msg\-level=all=warn,ao/alsa=error
  6168. .ft P
  6169. .fi
  6170. .UNINDENT
  6171. .UNINDENT
  6172. .sp
  6173. Only show warnings or worse, and let the ao_alsa output show errors
  6174. only.
  6175. .UNINDENT
  6176. .UNINDENT
  6177. .TP
  6178. .B \fB\-\-term\-osd=<auto|no|force>\fP
  6179. Control whether OSD messages are shown on the console when no video output
  6180. is available (default: auto).
  6181. .INDENT 7.0
  6182. .TP
  6183. .B auto
  6184. use terminal OSD if no video output active
  6185. .TP
  6186. .B no
  6187. disable terminal OSD
  6188. .TP
  6189. .B force
  6190. use terminal OSD even if video output active
  6191. .UNINDENT
  6192. .sp
  6193. The \fBauto\fP mode also enables terminal OSD if \fB\-\-video\-osd=no\fP was set.
  6194. .TP
  6195. .B \fB\-\-term\-osd\-bar\fP, \fB\-\-no\-term\-osd\-bar\fP
  6196. Enable printing a progress bar under the status line on the terminal.
  6197. (Disabled by default.)
  6198. .TP
  6199. .B \fB\-\-term\-osd\-bar\-chars=<string>\fP
  6200. Customize the \fB\-\-term\-osd\-bar\fP feature. The string is expected to
  6201. consist of 5 characters (start, left space, position indicator,
  6202. right space, end). You can use Unicode characters, but note that double\-
  6203. width characters will not be treated correctly.
  6204. .sp
  6205. Default: \fB[\-+\-]\fP\&.
  6206. .TP
  6207. .B \fB\-\-term\-playing\-msg=<string>\fP
  6208. Print out a string after starting playback. The string is expanded for
  6209. properties, e.g. \fB\-\-term\-playing\-msg=\(aqfile: ${filename}\(aq\fP will print the string
  6210. \fBfile:\fP followed by a space and the currently played filename.
  6211. .sp
  6212. See \fI\%Property Expansion\fP\&.
  6213. .TP
  6214. .B \fB\-\-term\-status\-msg=<string>\fP
  6215. Print out a custom string during playback instead of the standard status
  6216. line. Expands properties. See \fI\%Property Expansion\fP\&.
  6217. .TP
  6218. .B \fB\-\-msg\-module\fP
  6219. Prepend module name to each console message.
  6220. .TP
  6221. .B \fB\-\-msg\-time\fP
  6222. Prepend timing information to each console message.
  6223. .UNINDENT
  6224. .SS Cache
  6225. .INDENT 0.0
  6226. .TP
  6227. .B \fB\-\-cache=<yes|no|auto>\fP
  6228. Decide whether to use network cache settings (default: auto).
  6229. .sp
  6230. If enabled, use up to \fB\-\-cache\-secs\fP for the cache size (but still limited
  6231. to \fB\-\-demuxer\-max\-bytes\fP). \fB\-\-demuxer\-seekable\-cache=auto\fP behaves as if
  6232. it was set to \fByes\fP\&. If disabled, \fB\-\-cache\-pause\fP and related are
  6233. implicitly disabled.
  6234. .sp
  6235. The \fBauto\fP choice enables this depending on whether the stream is thought
  6236. to involve network accesses or other slow media (this is an imperfect
  6237. heuristic).
  6238. .sp
  6239. Before mpv 0.30.0, this used to accept a number, which specified the size
  6240. of the cache in kilobytes. Use e.g. \fB\-\-cache \-\-demuxer\-max\-bytes=123k\fP
  6241. instead.
  6242. .TP
  6243. .B \fB\-\-no\-cache\fP
  6244. Turn off input stream caching. See \fB\-\-cache\fP\&.
  6245. .TP
  6246. .B \fB\-\-cache\-secs=<seconds>\fP
  6247. How many seconds of audio/video to prefetch if the cache is active. This
  6248. overrides the \fB\-\-demuxer\-readahead\-secs\fP option if and only if the cache
  6249. is enabled and the value is larger. The default value is set to something
  6250. very high, so the actually achieved readahead will usually be limited by
  6251. the value of the \fB\-\-demuxer\-max\-bytes\fP option. Setting this option is
  6252. usually only useful for limiting readahead.
  6253. .TP
  6254. .B \fB\-\-cache\-on\-disk=<yes|no>\fP
  6255. Write packet data to a temporary file, instead of keeping them in memory.
  6256. This makes sense only with \fB\-\-cache\fP\&. If the normal cache is disabled,
  6257. this option is ignored.
  6258. .sp
  6259. You need to set \fB\-\-cache\-dir\fP to use this.
  6260. .sp
  6261. The cache file is append\-only. Even if the player appears to prune data, the
  6262. file space freed by it is not reused. The cache file is deleted when
  6263. playback is closed.
  6264. .sp
  6265. Note that packet metadata is still kept in memory. \fB\-\-demuxer\-max\-bytes\fP
  6266. and related options are applied to metadata \fIonly\fP\&. The size of this
  6267. metadata varies, but 50 MB per hour of media is typical. The cache
  6268. statistics will report this metadats size, instead of the size of the cache
  6269. file. If the metadata hits the size limits, the metadata is pruned (but not
  6270. the cache file).
  6271. .sp
  6272. When the media is closed, the cache file is deleted. A cache file is
  6273. generally worthless after the media is closed, and it\(aqs hard to retrieve
  6274. any media data from it (it\(aqs not supported by design).
  6275. .sp
  6276. If the option is enabled at runtime, the cache file is created, but old data
  6277. will remain in the memory cache. If the option is disabled at runtime, old
  6278. data remains in the disk cache, and the cache file is not closed until the
  6279. media is closed. If the option is disabled and enabled again, it will
  6280. continue to use the cache file that was opened first.
  6281. .TP
  6282. .B \fB\-\-cache\-dir=<path>\fP
  6283. Directory where to create temporary files (default: none).
  6284. .sp
  6285. Currently, this is used for \fB\-\-cache\-on\-disk\fP only.
  6286. .TP
  6287. .B \fB\-\-cache\-pause=<yes|no>\fP
  6288. Whether the player should automatically pause when the cache runs out of
  6289. data and stalls decoding/playback (default: yes). If enabled, it will
  6290. pause and unpause once more data is available, aka "buffering".
  6291. .TP
  6292. .B \fB\-\-cache\-pause\-wait=<seconds>\fP
  6293. Number of seconds the packet cache should have buffered before starting
  6294. playback again if "buffering" was entered (default: 1). This can be used
  6295. to control how long the player rebuffers if \fB\-\-cache\-pause\fP is enabled,
  6296. and the demuxer underruns. If the given time is higher than the maximum
  6297. set with \fB\-\-cache\-secs\fP or \fB\-\-demuxer\-readahead\-secs\fP, or prefetching
  6298. ends before that for some other reason (like file end or maximum configured
  6299. cache size reached), playback resumes earlier.
  6300. .TP
  6301. .B \fB\-\-cache\-pause\-initial=<yes|no>\fP
  6302. Enter "buffering" mode before starting playback (default: no). This can be
  6303. used to ensure playback starts smoothly, in exchange for waiting some time
  6304. to prefetch network data (as controlled by \fB\-\-cache\-pause\-wait\fP). For
  6305. example, some common behavior is that playback starts, but network caches
  6306. immediately underrun when trying to decode more data as playback progresses.
  6307. .sp
  6308. Another thing that can happen is that the network prefetching is so CPU
  6309. demanding (due to demuxing in the background) that playback drops frames
  6310. at first. In these cases, it helps enabling this option, and setting
  6311. \fB\-\-cache\-secs\fP and \fB\-\-cache\-pause\-wait\fP to roughly the same value.
  6312. .sp
  6313. This option also triggers when playback is restarted after seeking.
  6314. .TP
  6315. .B \fB\-\-cache\-unlink\-files=<immediate|whendone|no>\fP
  6316. Whether or when to unlink cache files (default: immediate). This affects
  6317. cache files which are inherently temporary, and which make no sense to
  6318. remain on disk after the player terminates. This is a debugging option.
  6319. .INDENT 7.0
  6320. .TP
  6321. .B \fBimmediate\fP
  6322. Unlink cache file after they were created. The cache files won\(aqt be
  6323. visible anymore, even though they\(aqre in use. This ensures they are
  6324. guaranteed to be removed from disk when the player terminates, even if
  6325. it crashes.
  6326. .TP
  6327. .B \fBwhendone\fP
  6328. Delete cache files after they are closed.
  6329. .TP
  6330. .B \fBno\fP
  6331. Don\(aqt delete cache files. They will consume disk space without having a
  6332. use.
  6333. .UNINDENT
  6334. .sp
  6335. Currently, this is used for \fB\-\-cache\-on\-disk\fP only.
  6336. .TP
  6337. .B \fB\-\-stream\-buffer\-size=<bytesize>\fP
  6338. Size of the low level stream byte buffer (default: 128KB). This is used as
  6339. buffer between demuxer and low level I/O (e.g. sockets). Generally, this
  6340. can be very small, and the main purpose is similar to the internal buffer
  6341. FILE in the C standard library will have.
  6342. .sp
  6343. Half of the buffer is always used for guaranteed seek back, which is
  6344. important for unseekable input.
  6345. .sp
  6346. There are known cases where this can help performance to set a large buffer:
  6347. .INDENT 7.0
  6348. .INDENT 3.5
  6349. .INDENT 0.0
  6350. .IP 1. 3
  6351. mp4 files. libavformat may trigger many small seeks in both
  6352. directions, depending on how the file was muxed.
  6353. .IP 2. 3
  6354. Certain network filesystems, which do not have a cache, and where
  6355. small reads can be inefficient.
  6356. .UNINDENT
  6357. .UNINDENT
  6358. .UNINDENT
  6359. .sp
  6360. In other cases, setting this to a large value can reduce performance.
  6361. .sp
  6362. Usually, read accesses are at half the buffer size, but it may happen that
  6363. accesses are done alternating with smaller and larger sizes (this is due to
  6364. the internal ring buffer wrap\-around).
  6365. .sp
  6366. See \fB\-\-list\-options\fP for defaults and value range. \fB<bytesize>\fP options
  6367. accept suffixes such as \fBKiB\fP and \fBMiB\fP\&.
  6368. .UNINDENT
  6369. .SS Network
  6370. .INDENT 0.0
  6371. .TP
  6372. .B \fB\-\-user\-agent=<string>\fP
  6373. Use \fB<string>\fP as user agent for HTTP streaming.
  6374. .TP
  6375. .B \fB\-\-cookies\fP, \fB\-\-no\-cookies\fP
  6376. Support cookies when making HTTP requests. Disabled by default.
  6377. .TP
  6378. .B \fB\-\-cookies\-file=<filename>\fP
  6379. Read HTTP cookies from <filename>. The file is assumed to be in Netscape
  6380. format.
  6381. .TP
  6382. .B \fB\-\-http\-header\-fields=<field1,field2>\fP
  6383. Set custom HTTP fields when accessing HTTP stream.
  6384. .sp
  6385. This is a string list option. See \fI\%List Options\fP for details.
  6386. .INDENT 7.0
  6387. .INDENT 3.5
  6388. .IP "Example"
  6389. .INDENT 0.0
  6390. .INDENT 3.5
  6391. .sp
  6392. .nf
  6393. .ft C
  6394. mpv \-\-http\-header\-fields=\(aqField1: value1\(aq,\(aqField2: value2\(aq \e
  6395. http://localhost:1234
  6396. .ft P
  6397. .fi
  6398. .UNINDENT
  6399. .UNINDENT
  6400. .sp
  6401. Will generate HTTP request:
  6402. .INDENT 0.0
  6403. .INDENT 3.5
  6404. .sp
  6405. .nf
  6406. .ft C
  6407. GET / HTTP/1.0
  6408. Host: localhost:1234
  6409. User\-Agent: MPlayer
  6410. Icy\-MetaData: 1
  6411. Field1: value1
  6412. Field2: value2
  6413. Connection: close
  6414. .ft P
  6415. .fi
  6416. .UNINDENT
  6417. .UNINDENT
  6418. .UNINDENT
  6419. .UNINDENT
  6420. .TP
  6421. .B \fB\-\-http\-proxy=<proxy>\fP
  6422. URL of the HTTP/HTTPS proxy. If this is set, the \fBhttp_proxy\fP environment
  6423. is ignored. The \fBno_proxy\fP environment variable is still respected. This
  6424. option is silently ignored if it does not start with \fBhttp://\fP\&. Proxies
  6425. are not used for https URLs. Setting this option does not try to make the
  6426. ytdl script use the proxy.
  6427. .TP
  6428. .B \fB\-\-tls\-ca\-file=<filename>\fP
  6429. Certificate authority database file for use with TLS. (Silently fails with
  6430. older FFmpeg or Libav versions.)
  6431. .TP
  6432. .B \fB\-\-tls\-verify\fP
  6433. Verify peer certificates when using TLS (e.g. with \fBhttps://...\fP).
  6434. (Silently fails with older FFmpeg or Libav versions.)
  6435. .TP
  6436. .B \fB\-\-tls\-cert\-file\fP
  6437. A file containing a certificate to use in the handshake with the
  6438. peer.
  6439. .TP
  6440. .B \fB\-\-tls\-key\-file\fP
  6441. A file containing the private key for the certificate.
  6442. .TP
  6443. .B \fB\-\-referrer=<string>\fP
  6444. Specify a referrer path or URL for HTTP requests.
  6445. .TP
  6446. .B \fB\-\-network\-timeout=<seconds>\fP
  6447. Specify the network timeout in seconds (default: 60 seconds). This affects
  6448. at least HTTP. The special value 0 uses the FFmpeg/Libav defaults. If a
  6449. protocol is used which does not support timeouts, this option is silently
  6450. ignored.
  6451. .sp
  6452. \fBWARNING:\fP
  6453. .INDENT 7.0
  6454. .INDENT 3.5
  6455. This breaks the RTSP protocol, because of inconsistent FFmpeg API
  6456. regarding its internal timeout option. Not only does the RTSP timeout
  6457. option accept different units (seconds instead of microseconds, causing
  6458. mpv to pass it huge values), it will also overflow FFmpeg internal
  6459. calculations. The worst is that merely setting the option will put RTSP
  6460. into listening mode, which breaks any client uses. At time of this
  6461. writing, the fix was not made effective yet. For this reason, this
  6462. option is ignored (or should be ignored) on RTSP URLs. You can still
  6463. set the timeout option directly with \fB\-\-demuxer\-lavf\-o\fP\&.
  6464. .UNINDENT
  6465. .UNINDENT
  6466. .TP
  6467. .B \fB\-\-rtsp\-transport=<lavf|udp|tcp|http>\fP
  6468. Select RTSP transport method (default: tcp). This selects the underlying
  6469. network transport when playing \fBrtsp://...\fP URLs. The value \fBlavf\fP
  6470. leaves the decision to libavformat.
  6471. .TP
  6472. .B \fB\-\-hls\-bitrate=<no|min|max|<rate>>\fP
  6473. If HLS streams are played, this option controls what streams are selected
  6474. by default. The option allows the following parameters:
  6475. .INDENT 7.0
  6476. .TP
  6477. .B no
  6478. Don\(aqt do anything special. Typically, this will simply pick the
  6479. first audio/video streams it can find.
  6480. .TP
  6481. .B min
  6482. Pick the streams with the lowest bitrate.
  6483. .TP
  6484. .B max
  6485. Same, but highest bitrate. (Default.)
  6486. .UNINDENT
  6487. .sp
  6488. Additionally, if the option is a number, the stream with the highest rate
  6489. equal or below the option value is selected.
  6490. .sp
  6491. The bitrate as used is sent by the server, and there\(aqs no guarantee it\(aqs
  6492. actually meaningful.
  6493. .UNINDENT
  6494. .SS DVB
  6495. .INDENT 0.0
  6496. .TP
  6497. .B \fB\-\-dvbin\-prog=<string>\fP
  6498. This defines the program to tune to. Usually, you may specify this
  6499. by using a stream URI like \fB"dvb://ZDF HD"\fP, but you can tune to a
  6500. different channel by writing to this property at runtime.
  6501. Also see \fBdvbin\-channel\-switch\-offset\fP for more useful channel
  6502. switching functionality.
  6503. .TP
  6504. .B \fB\-\-dvbin\-card=<0\-15>\fP
  6505. Specifies using card number 0\-15 (default: 0).
  6506. .TP
  6507. .B \fB\-\-dvbin\-file=<filename>\fP
  6508. Instructs mpv to read the channels list from \fB<filename>\fP\&. The default is
  6509. in the mpv configuration directory (usually \fB~/.config/mpv\fP) with the
  6510. filename \fBchannels.conf.{sat,ter,cbl,atsc}\fP (based on your card type) or
  6511. \fBchannels.conf\fP as a last resort.
  6512. For DVB\-S/2 cards, a VDR 1.7.x format channel list is recommended
  6513. as it allows tuning to DVB\-S2 channels, enabling subtitles and
  6514. decoding the PMT (which largely improves the demuxing).
  6515. Classic mplayer format channel lists are still supported (without
  6516. these improvements), and for other card types, only limited VDR
  6517. format channel list support is implemented (patches welcome).
  6518. For channels with dynamic PID switching or incomplete
  6519. \fBchannels.conf\fP, \fB\-\-dvbin\-full\-transponder\fP or the magic PID
  6520. \fB8192\fP are recommended.
  6521. .TP
  6522. .B \fB\-\-dvbin\-timeout=<1\-30>\fP
  6523. Maximum number of seconds to wait when trying to tune a frequency before
  6524. giving up (default: 30).
  6525. .TP
  6526. .B \fB\-\-dvbin\-full\-transponder=<yes|no>\fP
  6527. Apply no filters on program PIDs, only tune to frequency and pass full
  6528. transponder to demuxer.
  6529. The player frontend selects the streams from the full TS in this case,
  6530. so the program which is shown initially may not match the chosen channel.
  6531. Switching between the programs is possible by cycling the \fBprogram\fP
  6532. property.
  6533. This is useful to record multiple programs on a single transponder,
  6534. or to work around issues in the \fBchannels.conf\fP\&.
  6535. It is also recommended to use this for channels which switch PIDs
  6536. on\-the\-fly, e.g. for regional news.
  6537. .sp
  6538. Default: \fBno\fP
  6539. .TP
  6540. .B \fB\-\-dvbin\-channel\-switch\-offset=<integer>\fP
  6541. This value is not meant for setting via configuration, but used in channel
  6542. switching. An \fBinput.conf\fP can \fBcycle\fP this value \fBup\fP and \fBdown\fP
  6543. to perform channel switching. This number effectively gives the offset
  6544. to the initially tuned to channel in the channel list.
  6545. .sp
  6546. An example \fBinput.conf\fP could contain:
  6547. \fBH cycle dvbin\-channel\-switch\-offset up\fP, \fBK cycle dvbin\-channel\-switch\-offset down\fP
  6548. .UNINDENT
  6549. .SS ALSA audio output options
  6550. .INDENT 0.0
  6551. .TP
  6552. .B \fB\-\-alsa\-device=<device>\fP
  6553. Deprecated, use \fB\-\-audio\-device\fP (requires \fBalsa/\fP prefix).
  6554. .TP
  6555. .B \fB\-\-alsa\-resample=yes\fP
  6556. Enable ALSA resampling plugin. (This is disabled by default, because
  6557. some drivers report incorrect audio delay in some cases.)
  6558. .TP
  6559. .B \fB\-\-alsa\-mixer\-device=<device>\fP
  6560. Set the mixer device used with \fBao\-volume\fP (default: \fBdefault\fP).
  6561. .TP
  6562. .B \fB\-\-alsa\-mixer\-name=<name>\fP
  6563. Set the name of the mixer element (default: \fBMaster\fP). This is for
  6564. example \fBPCM\fP or \fBMaster\fP\&.
  6565. .TP
  6566. .B \fB\-\-alsa\-mixer\-index=<number>\fP
  6567. Set the index of the mixer channel (default: 0). Consider the output of
  6568. "\fBamixer scontrols\fP", then the index is the number that follows the
  6569. name of the element.
  6570. .TP
  6571. .B \fB\-\-alsa\-non\-interleaved\fP
  6572. Allow output of non\-interleaved formats (if the audio decoder uses
  6573. this format). Currently disabled by default, because some popular
  6574. ALSA plugins are utterly broken with non\-interleaved formats.
  6575. .TP
  6576. .B \fB\-\-alsa\-ignore\-chmap\fP
  6577. Don\(aqt read or set the channel map of the ALSA device \- only request the
  6578. required number of channels, and then pass the audio as\-is to it. This
  6579. option most likely should not be used. It can be useful for debugging,
  6580. or for static setups with a specially engineered ALSA configuration (in
  6581. this case you should always force the same layout with \fB\-\-audio\-channels\fP,
  6582. or it will work only for files which use the layout implicit to your
  6583. ALSA device).
  6584. .TP
  6585. .B \fB\-\-alsa\-buffer\-time=<microseconds>\fP
  6586. Set the requested buffer time in microseconds. A value of 0 skips requesting
  6587. anything from the ALSA API. This and the \fB\-\-alsa\-periods\fP option uses the
  6588. ALSA \fBnear\fP functions to set the requested parameters. If doing so results
  6589. in an empty configuration set, setting these parameters is skipped.
  6590. .sp
  6591. Both options control the buffer size. A low buffer size can lead to higher
  6592. CPU usage and audio dropouts, while a high buffer size can lead to higher
  6593. latency in volume changes and other filtering.
  6594. .TP
  6595. .B \fB\-\-alsa\-periods=<number>\fP
  6596. Number of periods requested from the ALSA API. See \fB\-\-alsa\-buffer\-time\fP
  6597. for further remarks.
  6598. .UNINDENT
  6599. .SS GPU renderer options
  6600. .sp
  6601. The following video options are currently all specific to \fB\-\-vo=gpu\fP and
  6602. \fB\-\-vo=libmpv\fP only, which are the only VOs that implement them.
  6603. .INDENT 0.0
  6604. .TP
  6605. .B \fB\-\-scale=<filter>\fP
  6606. The filter function to use when upscaling video.
  6607. .INDENT 7.0
  6608. .TP
  6609. .B \fBbilinear\fP
  6610. Bilinear hardware texture filtering (fastest, very low quality). This
  6611. is the default for compatibility reasons.
  6612. .TP
  6613. .B \fBspline36\fP
  6614. Mid quality and speed. This is the default when using \fBgpu\-hq\fP\&.
  6615. .TP
  6616. .B \fBlanczos\fP
  6617. Lanczos scaling. Provides mid quality and speed. Generally worse than
  6618. \fBspline36\fP, but it results in a slightly sharper image which is good
  6619. for some content types. The number of taps can be controlled with
  6620. \fBscale\-radius\fP, but is best left unchanged.
  6621. .sp
  6622. (This filter is an alias for \fBsinc\fP\-windowed \fBsinc\fP)
  6623. .TP
  6624. .B \fBewa_lanczos\fP
  6625. Elliptic weighted average Lanczos scaling. Also known as Jinc.
  6626. Relatively slow, but very good quality. The radius can be controlled
  6627. with \fBscale\-radius\fP\&. Increasing the radius makes the filter sharper
  6628. but adds more ringing.
  6629. .sp
  6630. (This filter is an alias for \fBjinc\fP\-windowed \fBjinc\fP)
  6631. .TP
  6632. .B \fBewa_lanczossharp\fP
  6633. A slightly sharpened version of ewa_lanczos, preconfigured to use an
  6634. ideal radius and parameter. If your hardware can run it, this is
  6635. probably what you should use by default.
  6636. .TP
  6637. .B \fBmitchell\fP
  6638. Mitchell\-Netravali. The \fBB\fP and \fBC\fP parameters can be set with
  6639. \fB\-\-scale\-param1\fP and \fB\-\-scale\-param2\fP\&. This filter is very good at
  6640. downscaling (see \fB\-\-dscale\fP).
  6641. .TP
  6642. .B \fBoversample\fP
  6643. A version of nearest neighbour that (naively) oversamples pixels, so
  6644. that pixels overlapping edges get linearly interpolated instead of
  6645. rounded. This essentially removes the small imperfections and judder
  6646. artifacts caused by nearest\-neighbour interpolation, in exchange for
  6647. adding some blur. This filter is good at temporal interpolation, and
  6648. also known as "smoothmotion" (see \fB\-\-tscale\fP).
  6649. .TP
  6650. .B \fBlinear\fP
  6651. A \fB\-\-tscale\fP filter.
  6652. .UNINDENT
  6653. .sp
  6654. There are some more filters, but most are not as useful. For a complete
  6655. list, pass \fBhelp\fP as value, e.g.:
  6656. .INDENT 7.0
  6657. .INDENT 3.5
  6658. .sp
  6659. .nf
  6660. .ft C
  6661. mpv \-\-scale=help
  6662. .ft P
  6663. .fi
  6664. .UNINDENT
  6665. .UNINDENT
  6666. .TP
  6667. .B \fB\-\-cscale=<filter>\fP
  6668. As \fB\-\-scale\fP, but for interpolating chroma information. If the image is
  6669. not subsampled, this option is ignored entirely.
  6670. .TP
  6671. .B \fB\-\-dscale=<filter>\fP
  6672. Like \fB\-\-scale\fP, but apply these filters on downscaling instead. If this
  6673. option is unset, the filter implied by \fB\-\-scale\fP will be applied.
  6674. .TP
  6675. .B \fB\-\-tscale=<filter>\fP
  6676. The filter used for interpolating the temporal axis (frames). This is only
  6677. used if \fB\-\-interpolation\fP is enabled. The only valid choices for
  6678. \fB\-\-tscale\fP are separable convolution filters (use \fB\-\-tscale=help\fP to
  6679. get a list). The default is \fBmitchell\fP\&.
  6680. .sp
  6681. Common \fB\-\-tscale\fP choices include \fBoversample\fP, \fBlinear\fP,
  6682. \fBcatmull_rom\fP, \fBmitchell\fP, \fBgaussian\fP, or \fBbicubic\fP\&. These are
  6683. listed in increasing order of smoothness/blurriness, with \fBbicubic\fP
  6684. being the smoothest/blurriest and \fBoversample\fP being the sharpest/least
  6685. smooth.
  6686. .TP
  6687. .B \fB\-\-scale\-param1=<value>\fP, \fB\-\-scale\-param2=<value>\fP, \fB\-\-cscale\-param1=<value>\fP, \fB\-\-cscale\-param2=<value>\fP, \fB\-\-dscale\-param1=<value>\fP, \fB\-\-dscale\-param2=<value>\fP, \fB\-\-tscale\-param1=<value>\fP, \fB\-\-tscale\-param2=<value>\fP
  6688. Set filter parameters. By default, these are set to the special string
  6689. \fBdefault\fP, which maps to a scaler\-specific default value. Ignored if the
  6690. filter is not tunable. Currently, this affects the following filter
  6691. parameters:
  6692. .INDENT 7.0
  6693. .TP
  6694. .B bcspline
  6695. Spline parameters (\fBB\fP and \fBC\fP). Defaults to 0.5 for both.
  6696. .TP
  6697. .B gaussian
  6698. Scale parameter (\fBt\fP). Increasing this makes the result blurrier.
  6699. Defaults to 1.
  6700. .TP
  6701. .B oversample
  6702. Minimum distance to an edge before interpolation is used. Setting this
  6703. to 0 will always interpolate edges, whereas setting it to 0.5 will
  6704. never interpolate, thus behaving as if the regular nearest neighbour
  6705. algorithm was used. Defaults to 0.0.
  6706. .UNINDENT
  6707. .TP
  6708. .B \fB\-\-scale\-blur=<value>\fP, \fB\-\-scale\-wblur=<value>\fP, \fB\-\-cscale\-blur=<value>\fP, \fB\-\-cscale\-wblur=<value>\fP, \fB\-\-dscale\-blur=<value>\fP, \fB\-\-dscale\-wblur=<value>\fP, \fB\-\-tscale\-blur=<value>\fP, \fB\-\-tscale\-wblur=<value>\fP
  6709. Kernel/window scaling factor (also known as a blur factor). Decreasing this
  6710. makes the result sharper, increasing it makes it blurrier (default 0). If
  6711. set to 0, the kernel\(aqs preferred blur factor is used. Note that setting
  6712. this too low (eg. 0.5) leads to bad results. It\(aqs generally recommended to
  6713. stick to values between 0.8 and 1.2.
  6714. .TP
  6715. .B \fB\-\-scale\-clamp=<0.0\-1.0>\fP, \fB\-\-cscale\-clamp\fP, \fB\-\-dscale\-clamp\fP, \fB\-\-tscale\-clamp\fP
  6716. Specifies a weight bias to multiply into negative coefficients. Specifying
  6717. \fB\-\-scale\-clamp=1\fP has the effect of removing negative weights completely,
  6718. thus effectively clamping the value range to [0\-1]. Values between 0.0 and
  6719. 1.0 can be specified to apply only a moderate diminishment of negative
  6720. weights. This is especially useful for \fB\-\-tscale\fP, where it reduces
  6721. excessive ringing artifacts in the temporal domain (which typically
  6722. manifest themselves as short flashes or fringes of black, mostly around
  6723. moving edges) in exchange for potentially adding more blur. The default for
  6724. \fB\-\-tscale\-clamp\fP is 1.0, the others default to 0.0.
  6725. .TP
  6726. .B \fB\-\-scale\-cutoff=<value>\fP, \fB\-\-cscale\-cutoff=<value>\fP, \fB\-\-dscale\-cutoff=<value>\fP
  6727. Cut off the filter kernel prematurely once the value range drops below
  6728. this threshold. Doing so allows more aggressive pruning of skippable
  6729. coefficients by disregarding parts of the LUT which are effectively zeroed
  6730. out by the window function. Only affects polar (EWA) filters. The default
  6731. is 0.001 for each, which is perceptually transparent but provides a 10%\-20%
  6732. speedup, depending on the exact radius and filter kernel chosen.
  6733. .TP
  6734. .B \fB\-\-scale\-taper=<value>\fP, \fB\-\-scale\-wtaper=<value>\fP, \fB\-\-dscale\-taper=<value>\fP, \fB\-\-dscale\-wtaper=<value>\fP, \fB\-\-cscale\-taper=<value>\fP, \fB\-\-cscale\-wtaper=<value>\fP, \fB\-\-tscale\-taper=<value>\fP, \fB\-\-tscale\-wtaper=<value>\fP
  6735. Kernel/window taper factor. Increasing this flattens the filter function.
  6736. Value range is 0 to 1. A value of 0 (the default) means no flattening, a
  6737. value of 1 makes the filter completely flat (equivalent to a box function).
  6738. Values in between mean that some portion will be flat and the actual filter
  6739. function will be squeezed into the space in between.
  6740. .TP
  6741. .B \fB\-\-scale\-radius=<value>\fP, \fB\-\-cscale\-radius=<value>\fP, \fB\-\-dscale\-radius=<value>\fP, \fB\-\-tscale\-radius=<value>\fP
  6742. Set radius for tunable filters, must be a float number between 0.5 and
  6743. 16.0. Defaults to the filter\(aqs preferred radius if not specified. Doesn\(aqt
  6744. work for every scaler and VO combination.
  6745. .sp
  6746. Note that depending on filter implementation details and video scaling
  6747. ratio, the radius that actually being used might be different (most likely
  6748. being increased a bit).
  6749. .TP
  6750. .B \fB\-\-scale\-antiring=<value>\fP, \fB\-\-cscale\-antiring=<value>\fP, \fB\-\-dscale\-antiring=<value>\fP, \fB\-\-tscale\-antiring=<value>\fP
  6751. Set the antiringing strength. This tries to eliminate ringing, but can
  6752. introduce other artifacts in the process. Must be a float number between
  6753. 0.0 and 1.0. The default value of 0.0 disables antiringing entirely.
  6754. .sp
  6755. Note that this doesn\(aqt affect the special filters \fBbilinear\fP and
  6756. \fBbicubic_fast\fP, nor does it affect any polar (EWA) scalers.
  6757. .TP
  6758. .B \fB\-\-scale\-window=<window>\fP, \fB\-\-cscale\-window=<window>\fP, \fB\-\-dscale\-window=<window>\fP, \fB\-\-tscale\-window=<window>\fP
  6759. (Advanced users only) Choose a custom windowing function for the kernel.
  6760. Defaults to the filter\(aqs preferred window if unset. Use
  6761. \fB\-\-scale\-window=help\fP to get a list of supported windowing functions.
  6762. .TP
  6763. .B \fB\-\-scale\-wparam=<window>\fP, \fB\-\-cscale\-wparam=<window>\fP, \fB\-\-cscale\-wparam=<window>\fP, \fB\-\-tscale\-wparam=<window>\fP
  6764. (Advanced users only) Configure the parameter for the window function given
  6765. by \fB\-\-scale\-window\fP etc. By default, these are set to the special string
  6766. \fBdefault\fP, which maps to a window\-specific default value. Ignored if the
  6767. window is not tunable. Currently, this affects the following window
  6768. parameters:
  6769. .INDENT 7.0
  6770. .TP
  6771. .B kaiser
  6772. Window parameter (alpha). Defaults to 6.33.
  6773. .TP
  6774. .B blackman
  6775. Window parameter (alpha). Defaults to 0.16.
  6776. .TP
  6777. .B gaussian
  6778. Scale parameter (t). Increasing this makes the window wider. Defaults
  6779. to 1.
  6780. .UNINDENT
  6781. .TP
  6782. .B \fB\-\-scaler\-lut\-size=<4..10>\fP
  6783. Set the size of the lookup texture for scaler kernels (default: 6). The
  6784. actual size of the texture is \fB2^N\fP for an option value of \fBN\fP\&. So the
  6785. lookup texture with the default setting uses 64 samples.
  6786. .sp
  6787. All weights are linearly interpolated from those samples, so increasing
  6788. the size of lookup table might improve the accuracy of scaler.
  6789. .TP
  6790. .B \fB\-\-scaler\-resizes\-only\fP
  6791. Disable the scaler if the video image is not resized. In that case,
  6792. \fBbilinear\fP is used instead of whatever is set with \fB\-\-scale\fP\&. Bilinear
  6793. will reproduce the source image perfectly if no scaling is performed.
  6794. Enabled by default. Note that this option never affects \fB\-\-cscale\fP\&.
  6795. .TP
  6796. .B \fB\-\-correct\-downscaling\fP
  6797. When using convolution based filters, extend the filter size when
  6798. downscaling. Increases quality, but reduces performance while downscaling.
  6799. .sp
  6800. This will perform slightly sub\-optimally for anamorphic video (but still
  6801. better than without it) since it will extend the size to match only the
  6802. milder of the scale factors between the axes.
  6803. .TP
  6804. .B \fB\-\-linear\-downscaling\fP
  6805. Scale in linear light when downscaling. It should only be used with a
  6806. \fB\-\-fbo\-format\fP that has at least 16 bit precision. This option
  6807. has no effect on HDR content.
  6808. .TP
  6809. .B \fB\-\-linear\-upscaling\fP
  6810. Scale in linear light when upscaling. Like \fB\-\-linear\-downscaling\fP, it
  6811. should only be used with a \fB\-\-fbo\-format\fP that has at least 16 bits
  6812. precisions. This is not usually recommended except for testing/specific
  6813. purposes. Users are advised to either enable \fB\-\-sigmoid\-upscaling\fP or
  6814. keep both options disabled (i.e. scaling in gamma light).
  6815. .TP
  6816. .B \fB\-\-sigmoid\-upscaling\fP
  6817. When upscaling, use a sigmoidal color transform to avoid emphasizing
  6818. ringing artifacts. This is incompatible with and replaces
  6819. \fB\-\-linear\-upscaling\fP\&. (Note that sigmoidization also requires
  6820. linearization, so the \fBLINEAR\fP rendering step fires in both cases)
  6821. .TP
  6822. .B \fB\-\-sigmoid\-center\fP
  6823. The center of the sigmoid curve used for \fB\-\-sigmoid\-upscaling\fP, must be a
  6824. float between 0.0 and 1.0. Defaults to 0.75 if not specified.
  6825. .TP
  6826. .B \fB\-\-sigmoid\-slope\fP
  6827. The slope of the sigmoid curve used for \fB\-\-sigmoid\-upscaling\fP, must be a
  6828. float between 1.0 and 20.0. Defaults to 6.5 if not specified.
  6829. .TP
  6830. .B \fB\-\-interpolation\fP
  6831. Reduce stuttering caused by mismatches in the video fps and display refresh
  6832. rate (also known as judder).
  6833. .sp
  6834. \fBWARNING:\fP
  6835. .INDENT 7.0
  6836. .INDENT 3.5
  6837. This requires setting the \fB\-\-video\-sync\fP option to one
  6838. of the \fBdisplay\-\fP modes, or it will be silently disabled.
  6839. This was not required before mpv 0.14.0.
  6840. .UNINDENT
  6841. .UNINDENT
  6842. .sp
  6843. This essentially attempts to interpolate the missing frames by convoluting
  6844. the video along the temporal axis. The filter used can be controlled using
  6845. the \fB\-\-tscale\fP setting.
  6846. .TP
  6847. .B \fB\-\-interpolation\-threshold=<0..1,\-1>\fP
  6848. Threshold below which frame ratio interpolation gets disabled (default:
  6849. \fB0.0001\fP). This is calculated as \fBabs(disphz/vfps \- 1) < threshold\fP,
  6850. where \fBvfps\fP is the speed\-adjusted video FPS, and \fBdisphz\fP the
  6851. display refresh rate. (The speed\-adjusted video FPS is roughly equal to
  6852. the normal video FPS, but with slowdown and speedup applied. This matters
  6853. if you use \fB\-\-video\-sync=display\-resample\fP to make video run synchronously
  6854. to the display FPS, or if you change the \fBspeed\fP property.)
  6855. .sp
  6856. The default is intended to almost always enable interpolation if the
  6857. playback rate is even slightly different from the display refresh rate. But
  6858. note that if you use e.g. \fB\-\-video\-sync=display\-vdrop\fP, small deviations
  6859. in the rate can disable interpolation and introduce a discontinuity every
  6860. other minute.
  6861. .sp
  6862. Set this to \fB\-1\fP to disable this logic.
  6863. .TP
  6864. .B \fB\-\-opengl\-pbo\fP
  6865. Enable use of PBOs. On some drivers this can be faster, especially if the
  6866. source video size is huge (e.g. so called "4K" video). On other drivers it
  6867. might be slower or cause latency issues.
  6868. .TP
  6869. .B \fB\-\-dither\-depth=<N|no|auto>\fP
  6870. Set dither target depth to N. Default: no.
  6871. .INDENT 7.0
  6872. .TP
  6873. .B no
  6874. Disable any dithering done by mpv.
  6875. .TP
  6876. .B auto
  6877. Automatic selection. If output bit depth cannot be detected, 8 bits per
  6878. component are assumed.
  6879. .TP
  6880. .B 8
  6881. Dither to 8 bit output.
  6882. .UNINDENT
  6883. .sp
  6884. Note that the depth of the connected video display device cannot be
  6885. detected. Often, LCD panels will do dithering on their own, which conflicts
  6886. with this option and leads to ugly output.
  6887. .TP
  6888. .B \fB\-\-dither\-size\-fruit=<2\-8>\fP
  6889. Set the size of the dither matrix (default: 6). The actual size of the
  6890. matrix is \fB(2^N) x (2^N)\fP for an option value of \fBN\fP, so a value of 6
  6891. gives a size of 64x64. The matrix is generated at startup time, and a large
  6892. matrix can take rather long to compute (seconds).
  6893. .sp
  6894. Used in \fB\-\-dither=fruit\fP mode only.
  6895. .TP
  6896. .B \fB\-\-dither=<fruit|ordered|error\-diffusion|no>\fP
  6897. Select dithering algorithm (default: fruit). (Normally, the
  6898. \fB\-\-dither\-depth\fP option controls whether dithering is enabled.)
  6899. .sp
  6900. The \fBerror\-diffusion\fP option requires compute shader support. It also
  6901. requires large amount of shared memory to run, the size of which depends on
  6902. both the kernel (see \fB\-\-error\-diffusion\fP option below) and the height of
  6903. video window. It will fallback to \fBfruit\fP dithering if there is no enough
  6904. shared memory to run the shader.
  6905. .TP
  6906. .B \fB\-\-temporal\-dither\fP
  6907. Enable temporal dithering. (Only active if dithering is enabled in
  6908. general.) This changes between 8 different dithering patterns on each frame
  6909. by changing the orientation of the tiled dithering matrix. Unfortunately,
  6910. this can lead to flicker on LCD displays, since these have a high reaction
  6911. time.
  6912. .TP
  6913. .B \fB\-\-temporal\-dither\-period=<1\-128>\fP
  6914. Determines how often the dithering pattern is updated when
  6915. \fB\-\-temporal\-dither\fP is in use. 1 (the default) will update on every video
  6916. frame, 2 on every other frame, etc.
  6917. .TP
  6918. .B \fB\-\-error\-diffusion=<kernel>\fP
  6919. The error diffusion kernel to use when \fB\-\-dither=error\-diffusion\fP is set.
  6920. .INDENT 7.0
  6921. .TP
  6922. .B \fBsimple\fP
  6923. Propagate error to only two adjacent pixels. Fastest but low quality.
  6924. .TP
  6925. .B \fBsierra\-lite\fP
  6926. Fast with reasonable quality. This is the default.
  6927. .TP
  6928. .B \fBfloyd\-steinberg\fP
  6929. Most notable error diffusion kernel.
  6930. .TP
  6931. .B \fBatkinson\fP
  6932. Looks different from other kernels because only fraction of errors will
  6933. be propagated during dithering. A typical use case of this kernel is
  6934. saving dithered screenshot (in window mode). This kernel produces
  6935. slightly smaller file, with still reasonable dithering quality.
  6936. .UNINDENT
  6937. .sp
  6938. There are other kernels (use \fB\-\-error\-diffusion=help\fP to list) but most of
  6939. them are much slower and demanding even larger amount of shared memory.
  6940. Among these kernels, \fBburkes\fP achieves a good balance between performance
  6941. and quality, and probably is the one you want to try first.
  6942. .TP
  6943. .B \fB\-\-gpu\-debug\fP
  6944. Enables GPU debugging. What this means depends on the API type. For OpenGL,
  6945. it calls \fBglGetError()\fP, and requests a debug context. For Vulkan, it
  6946. enables validation layers.
  6947. .TP
  6948. .B \fB\-\-opengl\-swapinterval=<n>\fP
  6949. Interval in displayed frames between two buffer swaps. 1 is equivalent to
  6950. enable VSYNC, 0 to disable VSYNC. Defaults to 1 if not specified.
  6951. .sp
  6952. Note that this depends on proper OpenGL vsync support. On some platforms
  6953. and drivers, this only works reliably when in fullscreen mode. It may also
  6954. require driver\-specific hacks if using multiple monitors, to ensure mpv
  6955. syncs to the right one. Compositing window managers can also lead to bad
  6956. results, as can missing or incorrect display FPS information (see
  6957. \fB\-\-override\-display\-fps\fP).
  6958. .TP
  6959. .B \fB\-\-vulkan\-swap\-mode=<mode>\fP
  6960. Controls the presentation mode of the vulkan swapchain. This is similar
  6961. to the \fB\-\-opengl\-swapinterval\fP option.
  6962. .INDENT 7.0
  6963. .TP
  6964. .B auto
  6965. Use the preferred swapchain mode for the vulkan context. (Default)
  6966. .TP
  6967. .B fifo
  6968. Non\-tearing, vsync blocked. Similar to "VSync on".
  6969. .TP
  6970. .B fifo\-relaxed
  6971. Tearing, vsync blocked. Late frames will tear instead of stuttering.
  6972. .TP
  6973. .B mailbox
  6974. Non\-tearing, not vsync blocked. Similar to "triple buffering".
  6975. .TP
  6976. .B immediate
  6977. Tearing, not vsync blocked. Similar to "VSync off".
  6978. .UNINDENT
  6979. .TP
  6980. .B \fB\-\-vulkan\-queue\-count=<1..8>\fP
  6981. Controls the number of VkQueues used for rendering (limited by how many
  6982. your device supports). In theory, using more queues could enable some
  6983. parallelism between frames (when using a \fB\-\-swapchain\-depth\fP higher than
  6984. 1), but it can also slow things down on hardware where there\(aqs no true
  6985. parallelism between queues. (Default: 1)
  6986. .TP
  6987. .B \fB\-\-vulkan\-async\-transfer\fP
  6988. Enables the use of async transfer queues on supported vulkan devices. Using
  6989. them allows transfer operations like texture uploads and blits to happen
  6990. concurrently with the actual rendering, thus improving overall throughput
  6991. and power consumption. Enabled by default, and should be relatively safe.
  6992. .TP
  6993. .B \fB\-\-vulkan\-async\-compute\fP
  6994. Enables the use of async compute queues on supported vulkan devices. Using
  6995. this, in theory, allows out\-of\-order scheduling of compute shaders with
  6996. graphics shaders, thus enabling the hardware to do more effective work while
  6997. waiting for pipeline bubbles and memory operations. Not beneficial on all
  6998. GPUs. It\(aqs worth noting that if async compute is enabled, and the device
  6999. supports more compute queues than graphics queues (bound by the restrictions
  7000. set by \fB\-\-vulkan\-queue\-count\fP), mpv will internally try and prefer the
  7001. use of compute shaders over fragment shaders wherever possible. Enabled by
  7002. default, although Nvidia users may want to disable it.
  7003. .TP
  7004. .B \fB\-\-d3d11\-warp=<yes|no|auto>\fP
  7005. Use WARP (Windows Advanced Rasterization Platform) with the D3D11 GPU
  7006. backend (default: auto). This is a high performance software renderer. By
  7007. default, it is only used when the system has no hardware adapters that
  7008. support D3D11. While the extended GPU features will work with WARP, they
  7009. can be very slow.
  7010. .TP
  7011. .B \fB\-\-d3d11\-feature\-level=<12_1|12_0|11_1|11_0|10_1|10_0|9_3|9_2|9_1>\fP
  7012. Select a specific feature level when using the D3D11 GPU backend. By
  7013. default, the highest available feature level is used. This option can be
  7014. used to select a lower feature level, which is mainly useful for debugging.
  7015. Most extended GPU features will not work at 9_x feature levels.
  7016. .TP
  7017. .B \fB\-\-d3d11\-flip=<yes|no>\fP
  7018. Enable flip\-model presentation, which avoids unnecessarily copying the
  7019. backbuffer by sharing surfaces with the DWM (default: yes). This may cause
  7020. performance issues with older drivers. If flip\-model presentation is not
  7021. supported (for example, on Windows 7 without the platform update), mpv will
  7022. automatically fall back to the older bitblt presentation model.
  7023. .TP
  7024. .B \fB\-\-d3d11\-sync\-interval=<0..4>\fP
  7025. Schedule each frame to be presented for this number of VBlank intervals.
  7026. (default: 1) Setting to 1 will enable VSync, setting to 0 will disable it.
  7027. .TP
  7028. .B \fB\-\-d3d11\-adapter=<adapter name|help>\fP
  7029. Select a specific D3D11 adapter to utilize for D3D11 rendering.
  7030. Will pick the default adapter if unset. Alternatives are listed
  7031. when the name "help" is given.
  7032. .sp
  7033. Checks for matches based on the start of the string, case
  7034. insensitive. Thus, if the description of the adapter starts with
  7035. the vendor name, that can be utilized as the selection parameter.
  7036. .sp
  7037. Hardware decoders utilizing the D3D11 rendering abstraction\(aqs helper
  7038. functionality to receive a device, such as D3D11VA or DXVA2\(aqs DXGI
  7039. mode, will be affected by this choice.
  7040. .TP
  7041. .B \fB\-\-d3d11\-output\-format=<auto|rgba8|bgra8|rgb10_a2|rgba16f>\fP
  7042. Select a specific D3D11 output format to utilize for D3D11 rendering.
  7043. "auto" is the default, which will pick either rgba8 or rgb10_a2 depending
  7044. on the configured desktop bit depth. rgba16f and bgra8 are left out of
  7045. the autodetection logic, and are available for manual testing.
  7046. .sp
  7047. \fBNOTE:\fP
  7048. .INDENT 7.0
  7049. .INDENT 3.5
  7050. Desktop bit depth querying is only available from an API available
  7051. from Windows 10. Thus on older systems it will only automatically
  7052. utilize the rgba8 output format.
  7053. .UNINDENT
  7054. .UNINDENT
  7055. .TP
  7056. .B \fB\-\-d3d11\-output\-csp=<auto|srgb|linear|pq|bt.2020>\fP
  7057. Select a specific D3D11 output color space to utilize for D3D11 rendering.
  7058. "auto" is the default, which will select the color space of the desktop
  7059. on which the swap chain is located.
  7060. .sp
  7061. Values other than "srgb" and "pq" have had issues in testing, so they
  7062. are mostly available for manual testing.
  7063. .sp
  7064. \fBNOTE:\fP
  7065. .INDENT 7.0
  7066. .INDENT 3.5
  7067. Swap chain color space configuration is only available from an API
  7068. available from Windows 10. Thus on older systems it will not work.
  7069. .UNINDENT
  7070. .UNINDENT
  7071. .TP
  7072. .B \fB\-\-d3d11va\-zero\-copy=<yes|no>\fP
  7073. By default, when using hardware decoding with \fB\-\-gpu\-api=d3d11\fP, the
  7074. video image will be copied (GPU\-to\-GPU) from the decoder surface to a
  7075. shader resource. Set this option to avoid that copy by sampling directly
  7076. from the decoder image. This may increase performance and reduce power
  7077. usage, but can cause the image to be sampled incorrectly on the bottom and
  7078. right edges due to padding, and may invoke driver bugs, since Direct3D 11
  7079. technically does not allow sampling from a decoder surface (though most
  7080. drivers support it.)
  7081. .sp
  7082. Currently only relevant for \fB\-\-gpu\-api=d3d11\fP\&.
  7083. .TP
  7084. .B \fB\-\-wayland\-frame\-wait\-offset=<\-500..3000>\fP
  7085. Control the amount of offset (in microseconds) to add to wayland\(aqs frame wait
  7086. (default 1000). The wayland context assumes that if frame callback or presentation
  7087. feedback isn\(aqt received within a certain amount of time then the video is being
  7088. rendered offscreen. The time it waits is equal to how long it takes your monitor
  7089. to display a frame (i.e. 1/refresh rate) plus the offset. In general, staying
  7090. close to your monitor\(aqs refresh rate is preferred, but with a small offset in
  7091. case a frame takes a little long to display.
  7092. .TP
  7093. .B \fB\-\-wayland\-disable\-vsync=<yes|no>\fP
  7094. Disable vsync for the wayland contexts (default: no). Useful for benchmarking
  7095. the wayland context when combined with \fBvideo\-sync=display\-desync\fP,
  7096. \fB\-\-no\-audio\fP, and \fB\-\-untimed=yes\fP\&. Only works with \fB\-\-gpu\-context=wayland\fP
  7097. and \fB\-\-gpu\-context=waylandvk\fP\&.
  7098. .TP
  7099. .B \fB\-\-spirv\-compiler=<compiler>\fP
  7100. Controls which compiler is used to translate GLSL to SPIR\-V. This is
  7101. (currently) only relevant for \fB\-\-gpu\-api=vulkan\fP and \fI\-\-gpu\-api=d3d11\fP\&.
  7102. The possible choices are currently only:
  7103. .INDENT 7.0
  7104. .TP
  7105. .B auto
  7106. Use the first available compiler. (Default)
  7107. .TP
  7108. .B shaderc
  7109. Use libshaderc, which is an API wrapper around glslang. This is
  7110. generally the most preferred, if available.
  7111. .UNINDENT
  7112. .sp
  7113. \fBNOTE:\fP
  7114. .INDENT 7.0
  7115. .INDENT 3.5
  7116. This option is deprecated, since there is only one reasonable value.
  7117. It may be removed in the future.
  7118. .UNINDENT
  7119. .UNINDENT
  7120. .TP
  7121. .B \fB\-\-glsl\-shader=<file>\fP, \fB\-\-glsl\-shaders=<file\-list>\fP
  7122. Custom GLSL hooks. These are a flexible way to add custom fragment shaders,
  7123. which can be injected at almost arbitrary points in the rendering pipeline,
  7124. and access all previous intermediate textures.
  7125. .sp
  7126. Each use of the \fB\-\-glsl\-shader\fP option will add another file to the
  7127. internal list of shaders, while \fB\-\-glsl\-shaders\fP takes a list of files,
  7128. and overwrites the internal list with it. The latter is a path list option
  7129. (see \fI\%List Options\fP for details).
  7130. .INDENT 7.0
  7131. .INDENT 3.5
  7132. .IP "Warning"
  7133. .sp
  7134. The syntax is not stable yet and may change any time.
  7135. .UNINDENT
  7136. .UNINDENT
  7137. .sp
  7138. The general syntax of a user shader looks like this:
  7139. .INDENT 7.0
  7140. .INDENT 3.5
  7141. .sp
  7142. .nf
  7143. .ft C
  7144. //!METADATA ARGS...
  7145. //!METADATA ARGS...
  7146. vec4 hook() {
  7147. ...
  7148. return something;
  7149. }
  7150. //!METADATA ARGS...
  7151. //!METADATA ARGS...
  7152. \&...
  7153. .ft P
  7154. .fi
  7155. .UNINDENT
  7156. .UNINDENT
  7157. .sp
  7158. Each section of metadata, along with the non\-metadata lines after it,
  7159. defines a single block. There are currently two types of blocks, HOOKs and
  7160. TEXTUREs.
  7161. .sp
  7162. A \fBTEXTURE\fP block can set the following options:
  7163. .INDENT 7.0
  7164. .TP
  7165. .B TEXTURE <name> (required)
  7166. The name of this texture. Hooks can then bind the texture under this
  7167. name using BIND. This must be the first option of the texture block.
  7168. .TP
  7169. .B SIZE <width> [<height>] [<depth>] (required)
  7170. The dimensions of the texture. The height and depth are optional. The
  7171. type of texture (1D, 2D or 3D) depends on the number of components
  7172. specified.
  7173. .TP
  7174. .B FORMAT <name> (required)
  7175. The texture format for the samples. Supported texture formats are listed
  7176. in debug logging when the \fBgpu\fP VO is initialized (look for
  7177. \fBTexture formats:\fP). Usually, this follows OpenGL naming conventions.
  7178. For example, \fBrgb16\fP provides 3 channels with normalized 16 bit
  7179. components. One oddity are float formats: for example, \fBrgba16f\fP has
  7180. 16 bit internal precision, but the texture data is provided as 32 bit
  7181. floats, and the driver converts the data on texture upload.
  7182. .sp
  7183. Although format names follow a common naming convention, not all of them
  7184. are available on all hardware, drivers, GL versions, and so on.
  7185. .TP
  7186. .B FILTER <LINEAR|NEAREST>
  7187. The min/magnification filter used when sampling from this texture.
  7188. .TP
  7189. .B BORDER <CLAMP|REPEAT|MIRROR>
  7190. The border wrapping mode used when sampling from this texture.
  7191. .UNINDENT
  7192. .sp
  7193. Following the metadata is a string of bytes in hexadecimal notation that
  7194. define the raw texture data, corresponding to the format specified by
  7195. \fIFORMAT\fP, on a single line with no extra whitespace.
  7196. .sp
  7197. A \fBHOOK\fP block can set the following options:
  7198. .INDENT 7.0
  7199. .TP
  7200. .B HOOK <name> (required)
  7201. The texture which to hook into. May occur multiple times within a
  7202. metadata block, up to a predetermined limit. See below for a list of
  7203. hookable textures.
  7204. .TP
  7205. .B DESC <title>
  7206. User\-friendly description of the pass. This is the name used when
  7207. representing this shader in the list of passes for property
  7208. \fIvo\-passes\fP\&.
  7209. .TP
  7210. .B BIND <name>
  7211. Loads a texture (either coming from mpv or from a \fBTEXTURE\fP block)
  7212. and makes it available to the pass. When binding textures from mpv,
  7213. this will also set up macros to facilitate accessing it properly. See
  7214. below for a list. By default, no textures are bound. The special name
  7215. HOOKED can be used to refer to the texture that triggered this pass.
  7216. .TP
  7217. .B SAVE <name>
  7218. Gives the name of the texture to save the result of this pass into. By
  7219. default, this is set to the special name HOOKED which has the effect of
  7220. overwriting the hooked texture.
  7221. .TP
  7222. .B WIDTH <szexpr>, HEIGHT <szexpr>
  7223. Specifies the size of the resulting texture for this pass. \fBszexpr\fP
  7224. refers to an expression in RPN (reverse polish notation), using the
  7225. operators + \- * / > < !, floating point literals, and references to
  7226. sizes of existing texture (such as MAIN.width or CHROMA.height),
  7227. OUTPUT, or NATIVE_CROPPED (size of an input texture cropped after
  7228. pan\-and\-scan, video\-align\-x/y, video\-pan\-x/y, etc. and possibly
  7229. prescaled). By default, these are set to HOOKED.w and HOOKED.h,
  7230. espectively.
  7231. .TP
  7232. .B WHEN <szexpr>
  7233. Specifies a condition that needs to be true (non\-zero) for the shader
  7234. stage to be evaluated. If it fails, it will silently be omitted. (Note
  7235. that a shader stage like this which has a dependency on an optional
  7236. hook point can still cause that hook point to be saved, which has some
  7237. minor overhead)
  7238. .TP
  7239. .B OFFSET <ox oy | ALIGN>
  7240. Indicates a pixel shift (offset) introduced by this pass. These pixel
  7241. offsets will be accumulated and corrected during the next scaling pass
  7242. (\fBcscale\fP or \fBscale\fP). The default values are 0 0 which correspond
  7243. to no shift. Note that offsets are ignored when not overwriting the
  7244. hooked texture.
  7245. .sp
  7246. A special value of \fBALIGN\fP will attempt to fix existing offset of
  7247. HOOKED by align it with reference. It requires HOOKED to be resizable
  7248. (see below). It works transparently with fragment shader. For compute
  7249. shader, the predefined \fBtexmap\fP macro is required to handle coordinate
  7250. mapping.
  7251. .TP
  7252. .B COMPONENTS <n>
  7253. Specifies how many components of this pass\(aqs output are relevant and
  7254. should be stored in the texture, up to 4 (rgba). By default, this value
  7255. is equal to the number of components in HOOKED.
  7256. .TP
  7257. .B COMPUTE <bw> <bh> [<tw> <th>]
  7258. Specifies that this shader should be treated as a compute shader, with
  7259. the block size bw and bh. The compute shader will be dispatched with
  7260. however many blocks are necessary to completely tile over the output.
  7261. Within each block, there will bw tw*th threads, forming a single work
  7262. group. In other words: tw and th specify the work group size, which can
  7263. be different from the block size. So for example, a compute shader with
  7264. bw, bh = 32 and tw, th = 8 running on a 500x500 texture would dispatch
  7265. 16x16 blocks (rounded up), each with 8x8 threads.
  7266. .sp
  7267. Compute shaders in mpv are treated a bit different from fragment
  7268. shaders. Instead of defining a \fBvec4 hook\fP that produces an output
  7269. sample, you directly define \fBvoid hook\fP which writes to a fixed
  7270. writeonly image unit named \fBout_image\fP (this is bound by mpv) using
  7271. \fIimageStore\fP\&. To help translate texture coordinates in the absence of
  7272. vertices, mpv provides a special function \fBNAME_map(id)\fP to map from
  7273. the texel space of the output image to the texture coordinates for all
  7274. bound textures. In particular, \fBNAME_pos\fP is equivalent to
  7275. \fBNAME_map(gl_GlobalInvocationID)\fP, although using this only really
  7276. makes sense if (tw,th) == (bw,bh).
  7277. .UNINDENT
  7278. .sp
  7279. Each bound mpv texture (via \fBBIND\fP) will make available the following
  7280. definitions to that shader pass, where NAME is the name of the bound
  7281. texture:
  7282. .INDENT 7.0
  7283. .TP
  7284. .B vec4 NAME_tex(vec2 pos)
  7285. The sampling function to use to access the texture at a certain spot
  7286. (in texture coordinate space, range [0,1]). This takes care of any
  7287. necessary normalization conversions.
  7288. .TP
  7289. .B vec4 NAME_texOff(vec2 offset)
  7290. Sample the texture at a certain offset in pixels. This works like
  7291. NAME_tex but additionally takes care of necessary rotations, so that
  7292. sampling at e.g. vec2(\-1,0) is always one pixel to the left.
  7293. .TP
  7294. .B vec2 NAME_pos
  7295. The local texture coordinate of that texture, range [0,1].
  7296. .TP
  7297. .B vec2 NAME_size
  7298. The (rotated) size in pixels of the texture.
  7299. .TP
  7300. .B mat2 NAME_rot
  7301. The rotation matrix associated with this texture. (Rotates pixel space
  7302. to texture coordinates)
  7303. .TP
  7304. .B vec2 NAME_pt
  7305. The (unrotated) size of a single pixel, range [0,1].
  7306. .TP
  7307. .B float NAME_mul
  7308. The coefficient that needs to be multiplied into the texture contents
  7309. in order to normalize it to the range [0,1].
  7310. .TP
  7311. .B sampler NAME_raw
  7312. The raw bound texture itself. The use of this should be avoided unless
  7313. absolutely necessary.
  7314. .UNINDENT
  7315. .sp
  7316. Normally, users should use either NAME_tex or NAME_texOff to read from the
  7317. texture. For some shaders however , it can be better for performance to do
  7318. custom sampling from NAME_raw, in which case care needs to be taken to
  7319. respect NAME_mul and NAME_rot.
  7320. .sp
  7321. In addition to these parameters, the following uniforms are also globally
  7322. available:
  7323. .INDENT 7.0
  7324. .TP
  7325. .B float random
  7326. A random number in the range [0\-1], different per frame.
  7327. .TP
  7328. .B int frame
  7329. A simple count of frames rendered, increases by one per frame and never
  7330. resets (regardless of seeks).
  7331. .TP
  7332. .B vec2 input_size
  7333. The size in pixels of the input image (possibly cropped and prescaled).
  7334. .TP
  7335. .B vec2 target_size
  7336. The size in pixels of the visible part of the scaled (and possibly
  7337. cropped) image.
  7338. .TP
  7339. .B vec2 tex_offset
  7340. Texture offset introduced by user shaders or options like panscan, video\-align\-x/y, video\-pan\-x/y.
  7341. .UNINDENT
  7342. .sp
  7343. Internally, vo_gpu may generate any number of the following textures.
  7344. Whenever a texture is rendered and saved by vo_gpu, all of the passes
  7345. that have hooked into it will run, in the order they were added by the
  7346. user. This is a list of the legal hook points:
  7347. .INDENT 7.0
  7348. .TP
  7349. .B RGB, LUMA, CHROMA, ALPHA, XYZ (resizable)
  7350. Source planes (raw). Which of these fire depends on the image format of
  7351. the source.
  7352. .TP
  7353. .B CHROMA_SCALED, ALPHA_SCALED (fixed)
  7354. Source planes (upscaled). These only fire on subsampled content.
  7355. .TP
  7356. .B NATIVE (resizable)
  7357. The combined image, in the source colorspace, before conversion to RGB.
  7358. .TP
  7359. .B MAINPRESUB (resizable)
  7360. The image, after conversion to RGB, but before
  7361. \fB\-\-blend\-subtitles=video\fP is applied.
  7362. .TP
  7363. .B MAIN (resizable)
  7364. The main image, after conversion to RGB but before upscaling.
  7365. .TP
  7366. .B LINEAR (fixed)
  7367. Linear light image, before scaling. This only fires when
  7368. \fB\-\-linear\-upscaling\fP, \fB\-\-linear\-downscaling\fP or
  7369. \fB\-\-sigmoid\-upscaling\fP is in effect.
  7370. .TP
  7371. .B SIGMOID (fixed)
  7372. Sigmoidized light, before scaling. This only fires when
  7373. \fB\-\-sigmoid\-upscaling\fP is in effect.
  7374. .TP
  7375. .B PREKERNEL (fixed)
  7376. The image immediately before the scaler kernel runs.
  7377. .TP
  7378. .B POSTKERNEL (fixed)
  7379. The image immediately after the scaler kernel runs.
  7380. .TP
  7381. .B SCALED (fixed)
  7382. The final upscaled image, before color management.
  7383. .TP
  7384. .B OUTPUT (fixed)
  7385. The final output image, after color management but before dithering and
  7386. drawing to screen.
  7387. .UNINDENT
  7388. .sp
  7389. Only the textures labelled with \fBresizable\fP may be transformed by the
  7390. pass. When overwriting a texture marked \fBfixed\fP, the WIDTH, HEIGHT and
  7391. OFFSET must be left at their default values.
  7392. .TP
  7393. .B \fB\-\-glsl\-shader=<file>\fP
  7394. CLI/config file only alias for \fB\-\-glsl\-shaders\-append\fP\&.
  7395. .TP
  7396. .B \fB\-\-deband\fP
  7397. Enable the debanding algorithm. This greatly reduces the amount of visible
  7398. banding, blocking and other quantization artifacts, at the expense of
  7399. very slightly blurring some of the finest details. In practice, it\(aqs
  7400. virtually always an improvement \- the only reason to disable it would be
  7401. for performance.
  7402. .TP
  7403. .B \fB\-\-deband\-iterations=<1..16>\fP
  7404. The number of debanding steps to perform per sample. Each step reduces a
  7405. bit more banding, but takes time to compute. Note that the strength of each
  7406. step falls off very quickly, so high numbers (>4) are practically useless.
  7407. (Default 1)
  7408. .TP
  7409. .B \fB\-\-deband\-threshold=<0..4096>\fP
  7410. The debanding filter\(aqs cut\-off threshold. Higher numbers increase the
  7411. debanding strength dramatically but progressively diminish image details.
  7412. (Default 64)
  7413. .TP
  7414. .B \fB\-\-deband\-range=<1..64>\fP
  7415. The debanding filter\(aqs initial radius. The radius increases linearly for
  7416. each iteration. A higher radius will find more gradients, but a lower
  7417. radius will smooth more aggressively. (Default 16)
  7418. .sp
  7419. If you increase the \fB\-\-deband\-iterations\fP, you should probably decrease
  7420. this to compensate.
  7421. .TP
  7422. .B \fB\-\-deband\-grain=<0..4096>\fP
  7423. Add some extra noise to the image. This significantly helps cover up
  7424. remaining quantization artifacts. Higher numbers add more noise. (Default
  7425. 48)
  7426. .TP
  7427. .B \fB\-\-sharpen=<value>\fP
  7428. If set to a value other than 0, enable an unsharp masking filter. Positive
  7429. values will sharpen the image (but add more ringing and aliasing). Negative
  7430. values will blur the image. If your GPU is powerful enough, consider
  7431. alternatives like the \fBewa_lanczossharp\fP scale filter, or the
  7432. \fB\-\-scale\-blur\fP option.
  7433. .TP
  7434. .B \fB\-\-opengl\-glfinish\fP
  7435. Call \fBglFinish()\fP before swapping buffers (default: disabled). Slower,
  7436. but might improve results when doing framedropping. Can completely ruin
  7437. performance. The details depend entirely on the OpenGL driver.
  7438. .TP
  7439. .B \fB\-\-opengl\-waitvsync\fP
  7440. Call \fBglXWaitVideoSyncSGI\fP after each buffer swap (default: disabled).
  7441. This may or may not help with video timing accuracy and frame drop. It\(aqs
  7442. possible that this makes video output slower, or has no effect at all.
  7443. .sp
  7444. X11/GLX only.
  7445. .TP
  7446. .B \fB\-\-opengl\-dwmflush=<no|windowed|yes|auto>\fP
  7447. Calls \fBDwmFlush\fP after swapping buffers on Windows (default: auto). It
  7448. also sets \fBSwapInterval(0)\fP to ignore the OpenGL timing. Values are: no
  7449. (disabled), windowed (only in windowed mode), yes (also in full screen).
  7450. .sp
  7451. The value \fBauto\fP will try to determine whether the compositor is active,
  7452. and calls \fBDwmFlush\fP only if it seems to be.
  7453. .sp
  7454. This may help to get more consistent frame intervals, especially with
  7455. high\-fps clips \- which might also reduce dropped frames. Typically, a value
  7456. of \fBwindowed\fP should be enough, since full screen may bypass the DWM.
  7457. .sp
  7458. Windows only.
  7459. .TP
  7460. .B \fB\-\-angle\-d3d11\-feature\-level=<11_0|10_1|10_0|9_3>\fP
  7461. Selects a specific feature level when using the ANGLE backend with D3D11.
  7462. By default, the highest available feature level is used. This option can be
  7463. used to select a lower feature level, which is mainly useful for debugging.
  7464. Note that OpenGL ES 3.0 is only supported at feature level 10_1 or higher.
  7465. Most extended OpenGL features will not work at lower feature levels
  7466. (similar to \fB\-\-gpu\-dumb\-mode\fP).
  7467. .sp
  7468. Windows with ANGLE only.
  7469. .TP
  7470. .B \fB\-\-angle\-d3d11\-warp=<yes|no|auto>\fP
  7471. Use WARP (Windows Advanced Rasterization Platform) when using the ANGLE
  7472. backend with D3D11 (default: auto). This is a high performance software
  7473. renderer. By default, it is used when the Direct3D hardware does not
  7474. support Direct3D 11 feature level 9_3. While the extended OpenGL features
  7475. will work with WARP, they can be very slow.
  7476. .sp
  7477. Windows with ANGLE only.
  7478. .TP
  7479. .B \fB\-\-angle\-egl\-windowing=<yes|no|auto>\fP
  7480. Use ANGLE\(aqs built in EGL windowing functions to create a swap chain
  7481. (default: auto). If this is set to \fBno\fP and the D3D11 renderer is in use,
  7482. ANGLE\(aqs built in swap chain will not be used and a custom swap chain that
  7483. is optimized for video rendering will be created instead. If set to
  7484. \fBauto\fP, a custom swap chain will be used for D3D11 and the built in swap
  7485. chain will be used for D3D9. This option is mainly for debugging purposes,
  7486. in case the custom swap chain has poor performance or does not work.
  7487. .sp
  7488. If set to \fByes\fP, the \fB\-\-angle\-max\-frame\-latency\fP,
  7489. \fB\-\-angle\-swapchain\-length\fP and \fB\-\-angle\-flip\fP options will have no
  7490. effect.
  7491. .sp
  7492. Windows with ANGLE only.
  7493. .TP
  7494. .B \fB\-\-angle\-flip=<yes|no>\fP
  7495. Enable flip\-model presentation, which avoids unnecessarily copying the
  7496. backbuffer by sharing surfaces with the DWM (default: yes). This may cause
  7497. performance issues with older drivers. If flip\-model presentation is not
  7498. supported (for example, on Windows 7 without the platform update), mpv will
  7499. automatically fall back to the older bitblt presentation model.
  7500. .sp
  7501. If set to \fBno\fP, the \fB\-\-angle\-swapchain\-length\fP option will have no
  7502. effect.
  7503. .sp
  7504. Windows with ANGLE only.
  7505. .TP
  7506. .B \fB\-\-angle\-renderer=<d3d9|d3d11|auto>\fP
  7507. Forces a specific renderer when using the ANGLE backend (default: auto). In
  7508. auto mode this will pick D3D11 for systems that support Direct3D 11 feature
  7509. level 9_3 or higher, and D3D9 otherwise. This option is mainly for
  7510. debugging purposes. Normally there is no reason to force a specific
  7511. renderer, though \fB\-\-angle\-renderer=d3d9\fP may give slightly better
  7512. performance on old hardware. Note that the D3D9 renderer only supports
  7513. OpenGL ES 2.0, so most extended OpenGL features will not work if this
  7514. renderer is selected (similar to \fB\-\-gpu\-dumb\-mode\fP).
  7515. .sp
  7516. Windows with ANGLE only.
  7517. .TP
  7518. .B \fB\-\-cocoa\-force\-dedicated\-gpu=<yes|no>\fP
  7519. Deactivates the automatic graphics switching and forces the dedicated GPU.
  7520. (default: no)
  7521. .sp
  7522. OS X only.
  7523. .TP
  7524. .B \fB\-\-cocoa\-cb\-sw\-renderer=<yes|no|auto>\fP
  7525. Use the Apple Software Renderer when using cocoa\-cb (default: auto). If set
  7526. to \fBno\fP the software renderer is never used and instead fails when a the
  7527. usual pixel format could not be created, \fByes\fP will always only use the
  7528. software renderer, and \fBauto\fP only falls back to the software renderer
  7529. when the usual pixel format couldn\(aqt be created.
  7530. .sp
  7531. OS X only.
  7532. .TP
  7533. .B \fB\-\-cocoa\-cb\-10bit\-context=<yes|no>\fP
  7534. Creates a 10bit capable pixel format for the context creation (default: yes).
  7535. Instead of 8bit integer framebuffer a 16bit half\-float framebuffer is
  7536. requested.
  7537. .sp
  7538. OS X only.
  7539. .TP
  7540. .B \fB\-\-macos\-title\-bar\-appearance=<appearance>\fP
  7541. Sets the appearance of the title bar (default: auto). Not all combinations
  7542. of appearances and \fB\-\-macos\-title\-bar\-material\fP materials make sense or
  7543. are unique. Appearances that are not supported by you current macOS version
  7544. fall back to the default value.
  7545. macOS and cocoa\-cb only
  7546. .sp
  7547. \fB<appearance>\fP can be one of the following:
  7548. .INDENT 7.0
  7549. .TP
  7550. .B auto
  7551. Detects the system settings and sets the title
  7552. bar appearance appropriately. On macOS 10.14 it
  7553. also detects run time changes.
  7554. .TP
  7555. .B aqua
  7556. The standard macOS Light appearance.
  7557. .TP
  7558. .B darkAqua
  7559. The standard macOS Dark appearance. (macOS 10.14+)
  7560. .TP
  7561. .B vibrantLight
  7562. Light vibrancy appearance with.
  7563. .TP
  7564. .B vibrantDark
  7565. Dark vibrancy appearance with.
  7566. .TP
  7567. .B aquaHighContrast
  7568. Light Accessibility appearance. (macOS 10.14+)
  7569. .TP
  7570. .B darkAquaHighContrast
  7571. Dark Accessibility appearance. (macOS 10.14+)
  7572. .TP
  7573. .B vibrantLightHighContrast
  7574. Light vibrancy Accessibility appearance.
  7575. (macOS 10.14+)
  7576. .TP
  7577. .B vibrantDarkHighContrast
  7578. Dark vibrancy Accessibility appearance.
  7579. (macOS 10.14+)
  7580. .UNINDENT
  7581. .TP
  7582. .B \fB\-\-macos\-title\-bar\-material=<material>\fP
  7583. Sets the material of the title bar (default: titlebar). All deprecated
  7584. materials should not be used on macOS 10.14+ because their functionality
  7585. is not guaranteed. Not all combinations of materials and
  7586. \fB\-\-macos\-title\-bar\-appearance\fP appearances make sense or are unique.
  7587. Materials that are not supported by you current macOS version fall back to
  7588. the default value.
  7589. macOS and cocoa\-cb only
  7590. .sp
  7591. \fB<material>\fP can be one of the following:
  7592. .INDENT 7.0
  7593. .TP
  7594. .B titlebar
  7595. The standard macOS titel bar material.
  7596. .TP
  7597. .B selection
  7598. The standard macOS selection material.
  7599. .TP
  7600. .B menu
  7601. The standard macOS menu material. (macOS 10.11+)
  7602. .TP
  7603. .B popover
  7604. The standard macOS popover material. (macOS 10.11+)
  7605. .TP
  7606. .B sidebar
  7607. The standard macOS sidebar material. (macOS 10.11+)
  7608. .TP
  7609. .B headerView
  7610. The standard macOS header view material.
  7611. (macOS 10.14+)
  7612. .TP
  7613. .B sheet
  7614. The standard macOS sheet material. (macOS 10.14+)
  7615. .TP
  7616. .B windowBackground
  7617. The standard macOS window background material.
  7618. (macOS 10.14+)
  7619. .TP
  7620. .B hudWindow
  7621. The standard macOS hudWindow material. (macOS 10.14+)
  7622. .TP
  7623. .B fullScreen
  7624. The standard macOS full screen material.
  7625. (macOS 10.14+)
  7626. .TP
  7627. .B toolTip
  7628. The standard macOS tool tip material. (macOS 10.14+)
  7629. .TP
  7630. .B contentBackground
  7631. The standard macOS content background material.
  7632. (macOS 10.14+)
  7633. .TP
  7634. .B underWindowBackground
  7635. The standard macOS under window background material.
  7636. (macOS 10.14+)
  7637. .TP
  7638. .B underPageBackground
  7639. The standard macOS under page background material.
  7640. (deprecated in macOS 10.14+)
  7641. .TP
  7642. .B dark
  7643. The standard macOS dark material.
  7644. (deprecated in macOS 10.14+)
  7645. .TP
  7646. .B light
  7647. The standard macOS light material.
  7648. (macOS 10.14+)
  7649. .TP
  7650. .B mediumLight
  7651. The standard macOS mediumLight material.
  7652. (macOS 10.11+, deprecated in macOS 10.14+)
  7653. .TP
  7654. .B ultraDark
  7655. The standard macOS ultraDark material.
  7656. (macOS 10.11+ deprecated in macOS 10.14+)
  7657. .UNINDENT
  7658. .TP
  7659. .B \fB\-\-macos\-title\-bar\-color=<color>\fP
  7660. Sets the color of the title bar (default: completely transparent). Is
  7661. influenced by \fB\-\-macos\-title\-bar\-appearance\fP and
  7662. \fB\-\-macos\-title\-bar\-material\fP\&.
  7663. See \fB\-\-sub\-color\fP for color syntax.
  7664. .TP
  7665. .B \fB\-\-macos\-fs\-animation\-duration=<default|0\-1000>\fP
  7666. Sets the fullscreen resize animation duration in ms (default: default).
  7667. The default value is slightly less than the system\(aqs animation duration
  7668. (500ms) to prevent some problems when the end of an async animation happens
  7669. at the same time as the end of the system wide fullscreen animation. Setting
  7670. anything higher than 500ms will only prematurely cancel the resize animation
  7671. after the system wide animation ended. The upper limit is still set at
  7672. 1000ms since it\(aqs possible that Apple or the user changes the system
  7673. defaults. Anything higher than 1000ms though seems too long and shouldn\(aqt be
  7674. set anyway.
  7675. OS X and cocoa\-cb only
  7676. .TP
  7677. .B \fB\-\-android\-surface\-size=<WxH>\fP
  7678. Set dimensions of the rendering surface used by the Android gpu context.
  7679. Needs to be set by the embedding application if the dimensions change during
  7680. runtime (i.e. if the device is rotated), via the surfaceChanged callback.
  7681. .sp
  7682. Android with \fB\-\-gpu\-context=android\fP only.
  7683. .TP
  7684. .B \fB\-\-gpu\-sw\fP
  7685. Continue even if a software renderer is detected.
  7686. .TP
  7687. .B \fB\-\-gpu\-context=<sys>\fP
  7688. The value \fBauto\fP (the default) selects the GPU context. You can also pass
  7689. \fBhelp\fP to get a complete list of compiled in backends (sorted by
  7690. autoprobe order).
  7691. .INDENT 7.0
  7692. .TP
  7693. .B auto
  7694. auto\-select (default)
  7695. .TP
  7696. .B cocoa
  7697. Cocoa/OS X (deprecated, use \-\-vo=libmpv instead)
  7698. .TP
  7699. .B win
  7700. Win32/WGL
  7701. .TP
  7702. .B winvk
  7703. VK_KHR_win32_surface
  7704. .TP
  7705. .B angle
  7706. Direct3D11 through the OpenGL ES translation layer ANGLE. This supports
  7707. almost everything the \fBwin\fP backend does (if the ANGLE build is new
  7708. enough).
  7709. .TP
  7710. .B dxinterop (experimental)
  7711. Win32, using WGL for rendering and Direct3D 9Ex for presentation. Works
  7712. on Nvidia and AMD. Newer Intel chips with the latest drivers may also
  7713. work.
  7714. .TP
  7715. .B d3d11
  7716. Win32, with native Direct3D 11 rendering.
  7717. .TP
  7718. .B x11
  7719. X11/GLX
  7720. .TP
  7721. .B x11vk
  7722. VK_KHR_xlib_surface
  7723. .TP
  7724. .B wayland
  7725. Wayland/EGL
  7726. .TP
  7727. .B waylandvk
  7728. VK_KHR_wayland_surface
  7729. .TP
  7730. .B drm
  7731. DRM/EGL
  7732. .TP
  7733. .B x11egl
  7734. X11/EGL
  7735. .TP
  7736. .B android
  7737. Android/EGL. Requires \fB\-\-wid\fP be set to an \fBandroid.view.Surface\fP\&.
  7738. .UNINDENT
  7739. .TP
  7740. .B \fB\-\-gpu\-api=<type>\fP
  7741. Controls which type of graphics APIs will be accepted:
  7742. .INDENT 7.0
  7743. .TP
  7744. .B auto
  7745. Use any available API (default)
  7746. .TP
  7747. .B opengl
  7748. Allow only OpenGL (requires OpenGL 2.1+ or GLES 2.0+)
  7749. .TP
  7750. .B vulkan
  7751. Allow only Vulkan (requires a valid/working \fB\-\-spirv\-compiler\fP)
  7752. .TP
  7753. .B d3d11
  7754. Allow only \fB\-\-gpu\-context=d3d11\fP
  7755. .UNINDENT
  7756. .TP
  7757. .B \fB\-\-opengl\-es=<mode>\fP
  7758. Controls which type of OpenGL context will be accepted:
  7759. .INDENT 7.0
  7760. .TP
  7761. .B auto
  7762. Allow all types of OpenGL (default)
  7763. .TP
  7764. .B yes
  7765. Only allow GLES
  7766. .TP
  7767. .B no
  7768. Only allow desktop/core GL
  7769. .UNINDENT
  7770. .TP
  7771. .B \fB\-\-opengl\-restrict=<version>\fP
  7772. Restricts all OpenGL versions above a certain version. Versions are encoded
  7773. in hundreds, i.e. OpenGL 4.5 \-> 450. As an example, \-\-opengl\-restrict=300
  7774. would restrict OpenGL 3.0 and higher, effectively only allowing 2.x
  7775. contexts. Note that this only imposes a limit on context creation APIs, the
  7776. actual OpenGL context may still have a higher OpenGL version. (Default: 0)
  7777. .TP
  7778. .B \fB\-\-fbo\-format=<fmt>\fP
  7779. Selects the internal format of textures used for FBOs. The format can
  7780. influence performance and quality of the video output. \fBfmt\fP can be one
  7781. of: rgb8, rgb10, rgb10_a2, rgb16, rgb16f, rgb32f, rgba12, rgba16, rgba16f,
  7782. rgba16hf, rgba32f.
  7783. .sp
  7784. Default: \fBauto\fP, which first attempts to utilize 16bit float
  7785. (rgba16f, rgba16hf), and falls back to rgba16 if those are not available.
  7786. Finally, attempts to utilize rgb10_a2 or rgba8 if all of the previous formats
  7787. are not available.
  7788. .TP
  7789. .B \fB\-\-gamma\-factor=<0.1..2.0>\fP
  7790. Set an additional raw gamma factor (default: 1.0). If gamma is adjusted in
  7791. other ways (like with the \fB\-\-gamma\fP option or key bindings and the
  7792. \fBgamma\fP property), the value is multiplied with the other gamma value.
  7793. .sp
  7794. Recommended values based on the environmental brightness:
  7795. .INDENT 7.0
  7796. .TP
  7797. .B 1.0
  7798. Pitch black or dimly lit room (default)
  7799. .TP
  7800. .B 1.1
  7801. Moderately lit room, home
  7802. .TP
  7803. .B 1.2
  7804. Brightly illuminated room, office
  7805. .UNINDENT
  7806. .sp
  7807. NOTE: This is based around the assumptions of typical movie content, which
  7808. contains an implicit end\-to\-end of about 0.8 from scene to display. For
  7809. bright environments it can be useful to cancel that out.
  7810. .TP
  7811. .B \fB\-\-gamma\-auto\fP
  7812. Automatically corrects the gamma value depending on ambient lighting
  7813. conditions (adding a gamma boost for bright rooms).
  7814. .sp
  7815. With ambient illuminance of 16 lux, mpv will pick the 1.0 gamma value (no
  7816. boost), and slightly increase the boost up until 1.2 for 256 lux.
  7817. .sp
  7818. NOTE: Only implemented on OS X.
  7819. .TP
  7820. .B \fB\-\-target\-prim=<value>\fP
  7821. Specifies the primaries of the display. Video colors will be adapted to
  7822. this colorspace when ICC color management is not being used. Valid values
  7823. are:
  7824. .INDENT 7.0
  7825. .TP
  7826. .B auto
  7827. Disable any adaptation, except for atypical color spaces. Specifically,
  7828. wide/unusual gamuts get automatically adapted to BT.709, while standard
  7829. gamut (i.e. BT.601 and BT.709) content is not touched. (default)
  7830. .TP
  7831. .B bt.470m
  7832. ITU\-R BT.470 M
  7833. .TP
  7834. .B bt.601\-525
  7835. ITU\-R BT.601 (525\-line SD systems, eg. NTSC), SMPTE 170M/240M
  7836. .TP
  7837. .B bt.601\-625
  7838. ITU\-R BT.601 (625\-line SD systems, eg. PAL/SECAM), ITU\-R BT.470 B/G
  7839. .TP
  7840. .B bt.709
  7841. ITU\-R BT.709 (HD), IEC 61966\-2\-4 (sRGB), SMPTE RP177 Annex B
  7842. .TP
  7843. .B bt.2020
  7844. ITU\-R BT.2020 (UHD)
  7845. .TP
  7846. .B apple
  7847. Apple RGB
  7848. .TP
  7849. .B adobe
  7850. Adobe RGB (1998)
  7851. .TP
  7852. .B prophoto
  7853. ProPhoto RGB (ROMM)
  7854. .TP
  7855. .B cie1931
  7856. CIE 1931 RGB (not to be confused with CIE XYZ)
  7857. .TP
  7858. .B dci\-p3
  7859. DCI\-P3 (Digital Cinema Colorspace), SMPTE RP431\-2
  7860. .TP
  7861. .B v\-gamut
  7862. Panasonic V\-Gamut (VARICAM) primaries
  7863. .TP
  7864. .B s\-gamut
  7865. Sony S\-Gamut (S\-Log) primaries
  7866. .UNINDENT
  7867. .TP
  7868. .B \fB\-\-target\-trc=<value>\fP
  7869. Specifies the transfer characteristics (gamma) of the display. Video colors
  7870. will be adjusted to this curve when ICC color management is not being used.
  7871. Valid values are:
  7872. .INDENT 7.0
  7873. .TP
  7874. .B auto
  7875. Disable any adaptation, except for atypical transfers. Specifically,
  7876. HDR or linear light source material gets automatically converted to
  7877. gamma 2.2, while SDR content is not touched. (default)
  7878. .TP
  7879. .B bt.1886
  7880. ITU\-R BT.1886 curve (assuming infinite contrast)
  7881. .TP
  7882. .B srgb
  7883. IEC 61966\-2\-4 (sRGB)
  7884. .TP
  7885. .B linear
  7886. Linear light output
  7887. .TP
  7888. .B gamma1.8
  7889. Pure power curve (gamma 1.8), also used for Apple RGB
  7890. .TP
  7891. .B gamma2.0
  7892. Pure power curve (gamma 2.0)
  7893. .TP
  7894. .B gamma2.2
  7895. Pure power curve (gamma 2.2)
  7896. .TP
  7897. .B gamma2.4
  7898. Pure power curve (gamma 2.4)
  7899. .TP
  7900. .B gamma2.6
  7901. Pure power curve (gamma 2.6)
  7902. .TP
  7903. .B gamma2.8
  7904. Pure power curve (gamma 2.8), also used for BT.470\-BG
  7905. .TP
  7906. .B prophoto
  7907. ProPhoto RGB (ROMM)
  7908. .TP
  7909. .B pq
  7910. ITU\-R BT.2100 PQ (Perceptual quantizer) curve, aka SMPTE ST2084
  7911. .TP
  7912. .B hlg
  7913. ITU\-R BT.2100 HLG (Hybrid Log\-gamma) curve, aka ARIB STD\-B67
  7914. .TP
  7915. .B v\-log
  7916. Panasonic V\-Log (VARICAM) curve
  7917. .TP
  7918. .B s\-log1
  7919. Sony S\-Log1 curve
  7920. .TP
  7921. .B s\-log2
  7922. Sony S\-Log2 curve
  7923. .UNINDENT
  7924. .sp
  7925. \fBNOTE:\fP
  7926. .INDENT 7.0
  7927. .INDENT 3.5
  7928. When using HDR output formats, mpv will encode to the specified
  7929. curve but it will not set any HDMI flags or other signalling that might
  7930. be required for the target device to correctly display the HDR signal.
  7931. The user should independently guarantee this before using these signal
  7932. formats for display.
  7933. .UNINDENT
  7934. .UNINDENT
  7935. .TP
  7936. .B \fB\-\-target\-peak=<auto|nits>\fP
  7937. Specifies the measured peak brightness of the output display, in cd/m^2
  7938. (AKA nits). The interpretation of this brightness depends on the configured
  7939. \fB\-\-target\-trc\fP\&. In all cases, it imposes a limit on the signal values
  7940. that will be sent to the display. If the source exceeds this brightness
  7941. level, a tone mapping filter will be inserted. For HLG, it has the
  7942. additional effect of parametrizing the inverse OOTF, in order to get
  7943. colorimetrically consistent results with the mastering display. For SDR, or
  7944. when using an ICC (profile (\fB\-\-icc\-profile\fP), setting this to a value
  7945. above 100 essentially causes the display to be treated as if it were an HDR
  7946. display in disguise. (See the note below)
  7947. .sp
  7948. In \fBauto\fP mode (the default), the chosen peak is an appropriate value
  7949. based on the TRC in use. For SDR curves, it uses 100. For HDR curves, it
  7950. uses 100 * the transfer function\(aqs nominal peak.
  7951. .sp
  7952. \fBNOTE:\fP
  7953. .INDENT 7.0
  7954. .INDENT 3.5
  7955. When using an SDR transfer function, this is normally not needed, and
  7956. setting it may lead to very unexpected results. The one time it \fIis\fP
  7957. useful is if you want to calibrate a HDR display using traditional
  7958. transfer functions and calibration equipment. In such cases, you can
  7959. set your HDR display to a high brightness such as 800 cd/m^2, and then
  7960. calibrate it to a standard curve like gamma2.8. Setting this value to
  7961. 800 would then instruct mpv to essentially treat it as an HDR display
  7962. with the given peak. This may be a good alternative in environments
  7963. where PQ or HLG input to the display is not possible, and makes it
  7964. possible to use HDR displays with mpv regardless of operating system
  7965. support for HDMI HDR metadata.
  7966. .sp
  7967. In such a configuration, we highly recommend setting \fB\-\-tone\-mapping\fP
  7968. to \fBmobius\fP or even \fBclip\fP\&.
  7969. .UNINDENT
  7970. .UNINDENT
  7971. .TP
  7972. .B \fB\-\-tone\-mapping=<value>\fP
  7973. Specifies the algorithm used for tone\-mapping images onto the target
  7974. display. This is relevant for both HDR\->SDR conversion as well as gamut
  7975. reduction (e.g. playing back BT.2020 content on a standard gamut display).
  7976. Valid values are:
  7977. .INDENT 7.0
  7978. .TP
  7979. .B clip
  7980. Hard\-clip any out\-of\-range values. Use this when you care about
  7981. perfect color accuracy for in\-range values at the cost of completely
  7982. distorting out\-of\-range values. Not generally recommended.
  7983. .TP
  7984. .B mobius
  7985. Generalization of Reinhard to a Möbius transform with linear section.
  7986. Smoothly maps out\-of\-range values while retaining contrast and colors
  7987. for in\-range material as much as possible. Use this when you care about
  7988. color accuracy more than detail preservation. This is somewhere in
  7989. between \fBclip\fP and \fBreinhard\fP, depending on the value of
  7990. \fB\-\-tone\-mapping\-param\fP\&.
  7991. .TP
  7992. .B reinhard
  7993. Reinhard tone mapping algorithm. Very simple continuous curve.
  7994. Preserves overall image brightness but uses nonlinear contrast, which
  7995. results in flattening of details and degradation in color accuracy.
  7996. .TP
  7997. .B hable
  7998. Similar to \fBreinhard\fP but preserves both dark and bright details
  7999. better (slightly sigmoidal), at the cost of slightly darkening /
  8000. desaturating everything. Developed by John Hable for use in video
  8001. games. Use this when you care about detail preservation more than
  8002. color/brightness accuracy. This is roughly equivalent to
  8003. \fB\-\-tone\-mapping=reinhard \-\-tone\-mapping\-param=0.24\fP\&. If possible,
  8004. you should also enable \fB\-\-hdr\-compute\-peak\fP for the best results.
  8005. (Default)
  8006. .TP
  8007. .B gamma
  8008. Fits a logarithmic transfer between the tone curves.
  8009. .TP
  8010. .B linear
  8011. Linearly stretches the entire reference gamut to (a linear multiple of)
  8012. the display.
  8013. .UNINDENT
  8014. .TP
  8015. .B \fB\-\-tone\-mapping\-param=<value>\fP
  8016. Set tone mapping parameters. By default, this is set to the special string
  8017. \fBdefault\fP, which maps to an algorithm\-specific default value. Ignored if
  8018. the tone mapping algorithm is not tunable. This affects the following tone
  8019. mapping algorithms:
  8020. .INDENT 7.0
  8021. .TP
  8022. .B clip
  8023. Specifies an extra linear coefficient to multiply into the signal
  8024. before clipping. Defaults to 1.0.
  8025. .TP
  8026. .B mobius
  8027. Specifies the transition point from linear to mobius transform. Every
  8028. value below this point is guaranteed to be mapped 1:1. The higher the
  8029. value, the more accurate the result will be, at the cost of losing
  8030. bright details. Defaults to 0.3, which due to the steep initial slope
  8031. still preserves in\-range colors fairly accurately.
  8032. .TP
  8033. .B reinhard
  8034. Specifies the local contrast coefficient at the display peak. Defaults
  8035. to 0.5, which means that in\-gamut values will be about half as bright
  8036. as when clipping.
  8037. .TP
  8038. .B gamma
  8039. Specifies the exponent of the function. Defaults to 1.8.
  8040. .TP
  8041. .B linear
  8042. Specifies the scale factor to use while stretching. Defaults to 1.0.
  8043. .UNINDENT
  8044. .TP
  8045. .B \fB\-\-tone\-mapping\-max\-boost=<1.0..10.0>\fP
  8046. Upper limit for how much the tone mapping algorithm is allowed to boost
  8047. the average brightness by over\-exposing the image. The default value of 1.0
  8048. allows no additional brightness boost. A value of 2.0 would allow
  8049. over\-exposing by a factor of 2, and so on. Raising this setting can help
  8050. reveal details that would otherwise be hidden in dark scenes, but raising
  8051. it too high will make dark scenes appear unnaturally bright.
  8052. .TP
  8053. .B \fB\-\-hdr\-compute\-peak=<auto|yes|no>\fP
  8054. Compute the HDR peak and frame average brightness per\-frame instead of
  8055. relying on tagged metadata. These values are averaged over local regions as
  8056. well as over several frames to prevent the value from jittering around too
  8057. much. This option basically gives you dynamic, per\-scene tone mapping.
  8058. Requires compute shaders, which is a fairly recent OpenGL feature, and will
  8059. probably also perform horribly on some drivers, so enable at your own risk.
  8060. The special value \fBauto\fP (default) will enable HDR peak computation
  8061. automatically if compute shaders and SSBOs are supported.
  8062. .TP
  8063. .B \fB\-\-hdr\-peak\-decay\-rate=<1.0..1000.0>\fP
  8064. The decay rate used for the HDR peak detection algorithm (default: 100.0).
  8065. This is only relevant when \fB\-\-hdr\-compute\-peak\fP is enabled. Higher values
  8066. make the peak decay more slowly, leading to more stable values at the cost
  8067. of more "eye adaptation"\-like effects (although this is mitigated somewhat
  8068. by \fB\-\-hdr\-scene\-threshold\fP). A value of 1.0 (the lowest possible) disables
  8069. all averaging, meaning each frame\(aqs value is used directly as measured,
  8070. but doing this is not recommended for "noisy" sources since it may lead
  8071. to excessive flicker. (In signal theory terms, this controls the time
  8072. constant "tau" of an IIR low pass filter)
  8073. .TP
  8074. .B \fB\-\-hdr\-scene\-threshold\-low=<0.0..100.0>\fP, \fB\-\-hdr\-scene\-threshold\-high=<0.0..100.0>\fP
  8075. The lower and upper thresholds (in dB) for a brightness difference
  8076. to be considered a scene change (default: 5.5 low, 10.0 high). This is only
  8077. relevant when \fB\-\-hdr\-compute\-peak\fP is enabled. Normally, small
  8078. fluctuations in the frame brightness are compensated for by the peak
  8079. averaging mechanism, but for large jumps in the brightness this can result
  8080. in the frame remaining too bright or too dark for up to several seconds,
  8081. depending on the value of \fB\-\-hdr\-peak\-decay\-rate\fP\&. To counteract this,
  8082. when the brightness between the running average and the current frame
  8083. exceeds the low threshold, mpv will make the averaging filter more
  8084. aggressive, up to the limit of the high threshold (at which point the
  8085. filter becomes instant).
  8086. .TP
  8087. .B \fB\-\-tone\-mapping\-desaturate=<0.0..1.0>\fP
  8088. Apply desaturation for highlights (default: 0.75). The parameter controls
  8089. the strength of the desaturation curve. A value of 0.0 completely disables
  8090. it, while a value of 1.0 means that overly bright colors will tend towards
  8091. white. (This is not always the case, especially not for highlights that are
  8092. near primary colors)
  8093. .sp
  8094. Values in between apply progressively more/less aggressive desaturation.
  8095. This setting helps prevent unnaturally oversaturated colors for
  8096. super\-highlights, by (smoothly) turning them into less saturated (per
  8097. channel tone mapped) colors instead. This makes images feel more natural,
  8098. at the cost of chromatic distortions for out\-of\-range colors. The default
  8099. value of 0.75 provides a good balance. Setting this to 0.0 preserves the
  8100. chromatic accuracy of the tone mapping process.
  8101. .TP
  8102. .B \fB\-\-tone\-mapping\-desaturate\-exponent=<0.0..20.0>\fP
  8103. This setting controls the exponent of the desaturation curve, which
  8104. controls how bright a color needs to be in order to start being
  8105. desaturated. The default of 1.5 provides a reasonable balance. Decreasing
  8106. this exponent makes the curve more aggressive.
  8107. .TP
  8108. .B \fB\-\-gamut\-warning\fP
  8109. If enabled, mpv will mark all clipped/out\-of\-gamut pixels that exceed a
  8110. given threshold (currently hard\-coded to 101%). The affected pixels will be
  8111. inverted to make them stand out. Note: This option applies after the
  8112. effects of all of mpv\(aqs color space transformation / tone mapping options,
  8113. so it\(aqs a good idea to combine this with \fB\-\-tone\-mapping=clip\fP and use
  8114. \fB\-\-target\-prim\fP to set the gamut to simulate. For example,
  8115. \fB\-\-target\-prim=bt.709\fP would make mpv highlight all pixels that exceed the
  8116. gamut of a standard gamut (sRGB) display. This option also does not work
  8117. well with ICC profiles, since the 3DLUTs are always generated against the
  8118. source color space and have chromatically\-accurate clipping built in.
  8119. .TP
  8120. .B \fB\-\-use\-embedded\-icc\-profile\fP
  8121. Load the embedded ICC profile contained in media files such as PNG images.
  8122. (Default: yes). Note that this option only works when also using a display
  8123. ICC profile (\fB\-\-icc\-profile\fP or \fB\-\-icc\-profile\-auto\fP), and also
  8124. requires LittleCMS 2 support.
  8125. .TP
  8126. .B \fB\-\-icc\-profile=<file>\fP
  8127. Load an ICC profile and use it to transform video RGB to screen output.
  8128. Needs LittleCMS 2 support compiled in. This option overrides the
  8129. \fB\-\-target\-prim\fP, \fB\-\-target\-trc\fP and \fB\-\-icc\-profile\-auto\fP options.
  8130. .TP
  8131. .B \fB\-\-icc\-profile\-auto\fP
  8132. Automatically select the ICC display profile currently specified by the
  8133. display settings of the operating system.
  8134. .sp
  8135. NOTE: On Windows, the default profile must be an ICC profile. WCS profiles
  8136. are not supported.
  8137. .sp
  8138. Applications using libmpv with the render API need to provide the ICC
  8139. profile via \fBMPV_RENDER_PARAM_ICC_PROFILE\fP\&.
  8140. .TP
  8141. .B \fB\-\-icc\-cache\-dir=<dirname>\fP
  8142. Store and load the 3D LUTs created from the ICC profile in this directory.
  8143. This can be used to speed up loading, since LittleCMS 2 can take a while to
  8144. create a 3D LUT. Note that these files contain uncompressed LUTs. Their
  8145. size depends on the \fB\-\-icc\-3dlut\-size\fP, and can be very big.
  8146. .sp
  8147. NOTE: This is not cleaned automatically, so old, unused cache files may
  8148. stick around indefinitely.
  8149. .TP
  8150. .B \fB\-\-icc\-intent=<value>\fP
  8151. Specifies the ICC intent used for the color transformation (when using
  8152. \fB\-\-icc\-profile\fP).
  8153. .INDENT 7.0
  8154. .TP
  8155. .B 0
  8156. perceptual
  8157. .TP
  8158. .B 1
  8159. relative colorimetric (default)
  8160. .TP
  8161. .B 2
  8162. saturation
  8163. .TP
  8164. .B 3
  8165. absolute colorimetric
  8166. .UNINDENT
  8167. .TP
  8168. .B \fB\-\-icc\-3dlut\-size=<r>x<g>x<b>\fP
  8169. Size of the 3D LUT generated from the ICC profile in each dimension.
  8170. Default is 64x64x64. Sizes may range from 2 to 512.
  8171. .TP
  8172. .B \fB\-\-icc\-contrast=<0\-1000000|inf>\fP
  8173. Specifies an upper limit on the target device\(aqs contrast ratio. This is
  8174. detected automatically from the profile if possible, but for some profiles
  8175. it might be missing, causing the contrast to be assumed as infinite. As a
  8176. result, video may appear darker than intended. This only affects BT.1886
  8177. content. The default of 0 means no limit if the detected contrast is less
  8178. than 100000, and limits to 1000 otherwise. Use \fB\-\-icc\-contrast=inf\fP to
  8179. preserve the infinite contrast (most likely when using OLED displays).
  8180. .TP
  8181. .B \fB\-\-blend\-subtitles=<yes|video|no>\fP
  8182. Blend subtitles directly onto upscaled video frames, before interpolation
  8183. and/or color management (default: no). Enabling this causes subtitles to be
  8184. affected by \fB\-\-icc\-profile\fP, \fB\-\-target\-prim\fP, \fB\-\-target\-trc\fP,
  8185. \fB\-\-interpolation\fP, \fB\-\-gamma\-factor\fP and \fB\-\-glsl\-shaders\fP\&. It also
  8186. increases subtitle performance when using \fB\-\-interpolation\fP\&.
  8187. .sp
  8188. The downside of enabling this is that it restricts subtitles to the visible
  8189. portion of the video, so you can\(aqt have subtitles exist in the black
  8190. margins below a video (for example).
  8191. .sp
  8192. If \fBvideo\fP is selected, the behavior is similar to \fByes\fP, but subs are
  8193. drawn at the video\(aqs native resolution, and scaled along with the video.
  8194. .sp
  8195. \fBWARNING:\fP
  8196. .INDENT 7.0
  8197. .INDENT 3.5
  8198. This changes the way subtitle colors are handled. Normally,
  8199. subtitle colors are assumed to be in sRGB and color managed as
  8200. such. Enabling this makes them treated as being in the video\(aqs
  8201. color space instead. This is good if you want things like
  8202. softsubbed ASS signs to match the video colors, but may cause
  8203. SRT subtitles or similar to look slightly off.
  8204. .UNINDENT
  8205. .UNINDENT
  8206. .TP
  8207. .B \fB\-\-alpha=<blend\-tiles|blend|yes|no>\fP
  8208. Decides what to do if the input has an alpha component.
  8209. .INDENT 7.0
  8210. .TP
  8211. .B blend\-tiles
  8212. Blend the frame against a 16x16 gray/white tiles background (default).
  8213. .TP
  8214. .B blend
  8215. Blend the frame against the background color (\fB\-\-background\fP, normally
  8216. black).
  8217. .TP
  8218. .B yes
  8219. Try to create a framebuffer with alpha component. This only makes sense
  8220. if the video contains alpha information (which is extremely rare). May
  8221. not be supported on all platforms. If alpha framebuffers are
  8222. unavailable, it silently falls back on a normal framebuffer. Note that
  8223. if you set the \fB\-\-fbo\-format\fP option to a non\-default value, a
  8224. format with alpha must be specified, or this won\(aqt work.
  8225. This does not work on X11 with EGL and Mesa (freedesktop bug 67676).
  8226. .TP
  8227. .B no
  8228. Ignore alpha component.
  8229. .UNINDENT
  8230. .TP
  8231. .B \fB\-\-opengl\-rectangle\-textures\fP
  8232. Force use of rectangle textures (default: no). Normally this shouldn\(aqt have
  8233. any advantages over normal textures. Note that hardware decoding overrides
  8234. this flag. Could be removed any time.
  8235. .TP
  8236. .B \fB\-\-background=<color>\fP
  8237. Color used to draw parts of the mpv window not covered by video. See
  8238. \fB\-\-osd\-color\fP option how colors are defined.
  8239. .TP
  8240. .B \fB\-\-gpu\-tex\-pad\-x\fP, \fB\-\-gpu\-tex\-pad\-y\fP
  8241. Enlarge the video source textures by this many pixels. For debugging only
  8242. (normally textures are sized exactly, but due to hardware decoding interop
  8243. we may have to deal with additional padding, which can be tested with these
  8244. options). Could be removed any time.
  8245. .TP
  8246. .B \fB\-\-opengl\-early\-flush=<yes|no|auto>\fP
  8247. Call \fBglFlush()\fP after rendering a frame and before attempting to display
  8248. it (default: auto). Can fix stuttering in some cases, in other cases
  8249. probably causes it. The \fBauto\fP mode will call \fBglFlush()\fP only if
  8250. the renderer is going to wait for a while after rendering, instead of
  8251. flipping GL front and backbuffers immediately (i.e. it doesn\(aqt call it
  8252. in display\-sync mode).
  8253. .sp
  8254. On OSX this is always deactivated because it only causes performance
  8255. problems and other regressions.
  8256. .TP
  8257. .B \fB\-\-gpu\-dumb\-mode=<yes|no|auto>\fP
  8258. This mode is extremely restricted, and will disable most extended
  8259. features. That includes high quality scalers and custom shaders!
  8260. .sp
  8261. It is intended for hardware that does not support FBOs (including GLES,
  8262. which supports it insufficiently), or to get some more performance out of
  8263. bad or old hardware.
  8264. .sp
  8265. This mode is forced automatically if needed, and this option is mostly
  8266. useful for debugging. The default of \fBauto\fP will enable it automatically
  8267. if nothing uses features which require FBOs.
  8268. .sp
  8269. This option might be silently removed in the future.
  8270. .TP
  8271. .B \fB\-\-gpu\-shader\-cache\-dir=<dirname>\fP
  8272. Store and load compiled GLSL shaders in this directory. Normally, shader
  8273. compilation is very fast, so this is usually not needed. It mostly matters
  8274. for GPU APIs that require internally recompiling shaders to other languages,
  8275. for example anything based on ANGLE or Vulkan. Enabling this can improve
  8276. startup performance on these platforms.
  8277. .sp
  8278. NOTE: This is not cleaned automatically, so old, unused cache files may
  8279. stick around indefinitely.
  8280. .UNINDENT
  8281. .SS Miscellaneous
  8282. .INDENT 0.0
  8283. .TP
  8284. .B \fB\-\-display\-tags=tag1,tags2,...\fP
  8285. Set the list of tags that should be displayed on the terminal. Tags that
  8286. are in the list, but are not present in the played file, will not be shown.
  8287. If a value ends with \fB*\fP, all tags are matched by prefix (though there
  8288. is no general globbing). Just passing \fB*\fP essentially filtering.
  8289. .sp
  8290. The default includes a common list of tags, call mpv with \fB\-\-list\-options\fP
  8291. to see it.
  8292. .sp
  8293. This is a string list option. See \fI\%List Options\fP for details.
  8294. .TP
  8295. .B \fB\-\-mc=<seconds/frame>\fP
  8296. Maximum A\-V sync correction per frame (in seconds)
  8297. .TP
  8298. .B \fB\-\-autosync=<factor>\fP
  8299. Gradually adjusts the A/V sync based on audio delay measurements.
  8300. Specifying \fB\-\-autosync=0\fP, the default, will cause frame timing to be
  8301. based entirely on audio delay measurements. Specifying \fB\-\-autosync=1\fP
  8302. will do the same, but will subtly change the A/V correction algorithm. An
  8303. uneven video framerate in a video which plays fine with \fB\-\-no\-audio\fP can
  8304. often be helped by setting this to an integer value greater than 1. The
  8305. higher the value, the closer the timing will be to \fB\-\-no\-audio\fP\&. Try
  8306. \fB\-\-autosync=30\fP to smooth out problems with sound drivers which do not
  8307. implement a perfect audio delay measurement. With this value, if large A/V
  8308. sync offsets occur, they will only take about 1 or 2 seconds to settle
  8309. out. This delay in reaction time to sudden A/V offsets should be the only
  8310. side effect of turning this option on, for all sound drivers.
  8311. .TP
  8312. .B \fB\-\-video\-timing\-offset=<seconds>\fP
  8313. Control how long before video display target time the frame should be
  8314. rendered (default: 0.050). If a video frame should be displayed at a
  8315. certain time, the VO will start rendering the frame earlier, and then will
  8316. perform a blocking wait until the display time, and only then "swap" the
  8317. frame to display. The rendering cannot start before the previous frame is
  8318. displayed, so this value is implicitly limited by the video framerate. With
  8319. normal video frame rates, the default value will ensure that rendering is
  8320. always immediately started after the previous frame was displayed. On the
  8321. other hand, setting a too high value can reduce responsiveness with low
  8322. FPS value.
  8323. .sp
  8324. For client API users using the render API (or the deprecated \fBopengl\-cb\fP
  8325. API), this option is interesting, because you can stop the render API
  8326. from limiting your FPS (see \fBmpv_render_context_render()\fP documentation).
  8327. .sp
  8328. This applies only to audio timing modes (e.g. \fB\-\-video\-sync=audio\fP). In
  8329. other modes (\fB\-\-video\-sync=display\-...\fP), video timing relies on vsync
  8330. blocking, and this option is not used.
  8331. .TP
  8332. .B \fB\-\-video\-sync=<audio|...>\fP
  8333. How the player synchronizes audio and video.
  8334. .sp
  8335. If you use this option, you usually want to set it to \fBdisplay\-resample\fP
  8336. to enable a timing mode that tries to not skip or repeat frames when for
  8337. example playing 24fps video on a 24Hz screen.
  8338. .sp
  8339. The modes starting with \fBdisplay\-\fP try to output video frames completely
  8340. synchronously to the display, using the detected display vertical refresh
  8341. rate as a hint how fast frames will be displayed on average. These modes
  8342. change video speed slightly to match the display. See \fB\-\-video\-sync\-...\fP
  8343. options for fine tuning. The robustness of this mode is further reduced by
  8344. making a some idealized assumptions, which may not always apply in reality.
  8345. Behavior can depend on the VO and the system\(aqs video and audio drivers.
  8346. Media files must use constant framerate. Section\-wise VFR might work as well
  8347. with some container formats (but not e.g. mkv).
  8348. .sp
  8349. Under some circumstances, the player automatically reverts to \fBaudio\fP mode
  8350. for some time or permanently. This can happen on very low framerate video,
  8351. or if the framerate cannot be detected.
  8352. .sp
  8353. Also in display\-sync modes it can happen that interruptions to video
  8354. playback (such as toggling fullscreen mode, or simply resizing the window)
  8355. will skip the video frames that should have been displayed, while \fBaudio\fP
  8356. mode will display them after the renderer has resumed (typically resulting
  8357. in a short A/V desync and the video "catching up").
  8358. .sp
  8359. Before mpv 0.30.0, there was a fallback to \fBaudio\fP mode on severe A/V
  8360. desync. This was changed for the sake of not sporadically stopping. Now,
  8361. \fBdisplay\-desync\fP does what it promises and may desync with audio by an
  8362. arbitrary amount, until it is manually fixed with a seek.
  8363. .sp
  8364. These modes also require a vsync blocked presentation mode. For OpenGL, this
  8365. translates to \fB\-\-opengl\-swapinterval=1\fP\&. For Vulkan, it translates to
  8366. \fB\-\-vulkan\-swap\-mode=fifo\fP (or \fBfifo\-relaxed\fP).
  8367. .sp
  8368. The modes with \fBdesync\fP in their names do not attempt to keep audio/video
  8369. in sync. They will slowly (or quickly) desync, until e.g. the next seek
  8370. happens. These modes are meant for testing, not serious use.
  8371. .INDENT 7.0
  8372. .TP
  8373. .B audio
  8374. Time video frames to audio. This is the most robust
  8375. mode, because the player doesn\(aqt have to assume anything
  8376. about how the display behaves. The disadvantage is that
  8377. it can lead to occasional frame drops or repeats. If
  8378. audio is disabled, this uses the system clock. This is
  8379. the default mode.
  8380. .TP
  8381. .B display\-resample
  8382. Resample audio to match the video. This mode will also
  8383. try to adjust audio speed to compensate for other drift.
  8384. (This means it will play the audio at a different speed
  8385. every once in a while to reduce the A/V difference.)
  8386. .TP
  8387. .B display\-resample\-vdrop
  8388. Resample audio to match the video. Drop video
  8389. frames to compensate for drift.
  8390. .TP
  8391. .B display\-resample\-desync
  8392. Like the previous mode, but no A/V compensation.
  8393. .TP
  8394. .B display\-vdrop
  8395. Drop or repeat video frames to compensate desyncing
  8396. video. (Although it should have the same effects as
  8397. \fBaudio\fP, the implementation is very different.)
  8398. .TP
  8399. .B display\-adrop
  8400. Drop or repeat audio data to compensate desyncing
  8401. video. See \fB\-\-video\-sync\-adrop\-size\fP\&. This mode will
  8402. cause severe audio artifacts if the real monitor
  8403. refresh rate is too different from the reported or
  8404. forced rate.
  8405. .TP
  8406. .B display\-desync
  8407. Sync video to display, and let audio play on its own.
  8408. .TP
  8409. .B desync
  8410. Sync video according to system clock, and let audio play
  8411. on its own.
  8412. .UNINDENT
  8413. .TP
  8414. .B \fB\-\-video\-sync\-max\-video\-change=<value>\fP
  8415. Maximum speed difference in percent that is applied to video with
  8416. \fB\-\-video\-sync=display\-...\fP (default: 1). Display sync mode will be
  8417. disabled if the monitor and video refresh way do not match within the
  8418. given range. It tries multiples as well: playing 30 fps video on a 60 Hz
  8419. screen will duplicate every second frame. Playing 24 fps video on a 60 Hz
  8420. screen will play video in a 2\-3\-2\-3\-... pattern.
  8421. .sp
  8422. The default settings are not loose enough to speed up 23.976 fps video to
  8423. 25 fps. We consider the pitch change too extreme to allow this behavior
  8424. by default. Set this option to a value of \fB5\fP to enable it.
  8425. .sp
  8426. Note that in the \fB\-\-video\-sync=display\-resample\fP mode, audio speed will
  8427. additionally be changed by a small amount if necessary for A/V sync. See
  8428. \fB\-\-video\-sync\-max\-audio\-change\fP\&.
  8429. .TP
  8430. .B \fB\-\-video\-sync\-max\-audio\-change=<value>\fP
  8431. Maximum \fIadditional\fP speed difference in percent that is applied to audio
  8432. with \fB\-\-video\-sync=display\-...\fP (default: 0.125). Normally, the player
  8433. plays the audio at the speed of the video. But if the difference between
  8434. audio and video position is too high, e.g. due to drift or other timing
  8435. errors, it will attempt to speed up or slow down audio by this additional
  8436. factor. Too low values could lead to video frame dropping or repeating if
  8437. the A/V desync cannot be compensated, too high values could lead to chaotic
  8438. frame dropping due to the audio "overshooting" and skipping multiple video
  8439. frames before the sync logic can react.
  8440. .TP
  8441. .B \fB\-\-video\-sync\-adrop\-size=<value>\fP
  8442. For the \fB\-\-video\-sync=display\-adrop\fP mode. This mode duplicates/drops
  8443. audio data to keep audio in sync with video. To avoid audio artifacts on
  8444. jitter (which would add/remove samples all the time), this is done in
  8445. relatively large, fixed units, controlled by this option. The unit is
  8446. seconds.
  8447. .TP
  8448. .B \fB\-\-mf\-fps=<value>\fP
  8449. Framerate used when decoding from multiple PNG or JPEG files with \fBmf://\fP
  8450. (default: 1).
  8451. .TP
  8452. .B \fB\-\-mf\-type=<value>\fP
  8453. Input file type for \fBmf://\fP (available: jpeg, png, tga, sgi). By default,
  8454. this is guessed from the file extension.
  8455. .TP
  8456. .B \fB\-\-stream\-dump=<destination\-filename>\fP
  8457. Instead of playing a file, read its byte stream and write it to the given
  8458. destination file. The destination is overwritten. Can be useful to test
  8459. network\-related behavior.
  8460. .TP
  8461. .B \fB\-\-stream\-lavf\-o=opt1=value1,opt2=value2,...\fP
  8462. Set AVOptions on streams opened with libavformat. Unknown or misspelled
  8463. options are silently ignored. (They are mentioned in the terminal output
  8464. in verbose mode, i.e. \fB\-\-v\fP\&. In general we can\(aqt print errors, because
  8465. other options such as e.g. user agent are not available with all protocols,
  8466. and printing errors for unknown options would end up being too noisy.)
  8467. .sp
  8468. This is a key/value list option. See \fI\%List Options\fP for details.
  8469. .TP
  8470. .B \fB\-\-vo\-mmcss\-profile=<name>\fP
  8471. (Windows only.)
  8472. Set the MMCSS profile for the video renderer thread (default: \fBPlayback\fP).
  8473. .TP
  8474. .B \fB\-\-priority=<prio>\fP
  8475. (Windows only.)
  8476. Set process priority for mpv according to the predefined priorities
  8477. available under Windows.
  8478. .sp
  8479. Possible values of \fB<prio>\fP:
  8480. idle|belownormal|normal|abovenormal|high|realtime
  8481. .sp
  8482. \fBWARNING:\fP
  8483. .INDENT 7.0
  8484. .INDENT 3.5
  8485. Using realtime priority can cause system lockup.
  8486. .UNINDENT
  8487. .UNINDENT
  8488. .TP
  8489. .B \fB\-\-force\-media\-title=<string>\fP
  8490. Force the contents of the \fBmedia\-title\fP property to this value. Useful
  8491. for scripts which want to set a title, without overriding the user\(aqs
  8492. setting in \fB\-\-title\fP\&.
  8493. .TP
  8494. .B \fB\-\-external\-files=<file\-list>\fP
  8495. Load a file and add all of its tracks. This is useful to play different
  8496. files together (for example audio from one file, video from another), or
  8497. for advanced \fB\-\-lavfi\-complex\fP used (like playing two video files at
  8498. the same time).
  8499. .sp
  8500. Unlike \fB\-\-sub\-files\fP and \fB\-\-audio\-files\fP, this includes all tracks, and
  8501. does not cause default stream selection over the "proper" file. This makes
  8502. it slightly less intrusive. (In mpv 0.28.0 and before, this was not quite
  8503. strictly enforced.)
  8504. .sp
  8505. This is a path list option. See \fI\%List Options\fP for details.
  8506. .TP
  8507. .B \fB\-\-external\-file=<file>\fP
  8508. CLI/config file only alias for \fB\-\-external\-files\-append\fP\&. Each use of this
  8509. option will add a new external files.
  8510. .TP
  8511. .B \fB\-\-autoload\-files=<yes|no>\fP
  8512. Automatically load/select external files (default: yes).
  8513. .sp
  8514. If set to \fBno\fP, then do not automatically load external files as specified
  8515. by \fB\-\-sub\-auto\fP and \fB\-\-audio\-file\-auto\fP\&. If external files are forcibly
  8516. added (like with \fB\-\-sub\-files\fP), they will not be auto\-selected.
  8517. .sp
  8518. This does not affect playlist expansion, redirection, or other loading of
  8519. referenced files like with ordered chapters.
  8520. .TP
  8521. .B \fB\-\-record\-file=<file>\fP
  8522. Deprecated, use \fB\-\-stream\-record\fP, or the \fBdump\-cache\fP command.
  8523. .sp
  8524. Record the current stream to the given target file. The target file will
  8525. always be overwritten without asking.
  8526. .sp
  8527. This was deprecated because it isn\(aqt very nice to use. For one, seeking
  8528. while this is enabled will be directly reflected in the output, which was
  8529. not useful and annoying.
  8530. .TP
  8531. .B \fB\-\-stream\-record=<file>\fP
  8532. Write received/read data from the demuxer to the given output file. The
  8533. output file will always be overwritten without asking. The output format
  8534. is determined by the extension of the output file.
  8535. .sp
  8536. Switching streams or seeking during recording might result in recording
  8537. being stopped and/or broken files. Use with care.
  8538. .sp
  8539. Seeking outside of the demuxer cache will result in "skips" in the output
  8540. file, but seeking within the demuxer cache should not affect recording. One
  8541. exception is when you seek back far enough to exceed the forward buffering
  8542. size, in which case the cache stops actively reading. This will return in
  8543. dropped data if it\(aqs a live stream.
  8544. .sp
  8545. If this is set at runtime, the old file is closed, and the new file is
  8546. opened. Note that this will write only data that is appended at the end of
  8547. the cache, and the already cached data cannot be written. You can try the
  8548. \fBdump\-cache\fP command as an alternative.
  8549. .sp
  8550. External files (\fB\-\-audio\-file\fP etc.) are ignored by this, it works on the
  8551. "main" file only. Using this with files using ordered chapters or EDL files
  8552. will also not work correctly in general.
  8553. .sp
  8554. There are some glitches with this because it uses FFmpeg\(aqs libavformat for
  8555. writing the output file. For example, it\(aqs typical that it will only work if
  8556. the output format is the same as the input format. This is the case even if
  8557. it works with the \fBffmpeg\fP tool. One reason for this is that \fBffmpeg\fP
  8558. and its libraries contain certain hacks and workarounds for these issues,
  8559. that are unavailable to outside users.
  8560. .sp
  8561. This replaces \fB\-\-record\-file\fP\&. It is similar to the ancient/removed
  8562. \fB\-\-stream\-capture\fP/\fB\-capture\fP options, and provides better behavior in
  8563. most cases (i.e. actually works).
  8564. .TP
  8565. .B \fB\-\-lavfi\-complex=<string>\fP
  8566. Set a "complex" libavfilter filter, which means a single filter graph can
  8567. take input from multiple source audio and video tracks. The graph can result
  8568. in a single audio or video output (or both).
  8569. .sp
  8570. Currently, the filter graph labels are used to select the participating
  8571. input tracks and audio/video output. The following rules apply:
  8572. .INDENT 7.0
  8573. .IP \(bu 2
  8574. A label of the form \fBaidN\fP selects audio track N as input (e.g.
  8575. \fBaid1\fP).
  8576. .IP \(bu 2
  8577. A label of the form \fBvidN\fP selects video track N as input.
  8578. .IP \(bu 2
  8579. A label named \fBao\fP will be connected to the audio output.
  8580. .IP \(bu 2
  8581. A label named \fBvo\fP will be connected to the video output.
  8582. .UNINDENT
  8583. .sp
  8584. Each label can be used only once. If you want to use e.g. an audio stream
  8585. for multiple filters, you need to use the \fBasplit\fP filter. Multiple
  8586. video or audio outputs are not possible, but you can use filters to merge
  8587. them into one.
  8588. .sp
  8589. It\(aqs not possible to change the tracks connected to the filter at runtime,
  8590. unless you explicitly change the \fBlavfi\-complex\fP property and set new
  8591. track assignments. When the graph is changed, the track selection is changed
  8592. according to the used labels as well.
  8593. .sp
  8594. Other tracks, as long as they\(aqre not connected to the filter, and the
  8595. corresponding output is not connected to the filter, can still be freely
  8596. changed with the normal methods.
  8597. .sp
  8598. Note that the normal filter chains (\fB\-\-af\fP, \fB\-\-vf\fP) are applied between
  8599. the complex graphs (e.g. \fBao\fP label) and the actual output.
  8600. .INDENT 7.0
  8601. .INDENT 3.5
  8602. .IP "Examples"
  8603. .INDENT 0.0
  8604. .IP \(bu 2
  8605. \fB\-\-lavfi\-complex=\(aq[aid1] [aid2] amix [ao]\(aq\fP
  8606. Play audio track 1 and 2 at the same time.
  8607. .IP \(bu 2
  8608. \fB\-\-lavfi\-complex=\(aq[vid1] [vid2] vstack [vo]\(aq\fP
  8609. Stack video track 1 and 2 and play them at the same time. Note that
  8610. both tracks need to have the same width, or filter initialization
  8611. will fail (you can add \fBscale\fP filters before the \fBvstack\fP filter
  8612. to fix the size).
  8613. To load a video track from another file, you can use
  8614. \fB\-\-external\-file=other.mkv\fP\&.
  8615. .IP \(bu 2
  8616. \fB\-\-lavfi\-complex=\(aq[aid1] asplit [t1] [ao] ; [t1] showvolume [t2] ; [vid1] [t2] overlay [vo]\(aq\fP
  8617. Play audio track 1, and overlay the measured volume for each speaker
  8618. over video track 1.
  8619. .IP \(bu 2
  8620. \fBnull:// \-\-lavfi\-complex=\(aqlife [vo]\(aq\fP
  8621. A libavfilter source\-only filter (Conways\(aq Life Game).
  8622. .UNINDENT
  8623. .UNINDENT
  8624. .UNINDENT
  8625. .sp
  8626. See the FFmpeg libavfilter documentation for details on the available
  8627. filters.
  8628. .TP
  8629. .B \fB\-\-metadata\-codepage=<codepage>\fP
  8630. Codepage for various input metadata (default: \fButf\-8\fP). This affects how
  8631. file tags, chapter titles, etc. are interpreted. You can for example set
  8632. this to \fBauto\fP to enable autodetection of the codepage. (This is not the
  8633. default because non\-UTF\-8 codepages are an obscure fringe use\-case.)
  8634. .sp
  8635. See \fB\-\-sub\-codepage\fP option on how codepages are specified and further
  8636. details regarding autodetection and codepage conversion. (The underlying
  8637. code is the same.)
  8638. .sp
  8639. Conversion is not applied to metadata that is updated at runtime.
  8640. .UNINDENT
  8641. .SS Debugging
  8642. .INDENT 0.0
  8643. .TP
  8644. .B \fB\-\-unittest=<name>\fP
  8645. Run an internal unit test. There are multiple, and the name specifies which.
  8646. .sp
  8647. The special value \fBall\-simple\fP runs all tests which do not need further
  8648. setup (other arguments and such). Some tests may need additional arguments
  8649. to do anything useful.
  8650. .sp
  8651. On success, the player binary exits with exit status 0, otherwise it returns
  8652. with an undefined non\-0 exit status (it may crash or abort itself on test
  8653. failures).
  8654. .sp
  8655. This is only enabled if built with \fB\-\-enable\-tests\fP, and should normally
  8656. be enabled and used by developers only.
  8657. .UNINDENT
  8658. .SH AUDIO OUTPUT DRIVERS
  8659. .sp
  8660. Audio output drivers are interfaces to different audio output facilities. The
  8661. syntax is:
  8662. .INDENT 0.0
  8663. .TP
  8664. .B \fB\-\-ao=<driver1,driver2,...[,]>\fP
  8665. Specify a priority list of audio output drivers to be used.
  8666. .UNINDENT
  8667. .sp
  8668. If the list has a trailing \(aq,\(aq, mpv will fall back on drivers not contained
  8669. in the list.
  8670. .sp
  8671. \fBNOTE:\fP
  8672. .INDENT 0.0
  8673. .INDENT 3.5
  8674. See \fB\-\-ao=help\fP for a list of compiled\-in audio output drivers. The
  8675. driver \fB\-\-ao=alsa\fP is preferred. \fB\-\-ao=pulse\fP is preferred on systems
  8676. where PulseAudio is used. On BSD systems, \fB\-\-ao=oss\fP or \fB\-\-ao=sndio\fP
  8677. may work (the latter being experimental).
  8678. .UNINDENT
  8679. .UNINDENT
  8680. .sp
  8681. Available audio output drivers are:
  8682. .INDENT 0.0
  8683. .TP
  8684. .B \fBalsa\fP (Linux only)
  8685. ALSA audio output driver
  8686. .sp
  8687. See \fI\%ALSA audio output options\fP for options specific to this AO.
  8688. .sp
  8689. \fBWARNING:\fP
  8690. .INDENT 7.0
  8691. .INDENT 3.5
  8692. To get multichannel/surround audio, use \fB\-\-audio\-channels=auto\fP\&. The
  8693. default for this option is \fBauto\-safe\fP, which makes this audio output
  8694. explicitly reject multichannel output, as there is no way to detect
  8695. whether a certain channel layout is actually supported.
  8696. .sp
  8697. You can also try \fI\%using the upmix plugin\fP\&.
  8698. This setup enables multichannel audio on the \fBdefault\fP device
  8699. with automatic upmixing with shared access, so playing stereo
  8700. and multichannel audio at the same time will work as expected.
  8701. .UNINDENT
  8702. .UNINDENT
  8703. .TP
  8704. .B \fBoss\fP
  8705. OSS audio output driver
  8706. .sp
  8707. The following global options are supported by this audio output:
  8708. .INDENT 7.0
  8709. .TP
  8710. .B \fB\-\-oss\-mixer\-device\fP
  8711. Sets the audio mixer device (default: \fB/dev/mixer\fP).
  8712. .TP
  8713. .B \fB\-\-oss\-mixer\-channel\fP
  8714. Sets the audio mixer channel (default: \fBpcm\fP). Other valid values
  8715. include \fBvol, pcm, line\fP\&. For a complete list of options look for
  8716. \fBSOUND_DEVICE_NAMES\fP in \fB/usr/include/linux/soundcard.h\fP\&.
  8717. .UNINDENT
  8718. .TP
  8719. .B \fBjack\fP
  8720. JACK (Jack Audio Connection Kit) audio output driver.
  8721. .sp
  8722. The following global options are supported by this audio output:
  8723. .INDENT 7.0
  8724. .TP
  8725. .B \fB\-\-jack\-port=<name>\fP
  8726. Connects to the ports with the given name (default: physical ports).
  8727. .TP
  8728. .B \fB\-\-jack\-name=<client>\fP
  8729. Client name that is passed to JACK (default: \fBmpv\fP). Useful
  8730. if you want to have certain connections established automatically.
  8731. .TP
  8732. .B \fB\-\-jack\-autostart=<yes|no>\fP
  8733. Automatically start jackd if necessary (default: disabled). Note that
  8734. this tends to be unreliable and will flood stdout with server messages.
  8735. .TP
  8736. .B \fB\-\-jack\-connect=<yes|no>\fP
  8737. Automatically create connections to output ports (default: enabled).
  8738. When enabled, the maximum number of output channels will be limited to
  8739. the number of available output ports.
  8740. .TP
  8741. .B \fB\-\-jack\-std\-channel\-layout=<waveext|any>\fP
  8742. Select the standard channel layout (default: waveext). JACK itself has no
  8743. notion of channel layouts (i.e. assigning which speaker a given
  8744. channel is supposed to map to) \- it just takes whatever the application
  8745. outputs, and reroutes it to whatever the user defines. This means the
  8746. user and the application are in charge of dealing with the channel
  8747. layout. \fBwaveext\fP uses WAVE_FORMAT_EXTENSIBLE order, which, even
  8748. though it was defined by Microsoft, is the standard on many systems.
  8749. The value \fBany\fP makes JACK accept whatever comes from the audio
  8750. filter chain, regardless of channel layout and without reordering. This
  8751. mode is probably not very useful, other than for debugging or when used
  8752. with fixed setups.
  8753. .UNINDENT
  8754. .TP
  8755. .B \fBcoreaudio\fP (Mac OS X only)
  8756. Native Mac OS X audio output driver using AudioUnits and the CoreAudio
  8757. sound server.
  8758. .sp
  8759. Automatically redirects to \fBcoreaudio_exclusive\fP when playing compressed
  8760. formats.
  8761. .sp
  8762. The following global options are supported by this audio output:
  8763. .INDENT 7.0
  8764. .TP
  8765. .B \fB\-\-coreaudio\-change\-physical\-format=<yes|no>\fP
  8766. Change the physical format to one similar to the requested audio format
  8767. (default: no). This has the advantage that multichannel audio output
  8768. will actually work. The disadvantage is that it will change the
  8769. system\-wide audio settings. This is equivalent to changing the \fBFormat\fP
  8770. setting in the \fBAudio Devices\fP dialog in the \fBAudio MIDI Setup\fP
  8771. utility. Note that this does not affect the selected speaker setup.
  8772. .TP
  8773. .B \fB\-\-coreaudio\-spdif\-hack=<yes|no>\fP
  8774. Try to pass through AC3/DTS data as PCM. This is useful for drivers
  8775. which do not report AC3 support. It converts the AC3 data to float,
  8776. and assumes the driver will do the inverse conversion, which means
  8777. a typical A/V receiver will pick it up as compressed IEC framed AC3
  8778. stream, ignoring that it\(aqs marked as PCM. This disables normal AC3
  8779. passthrough (even if the device reports it as supported). Use with
  8780. extreme care.
  8781. .UNINDENT
  8782. .TP
  8783. .B \fBcoreaudio_exclusive\fP (Mac OS X only)
  8784. Native Mac OS X audio output driver using direct device access and
  8785. exclusive mode (bypasses the sound server).
  8786. .TP
  8787. .B \fBopenal\fP
  8788. OpenAL audio output driver
  8789. .INDENT 7.0
  8790. .TP
  8791. .B \fB\-\-openal\-num\-buffers=<2\-128>\fP
  8792. Specify the number of audio buffers to use. Lower values are better for
  8793. lower CPU usage. Default: 4.
  8794. .TP
  8795. .B \fB\-\-openal\-num\-samples=<256\-32768>\fP
  8796. Specify the number of complete samples to use for each buffer. Higher
  8797. values are better for lower CPU usage. Default: 8192.
  8798. .TP
  8799. .B \fB\-\-openal\-direct\-channels=<yes|no>\fP
  8800. Enable OpenAL Soft\(aqs direct channel extension when available to avoid
  8801. tinting the sound with ambisonics or HRTF.
  8802. Channels are dropped when when they are not available as downmixing
  8803. will be disabled. Default: no.
  8804. .UNINDENT
  8805. .TP
  8806. .B \fBpulse\fP
  8807. PulseAudio audio output driver
  8808. .sp
  8809. The following global options are supported by this audio output:
  8810. .INDENT 7.0
  8811. .TP
  8812. .B \fB\-\-pulse\-host=<host>\fP
  8813. Specify the host to use. An empty <host> string uses a local connection,
  8814. "localhost" uses network transfer (most likely not what you want).
  8815. .TP
  8816. .B \fB\-\-pulse\-buffer=<1\-2000|native>\fP
  8817. Set the audio buffer size in milliseconds. A higher value buffers
  8818. more data, and has a lower probability of buffer underruns. A smaller
  8819. value makes the audio stream react faster, e.g. to playback speed
  8820. changes.
  8821. .TP
  8822. .B \fB\-\-pulse\-latency\-hacks=<yes|no>\fP
  8823. Enable hacks to workaround PulseAudio timing bugs (default: no). If
  8824. enabled, mpv will do elaborate latency calculations on its own. If
  8825. disabled, it will use PulseAudio automatically updated timing
  8826. information. Disabling this might help with e.g. networked audio or
  8827. some plugins, while enabling it might help in some unknown situations
  8828. (it used to be required to get good behavior on old PulseAudio versions).
  8829. .sp
  8830. If you have stuttering video when using pulse, try to enable this
  8831. option. (Or try to update PulseAudio.)
  8832. .TP
  8833. .B \fB\-\-pulse\-allow\-suspended=<yes|no>\fP
  8834. Allow mpv to use PulseAudio even if the sink is suspended (default: no).
  8835. 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.
  8836. .UNINDENT
  8837. .TP
  8838. .B \fBsdl\fP
  8839. SDL 1.2+ audio output driver. Should work on any platform supported by SDL
  8840. 1.2, but may require the \fBSDL_AUDIODRIVER\fP environment variable to be set
  8841. appropriately for your system.
  8842. .sp
  8843. \fBNOTE:\fP
  8844. .INDENT 7.0
  8845. .INDENT 3.5
  8846. This driver is for compatibility with extremely foreign
  8847. environments, such as systems where none of the other drivers
  8848. are available.
  8849. .UNINDENT
  8850. .UNINDENT
  8851. .sp
  8852. The following global options are supported by this audio output:
  8853. .INDENT 7.0
  8854. .TP
  8855. .B \fB\-\-sdl\-buflen=<length>\fP
  8856. Sets the audio buffer length in seconds. Is used only as a hint by the
  8857. sound system. Playing a file with \fB\-v\fP will show the requested and
  8858. obtained exact buffer size. A value of 0 selects the sound system
  8859. default.
  8860. .TP
  8861. .B \fB\-\-sdl\-bufcnt=<count>\fP
  8862. Sets the number of extra audio buffers in mpv. Usually needs not be
  8863. changed.
  8864. .UNINDENT
  8865. .TP
  8866. .B \fBnull\fP
  8867. Produces no audio output but maintains video playback speed. You can use
  8868. \fB\-\-ao=null \-\-ao\-null\-untimed\fP for benchmarking.
  8869. .sp
  8870. The following global options are supported by this audio output:
  8871. .INDENT 7.0
  8872. .TP
  8873. .B \fB\-\-ao\-null\-untimed\fP
  8874. Do not simulate timing of a perfect audio device. This means audio
  8875. decoding will go as fast as possible, instead of timing it to the
  8876. system clock.
  8877. .TP
  8878. .B \fB\-\-ao\-null\-buffer\fP
  8879. Simulated buffer length in seconds.
  8880. .TP
  8881. .B \fB\-\-ao\-null\-outburst\fP
  8882. Simulated chunk size in samples.
  8883. .TP
  8884. .B \fB\-\-ao\-null\-speed\fP
  8885. Simulated audio playback speed as a multiplier. Usually, a real audio
  8886. device will not go exactly as fast as the system clock. It will deviate
  8887. just a little, and this option helps to simulate this.
  8888. .TP
  8889. .B \fB\-\-ao\-null\-latency\fP
  8890. Simulated device latency. This is additional to EOF.
  8891. .TP
  8892. .B \fB\-\-ao\-null\-broken\-eof\fP
  8893. Simulate broken audio drivers, which always add the fixed device
  8894. latency to the reported audio playback position.
  8895. .TP
  8896. .B \fB\-\-ao\-null\-broken\-delay\fP
  8897. Simulate broken audio drivers, which don\(aqt report latency correctly.
  8898. .TP
  8899. .B \fB\-\-ao\-null\-channel\-layouts\fP
  8900. If not empty, this is a \fB,\fP separated list of channel layouts the
  8901. AO allows. This can be used to test channel layout selection.
  8902. .TP
  8903. .B \fB\-\-ao\-null\-format\fP
  8904. Force the audio output format the AO will accept. If unset accepts any.
  8905. .UNINDENT
  8906. .TP
  8907. .B \fBpcm\fP
  8908. Raw PCM/WAVE file writer audio output
  8909. .sp
  8910. The following global options are supported by this audio output:
  8911. .INDENT 7.0
  8912. .TP
  8913. .B \fB\-\-ao\-pcm\-waveheader=<yes|no>\fP
  8914. Include or do not include the WAVE header (default: included). When
  8915. not included, raw PCM will be generated.
  8916. .TP
  8917. .B \fB\-\-ao\-pcm\-file=<filename>\fP
  8918. Write the sound to \fB<filename>\fP instead of the default
  8919. \fBaudiodump.wav\fP\&. If \fBno\-waveheader\fP is specified, the default is
  8920. \fBaudiodump.pcm\fP\&.
  8921. .TP
  8922. .B \fB\-\-ao\-pcm\-append=<yes|no>\fP
  8923. Append to the file, instead of overwriting it. Always use this with the
  8924. \fBno\-waveheader\fP option \- with \fBwaveheader\fP it\(aqs broken, because
  8925. it will write a WAVE header every time the file is opened.
  8926. .UNINDENT
  8927. .TP
  8928. .B \fBrsound\fP
  8929. Audio output to an RSound daemon. Use \fB\-\-audio\-device=rsound/<hostname>\fP
  8930. to set the host name (with \fB<hostname>\fP replaced, without the \fB< >\fP).
  8931. .sp
  8932. \fBNOTE:\fP
  8933. .INDENT 7.0
  8934. .INDENT 3.5
  8935. Completely useless, unless you intend to run RSound. Not to be
  8936. confused with RoarAudio, which is something completely
  8937. different.
  8938. .UNINDENT
  8939. .UNINDENT
  8940. .TP
  8941. .B \fBsndio\fP
  8942. Audio output to the OpenBSD sndio sound system
  8943. .sp
  8944. \fBNOTE:\fP
  8945. .INDENT 7.0
  8946. .INDENT 3.5
  8947. Experimental. There are known bugs and issues.
  8948. .UNINDENT
  8949. .UNINDENT
  8950. .sp
  8951. (Note: only supports mono, stereo, 4.0, 5.1 and 7.1 channel
  8952. layouts.)
  8953. .TP
  8954. .B \fBwasapi\fP
  8955. Audio output to the Windows Audio Session API.
  8956. .UNINDENT
  8957. .SH VIDEO OUTPUT DRIVERS
  8958. .sp
  8959. Video output drivers are interfaces to different video output facilities. The
  8960. syntax is:
  8961. .INDENT 0.0
  8962. .TP
  8963. .B \fB\-\-vo=<driver1,driver2,...[,]>\fP
  8964. Specify a priority list of video output drivers to be used.
  8965. .UNINDENT
  8966. .sp
  8967. If the list has a trailing \fB,\fP, mpv will fall back on drivers not contained
  8968. in the list.
  8969. .sp
  8970. \fBNOTE:\fP
  8971. .INDENT 0.0
  8972. .INDENT 3.5
  8973. See \fB\-\-vo=help\fP for a list of compiled\-in video output drivers.
  8974. .sp
  8975. The recommended output driver is \fB\-\-vo=gpu\fP, which is the default. All
  8976. other drivers are for compatibility or special purposes. If the default
  8977. does not work, it will fallback to other drivers (in the same order as
  8978. listed by \fB\-\-vo=help\fP).
  8979. .UNINDENT
  8980. .UNINDENT
  8981. .sp
  8982. Available video output drivers are:
  8983. .INDENT 0.0
  8984. .TP
  8985. .B \fBxv\fP (X11 only)
  8986. Uses the XVideo extension to enable hardware\-accelerated display. This is
  8987. the most compatible VO on X, but may be low\-quality, and has issues with
  8988. OSD and subtitle display.
  8989. .sp
  8990. \fBNOTE:\fP
  8991. .INDENT 7.0
  8992. .INDENT 3.5
  8993. This driver is for compatibility with old systems.
  8994. .UNINDENT
  8995. .UNINDENT
  8996. .sp
  8997. The following global options are supported by this video output:
  8998. .INDENT 7.0
  8999. .TP
  9000. .B \fB\-\-xv\-adaptor=<number>\fP
  9001. Select a specific XVideo adapter (check xvinfo results).
  9002. .TP
  9003. .B \fB\-\-xv\-port=<number>\fP
  9004. Select a specific XVideo port.
  9005. .TP
  9006. .B \fB\-\-xv\-ck=<cur|use|set>\fP
  9007. Select the source from which the color key is taken (default: cur).
  9008. .INDENT 7.0
  9009. .TP
  9010. .B cur
  9011. The default takes the color key currently set in Xv.
  9012. .TP
  9013. .B use
  9014. Use but do not set the color key from mpv (use the \fB\-\-colorkey\fP
  9015. option to change it).
  9016. .TP
  9017. .B set
  9018. Same as use but also sets the supplied color key.
  9019. .UNINDENT
  9020. .TP
  9021. .B \fB\-\-xv\-ck\-method=<none|man|bg|auto>\fP
  9022. Sets the color key drawing method (default: man).
  9023. .INDENT 7.0
  9024. .TP
  9025. .B none
  9026. Disables color\-keying.
  9027. .TP
  9028. .B man
  9029. Draw the color key manually (reduces flicker in some cases).
  9030. .TP
  9031. .B bg
  9032. Set the color key as window background.
  9033. .TP
  9034. .B auto
  9035. Let Xv draw the color key.
  9036. .UNINDENT
  9037. .TP
  9038. .B \fB\-\-xv\-colorkey=<number>\fP
  9039. Changes the color key to an RGB value of your choice. \fB0x000000\fP is
  9040. black and \fB0xffffff\fP is white.
  9041. .TP
  9042. .B \fB\-\-xv\-buffers=<number>\fP
  9043. Number of image buffers to use for the internal ringbuffer (default: 2).
  9044. Increasing this will use more memory, but might help with the X server
  9045. not responding quickly enough if video FPS is close to or higher than
  9046. the display refresh rate.
  9047. .UNINDENT
  9048. .TP
  9049. .B \fBx11\fP (X11 only)
  9050. Shared memory video output driver without hardware acceleration that works
  9051. whenever X11 is present.
  9052. .sp
  9053. Since mpv 0.30.0, you may need to use \fB\-\-profile=sw\-fast\fP to get decent
  9054. performance.
  9055. .sp
  9056. \fBNOTE:\fP
  9057. .INDENT 7.0
  9058. .INDENT 3.5
  9059. This is a fallback only, and should not be normally used.
  9060. .UNINDENT
  9061. .UNINDENT
  9062. .TP
  9063. .B \fBvdpau\fP (X11 only)
  9064. Uses the VDPAU interface to display and optionally also decode video.
  9065. Hardware decoding is used with \fB\-\-hwdec=vdpau\fP\&.
  9066. .sp
  9067. \fBNOTE:\fP
  9068. .INDENT 7.0
  9069. .INDENT 3.5
  9070. Earlier versions of mpv (and MPlayer, mplayer2) provided sub\-options
  9071. to tune vdpau post\-processing, like \fBdeint\fP, \fBsharpen\fP, \fBdenoise\fP,
  9072. \fBchroma\-deint\fP, \fBpullup\fP, \fBhqscaling\fP\&. These sub\-options are
  9073. deprecated, and you should use the \fBvdpaupp\fP video filter instead.
  9074. .UNINDENT
  9075. .UNINDENT
  9076. .sp
  9077. The following global options are supported by this video output:
  9078. .INDENT 7.0
  9079. .TP
  9080. .B \fB\-\-vo\-vdpau\-sharpen=<\-1\-1>\fP
  9081. (Deprecated. See note about \fBvdpaupp\fP\&.)
  9082. .sp
  9083. For positive values, apply a sharpening algorithm to the video, for
  9084. negative values a blurring algorithm (default: 0).
  9085. .TP
  9086. .B \fB\-\-vo\-vdpau\-denoise=<0\-1>\fP
  9087. (Deprecated. See note about \fBvdpaupp\fP\&.)
  9088. .sp
  9089. Apply a noise reduction algorithm to the video (default: 0; no noise
  9090. reduction).
  9091. .TP
  9092. .B \fB\-\-vo\-vdpau\-deint=<\-4\-4>\fP
  9093. (Deprecated. See note about \fBvdpaupp\fP\&.)
  9094. .sp
  9095. Select deinterlacing mode (default: 0). In older versions (as well as
  9096. MPlayer/mplayer2) you could use this option to enable deinterlacing.
  9097. This doesn\(aqt work anymore, and deinterlacing is enabled with either
  9098. the \fBd\fP key (by default mapped to the command \fBcycle deinterlace\fP),
  9099. or the \fB\-\-deinterlace\fP option. Also, to select the default deint mode,
  9100. you should use something like \fB\-\-vf\-defaults=vdpaupp:deint\-mode=temporal\fP
  9101. instead of this sub\-option.
  9102. .INDENT 7.0
  9103. .TP
  9104. .B 0
  9105. Pick the \fBvdpaupp\fP video filter default, which corresponds to 3.
  9106. .TP
  9107. .B 1
  9108. Show only first field.
  9109. .TP
  9110. .B 2
  9111. Bob deinterlacing.
  9112. .TP
  9113. .B 3
  9114. Motion\-adaptive temporal deinterlacing. May lead to A/V desync
  9115. with slow video hardware and/or high resolution.
  9116. .TP
  9117. .B 4
  9118. Motion\-adaptive temporal deinterlacing with edge\-guided spatial
  9119. interpolation. Needs fast video hardware.
  9120. .UNINDENT
  9121. .TP
  9122. .B \fB\-\-vo\-vdpau\-chroma\-deint\fP
  9123. (Deprecated. See note about \fBvdpaupp\fP\&.)
  9124. .sp
  9125. Makes temporal deinterlacers operate both on luma and chroma (default).
  9126. Use no\-chroma\-deint to solely use luma and speed up advanced
  9127. deinterlacing. Useful with slow video memory.
  9128. .TP
  9129. .B \fB\-\-vo\-vdpau\-pullup\fP
  9130. (Deprecated. See note about \fBvdpaupp\fP\&.)
  9131. .sp
  9132. Try to apply inverse telecine, needs motion adaptive temporal
  9133. deinterlacing.
  9134. .TP
  9135. .B \fB\-\-vo\-vdpau\-hqscaling=<0\-9>\fP
  9136. (Deprecated. See note about \fBvdpaupp\fP\&.)
  9137. .INDENT 7.0
  9138. .TP
  9139. .B 0
  9140. Use default VDPAU scaling (default).
  9141. .TP
  9142. .B 1\-9
  9143. Apply high quality VDPAU scaling (needs capable hardware).
  9144. .UNINDENT
  9145. .TP
  9146. .B \fB\-\-vo\-vdpau\-fps=<number>\fP
  9147. Override autodetected display refresh rate value (the value is needed
  9148. for framedrop to allow video playback rates higher than display
  9149. refresh rate, and for vsync\-aware frame timing adjustments). Default 0
  9150. means use autodetected value. A positive value is interpreted as a
  9151. refresh rate in Hz and overrides the autodetected value. A negative
  9152. value disables all timing adjustment and framedrop logic.
  9153. .TP
  9154. .B \fB\-\-vo\-vdpau\-composite\-detect\fP
  9155. NVIDIA\(aqs current VDPAU implementation behaves somewhat differently
  9156. under a compositing window manager and does not give accurate frame
  9157. timing information. With this option enabled, the player tries to
  9158. detect whether a compositing window manager is active. If one is
  9159. detected, the player disables timing adjustments as if the user had
  9160. specified \fBfps=\-1\fP (as they would be based on incorrect input). This
  9161. means timing is somewhat less accurate than without compositing, but
  9162. with the composited mode behavior of the NVIDIA driver, there is no
  9163. hard playback speed limit even without the disabled logic. Enabled by
  9164. default, use \fB\-\-vo\-vdpau\-composite\-detect=no\fP to disable.
  9165. .TP
  9166. .B \fB\-\-vo\-vdpau\-queuetime\-windowed=<number>\fP and \fBqueuetime\-fs=<number>\fP
  9167. Use VDPAU\(aqs presentation queue functionality to queue future video
  9168. frame changes at most this many milliseconds in advance (default: 50).
  9169. See below for additional information.
  9170. .TP
  9171. .B \fB\-\-vo\-vdpau\-output\-surfaces=<2\-15>\fP
  9172. Allocate this many output surfaces to display video frames (default:
  9173. 3). See below for additional information.
  9174. .TP
  9175. .B \fB\-\-vo\-vdpau\-colorkey=<#RRGGBB|#AARRGGBB>\fP
  9176. Set the VDPAU presentation queue background color, which in practice
  9177. is the colorkey used if VDPAU operates in overlay mode (default:
  9178. \fB#020507\fP, some shade of black). If the alpha component of this value
  9179. is 0, the default VDPAU colorkey will be used instead (which is usually
  9180. green).
  9181. .TP
  9182. .B \fB\-\-vo\-vdpau\-force\-yuv\fP
  9183. Never accept RGBA input. This means mpv will insert a filter to convert
  9184. to a YUV format before the VO. Sometimes useful to force availability
  9185. of certain YUV\-only features, like video equalizer or deinterlacing.
  9186. .UNINDENT
  9187. .sp
  9188. Using the VDPAU frame queuing functionality controlled by the queuetime
  9189. options makes mpv\(aqs frame flip timing less sensitive to system CPU load and
  9190. allows mpv to start decoding the next frame(s) slightly earlier, which can
  9191. reduce jitter caused by individual slow\-to\-decode frames. However, the
  9192. NVIDIA graphics drivers can make other window behavior such as window moves
  9193. choppy if VDPAU is using the blit queue (mainly happens if you have the
  9194. composite extension enabled) and this feature is active. If this happens on
  9195. your system and it bothers you then you can set the queuetime value to 0 to
  9196. disable this feature. The settings to use in windowed and fullscreen mode
  9197. are separate because there should be no reason to disable this for
  9198. fullscreen mode (as the driver issue should not affect the video itself).
  9199. .sp
  9200. You can queue more frames ahead by increasing the queuetime values and the
  9201. \fBoutput_surfaces\fP count (to ensure enough surfaces to buffer video for a
  9202. certain time ahead you need at least as many surfaces as the video has
  9203. frames during that time, plus two). This could help make video smoother in
  9204. some cases. The main downsides are increased video RAM requirements for
  9205. the surfaces and laggier display response to user commands (display
  9206. changes only become visible some time after they\(aqre queued). The graphics
  9207. driver implementation may also have limits on the length of maximum
  9208. queuing time or number of queued surfaces that work well or at all.
  9209. .TP
  9210. .B \fBdirect3d\fP (Windows only)
  9211. Video output driver that uses the Direct3D interface.
  9212. .sp
  9213. \fBNOTE:\fP
  9214. .INDENT 7.0
  9215. .INDENT 3.5
  9216. This driver is for compatibility with systems that don\(aqt provide
  9217. proper OpenGL drivers, and where ANGLE does not perform well.
  9218. .UNINDENT
  9219. .UNINDENT
  9220. .sp
  9221. \fBNOTE:\fP
  9222. .INDENT 7.0
  9223. .INDENT 3.5
  9224. Before to 0.21.0, \fBdirect3d_shaders\fP and \fBdirect3d\fP were
  9225. different, with \fBdirect3d\fP not using shader by default. Now
  9226. both use shaders by default, and \fBdirect3d_shaders\fP is a
  9227. deprecated alias. Use the \fB\-\-vo\-direct3d\-prefer\-stretchrect\fP
  9228. or the \fB\-\-vo\-direct3d\-disable\-shaders\fP options to get the old
  9229. behavior of \fBdirect3d\fP\&.
  9230. .UNINDENT
  9231. .UNINDENT
  9232. .sp
  9233. The following global options are supported by this video output:
  9234. .INDENT 7.0
  9235. .TP
  9236. .B \fB\-\-vo\-direct3d\-prefer\-stretchrect\fP
  9237. Use \fBIDirect3DDevice9::StretchRect\fP over other methods if possible.
  9238. .TP
  9239. .B \fB\-\-vo\-direct3d\-disable\-stretchrect\fP
  9240. Never render the video using \fBIDirect3DDevice9::StretchRect\fP\&.
  9241. .TP
  9242. .B \fB\-\-vo\-direct3d\-disable\-textures\fP
  9243. Never render the video using D3D texture rendering. Rendering with
  9244. textures + shader will still be allowed. Add \fBdisable\-shaders\fP to
  9245. completely disable video rendering with textures.
  9246. .TP
  9247. .B \fB\-\-vo\-direct3d\-disable\-shaders\fP
  9248. Never use shaders when rendering video.
  9249. .TP
  9250. .B \fB\-\-vo\-direct3d\-only\-8bit\fP
  9251. Never render YUV video with more than 8 bits per component.
  9252. Using this flag will force software conversion to 8\-bit.
  9253. .TP
  9254. .B \fB\-\-vo\-direct3d\-disable\-texture\-align\fP
  9255. Normally texture sizes are always aligned to 16. With this option
  9256. enabled, the video texture will always have exactly the same size as
  9257. the video itself.
  9258. .UNINDENT
  9259. .sp
  9260. Debug options. These might be incorrect, might be removed in the future,
  9261. might crash, might cause slow downs, etc. Contact the developers if you
  9262. actually need any of these for performance or proper operation.
  9263. .INDENT 7.0
  9264. .TP
  9265. .B \fB\-\-vo\-direct3d\-force\-power\-of\-2\fP
  9266. Always force textures to power of 2, even if the device reports
  9267. non\-power\-of\-2 texture sizes as supported.
  9268. .TP
  9269. .B \fB\-\-vo\-direct3d\-texture\-memory=<mode>\fP
  9270. Only affects operation with shaders/texturing enabled, and (E)OSD.
  9271. Possible values:
  9272. .INDENT 7.0
  9273. .TP
  9274. .B \fBdefault\fP (default)
  9275. Use \fBD3DPOOL_DEFAULT\fP, with a \fBD3DPOOL_SYSTEMMEM\fP texture for
  9276. locking. If the driver supports \fBD3DDEVCAPS_TEXTURESYSTEMMEMORY\fP,
  9277. \fBD3DPOOL_SYSTEMMEM\fP is used directly.
  9278. .TP
  9279. .B \fBdefault\-pool\fP
  9280. Use \fBD3DPOOL_DEFAULT\fP\&. (Like \fBdefault\fP, but never use a
  9281. shadow\-texture.)
  9282. .TP
  9283. .B \fBdefault\-pool\-shadow\fP
  9284. Use \fBD3DPOOL_DEFAULT\fP, with a \fBD3DPOOL_SYSTEMMEM\fP texture for
  9285. locking. (Like \fBdefault\fP, but always force the shadow\-texture.)
  9286. .TP
  9287. .B \fBmanaged\fP
  9288. Use \fBD3DPOOL_MANAGED\fP\&.
  9289. .TP
  9290. .B \fBscratch\fP
  9291. Use \fBD3DPOOL_SCRATCH\fP, with a \fBD3DPOOL_SYSTEMMEM\fP texture for
  9292. locking.
  9293. .UNINDENT
  9294. .TP
  9295. .B \fB\-\-vo\-direct3d\-swap\-discard\fP
  9296. Use \fBD3DSWAPEFFECT_DISCARD\fP, which might be faster.
  9297. Might be slower too, as it must(?) clear every frame.
  9298. .TP
  9299. .B \fB\-\-vo\-direct3d\-exact\-backbuffer\fP
  9300. Always resize the backbuffer to window size.
  9301. .UNINDENT
  9302. .TP
  9303. .B \fBgpu\fP
  9304. General purpose, customizable, GPU\-accelerated video output driver. It
  9305. supports extended scaling methods, dithering, color management, custom
  9306. shaders, HDR, and more.
  9307. .sp
  9308. See \fI\%GPU renderer options\fP for options specific to this VO.
  9309. .sp
  9310. By default, it tries to use fast and fail\-safe settings. Use the
  9311. \fBgpu\-hq\fP profile to use this driver with defaults set to high quality
  9312. rendering. The profile can be applied with \fB\-\-profile=gpu\-hq\fP and its
  9313. contents can be viewed with \fB\-\-show\-profile=gpu\-hq\fP\&.
  9314. .sp
  9315. This VO abstracts over several possible graphics APIs and windowing
  9316. contexts, which can be influenced using the \fB\-\-gpu\-api\fP and
  9317. \fB\-\-gpu\-context\fP options.
  9318. .sp
  9319. Hardware decoding over OpenGL\-interop is supported to some degree. Note
  9320. that in this mode, some corner case might not be gracefully handled, and
  9321. color space conversion and chroma upsampling is generally in the hand of
  9322. the hardware decoder APIs.
  9323. .sp
  9324. \fBgpu\fP makes use of FBOs by default. Sometimes you can achieve better
  9325. quality or performance by changing the \fB\-\-gpu\-fbo\-format\fP option to
  9326. \fBrgb16f\fP, \fBrgb32f\fP or \fBrgb\fP\&. Known problems include Mesa/Intel not
  9327. accepting \fBrgb16\fP, Mesa sometimes not being compiled with float texture
  9328. support, and some OS X setups being very slow with \fBrgb16\fP but fast
  9329. with \fBrgb32f\fP\&. If you have problems, you can also try enabling the
  9330. \fB\-\-gpu\-dumb\-mode=yes\fP option.
  9331. .TP
  9332. .B \fBsdl\fP
  9333. SDL 2.0+ Render video output driver, depending on system with or without
  9334. hardware acceleration. Should work on all platforms supported by SDL 2.0.
  9335. For tuning, refer to your copy of the file \fBSDL_hints.h\fP\&.
  9336. .sp
  9337. \fBNOTE:\fP
  9338. .INDENT 7.0
  9339. .INDENT 3.5
  9340. This driver is for compatibility with systems that don\(aqt provide
  9341. proper graphics drivers.
  9342. .UNINDENT
  9343. .UNINDENT
  9344. .sp
  9345. The following global options are supported by this video output:
  9346. .INDENT 7.0
  9347. .TP
  9348. .B \fB\-\-sdl\-sw\fP
  9349. Continue even if a software renderer is detected.
  9350. .TP
  9351. .B \fB\-\-sdl\-switch\-mode\fP
  9352. Instruct SDL to switch the monitor video mode when going fullscreen.
  9353. .UNINDENT
  9354. .TP
  9355. .B \fBvaapi\fP
  9356. Intel VA API video output driver with support for hardware decoding. Note
  9357. that there is absolutely no reason to use this, other than compatibility.
  9358. This is low quality, and has issues with OSD.
  9359. .sp
  9360. \fBNOTE:\fP
  9361. .INDENT 7.0
  9362. .INDENT 3.5
  9363. This driver is for compatibility with crappy systems. You can
  9364. use vaapi hardware decoding with \fB\-\-vo=gpu\fP too.
  9365. .UNINDENT
  9366. .UNINDENT
  9367. .sp
  9368. The following global options are supported by this video output:
  9369. .INDENT 7.0
  9370. .TP
  9371. .B \fB\-\-vo\-vaapi\-scaling=<algorithm>\fP
  9372. .INDENT 7.0
  9373. .TP
  9374. .B default
  9375. Driver default (mpv default as well).
  9376. .TP
  9377. .B fast
  9378. Fast, but low quality.
  9379. .TP
  9380. .B hq
  9381. Unspecified driver dependent high\-quality scaling, slow.
  9382. .TP
  9383. .B nla
  9384. \fBnon\-linear anamorphic scaling\fP
  9385. .UNINDENT
  9386. .TP
  9387. .B \fB\-\-vo\-vaapi\-deint\-mode=<mode>\fP
  9388. Select deinterlacing algorithm. Note that by default deinterlacing is
  9389. initially always off, and needs to be enabled with the \fBd\fP key
  9390. (default key binding for \fBcycle deinterlace\fP).
  9391. .sp
  9392. This option doesn\(aqt apply if libva supports video post processing (vpp).
  9393. In this case, the default for \fBdeint\-mode\fP is \fBno\fP, and enabling
  9394. deinterlacing via user interaction using the methods mentioned above
  9395. actually inserts the \fBvavpp\fP video filter. If vpp is not actually
  9396. supported with the libva backend in use, you can use this option to
  9397. forcibly enable VO based deinterlacing.
  9398. .INDENT 7.0
  9399. .TP
  9400. .B no
  9401. Don\(aqt allow deinterlacing (default for newer libva).
  9402. .TP
  9403. .B first\-field
  9404. Show only first field.
  9405. .TP
  9406. .B bob
  9407. bob deinterlacing (default for older libva).
  9408. .UNINDENT
  9409. .TP
  9410. .B \fB\-\-vo\-vaapi\-scaled\-osd=<yes|no>\fP
  9411. If enabled, then the OSD is rendered at video resolution and scaled to
  9412. display resolution. By default, this is disabled, and the OSD is
  9413. rendered at display resolution if the driver supports it.
  9414. .UNINDENT
  9415. .TP
  9416. .B \fBnull\fP
  9417. Produces no video output. Useful for benchmarking.
  9418. .sp
  9419. Usually, it\(aqs better to disable video with \fB\-\-no\-video\fP instead.
  9420. .sp
  9421. The following global options are supported by this video output:
  9422. .INDENT 7.0
  9423. .TP
  9424. .B \fB\-\-vo\-null\-fps=<value>\fP
  9425. Simulate display FPS. This artificially limits how many frames the
  9426. VO accepts per second.
  9427. .UNINDENT
  9428. .TP
  9429. .B \fBcaca\fP
  9430. Color ASCII art video output driver that works on a text console.
  9431. .sp
  9432. \fBNOTE:\fP
  9433. .INDENT 7.0
  9434. .INDENT 3.5
  9435. This driver is a joke.
  9436. .UNINDENT
  9437. .UNINDENT
  9438. .TP
  9439. .B \fBtct\fP
  9440. Color Unicode art video output driver that works on a text console.
  9441. Depends on support of true color by modern terminals to display the images
  9442. at full color range. On Windows it requires an ansi terminal such as mintty.
  9443. .sp
  9444. Since mpv 0.30.0, you may need to use \fB\-\-profile=sw\-fast\fP to get decent
  9445. performance.
  9446. .INDENT 7.0
  9447. .TP
  9448. .B \fB\-\-vo\-tct\-algo=<algo>\fP
  9449. Select how to write the pixels to the terminal.
  9450. .INDENT 7.0
  9451. .TP
  9452. .B half\-blocks
  9453. Uses unicode LOWER HALF BLOCK character to achieve higher vertical
  9454. resolution. (Default.)
  9455. .TP
  9456. .B plain
  9457. Uses spaces. Causes vertical resolution to drop twofolds, but in
  9458. theory works in more places.
  9459. .UNINDENT
  9460. .TP
  9461. .B \fB\-\-vo\-tct\-width=<width>\fP \fB\-\-vo\-tct\-height=<height>\fP
  9462. Assume the terminal has the specified character width and/or height.
  9463. These default to 80x25 if the terminal size cannot be determined.
  9464. .TP
  9465. .B \fB\-\-vo\-tct\-256=<yes|no>\fP (default: no)
  9466. Use 256 colors \- for terminals which don\(aqt support true color.
  9467. .UNINDENT
  9468. .TP
  9469. .B \fBimage\fP
  9470. Output each frame into an image file in the current directory. Each file
  9471. takes the frame number padded with leading zeros as name.
  9472. .sp
  9473. The following global options are supported by this video output:
  9474. .INDENT 7.0
  9475. .TP
  9476. .B \fB\-\-vo\-image\-format=<format>\fP
  9477. Select the image file format.
  9478. .INDENT 7.0
  9479. .TP
  9480. .B jpg
  9481. JPEG files, extension .jpg. (Default.)
  9482. .TP
  9483. .B jpeg
  9484. JPEG files, extension .jpeg.
  9485. .TP
  9486. .B png
  9487. PNG files.
  9488. .TP
  9489. .B webp
  9490. WebP files.
  9491. .UNINDENT
  9492. .TP
  9493. .B \fB\-\-vo\-image\-png\-compression=<0\-9>\fP
  9494. PNG compression factor (speed vs. file size tradeoff) (default: 7)
  9495. .TP
  9496. .B \fB\-\-vo\-image\-png\-filter=<0\-5>\fP
  9497. Filter applied prior to PNG compression (0 = none; 1 = sub; 2 = up;
  9498. 3 = average; 4 = Paeth; 5 = mixed) (default: 5)
  9499. .TP
  9500. .B \fB\-\-vo\-image\-jpeg\-quality=<0\-100>\fP
  9501. JPEG quality factor (default: 90)
  9502. .TP
  9503. .B \fB\-\-vo\-image\-jpeg\-optimize=<0\-100>\fP
  9504. JPEG optimization factor (default: 100)
  9505. .TP
  9506. .B \fB\-\-vo\-image\-webp\-lossless=<yes|no>\fP
  9507. Enable writing lossless WebP files (default: no)
  9508. .TP
  9509. .B \fB\-\-vo\-image\-webp\-quality=<0\-100>\fP
  9510. WebP quality (default: 75)
  9511. .TP
  9512. .B \fB\-\-vo\-image\-webp\-compression=<0\-6>\fP
  9513. WebP compression factor (default: 4)
  9514. .TP
  9515. .B \fB\-\-vo\-image\-outdir=<dirname>\fP
  9516. Specify the directory to save the image files to (default: \fB\&./\fP).
  9517. .UNINDENT
  9518. .TP
  9519. .B \fBlibmpv\fP
  9520. For use with libmpv direct embedding. As a special case, on OS X it
  9521. is used like a normal VO within mpv (cocoa\-cb). Otherwise useless in any
  9522. other contexts.
  9523. (See \fB<mpv/render.h>\fP\&.)
  9524. .sp
  9525. This also supports many of the options the \fBgpu\fP VO has, depending on the
  9526. backend.
  9527. .TP
  9528. .B \fBrpi\fP (Raspberry Pi)
  9529. Native video output on the Raspberry Pi using the MMAL API.
  9530. .sp
  9531. This is deprecated. Use \fB\-\-vo=gpu\fP instead, which is the default and
  9532. provides the same functionality. The \fBrpi\fP VO will be removed in
  9533. mpv 0.23.0. Its functionality was folded into \-\-vo=gpu, which now uses
  9534. RPI hardware decoding by treating it as a hardware overlay (without applying
  9535. GL filtering). Also to be changed in 0.23.0: the \-\-fs flag will be reset to
  9536. "no" by default (like on the other platforms).
  9537. .sp
  9538. The following deprecated global options are supported by this video output:
  9539. .INDENT 7.0
  9540. .TP
  9541. .B \fB\-\-rpi\-display=<number>\fP
  9542. Select the display number on which the video overlay should be shown
  9543. (default: 0).
  9544. .TP
  9545. .B \fB\-\-rpi\-layer=<number>\fP
  9546. Select the dispmanx layer on which the video overlay should be shown
  9547. (default: \-10). Note that mpv will also use the 2 layers above the
  9548. selected layer, to handle the window background and OSD. Actual video
  9549. rendering will happen on the layer above the selected layer.
  9550. .TP
  9551. .B \fB\-\-rpi\-background=<yes|no>\fP
  9552. Whether to render a black background behind the video (default: no).
  9553. Normally it\(aqs better to kill the console framebuffer instead, which
  9554. gives better performance.
  9555. .TP
  9556. .B \fB\-\-rpi\-osd=<yes|no>\fP
  9557. Enabled by default. If disabled with \fBno\fP, no OSD layer is created.
  9558. This also means there will be no subtitles rendered.
  9559. .UNINDENT
  9560. .TP
  9561. .B \fBdrm\fP (Direct Rendering Manager)
  9562. Video output driver using Kernel Mode Setting / Direct Rendering Manager.
  9563. Should be used when one doesn\(aqt want to install full\-blown graphical
  9564. environment (e.g. no X). Does not support hardware acceleration (if you
  9565. need this, check the \fBdrm\fP backend for \fBgpu\fP VO).
  9566. .sp
  9567. Since mpv 0.30.0, you may need to use \fB\-\-profile=sw\-fast\fP to get decent
  9568. performance.
  9569. .sp
  9570. The following global options are supported by this video output:
  9571. .INDENT 7.0
  9572. .TP
  9573. .B \fB\-\-drm\-connector=[<gpu_number>.]<name>\fP
  9574. Select the connector to use (usually this is a monitor.) If \fB<name>\fP
  9575. is empty or \fBauto\fP, mpv renders the output on the first available
  9576. connector. Use \fB\-\-drm\-connector=help\fP to get a list of available
  9577. connectors. When using multiple graphic cards, use the \fB<gpu_number>\fP
  9578. argument to disambiguate.
  9579. (default: empty)
  9580. .TP
  9581. .B \fB\-\-drm\-mode=<preferred|highest|N|WxH[@R]>\fP
  9582. Mode to use (resolution and frame rate).
  9583. Possible values:
  9584. .INDENT 7.0
  9585. .TP
  9586. .B preferred
  9587. Use the preferred mode for the screen on the selected
  9588. connector. (default)
  9589. .TP
  9590. .B highest
  9591. Use the mode with the highest resolution available on the
  9592. selected connector.
  9593. .TP
  9594. .B N
  9595. Select mode by index.
  9596. .TP
  9597. .B WxH[@R]
  9598. Specify mode by width, height, and optionally refresh rate.
  9599. In case several modes match, selects the mode that comes
  9600. first in the EDID list of modes.
  9601. .UNINDENT
  9602. .sp
  9603. Use \fB\-\-drm\-mode=help\fP to get a list of available modes for all active
  9604. connectors.
  9605. .TP
  9606. .B \fB\-\-drm\-atomic=<no|auto>\fP
  9607. Toggle use of atomic modesetting. Mostly useful for debugging.
  9608. .INDENT 7.0
  9609. .TP
  9610. .B no
  9611. Use legacy modesetting.
  9612. .TP
  9613. .B auto
  9614. Use atomic modesetting, falling back to legacy modesetting if
  9615. not available. (default)
  9616. .UNINDENT
  9617. .sp
  9618. Note: Only affects \fBgpu\-context=drm\fP\&. \fBvo=drm\fP supports legacy
  9619. modesetting only.
  9620. .TP
  9621. .B \fB\-\-drm\-draw\-plane=<primary|overlay|N>\fP
  9622. Select the DRM plane to which video and OSD is drawn to, under normal
  9623. circumstances. The plane can be specified as \fBprimary\fP, which will
  9624. pick the first applicable primary plane; \fBoverlay\fP, which will pick
  9625. the first applicable overlay plane; or by index. The index is zero
  9626. based, and related to the CRTC.
  9627. (default: primary)
  9628. .sp
  9629. When using this option with the drmprime\-drm hwdec interop, only the OSD
  9630. is rendered to this plane.
  9631. .TP
  9632. .B \fB\-\-drm\-drmprime\-video\-plane=<primary|overlay|N>\fP
  9633. Select the DRM plane to use for video with the drmprime\-drm hwdec
  9634. interop (used by e.g. the rkmpp hwdec on RockChip SoCs, and v4l2 hwdec:s
  9635. on various other SoC:s). The plane is unused otherwise. This option
  9636. accepts the same values as \fB\-\-drm\-draw\-plane\fP\&. (default: overlay)
  9637. .sp
  9638. To be able to successfully play 4K video on various SoCs you might need
  9639. to set \fB\-\-drm\-draw\-plane=overlay \-\-drm\-drmprime\-video\-plane=primary\fP
  9640. and setting \fB\-\-drm\-draw\-surface\-size=1920x1080\fP, to render the OSD at a
  9641. lower resolution (the video when handled by the hwdec will be on the
  9642. drmprime\-video plane and at full 4K resolution)
  9643. .TP
  9644. .B \fB\-\-drm\-format=<xrgb8888|xrgb2101010>\fP
  9645. Select the DRM format to use (default: xrgb8888). This allows you to
  9646. choose the bit depth of the DRM mode. xrgb8888 is your usual 24 bit per
  9647. pixel/8 bits per channel packed RGB format with 8 bits of padding.
  9648. xrgb2101010 is a packed 30 bits per pixel/10 bits per channel packed RGB
  9649. format with 2 bits of padding.
  9650. .sp
  9651. There are cases when xrgb2101010 will work with the \fBdrm\fP VO, but not
  9652. with the \fBdrm\fP backend for the \fBgpu\fP VO. This is because with the
  9653. \fBgpu\fP VO, in addition to requiring support in your DRM driver,
  9654. requires support for xrgb2101010 in your EGL driver
  9655. .TP
  9656. .B \fB\-\-drm\-draw\-surface\-size=<[WxH]>\fP
  9657. Sets the size of the surface used on the draw plane. The surface will
  9658. then be upscaled to the current screen resolution. This option can be
  9659. useful when used together with the drmprime\-drm hwdec interop at high
  9660. resolutions, as it allows scaling the draw plane (which in this case
  9661. only handles the OSD) down to a size the GPU can handle.
  9662. .sp
  9663. When used without the drmprime\-drm hwdec interop this option will just
  9664. cause the video to get rendered at a different resolution and then
  9665. scaled to screen size.
  9666. .sp
  9667. Note: this option is only available with DRM atomic support.
  9668. (default: display resolution)
  9669. .UNINDENT
  9670. .TP
  9671. .B \fBmediacodec_embed\fP (Android)
  9672. Renders \fBIMGFMT_MEDIACODEC\fP frames directly to an \fBandroid.view.Surface\fP\&.
  9673. Requires \fB\-\-hwdec=mediacodec\fP for hardware decoding, along with
  9674. \fB\-\-vo=mediacodec_embed\fP and \fB\-\-wid=(intptr_t)(*android.view.Surface)\fP\&.
  9675. .sp
  9676. Since this video output driver uses native decoding and rendering routines,
  9677. many of mpv\(aqs features (subtitle rendering, OSD/OSC, video filters, etc)
  9678. are not available with this driver.
  9679. .sp
  9680. To use hardware decoding with \fB\-\-vo=gpu\fP instead, use
  9681. \fB\-\-hwdec=mediacodec\-copy\fP along with \fB\-\-gpu\-context=android\fP\&.
  9682. .TP
  9683. .B \fBwlshm\fP (Wayland only)
  9684. Shared memory video output driver without hardware acceleration that works
  9685. whenever Wayland is present.
  9686. .sp
  9687. Since mpv 0.30.0, you may need to use \fB\-\-profile=sw\-fast\fP to get decent
  9688. performance.
  9689. .sp
  9690. \fBNOTE:\fP
  9691. .INDENT 7.0
  9692. .INDENT 3.5
  9693. This is a fallback only, and should not be normally used.
  9694. .UNINDENT
  9695. .UNINDENT
  9696. .UNINDENT
  9697. .SH AUDIO FILTERS
  9698. .sp
  9699. Audio filters allow you to modify the audio stream and its properties. The
  9700. syntax is:
  9701. .INDENT 0.0
  9702. .TP
  9703. .B \fB\-\-af=...\fP
  9704. Setup a chain of audio filters. See \fB\-\-vf\fP (\fI\%VIDEO FILTERS\fP) for the
  9705. full syntax.
  9706. .UNINDENT
  9707. .sp
  9708. \fBNOTE:\fP
  9709. .INDENT 0.0
  9710. .INDENT 3.5
  9711. To get a full list of available audio filters, see \fB\-\-af=help\fP\&.
  9712. .sp
  9713. Also, keep in mind that most actual filters are available via the \fBlavfi\fP
  9714. wrapper, which gives you access to most of libavfilter\(aqs filters. This
  9715. includes all filters that have been ported from MPlayer to libavfilter.
  9716. .sp
  9717. The \fB\-\-vf\fP description describes how libavfilter can be used and how to
  9718. workaround deprecated mpv filters.
  9719. .UNINDENT
  9720. .UNINDENT
  9721. .sp
  9722. See \fB\-\-vf\fP group of options for info on how \fB\-\-af\-defaults\fP, \fB\-\-af\-add\fP,
  9723. \fB\-\-af\-pre\fP, \fB\-\-af\-del\fP, \fB\-\-af\-clr\fP, and possibly others work.
  9724. .sp
  9725. Available filters are:
  9726. .INDENT 0.0
  9727. .TP
  9728. .B \fBlavcac3enc[=options]\fP
  9729. Encode multi\-channel audio to AC\-3 at runtime using libavcodec. Supports
  9730. 16\-bit native\-endian input format, maximum 6 channels. The output is
  9731. big\-endian when outputting a raw AC\-3 stream, native\-endian when
  9732. outputting to S/PDIF. If the input sample rate is not 48 kHz, 44.1 kHz or
  9733. 32 kHz, it will be resampled to 48 kHz.
  9734. .INDENT 7.0
  9735. .TP
  9736. .B \fBtospdif=<yes|no>\fP
  9737. Output raw AC\-3 stream if \fBno\fP, output to S/PDIF for
  9738. pass\-through if \fByes\fP (default).
  9739. .TP
  9740. .B \fBbitrate=<rate>\fP
  9741. The bitrate use for the AC\-3 stream. Set it to 384 to get 384 kbps.
  9742. .sp
  9743. The default is 640. Some receivers might not be able to handle this.
  9744. .sp
  9745. Valid values: 32, 40, 48, 56, 64, 80, 96, 112, 128,
  9746. 160, 192, 224, 256, 320, 384, 448, 512, 576, 640.
  9747. .sp
  9748. The special value \fBauto\fP selects a default bitrate based on the
  9749. input channel number:
  9750. .INDENT 7.0
  9751. .TP
  9752. .B 1ch
  9753. 96
  9754. .TP
  9755. .B 2ch
  9756. 192
  9757. .TP
  9758. .B 3ch
  9759. 224
  9760. .TP
  9761. .B 4ch
  9762. 384
  9763. .TP
  9764. .B 5ch
  9765. 448
  9766. .TP
  9767. .B 6ch
  9768. 448
  9769. .UNINDENT
  9770. .TP
  9771. .B \fBminch=<n>\fP
  9772. If the input channel number is less than \fB<minch>\fP, the filter will
  9773. detach itself (default: 3).
  9774. .TP
  9775. .B \fBencoder=<name>\fP
  9776. Select the libavcodec encoder used. Currently, this should be an AC\-3
  9777. encoder, and using another codec will fail horribly.
  9778. .UNINDENT
  9779. .TP
  9780. .B \fBformat=format:srate:channels:out\-srate:out\-channels\fP
  9781. Does not do any format conversion itself. Rather, it may cause the
  9782. filter system to insert necessary conversion filters before or after this
  9783. filter if needed. It is primarily useful for controlling the audio format
  9784. going into other filters. To specify the format for audio output, see
  9785. \fB\-\-audio\-format\fP, \fB\-\-audio\-samplerate\fP, and \fB\-\-audio\-channels\fP\&. This
  9786. filter is able to force a particular format, whereas \fB\-\-audio\-*\fP
  9787. may be overridden by the ao based on output compatibility.
  9788. .sp
  9789. All parameters are optional. The first 3 parameters restrict what the filter
  9790. accepts as input. They will therefore cause conversion filters to be
  9791. inserted before this one. The \fBout\-\fP parameters tell the filters or audio
  9792. outputs following this filter how to interpret the data without actually
  9793. doing a conversion. Setting these will probably just break things unless you
  9794. really know you want this for some reason, such as testing or dealing with
  9795. broken media.
  9796. .INDENT 7.0
  9797. .TP
  9798. .B \fB<format>\fP
  9799. Force conversion to this format. Use \fB\-\-af=format=format=help\fP to get
  9800. a list of valid formats.
  9801. .TP
  9802. .B \fB<srate>\fP
  9803. Force conversion to a specific sample rate. The rate is an integer,
  9804. 48000 for example.
  9805. .TP
  9806. .B \fB<channels>\fP
  9807. Force mixing to a specific channel layout. See \fB\-\-audio\-channels\fP option
  9808. for possible values.
  9809. .UNINDENT
  9810. .sp
  9811. \fB<out\-srate>\fP
  9812. .sp
  9813. \fB<out\-channels>\fP
  9814. .sp
  9815. \fINOTE\fP: this filter used to be named \fBforce\fP\&. The old \fBformat\fP filter
  9816. used to do conversion itself, unlike this one which lets the filter system
  9817. handle the conversion.
  9818. .TP
  9819. .B \fBscaletempo[=option1:option2:...]\fP
  9820. Scales audio tempo without altering pitch, optionally synced to playback
  9821. speed (default).
  9822. .sp
  9823. This works by playing \(aqstride\(aq ms of audio at normal speed then consuming
  9824. \(aqstride*scale\(aq ms of input audio. It pieces the strides together by
  9825. blending \(aqoverlap\(aq% of stride with audio following the previous stride. It
  9826. optionally performs a short statistical analysis on the next \(aqsearch\(aq ms
  9827. of audio to determine the best overlap position.
  9828. .INDENT 7.0
  9829. .TP
  9830. .B \fBscale=<amount>\fP
  9831. Nominal amount to scale tempo. Scales this amount in addition to
  9832. speed. (default: 1.0)
  9833. .TP
  9834. .B \fBstride=<amount>\fP
  9835. Length in milliseconds to output each stride. Too high of a value will
  9836. cause noticeable skips at high scale amounts and an echo at low scale
  9837. amounts. Very low values will alter pitch. Increasing improves
  9838. performance. (default: 60)
  9839. .TP
  9840. .B \fBoverlap=<percent>\fP
  9841. Percentage of stride to overlap. Decreasing improves performance.
  9842. (default: .20)
  9843. .TP
  9844. .B \fBsearch=<amount>\fP
  9845. Length in milliseconds to search for best overlap position. Decreasing
  9846. improves performance greatly. On slow systems, you will probably want
  9847. to set this very low. (default: 14)
  9848. .TP
  9849. .B \fBspeed=<tempo|pitch|both|none>\fP
  9850. Set response to speed change.
  9851. .INDENT 7.0
  9852. .TP
  9853. .B tempo
  9854. Scale tempo in sync with speed (default).
  9855. .TP
  9856. .B pitch
  9857. Reverses effect of filter. Scales pitch without altering tempo.
  9858. Add this to your \fBinput.conf\fP to step by musical semi\-tones:
  9859. .INDENT 7.0
  9860. .INDENT 3.5
  9861. .sp
  9862. .nf
  9863. .ft C
  9864. [ multiply speed 0.9438743126816935
  9865. ] multiply speed 1.059463094352953
  9866. .ft P
  9867. .fi
  9868. .UNINDENT
  9869. .UNINDENT
  9870. .sp
  9871. \fBWARNING:\fP
  9872. .INDENT 7.0
  9873. .INDENT 3.5
  9874. Loses sync with video.
  9875. .UNINDENT
  9876. .UNINDENT
  9877. .TP
  9878. .B both
  9879. Scale both tempo and pitch.
  9880. .TP
  9881. .B none
  9882. Ignore speed changes.
  9883. .UNINDENT
  9884. .UNINDENT
  9885. .INDENT 7.0
  9886. .INDENT 3.5
  9887. .IP "Examples"
  9888. .INDENT 0.0
  9889. .TP
  9890. .B \fBmpv \-\-af=scaletempo \-\-speed=1.2 media.ogg\fP
  9891. Would play media at 1.2x normal speed, with audio at normal
  9892. pitch. Changing playback speed would change audio tempo to match.
  9893. .TP
  9894. .B \fBmpv \-\-af=scaletempo=scale=1.2:speed=none \-\-speed=1.2 media.ogg\fP
  9895. Would play media at 1.2x normal speed, with audio at normal
  9896. pitch, but changing playback speed would have no effect on audio
  9897. tempo.
  9898. .TP
  9899. .B \fBmpv \-\-af=scaletempo=stride=30:overlap=.50:search=10 media.ogg\fP
  9900. Would tweak the quality and performance parameters.
  9901. .TP
  9902. .B \fBmpv \-\-af=scaletempo=scale=1.2:speed=pitch audio.ogg\fP
  9903. Would play media at 1.2x normal speed, with audio at normal pitch.
  9904. Changing playback speed would change pitch, leaving audio tempo at
  9905. 1.2x.
  9906. .UNINDENT
  9907. .UNINDENT
  9908. .UNINDENT
  9909. .TP
  9910. .B \fBrubberband\fP
  9911. High quality pitch correction with librubberband. This can be used in place
  9912. of \fBscaletempo\fP, and will be used to adjust audio pitch when playing
  9913. at speed different from normal. It can also be used to adjust audio pitch
  9914. without changing playback speed.
  9915. .INDENT 7.0
  9916. .TP
  9917. .B \fB<pitch\-scale>\fP
  9918. Sets the pitch scaling factor. Frequencies are multiplied by this value.
  9919. .UNINDENT
  9920. .sp
  9921. This filter has a number of additional sub\-options. You can list them with
  9922. \fBmpv \-\-af=rubberband=help\fP\&. This will also show the default values
  9923. for each option. The options are not documented here, because they are
  9924. merely passed to librubberband. Look at the librubberband documentation
  9925. to learn what each option does:
  9926. \fI\%http://breakfastquay.com/rubberband/code\-doc/classRubberBand_1_1RubberBandStretcher.html\fP
  9927. (The mapping of the mpv rubberband filter sub\-option names and values to
  9928. those of librubberband follows a simple pattern: \fB"Option" + Name + Value\fP\&.)
  9929. .sp
  9930. This filter supports the following \fBaf\-command\fP commands:
  9931. .INDENT 7.0
  9932. .TP
  9933. .B \fBset\-pitch\fP
  9934. Set the \fB<pitch\-scale>\fP argument dynamically. This can be used to
  9935. change the playback pitch at runtime. Note that speed is controlled
  9936. using the standard \fBspeed\fP property, not \fBaf\-command\fP\&.
  9937. .TP
  9938. .B \fBmultiply\-pitch <factor>\fP
  9939. Multiply the current value of \fB<pitch\-scale>\fP dynamically. For
  9940. example: 0.5 to go down by an octave, 1.5 to go up by a perfect fifth.
  9941. If you want to go up or down by semi\-tones, use 1.059463094352953 and
  9942. 0.9438743126816935
  9943. .UNINDENT
  9944. .TP
  9945. .B \fBlavfi=graph\fP
  9946. Filter audio using FFmpeg\(aqs libavfilter.
  9947. .INDENT 7.0
  9948. .TP
  9949. .B \fB<graph>\fP
  9950. Libavfilter graph. See \fBlavfi\fP video filter for details \- the graph
  9951. syntax is the same.
  9952. .sp
  9953. \fBWARNING:\fP
  9954. .INDENT 7.0
  9955. .INDENT 3.5
  9956. Don\(aqt forget to quote libavfilter graphs as described in the lavfi
  9957. video filter section.
  9958. .UNINDENT
  9959. .UNINDENT
  9960. .TP
  9961. .B \fBo=<string>\fP
  9962. AVOptions.
  9963. .TP
  9964. .B \fBfix\-pts=<yes|no>\fP
  9965. Determine PTS based on sample count (default: no). If this is enabled,
  9966. the player won\(aqt rely on libavfilter passing through PTS accurately.
  9967. Instead, it pass a sample count as PTS to libavfilter, and compute the
  9968. PTS used by mpv based on that and the input PTS. This helps with filters
  9969. which output a recomputed PTS instead of the original PTS (including
  9970. filters which require the PTS to start at 0). mpv normally expects
  9971. filters to not touch the PTS (or only to the extent of changing frame
  9972. boundaries), so this is not the default, but it will be needed to use
  9973. broken filters. In practice, these broken filters will either cause slow
  9974. A/V desync over time (with some files), or break playback completely if
  9975. you seek or start playback from the middle of a file.
  9976. .UNINDENT
  9977. .UNINDENT
  9978. .SH VIDEO FILTERS
  9979. .sp
  9980. Video filters allow you to modify the video stream and its properties. All of
  9981. the information described in this section applies to audio filters as well
  9982. (generally using the prefix \fB\-\-af\fP instead of \fB\-\-vf\fP).
  9983. .sp
  9984. The exact syntax is:
  9985. .INDENT 0.0
  9986. .TP
  9987. .B \fB\-\-vf=<filter1[=parameter1:parameter2:...],filter2,...>\fP
  9988. Setup a chain of video filters. This consists on the filter name, and an
  9989. option list of parameters after \fB=\fP\&. The parameters are separated by
  9990. \fB:\fP (not \fB,\fP, as that starts a new filter entry).
  9991. .sp
  9992. Before the filter name, a label can be specified with \fB@name:\fP, where
  9993. name is an arbitrary user\-given name, which identifies the filter. This
  9994. is only needed if you want to toggle the filter at runtime.
  9995. .sp
  9996. A \fB!\fP before the filter name means the filter is disabled by default. It
  9997. will be skipped on filter creation. This is also useful for runtime filter
  9998. toggling.
  9999. .sp
  10000. See the \fBvf\fP command (and \fBtoggle\fP sub\-command) for further explanations
  10001. and examples.
  10002. .sp
  10003. The general filter entry syntax is:
  10004. .INDENT 7.0
  10005. .INDENT 3.5
  10006. \fB["@"<label\-name>":"] ["!"] <filter\-name> [ "=" <filter\-parameter\-list> ]\fP
  10007. .UNINDENT
  10008. .UNINDENT
  10009. .sp
  10010. or for the special "toggle" syntax (see \fBvf\fP command):
  10011. .INDENT 7.0
  10012. .INDENT 3.5
  10013. \fB"@"<label\-name>\fP
  10014. .UNINDENT
  10015. .UNINDENT
  10016. .sp
  10017. and the \fBfilter\-parameter\-list\fP:
  10018. .INDENT 7.0
  10019. .INDENT 3.5
  10020. \fB<filter\-parameter> | <filter\-parameter> "," <filter\-parameter\-list>\fP
  10021. .UNINDENT
  10022. .UNINDENT
  10023. .sp
  10024. and \fBfilter\-parameter\fP:
  10025. .INDENT 7.0
  10026. .INDENT 3.5
  10027. \fB( <param\-name> "=" <param\-value> ) | <param\-value>\fP
  10028. .UNINDENT
  10029. .UNINDENT
  10030. .sp
  10031. \fBparam\-value\fP can further be quoted in \fB[\fP / \fB]\fP in case the value
  10032. contains characters like \fB,\fP or \fB=\fP\&. This is used in particular with
  10033. the \fBlavfi\fP filter, which uses a very similar syntax as mpv (MPlayer
  10034. historically) to specify filters and their parameters.
  10035. .UNINDENT
  10036. .sp
  10037. Filters can be manipulated at run time. You can use \fB@\fP labels as described
  10038. above in combination with the \fBvf\fP command (see \fI\%COMMAND INTERFACE\fP) to get
  10039. more control over this. Initially disabled filters with \fB!\fP are useful for
  10040. this as well.
  10041. .sp
  10042. You can also set defaults for each filter. The defaults are applied before the
  10043. normal filter parameters. This is deprecated and never worked for the
  10044. libavfilter bridge.
  10045. .INDENT 0.0
  10046. .TP
  10047. .B \fB\-\-vf\-defaults=<filter1[=parameter1:parameter2:...],filter2,...>\fP
  10048. Set defaults for each filter. (Deprecated. \fB\-\-af\-defaults\fP is deprecated
  10049. as well.)
  10050. .UNINDENT
  10051. .sp
  10052. \fBNOTE:\fP
  10053. .INDENT 0.0
  10054. .INDENT 3.5
  10055. To get a full list of available video filters, see \fB\-\-vf=help\fP and
  10056. \fI\%http://ffmpeg.org/ffmpeg\-filters.html\fP .
  10057. .sp
  10058. Also, keep in mind that most actual filters are available via the \fBlavfi\fP
  10059. wrapper, which gives you access to most of libavfilter\(aqs filters. This
  10060. includes all filters that have been ported from MPlayer to libavfilter.
  10061. .sp
  10062. Most builtin filters are deprecated in some ways, unless they\(aqre only available
  10063. in mpv (such as filters which deal with mpv specifics, or which are
  10064. implemented in mpv only).
  10065. .sp
  10066. If a filter is not builtin, the \fBlavfi\-bridge\fP will be automatically
  10067. tried. This bridge does not support help output, and does not verify
  10068. parameters before the filter is actually used. Although the mpv syntax
  10069. is rather similar to libavfilter\(aqs, it\(aqs not the same. (Which means not
  10070. everything accepted by vf_lavfi\(aqs \fBgraph\fP option will be accepted by
  10071. \fB\-\-vf\fP\&.)
  10072. .sp
  10073. You can also prefix the filter name with \fBlavfi\-\fP to force the wrapper.
  10074. This is helpful if the filter name collides with a deprecated mpv builtin
  10075. filter. For example \fB\-\-vf=lavfi\-scale=args\fP would use libavfilter\(aqs
  10076. \fBscale\fP filter over mpv\(aqs deprecated builtin one.
  10077. .UNINDENT
  10078. .UNINDENT
  10079. .sp
  10080. Video filters are managed in lists. There are a few commands to manage the
  10081. filter list.
  10082. .INDENT 0.0
  10083. .TP
  10084. .B \fB\-\-vf\-append=filter\fP
  10085. Appends the filter given as arguments to the filter list.
  10086. .TP
  10087. .B \fB\-\-vf\-add=filter\fP
  10088. Appends the filter given as arguments to the filter list. (Passing multiple
  10089. filters is currently still possible, but deprecated.)
  10090. .TP
  10091. .B \fB\-\-vf\-pre=filter\fP
  10092. Prepends the filters given as arguments to the filter list. (Passing
  10093. multiple filters is currently still possible, but deprecated.)
  10094. .TP
  10095. .B \fB\-\-vf\-remove=filter\fP
  10096. Deletes the filter from the list. The filter can be either given the way it
  10097. was added (filter name and its full argument list), or by label (prefixed
  10098. with \fB@\fP). Matching of filters works as follows: if either of the compared
  10099. filters has a label set, only the labels are compared. If none of the
  10100. filters have a label, the filter name, arguments, and argument order are
  10101. compared. (Passing multiple filters is currently still possible, but
  10102. deprecated.)
  10103. .TP
  10104. .B \fB\-vf\-toggle=filter\fP
  10105. Add the given filter to the list if it was not present yet, or remove it
  10106. from the list if it was present. Matching of filters works as described in
  10107. \fB\-\-vf\-remove\fP\&.
  10108. .TP
  10109. .B \fB\-\-vf\-del=filter\fP
  10110. Sort of like \fB\-\-vf\-remove\fP, but also accepts an index number. Index
  10111. numbers start at 0, negative numbers address the end of the list (\-1 is the
  10112. last). Deprecated.
  10113. .TP
  10114. .B \fB\-\-vf\-clr\fP
  10115. Completely empties the filter list.
  10116. .UNINDENT
  10117. .sp
  10118. With filters that support it, you can access parameters by their name.
  10119. .INDENT 0.0
  10120. .TP
  10121. .B \fB\-\-vf=<filter>=help\fP
  10122. Prints the parameter names and parameter value ranges for a particular
  10123. filter.
  10124. .UNINDENT
  10125. .sp
  10126. Available mpv\-only filters are:
  10127. .INDENT 0.0
  10128. .TP
  10129. .B \fBformat=fmt=<value>:colormatrix=<value>:...\fP
  10130. Applies video parameter overrides, with optional conversion. By default,
  10131. this overrides the video\(aqs parameters without conversion (except for the
  10132. \fBfmt\fP parameter), but can be made to perform an appropriate conversion
  10133. with \fBconvert=yes\fP for parameters for which conversion is supported.
  10134. .INDENT 7.0
  10135. .TP
  10136. .B \fB<fmt>\fP
  10137. Image format name, e.g. rgb15, bgr24, 420p, etc. (default: don\(aqt change).
  10138. .sp
  10139. This filter always performs conversion to the given format.
  10140. .sp
  10141. \fBNOTE:\fP
  10142. .INDENT 7.0
  10143. .INDENT 3.5
  10144. For a list of available formats, use \fB\-\-vf=format=fmt=help\fP\&.
  10145. .UNINDENT
  10146. .UNINDENT
  10147. .TP
  10148. .B \fB<convert=yes|no>\fP
  10149. Force conversion of color parameters (default: no).
  10150. .sp
  10151. If this is disabled (the default), the only conversion that is possibly
  10152. performed is format conversion if \fB<fmt>\fP is set. All other parameters
  10153. (like \fB<colormatrix>\fP) are forced without conversion. This mode is
  10154. typically useful when files have been incorrectly tagged.
  10155. .sp
  10156. If this is enabled, libswscale or zimg is used if any of the parameters
  10157. mismatch. zimg is used of the input/output image formats are supported
  10158. by mpv\(aqs zimg wrapper, and if \fB\-\-sws\-allow\-zimg=yes\fP is used. Both
  10159. libraries may not support all kinds of conversions. This typically
  10160. results in silent incorrect conversion. zimg has in many cases a better
  10161. chance of performing the conversion correctly.
  10162. .sp
  10163. In both cases, the color parameters are set on the output stage of the
  10164. image format conversion (if \fBfmt\fP was set). The difference is that
  10165. with \fBconvert=no\fP, the color parameters are not passed on to the
  10166. converter.
  10167. .sp
  10168. If input and output video parameters are the same, conversion is always
  10169. skipped.
  10170. .INDENT 7.0
  10171. .INDENT 3.5
  10172. .IP "Examples"
  10173. .INDENT 0.0
  10174. .TP
  10175. .B \fBmpv test.mkv \-\-vf=format:colormatrix=ycgco\fP
  10176. Results in incorrect colors (if test.mkv was tagged correctly).
  10177. .TP
  10178. .B \fBmpv test.mkv \-\-vf=format:colormatrix=ycgco:convert=yes \-\-sws\-allow\-zimg\fP
  10179. Results in true conversion to \fBycgco\fP, assuming the renderer
  10180. supports it (\fB\-\-vo=gpu\fP normally does). You can add \fB\-\-vo=xv\fP
  10181. to force a VO which definitely does not support it, which should
  10182. show incorrect colors as confirmation.
  10183. .sp
  10184. Using \fB\-\-sws\-allow\-zimg=no\fP (or disabling zimg at build time)
  10185. will use libswscale, which cannot perform this conversion as
  10186. of this writing.
  10187. .UNINDENT
  10188. .UNINDENT
  10189. .UNINDENT
  10190. .TP
  10191. .B \fB<colormatrix>\fP
  10192. Controls the YUV to RGB color space conversion when playing video. There
  10193. are various standards. Normally, BT.601 should be used for SD video, and
  10194. BT.709 for HD video. (This is done by default.) Using incorrect color space
  10195. results in slightly under or over saturated and shifted colors.
  10196. .sp
  10197. These options are not always supported. Different video outputs provide
  10198. varying degrees of support. The \fBgpu\fP and \fBvdpau\fP video output
  10199. drivers usually offer full support. The \fBxv\fP output can set the color
  10200. space if the system video driver supports it, but not input and output
  10201. levels. The \fBscale\fP video filter can configure color space and input
  10202. levels, but only if the output format is RGB (if the video output driver
  10203. supports RGB output, you can force this with \fB\-vf scale,format=rgba\fP).
  10204. .sp
  10205. If this option is set to \fBauto\fP (which is the default), the video\(aqs
  10206. color space flag will be used. If that flag is unset, the color space
  10207. will be selected automatically. This is done using a simple heuristic that
  10208. attempts to distinguish SD and HD video. If the video is larger than
  10209. 1279x576 pixels, BT.709 (HD) will be used; otherwise BT.601 (SD) is
  10210. selected.
  10211. .sp
  10212. Available color spaces are:
  10213. .INDENT 7.0
  10214. .TP
  10215. .B auto
  10216. automatic selection (default)
  10217. .TP
  10218. .B bt.601
  10219. ITU\-R BT.601 (SD)
  10220. .TP
  10221. .B bt.709
  10222. ITU\-R BT.709 (HD)
  10223. .TP
  10224. .B bt.2020\-ncl
  10225. ITU\-R BT.2020 non\-constant luminance system
  10226. .TP
  10227. .B bt.2020\-cl
  10228. ITU\-R BT.2020 constant luminance system
  10229. .TP
  10230. .B smpte\-240m
  10231. SMPTE\-240M
  10232. .UNINDENT
  10233. .TP
  10234. .B \fB<colorlevels>\fP
  10235. YUV color levels used with YUV to RGB conversion. This option is only
  10236. necessary when playing broken files which do not follow standard color
  10237. levels or which are flagged wrong. If the video does not specify its
  10238. color range, it is assumed to be limited range.
  10239. .sp
  10240. The same limitations as with \fB<colormatrix>\fP apply.
  10241. .sp
  10242. Available color ranges are:
  10243. .INDENT 7.0
  10244. .TP
  10245. .B auto
  10246. automatic selection (normally limited range) (default)
  10247. .TP
  10248. .B limited
  10249. limited range (16\-235 for luma, 16\-240 for chroma)
  10250. .TP
  10251. .B full
  10252. full range (0\-255 for both luma and chroma)
  10253. .UNINDENT
  10254. .TP
  10255. .B \fB<primaries>\fP
  10256. RGB primaries the source file was encoded with. Normally this should be set
  10257. in the file header, but when playing broken or mistagged files this can be
  10258. used to override the setting.
  10259. .sp
  10260. This option only affects video output drivers that perform color
  10261. management, for example \fBgpu\fP with the \fBtarget\-prim\fP or
  10262. \fBicc\-profile\fP suboptions set.
  10263. .sp
  10264. If this option is set to \fBauto\fP (which is the default), the video\(aqs
  10265. primaries flag will be used. If that flag is unset, the color space will
  10266. be selected automatically, using the following heuristics: If the
  10267. \fB<colormatrix>\fP is set or determined as BT.2020 or BT.709, the
  10268. corresponding primaries are used. Otherwise, if the video height is
  10269. exactly 576 (PAL), BT.601\-625 is used. If it\(aqs exactly 480 or 486 (NTSC),
  10270. BT.601\-525 is used. If the video resolution is anything else, BT.709 is
  10271. used.
  10272. .sp
  10273. Available primaries are:
  10274. .INDENT 7.0
  10275. .TP
  10276. .B auto
  10277. automatic selection (default)
  10278. .TP
  10279. .B bt.601\-525
  10280. ITU\-R BT.601 (SD) 525\-line systems (NTSC, SMPTE\-C)
  10281. .TP
  10282. .B bt.601\-625
  10283. ITU\-R BT.601 (SD) 625\-line systems (PAL, SECAM)
  10284. .TP
  10285. .B bt.709
  10286. ITU\-R BT.709 (HD) (same primaries as sRGB)
  10287. .TP
  10288. .B bt.2020
  10289. ITU\-R BT.2020 (UHD)
  10290. .TP
  10291. .B apple
  10292. Apple RGB
  10293. .TP
  10294. .B adobe
  10295. Adobe RGB (1998)
  10296. .TP
  10297. .B prophoto
  10298. ProPhoto RGB (ROMM)
  10299. .TP
  10300. .B cie1931
  10301. CIE 1931 RGB
  10302. .TP
  10303. .B dci\-p3
  10304. DCI\-P3 (Digital Cinema)
  10305. .TP
  10306. .B v\-gamut
  10307. Panasonic V\-Gamut primaries
  10308. .UNINDENT
  10309. .TP
  10310. .B \fB<gamma>\fP
  10311. Gamma function the source file was encoded with. Normally this should be set
  10312. in the file header, but when playing broken or mistagged files this can be
  10313. used to override the setting.
  10314. .sp
  10315. This option only affects video output drivers that perform color management.
  10316. .sp
  10317. If this option is set to \fBauto\fP (which is the default), the gamma will
  10318. be set to BT.1886 for YCbCr content, sRGB for RGB content and Linear for
  10319. XYZ content.
  10320. .sp
  10321. Available gamma functions are:
  10322. .INDENT 7.0
  10323. .TP
  10324. .B auto
  10325. automatic selection (default)
  10326. .TP
  10327. .B bt.1886
  10328. ITU\-R BT.1886 (EOTF corresponding to BT.601/BT.709/BT.2020)
  10329. .TP
  10330. .B srgb
  10331. IEC 61966\-2\-4 (sRGB)
  10332. .TP
  10333. .B linear
  10334. Linear light
  10335. .TP
  10336. .B gamma1.8
  10337. Pure power curve (gamma 1.8)
  10338. .TP
  10339. .B gamma2.0
  10340. Pure power curve (gamma 2.0)
  10341. .TP
  10342. .B gamma2.2
  10343. Pure power curve (gamma 2.2)
  10344. .TP
  10345. .B gamma2.4
  10346. Pure power curve (gamma 2.4)
  10347. .TP
  10348. .B gamma2.6
  10349. Pure power curve (gamma 2.6)
  10350. .TP
  10351. .B gamma2.8
  10352. Pure power curve (gamma 2.8)
  10353. .TP
  10354. .B prophoto
  10355. ProPhoto RGB (ROMM) curve
  10356. .TP
  10357. .B pq
  10358. ITU\-R BT.2100 PQ (Perceptual quantizer) curve
  10359. .TP
  10360. .B hlg
  10361. ITU\-R BT.2100 HLG (Hybrid Log\-gamma) curve
  10362. .TP
  10363. .B v\-log
  10364. Panasonic V\-Log transfer curve
  10365. .TP
  10366. .B s\-log1
  10367. Sony S\-Log1 transfer curve
  10368. .TP
  10369. .B s\-log2
  10370. Sony S\-Log2 transfer curve
  10371. .UNINDENT
  10372. .TP
  10373. .B \fB<sig\-peak>\fP
  10374. Reference peak illumination for the video file, relative to the
  10375. signal\(aqs reference white level. This is mostly interesting for HDR, but
  10376. it can also be used tone map SDR content to simulate a different
  10377. exposure. Normally inferred from tags such as MaxCLL or mastering
  10378. metadata.
  10379. .sp
  10380. The default of 0.0 will default to the source\(aqs nominal peak luminance.
  10381. .TP
  10382. .B \fB<light>\fP
  10383. .INDENT 7.0
  10384. .INDENT 3.5
  10385. Light type of the scene. This is mostly correctly inferred based on the
  10386. gamma function, but it can be useful to override this when viewing raw
  10387. camera footage (e.g. V\-Log), which is normally scene\-referred instead
  10388. of display\-referred.
  10389. .sp
  10390. Available light types are:
  10391. .UNINDENT
  10392. .UNINDENT
  10393. .INDENT 7.0
  10394. .TP
  10395. .B auto
  10396. Automatic selection (default)
  10397. .TP
  10398. .B display
  10399. Display\-referred light (most content)
  10400. .TP
  10401. .B hlg
  10402. Scene\-referred using the HLG OOTF (e.g. HLG content)
  10403. .TP
  10404. .B 709\-1886
  10405. Scene\-referred using the BT709+BT1886 interaction
  10406. .TP
  10407. .B gamma1.2
  10408. Scene\-referred using a pure power OOTF (gamma=1.2)
  10409. .UNINDENT
  10410. .TP
  10411. .B \fB<stereo\-in>\fP
  10412. Set the stereo mode the video is assumed to be encoded in. Use
  10413. \fB\-\-vf format:stereo\-in=help\fP to list all available modes. Check with
  10414. the \fBstereo3d\fP filter documentation to see what the names mean.
  10415. .TP
  10416. .B \fB<stereo\-out>\fP
  10417. Set the stereo mode the video should be displayed as. Takes the
  10418. same values as the \fBstereo\-in\fP option.
  10419. .TP
  10420. .B \fB<rotate>\fP
  10421. Set the rotation the video is assumed to be encoded with in degrees.
  10422. The special value \fB\-1\fP uses the input format.
  10423. .TP
  10424. .B \fB<dw>\fP, \fB<dh>\fP
  10425. Set the display size. Note that setting the display size such that
  10426. the video is scaled in both directions instead of just changing the
  10427. aspect ratio is an implementation detail, and might change later.
  10428. .TP
  10429. .B \fB<dar>\fP
  10430. Set the display aspect ratio of the video frame. This is a float,
  10431. but values such as \fB[16:9]\fP can be passed too (\fB[...]\fP for quoting
  10432. to prevent the option parser from interpreting the \fB:\fP character).
  10433. .UNINDENT
  10434. .TP
  10435. .B \fBlavfi=graph[:sws\-flags[:o=opts]]\fP
  10436. Filter video using FFmpeg\(aqs libavfilter.
  10437. .INDENT 7.0
  10438. .TP
  10439. .B \fB<graph>\fP
  10440. The libavfilter graph string. The filter must have a single video input
  10441. pad and a single video output pad.
  10442. .sp
  10443. See \fI\%https://ffmpeg.org/ffmpeg\-filters.html\fP for syntax and available
  10444. filters.
  10445. .sp
  10446. \fBWARNING:\fP
  10447. .INDENT 7.0
  10448. .INDENT 3.5
  10449. If you want to use the full filter syntax with this option, you have
  10450. to quote the filter graph in order to prevent mpv\(aqs syntax and the
  10451. filter graph syntax from clashing. To prevent a quoting and escaping
  10452. mess, consider using \fB\-\-lavfi\-complex\fP if you know which video
  10453. track you want to use from the input file. (There is only one video
  10454. track for nearly all video files anyway.)
  10455. .UNINDENT
  10456. .UNINDENT
  10457. .INDENT 7.0
  10458. .INDENT 3.5
  10459. .IP "Examples"
  10460. .INDENT 0.0
  10461. .TP
  10462. .B \fB\-\-vf=lavfi=[gradfun=20:30,vflip]\fP
  10463. \fBgradfun\fP filter with nonsense parameters, followed by a
  10464. \fBvflip\fP filter. (This demonstrates how libavfilter takes a
  10465. graph and not just a single filter.) The filter graph string is
  10466. quoted with \fB[\fP and \fB]\fP\&. This requires no additional quoting
  10467. or escaping with some shells (like bash), while others (like
  10468. zsh) require additional \fB"\fP quotes around the option string.
  10469. .TP
  10470. .B \fB\(aq\-\-vf=lavfi="gradfun=20:30,vflip"\(aq\fP
  10471. Same as before, but uses quoting that should be safe with all
  10472. shells. The outer \fB\(aq\fP quotes make sure that the shell does not
  10473. remove the \fB"\fP quotes needed by mpv.
  10474. .TP
  10475. .B \fB\(aq\-\-vf=lavfi=graph="gradfun=radius=30:strength=20,vflip"\(aq\fP
  10476. Same as before, but uses named parameters for everything.
  10477. .UNINDENT
  10478. .UNINDENT
  10479. .UNINDENT
  10480. .TP
  10481. .B \fB<sws\-flags>\fP
  10482. If libavfilter inserts filters for pixel format conversion, this
  10483. option gives the flags which should be passed to libswscale. This
  10484. option is numeric and takes a bit\-wise combination of \fBSWS_\fP flags.
  10485. .sp
  10486. See \fBhttp://git.videolan.org/?p=ffmpeg.git;a=blob;f=libswscale/swscale.h\fP\&.
  10487. .TP
  10488. .B \fB<o>\fP
  10489. Set AVFilterGraph options. These should be documented by FFmpeg.
  10490. .INDENT 7.0
  10491. .INDENT 3.5
  10492. .IP "Example"
  10493. .INDENT 0.0
  10494. .TP
  10495. .B \fB\(aq\-\-vf=lavfi=yadif:o="threads=2,thread_type=slice"\(aq\fP
  10496. forces a specific threading configuration.
  10497. .UNINDENT
  10498. .UNINDENT
  10499. .UNINDENT
  10500. .UNINDENT
  10501. .TP
  10502. .B \fBsub=[=bottom\-margin:top\-margin]\fP
  10503. Moves subtitle rendering to an arbitrary point in the filter chain, or force
  10504. subtitle rendering in the video filter as opposed to using video output OSD
  10505. support.
  10506. .INDENT 7.0
  10507. .TP
  10508. .B \fB<bottom\-margin>\fP
  10509. Adds a black band at the bottom of the frame. The SSA/ASS renderer can
  10510. place subtitles there (with \fB\-\-sub\-use\-margins\fP).
  10511. .TP
  10512. .B \fB<top\-margin>\fP
  10513. Black band on the top for toptitles (with \fB\-\-sub\-use\-margins\fP).
  10514. .UNINDENT
  10515. .INDENT 7.0
  10516. .INDENT 3.5
  10517. .IP "Examples"
  10518. .INDENT 0.0
  10519. .TP
  10520. .B \fB\-\-vf=sub,eq\fP
  10521. Moves sub rendering before the eq filter. This will put both
  10522. subtitle colors and video under the influence of the video equalizer
  10523. settings.
  10524. .UNINDENT
  10525. .UNINDENT
  10526. .UNINDENT
  10527. .TP
  10528. .B \fBvapoursynth=file:buffered\-frames:concurrent\-frames\fP
  10529. Loads a VapourSynth filter script. This is intended for streamed
  10530. processing: mpv actually provides a source filter, instead of using a
  10531. native VapourSynth video source. The mpv source will answer frame
  10532. requests only within a small window of frames (the size of this window
  10533. is controlled with the \fBbuffered\-frames\fP parameter), and requests outside
  10534. of that will return errors. As such, you can\(aqt use the full power of
  10535. VapourSynth, but you can use certain filters.
  10536. .sp
  10537. \fBWARNING:\fP
  10538. .INDENT 7.0
  10539. .INDENT 3.5
  10540. Do not use this filter, unless you have expert knowledge in VapourSynth,
  10541. and know how to fix bugs in the mpv VapourSynth wrapper code.
  10542. .UNINDENT
  10543. .UNINDENT
  10544. .sp
  10545. If you just want to play video generated by VapourSynth (i.e. using
  10546. a native VapourSynth video source), it\(aqs better to use \fBvspipe\fP and a
  10547. pipe or FIFO to feed the video to mpv. The same applies if the filter script
  10548. requires random frame access (see \fBbuffered\-frames\fP parameter).
  10549. .INDENT 7.0
  10550. .TP
  10551. .B \fBfile\fP
  10552. Filename of the script source. Currently, this is always a python
  10553. script (\fB\&.vpy\fP in VapourSynth convention).
  10554. .sp
  10555. The variable \fBvideo_in\fP is set to the mpv video source, and it is
  10556. expected that the script reads video from it. (Otherwise, mpv will
  10557. decode no video, and the video packet queue will overflow, eventually
  10558. leading to only audio playing, or worse.)
  10559. .sp
  10560. The filter graph created by the script is also expected to pass through
  10561. timestamps using the \fB_DurationNum\fP and \fB_DurationDen\fP frame
  10562. properties.
  10563. .sp
  10564. See the end of the option list for a full list of script variables
  10565. defined by mpv.
  10566. .INDENT 7.0
  10567. .INDENT 3.5
  10568. .IP "Example:"
  10569. .INDENT 0.0
  10570. .INDENT 3.5
  10571. .sp
  10572. .nf
  10573. .ft C
  10574. import vapoursynth as vs
  10575. core = vs.get_core()
  10576. core.std.AddBorders(video_in, 10, 10, 20, 20).set_output()
  10577. .ft P
  10578. .fi
  10579. .UNINDENT
  10580. .UNINDENT
  10581. .UNINDENT
  10582. .UNINDENT
  10583. .sp
  10584. \fBWARNING:\fP
  10585. .INDENT 7.0
  10586. .INDENT 3.5
  10587. The script will be reloaded on every seek. This is done to reset
  10588. the filter properly on discontinuities.
  10589. .UNINDENT
  10590. .UNINDENT
  10591. .TP
  10592. .B \fBbuffered\-frames\fP
  10593. Maximum number of decoded video frames that should be buffered before
  10594. the filter (default: 4). This specifies the maximum number of frames
  10595. the script can request in backward direction.
  10596. .sp
  10597. E.g. if \fBbuffered\-frames=5\fP, and the script just requested frame 15,
  10598. it can still request frame 10, but frame 9 is not available anymore.
  10599. If it requests frame 30, mpv will decode 15 more frames, and keep only
  10600. frames 25\-30.
  10601. .sp
  10602. The only reason why this buffer exists is to serve the random access
  10603. requests the VapourSynth filter can make.
  10604. .sp
  10605. The VapourSynth API has a \fBgetFrameAsync\fP function, which takes an
  10606. absolute frame number. Source filters must respond to all requests. For
  10607. example, a source filter can request frame 2432, and then frame 3.
  10608. Source filters typically implement this by pre\-indexing the entire
  10609. file.
  10610. .sp
  10611. mpv on the other hand is stream oriented, and does not allow filters to
  10612. seek. (And it would not make sense to allow it, because it would ruin
  10613. performance.) Filters get frames sequentially in playback direction, and
  10614. cannot request them out of order.
  10615. .sp
  10616. To compensate for this mismatch, mpv allows the filter to access frames
  10617. within a certain window. \fBbuffered\-frames\fP controls the size of this
  10618. window. Most VapourSynth filters happen to work with this, because mpv
  10619. requests frames sequentially increasing from it, and most filters only
  10620. require frames "close" to the requested frame.
  10621. .sp
  10622. If the filter requests a frame that has a higher frame number than the
  10623. highest buffered frame, new frames will be decoded until the requested
  10624. frame number is reached. Excessive frames will be flushed out in a FIFO
  10625. manner (there are only at most \fBbuffered\-frames\fP in this buffer).
  10626. .sp
  10627. If the filter requests a frame that has a lower frame number than the
  10628. lowest buffered frame, the request cannot be satisfied, and an error
  10629. is returned to the filter. This kind of error is not supposed to happen
  10630. in a "proper" VapourSynth environment. What exactly happens depends on
  10631. the filters involved.
  10632. .sp
  10633. Increasing this buffer will not improve performance. Rather, it will
  10634. waste memory, and slow down seeks (when enough frames to fill the buffer
  10635. need to be decoded at once). It is only needed to prevent the error
  10636. described in the previous paragraph.
  10637. .sp
  10638. How many frames a filter requires depends on filter implementation
  10639. details, and mpv has no way of knowing. A scale filter might need only
  10640. 1 frame, an interpolation filter may require a small number of frames,
  10641. and the \fBReverse\fP filter will require an infinite number of frames.
  10642. .sp
  10643. If you want reliable operation to the full extend VapourSynth is
  10644. capable, use \fBvspipe\fP\&.
  10645. .sp
  10646. The actual number of buffered frames also depends on the value of the
  10647. \fBconcurrent\-frames\fP option. Currently, both option values are
  10648. multiplied to get the final buffer size.
  10649. .TP
  10650. .B \fBconcurrent\-frames\fP
  10651. Number of frames that should be requested in parallel. The
  10652. level of concurrency depends on the filter and how quickly mpv can
  10653. decode video to feed the filter. This value should probably be
  10654. proportional to the number of cores on your machine. Most time,
  10655. making it higher than the number of cores can actually make it
  10656. slower.
  10657. .sp
  10658. Technically, mpv will call the VapourSynth \fBgetFrameAsync\fP function
  10659. in a loop, until there are \fBconcurrent\-frames\fP frames that have not
  10660. been returned by the filter yet. This also assumes that the rest of the
  10661. mpv filter chain reads the output of the \fBvapoursynth\fP filter quickly
  10662. enough. (For example, if you pause the player, filtering will stop very
  10663. soon, because the filtered frames are waiting in a queue.)
  10664. .sp
  10665. Actual concurrency depends on many other factors.
  10666. .sp
  10667. By default, this uses the special value \fBauto\fP, which sets the option
  10668. to the number of detected logical CPU cores.
  10669. .UNINDENT
  10670. .sp
  10671. The following \fB\&.vpy\fP script variables are defined by mpv:
  10672. .INDENT 7.0
  10673. .TP
  10674. .B \fBvideo_in\fP
  10675. The mpv video source as vapoursynth clip. Note that this has an
  10676. incorrect (very high) length set, which confuses many filters. This is
  10677. necessary, because the true number of frames is unknown. You can use the
  10678. \fBTrim\fP filter on the clip to reduce the length.
  10679. .TP
  10680. .B \fBvideo_in_dw\fP, \fBvideo_in_dh\fP
  10681. Display size of the video. Can be different from video size if the
  10682. video does not use square pixels (e.g. DVD).
  10683. .TP
  10684. .B \fBcontainer_fps\fP
  10685. FPS value as reported by file headers. This value can be wrong or
  10686. completely broken (e.g. 0 or NaN). Even if the value is correct,
  10687. if another filter changes the real FPS (by dropping or inserting
  10688. frames), the value of this variable will not be useful. Note that
  10689. the \fB\-\-fps\fP command line option overrides this value.
  10690. .sp
  10691. Useful for some filters which insist on having a FPS.
  10692. .TP
  10693. .B \fBdisplay_fps\fP
  10694. Refresh rate of the current display. Note that this value can be 0.
  10695. .UNINDENT
  10696. .TP
  10697. .B \fBvavpp\fP
  10698. VA\-API video post processing. Requires the system to support VA\-API,
  10699. i.e. Linux/BSD only. Works with \fB\-\-vo=vaapi\fP and \fB\-\-vo=gpu\fP only.
  10700. Currently deinterlaces. This filter is automatically inserted if
  10701. deinterlacing is requested (either using the \fBd\fP key, by default mapped to
  10702. the command \fBcycle deinterlace\fP, or the \fB\-\-deinterlace\fP option).
  10703. .INDENT 7.0
  10704. .TP
  10705. .B \fBdeint=<method>\fP
  10706. Select the deinterlacing algorithm.
  10707. .INDENT 7.0
  10708. .TP
  10709. .B no
  10710. Don\(aqt perform deinterlacing.
  10711. .TP
  10712. .B auto
  10713. Select the best quality deinterlacing algorithm (default). This
  10714. goes by the order of the options as documented, with
  10715. \fBmotion\-compensated\fP being considered best quality.
  10716. .TP
  10717. .B first\-field
  10718. Show only first field.
  10719. .TP
  10720. .B bob
  10721. bob deinterlacing.
  10722. .TP
  10723. .B weave, motion\-adaptive, motion\-compensated
  10724. Advanced deinterlacing algorithms. Whether these actually work
  10725. depends on the GPU hardware, the GPU drivers, driver bugs, and
  10726. mpv bugs.
  10727. .UNINDENT
  10728. .TP
  10729. .B \fB<interlaced\-only>\fP
  10730. .INDENT 7.0
  10731. .TP
  10732. .B no
  10733. Deinterlace all frames (default).
  10734. .TP
  10735. .B yes
  10736. Only deinterlace frames marked as interlaced.
  10737. .UNINDENT
  10738. .TP
  10739. .B \fBreversal\-bug=<yes|no>\fP
  10740. .INDENT 7.0
  10741. .TP
  10742. .B no
  10743. Use the API as it was interpreted by older Mesa drivers. While
  10744. this interpretation was more obvious and inuitive, it was
  10745. apparently wrong, and not shared by Intel driver developers.
  10746. .TP
  10747. .B yes
  10748. Use Intel interpretation of surface forward and backwards
  10749. references (default). This is what Intel drivers and newer Mesa
  10750. drivers expect. Matters only for the advanced deinterlacing
  10751. algorithms.
  10752. .UNINDENT
  10753. .UNINDENT
  10754. .TP
  10755. .B \fBvdpaupp\fP
  10756. VDPAU video post processing. Works with \fB\-\-vo=vdpau\fP and \fB\-\-vo=gpu\fP
  10757. only. This filter is automatically inserted if deinterlacing is requested
  10758. (either using the \fBd\fP key, by default mapped to the command
  10759. \fBcycle deinterlace\fP, or the \fB\-\-deinterlace\fP option). When enabling
  10760. deinterlacing, it is always preferred over software deinterlacer filters
  10761. if the \fBvdpau\fP VO is used, and also if \fBgpu\fP is used and hardware
  10762. decoding was activated at least once (i.e. vdpau was loaded).
  10763. .INDENT 7.0
  10764. .TP
  10765. .B \fBsharpen=<\-1\-1>\fP
  10766. For positive values, apply a sharpening algorithm to the video, for
  10767. negative values a blurring algorithm (default: 0).
  10768. .TP
  10769. .B \fBdenoise=<0\-1>\fP
  10770. Apply a noise reduction algorithm to the video (default: 0; no noise
  10771. reduction).
  10772. .TP
  10773. .B \fBdeint=<yes|no>\fP
  10774. Whether deinterlacing is enabled (default: no). If enabled, it will use
  10775. the mode selected with \fBdeint\-mode\fP\&.
  10776. .TP
  10777. .B \fBdeint\-mode=<first\-field|bob|temporal|temporal\-spatial>\fP
  10778. Select deinterlacing mode (default: temporal).
  10779. .sp
  10780. Note that there\(aqs currently a mechanism that allows the \fBvdpau\fP VO to
  10781. change the \fBdeint\-mode\fP of auto\-inserted \fBvdpaupp\fP filters. To avoid
  10782. confusion, it\(aqs recommended not to use the \fB\-\-vo=vdpau\fP suboptions
  10783. related to filtering.
  10784. .INDENT 7.0
  10785. .TP
  10786. .B first\-field
  10787. Show only first field.
  10788. .TP
  10789. .B bob
  10790. Bob deinterlacing.
  10791. .TP
  10792. .B temporal
  10793. Motion\-adaptive temporal deinterlacing. May lead to A/V desync
  10794. with slow video hardware and/or high resolution.
  10795. .TP
  10796. .B temporal\-spatial
  10797. Motion\-adaptive temporal deinterlacing with edge\-guided spatial
  10798. interpolation. Needs fast video hardware.
  10799. .UNINDENT
  10800. .TP
  10801. .B \fBchroma\-deint\fP
  10802. Makes temporal deinterlacers operate both on luma and chroma (default).
  10803. Use no\-chroma\-deint to solely use luma and speed up advanced
  10804. deinterlacing. Useful with slow video memory.
  10805. .TP
  10806. .B \fBpullup\fP
  10807. Try to apply inverse telecine, needs motion adaptive temporal
  10808. deinterlacing.
  10809. .TP
  10810. .B \fBinterlaced\-only=<yes|no>\fP
  10811. If \fByes\fP, only deinterlace frames marked as interlaced (default: no).
  10812. .TP
  10813. .B \fBhqscaling=<0\-9>\fP
  10814. .INDENT 7.0
  10815. .TP
  10816. .B 0
  10817. Use default VDPAU scaling (default).
  10818. .TP
  10819. .B 1\-9
  10820. Apply high quality VDPAU scaling (needs capable hardware).
  10821. .UNINDENT
  10822. .UNINDENT
  10823. .TP
  10824. .B \fBd3d11vpp\fP
  10825. Direct3D 11 video post processing. Currently requires D3D11 hardware
  10826. decoding for use.
  10827. .INDENT 7.0
  10828. .TP
  10829. .B \fBdeint=<yes|no>\fP
  10830. Whether deinterlacing is enabled (default: no).
  10831. .TP
  10832. .B \fBinterlaced\-only=<yes|no>\fP
  10833. If \fByes\fP, only deinterlace frames marked as interlaced (default: no).
  10834. .TP
  10835. .B \fBmode=<blend|bob|adaptive|mocomp|ivctc|none>\fP
  10836. Tries to select a video processor with the given processing capability.
  10837. If a video processor supports multiple capabilities, it is not clear
  10838. which algorithm is actually selected. \fBnone\fP always falls back. On
  10839. most if not all hardware, this option will probably do nothing, because
  10840. a video processor usually supports all modes or none.
  10841. .UNINDENT
  10842. .TP
  10843. .B \fBfingerprint=...\fP
  10844. Compute video frame fingerprints and provide them as metadata. Actually, it
  10845. currently barely deserved to be called \fBfingerprint\fP, because it does not
  10846. compute "proper" fingerprints, only tiny downscaled images (but which can be
  10847. used to compute image hashes or for similarity matching).
  10848. .sp
  10849. The main purpose of this filter is to support the \fBskip\-logo.lua\fP script.
  10850. If this script is dropped, or mpv ever gains a way to load user\-defined
  10851. filters (other than VapourSynth), this filter will be removed. Due to the
  10852. "special" nature of this filter, it will be removed without warning.
  10853. .sp
  10854. The intended way to read from the filter is using \fBvf\-metadata\fP (also
  10855. see \fBclear\-on\-query\fP filter parameter). The property will return a list
  10856. of key/value pairs as follows:
  10857. .INDENT 7.0
  10858. .INDENT 3.5
  10859. .sp
  10860. .nf
  10861. .ft C
  10862. fp0.pts = 1.2345
  10863. fp0.hex = 1234abcdef...bcde
  10864. fp1.pts = 1.4567
  10865. fp1.hex = abcdef1234...6789
  10866. \&...
  10867. fpN.pts = ...
  10868. fpN.hex = ...
  10869. type = gray\-hex\-16x16
  10870. .ft P
  10871. .fi
  10872. .UNINDENT
  10873. .UNINDENT
  10874. .sp
  10875. Each \fBfp<N>\fP entry is for a frame. The \fBpts\fP entry specifies the
  10876. timestamp of the frame (within the filter chain; in simple cases this is
  10877. the same as the display timestamp). The \fBhex\fP field is the hex encoded
  10878. fingerprint, whose size and meaning depend on the \fBtype\fP filter option.
  10879. The \fBtype\fP field has the same value as the option the filter was created
  10880. with.
  10881. .sp
  10882. This returns the frames that were filtered since the last query of the
  10883. property. If \fBclear\-on\-query=no\fP was set, a query doesn\(aqt reset the list
  10884. of frames. In both cases, a maximum of 10 frames is returned. If there are
  10885. more frames, the oldest frames are discarded. Frames are returned in filter
  10886. order.
  10887. .sp
  10888. (This doesn\(aqt return a structured list for the per\-frame details because the
  10889. internals of the \fBvf\-metadata\fP mechanism suck. The returned format may
  10890. change in the future.)
  10891. .sp
  10892. This filter uses zimg for speed and profit. However, it will fallback to
  10893. libswscale in a number of situations: lesser pixel formats, unaligned data
  10894. pointers or strides, or if zimg fails to initialize for unknown reasons. In
  10895. these cases, the filter will use more CPU. Also, it will output different
  10896. fingerprints, because libswscale cannot perform the full range expansion we
  10897. normally request from zimg. As a consequence, the filter may be slower and
  10898. not work correctly in random situations.
  10899. .INDENT 7.0
  10900. .TP
  10901. .B \fBtype=...\fP
  10902. What fingerprint to compute. Available types are:
  10903. .INDENT 7.0
  10904. .TP
  10905. .B gray\-hex\-8x8
  10906. grayscale, 8 bit, 8x8 size
  10907. .TP
  10908. .B gray\-hex\-16x16
  10909. grayscale, 8 bit, 16x16 size (default)
  10910. .UNINDENT
  10911. .sp
  10912. Both types simply remove all colors, downscale the image, concatenate
  10913. all pixel values to a byte array, and convert the array to a hex string.
  10914. .TP
  10915. .B \fBclear\-on\-query=yes|no\fP
  10916. Clear the list of frame fingerprints if the \fBvf\-metadata\fP property for
  10917. this filter is queried (default: yes). This requires some care by the
  10918. user. Some types of accesses might query the filter multiple times,
  10919. which leads to lost frames.
  10920. .TP
  10921. .B \fBprint=yes|no\fP
  10922. Print computed fingerprints the the terminal (default: no). This is
  10923. mostly for testing and such. Scripts should use \fBvf\-metadata\fP to
  10924. read information from this filter instead.
  10925. .UNINDENT
  10926. .TP
  10927. .B \fBgpu=...\fP
  10928. Convert video to RGB using the OpenGL renderer normally used with
  10929. \fB\-\-vo=gpu\fP\&. This requires that the EGL implementation supports off\-screen
  10930. rendering on the default display. (This is the case with Mesa.)
  10931. .sp
  10932. Sub\-options:
  10933. .INDENT 7.0
  10934. .TP
  10935. .B \fBw=<pixels>\fP, \fBh=<pixels>\fP
  10936. Size of the output in pixels (default: 0). If not positive, this will
  10937. use the size of the first filtered input frame.
  10938. .UNINDENT
  10939. .sp
  10940. \fBWARNING:\fP
  10941. .INDENT 7.0
  10942. .INDENT 3.5
  10943. This is highly experimental. Performance is bad, and it will not work
  10944. everywhere in the first place. Some features are not supported.
  10945. .UNINDENT
  10946. .UNINDENT
  10947. .sp
  10948. \fBWARNING:\fP
  10949. .INDENT 7.0
  10950. .INDENT 3.5
  10951. This does not do OSD rendering. If you see OSD, then it has been
  10952. rendered by the VO backend. (Subtitles are rendered by the \fBgpu\fP
  10953. filter, if possible.)
  10954. .UNINDENT
  10955. .UNINDENT
  10956. .sp
  10957. \fBWARNING:\fP
  10958. .INDENT 7.0
  10959. .INDENT 3.5
  10960. If you use this with encoding mode, keep in mind that encoding mode will
  10961. convert the RGB filter\(aqs output back to yuv420p in software, using the
  10962. configured software scaler. Using \fBzimg\fP might improve this, but in
  10963. any case it might go against your goals when using this filter.
  10964. .UNINDENT
  10965. .UNINDENT
  10966. .sp
  10967. \fBWARNING:\fP
  10968. .INDENT 7.0
  10969. .INDENT 3.5
  10970. Do not use this with \fB\-\-vo=gpu\fP\&. It will apply filtering twice, since
  10971. most \fB\-\-vo=gpu\fP options are unconditionally applied to the \fBgpu\fP
  10972. filter. There is no mechanism in mpv to prevent this.
  10973. .UNINDENT
  10974. .UNINDENT
  10975. .UNINDENT
  10976. .SH ENCODING
  10977. .sp
  10978. You can encode files from one format/codec to another using this facility.
  10979. .INDENT 0.0
  10980. .TP
  10981. .B \fB\-\-o=<filename>\fP
  10982. Enables encoding mode and specifies the output file name.
  10983. .TP
  10984. .B \fB\-\-of=<format>\fP
  10985. Specifies the output format (overrides autodetection by the file name
  10986. extension of the file specified by \fB\-o\fP). See \fB\-\-of=help\fP for a full
  10987. list of supported formats.
  10988. .TP
  10989. .B \fB\-\-ofopts=<options>\fP
  10990. Specifies the output format options for libavformat.
  10991. See \fB\-\-ofopts=help\fP for a full list of supported options.
  10992. .sp
  10993. This is a key/value list option. See \fI\%List Options\fP for details.
  10994. .INDENT 7.0
  10995. .TP
  10996. .B \fB\-\-ofopts\-add=<option>\fP
  10997. Appends the option given as an argument to the options list. (Passing
  10998. multiple options is currently still possible, but deprecated.)
  10999. .TP
  11000. .B \fB\-\-ofopts=""\fP
  11001. Completely empties the options list.
  11002. .UNINDENT
  11003. .TP
  11004. .B \fB\-\-oac=<codec>\fP
  11005. Specifies the output audio codec. See \fB\-\-oac=help\fP for a full list of
  11006. supported codecs.
  11007. .TP
  11008. .B \fB\-\-oaoffset=<value>\fP
  11009. Shifts audio data by the given time (in seconds) by adding/removing
  11010. samples at the start. Deprecated.
  11011. .TP
  11012. .B \fB\-\-oacopts=<options>\fP
  11013. Specifies the output audio codec options for libavcodec.
  11014. See \fB\-\-oacopts=help\fP for a full list of supported options.
  11015. .INDENT 7.0
  11016. .INDENT 3.5
  11017. .IP "Example"
  11018. .INDENT 0.0
  11019. .TP
  11020. .B "\fB\-\-oac=libmp3lame \-\-oacopts=b=128000\fP"
  11021. selects 128 kbps MP3 encoding.
  11022. .UNINDENT
  11023. .UNINDENT
  11024. .UNINDENT
  11025. .sp
  11026. This is a key/value list option. See \fI\%List Options\fP for details.
  11027. .INDENT 7.0
  11028. .TP
  11029. .B \fB\-\-oacopts\-add=<option>\fP
  11030. Appends the option given as an argument to the options list. (Passing
  11031. multiple options is currently still possible, but deprecated.)
  11032. .TP
  11033. .B \fB\-\-oacopts=""\fP
  11034. Completely empties the options list.
  11035. .UNINDENT
  11036. .TP
  11037. .B \fB\-\-oafirst\fP
  11038. Force the audio stream to become the first stream in the output.
  11039. By default, the order is unspecified. Deprecated.
  11040. .TP
  11041. .B \fB\-\-ovc=<codec>\fP
  11042. Specifies the output video codec. See \fB\-\-ovc=help\fP for a full list of
  11043. supported codecs.
  11044. .TP
  11045. .B \fB\-\-ovoffset=<value>\fP
  11046. Shifts video data by the given time (in seconds) by shifting the pts
  11047. values. Deprecated.
  11048. .TP
  11049. .B \fB\-\-ovcopts=<options>\fP
  11050. Specifies the output video codec options for libavcodec.
  11051. See \-\-ovcopts=help for a full list of supported options.
  11052. .INDENT 7.0
  11053. .INDENT 3.5
  11054. .IP "Examples"
  11055. .INDENT 0.0
  11056. .TP
  11057. .B \fB"\-\-ovc=mpeg4 \-\-ovcopts=qscale=5"\fP
  11058. selects constant quantizer scale 5 for MPEG\-4 encoding.
  11059. .TP
  11060. .B \fB"\-\-ovc=libx264 \-\-ovcopts=crf=23"\fP
  11061. selects VBR quality factor 23 for H.264 encoding.
  11062. .UNINDENT
  11063. .UNINDENT
  11064. .UNINDENT
  11065. .sp
  11066. This is a key/value list option. See \fI\%List Options\fP for details.
  11067. .INDENT 7.0
  11068. .TP
  11069. .B \fB\-\-ovcopts\-add=<option>\fP
  11070. Appends the option given as an argument to the options list. (Passing
  11071. multiple options is currently still possible, but deprecated.)
  11072. .TP
  11073. .B \fB\-\-ovcopts=""\fP
  11074. Completely empties the options list.
  11075. .UNINDENT
  11076. .TP
  11077. .B \fB\-\-ovfirst\fP
  11078. Force the video stream to become the first stream in the output.
  11079. By default, the order is unspecified. Deprecated.
  11080. .TP
  11081. .B \fB\-\-orawts\fP
  11082. Copies input pts to the output video (not supported by some output
  11083. container formats, e.g. AVI). In this mode, discontinuities are not fixed
  11084. and all pts are passed through as\-is. Never seek backwards or use multiple
  11085. input files in this mode!
  11086. .TP
  11087. .B \fB\-\-no\-ocopy\-metadata\fP
  11088. Turns off copying of metadata from input files to output files when
  11089. encoding (which is enabled by default).
  11090. .TP
  11091. .B \fB\-\-oset\-metadata=<metadata\-tag[,metadata\-tag,...]>\fP
  11092. Specifies metadata to include in the output file.
  11093. Supported keys vary between output formats. For example, Matroska (MKV) and
  11094. FLAC allow almost arbitrary keys, while support in MP4 and MP3 is more
  11095. limited.
  11096. .sp
  11097. This is a key/value list option. See \fI\%List Options\fP for details.
  11098. .INDENT 7.0
  11099. .INDENT 3.5
  11100. .IP "Example"
  11101. .INDENT 0.0
  11102. .TP
  11103. .B "\fB\-\-oset\-metadata=title="Output title",comment="Another tag"\fP"
  11104. adds a title and a comment to the output file.
  11105. .UNINDENT
  11106. .UNINDENT
  11107. .UNINDENT
  11108. .TP
  11109. .B \fB\-\-oremove\-metadata=<metadata\-tag[,metadata\-tag,...]>\fP
  11110. Specifies metadata to exclude from the output file when copying from the
  11111. input file.
  11112. .sp
  11113. This is a string list option. See \fI\%List Options\fP for details.
  11114. .INDENT 7.0
  11115. .INDENT 3.5
  11116. .IP "Example"
  11117. .INDENT 0.0
  11118. .TP
  11119. .B "\fB\-\-oremove\-metadata=comment,genre\fP"
  11120. excludes copying of the the comment and genre tags to the output
  11121. file.
  11122. .UNINDENT
  11123. .UNINDENT
  11124. .UNINDENT
  11125. .UNINDENT
  11126. .SH COMMAND INTERFACE
  11127. .sp
  11128. The mpv core can be controlled with commands and properties. A number of ways
  11129. to interact with the player use them: key bindings (\fBinput.conf\fP), OSD
  11130. (showing information with properties), JSON IPC, the client API (\fBlibmpv\fP),
  11131. and the classic slave mode.
  11132. .SS input.conf
  11133. .sp
  11134. The input.conf file consists of a list of key bindings, for example:
  11135. .INDENT 0.0
  11136. .INDENT 3.5
  11137. .sp
  11138. .nf
  11139. .ft C
  11140. s screenshot # take a screenshot with the s key
  11141. LEFT seek 15 # map the left\-arrow key to seeking forward by 15 seconds
  11142. .ft P
  11143. .fi
  11144. .UNINDENT
  11145. .UNINDENT
  11146. .sp
  11147. Each line maps a key to an input command. Keys are specified with their literal
  11148. value (upper case if combined with \fBShift\fP), or a name for special keys. For
  11149. example, \fBa\fP maps to the \fBa\fP key without shift, and \fBA\fP maps to \fBa\fP
  11150. with shift.
  11151. .sp
  11152. The file is located in the mpv configuration directory (normally at
  11153. \fB~/.config/mpv/input.conf\fP depending on platform). The default bindings are
  11154. defined here:
  11155. .INDENT 0.0
  11156. .INDENT 3.5
  11157. .sp
  11158. .nf
  11159. .ft C
  11160. https://github.com/mpv\-player/mpv/blob/master/etc/input.conf
  11161. .ft P
  11162. .fi
  11163. .UNINDENT
  11164. .UNINDENT
  11165. .sp
  11166. A list of special keys can be obtained with
  11167. .INDENT 0.0
  11168. .INDENT 3.5
  11169. \fBmpv \-\-input\-keylist\fP
  11170. .UNINDENT
  11171. .UNINDENT
  11172. .sp
  11173. In general, keys can be combined with \fBShift\fP, \fBCtrl\fP and \fBAlt\fP:
  11174. .INDENT 0.0
  11175. .INDENT 3.5
  11176. .sp
  11177. .nf
  11178. .ft C
  11179. ctrl+q quit
  11180. .ft P
  11181. .fi
  11182. .UNINDENT
  11183. .UNINDENT
  11184. .sp
  11185. \fBmpv\fP can be started in input test mode, which displays key bindings and the
  11186. commands they\(aqre bound to on the OSD, instead of executing the commands:
  11187. .INDENT 0.0
  11188. .INDENT 3.5
  11189. .sp
  11190. .nf
  11191. .ft C
  11192. mpv \-\-input\-test \-\-force\-window \-\-idle
  11193. .ft P
  11194. .fi
  11195. .UNINDENT
  11196. .UNINDENT
  11197. .sp
  11198. (Only closing the window will make \fBmpv\fP exit, pressing normal keys will
  11199. merely display the binding, even if mapped to quit.)
  11200. .sp
  11201. Also see \fI\%Key names\fP\&.
  11202. .SS input.conf syntax
  11203. .sp
  11204. \fB[Shift+][Ctrl+][Alt+][Meta+]<key> [{<section>}] <command> ( ; <command> )*\fP
  11205. .sp
  11206. Note that by default, the right Alt key can be used to create special
  11207. characters, and thus does not register as a modifier. The option
  11208. \fB\-\-no\-input\-right\-alt\-gr\fP changes this behavior.
  11209. .sp
  11210. Newlines always start a new binding. \fB#\fP starts a comment (outside of quoted
  11211. string arguments). To bind commands to the \fB#\fP key, \fBSHARP\fP can be used.
  11212. .sp
  11213. \fB<key>\fP is either the literal character the key produces (ASCII or Unicode
  11214. character), or a symbolic name (as printed by \fB\-\-input\-keylist\fP).
  11215. .sp
  11216. \fB<section>\fP (braced with \fB{\fP and \fB}\fP) is the input section for this
  11217. command.
  11218. .sp
  11219. \fB<command>\fP is the command itself. It consists of the command name and
  11220. multiple (or none) commands, all separated by whitespace. String arguments
  11221. need to be quoted with \fB"\fP\&. Details see \fBFlat command syntax\fP\&.
  11222. .sp
  11223. You can bind multiple commands to one key. For example:
  11224. .nf
  11225. a show\-text "command 1" ; show\-text "command 2"
  11226. .fi
  11227. .sp
  11228. .sp
  11229. It\(aqs also possible to bind a command to a sequence of keys:
  11230. .nf
  11231. a\-b\-c show\-text "command run after a, b, c have been pressed"
  11232. .fi
  11233. .sp
  11234. .sp
  11235. (This is not shown in the general command syntax.)
  11236. .sp
  11237. If \fBa\fP or \fBa\-b\fP or \fBb\fP are already bound, this will run the first command
  11238. that matches, and the multi\-key command will never be called. Intermediate keys
  11239. can be remapped to \fBignore\fP in order to avoid this issue. The maximum number
  11240. of (non\-modifier) keys for combinations is currently 4.
  11241. .SS Key names
  11242. .sp
  11243. All mouse and keyboard input is to converted to mpv\-specific key names. Key
  11244. names are either special symbolic identifiers representing a physical key, or a
  11245. text key names, which are unicode code points encoded as UTF\-8. These are what
  11246. keyboard input would normally produce, for example \fBa\fP for the A key. As a
  11247. consequence, mpv uses input translated by the current OS keyboard layout, rather
  11248. than physical scan codes.
  11249. .sp
  11250. Currently there is the hardcoded assumption that every text key can be
  11251. represented as a single unicode code point (in NFKC form).
  11252. .sp
  11253. All key names can be combined with the modifiers \fBShift\fP, \fBCtrl\fP, \fBAlt\fP,
  11254. \fBMeta\fP\&. They must be prefixed to the actual key name, where each modifier
  11255. is followed by a \fB+\fP (for example \fBctrl+q\fP).
  11256. .sp
  11257. Symbolic key names and modifier names are case\-insensitive. Unicode key names
  11258. are case\-sensitive because input bindings typically respect the shift key.
  11259. .sp
  11260. Another type of key names are hexadecimal key names, that serve as fallback
  11261. for special keys that are neither unicode, nor have a special mpv defined name.
  11262. They will break as soon as mpv adds proper names for them, but can enable you
  11263. to use a key at all if that does not happen.
  11264. .sp
  11265. All symbolic names are listed by \fB\-\-input\-keylist\fP\&. \fB\-\-input\-test\fP is a
  11266. special mode that prints all input on the OSD.
  11267. .sp
  11268. Comments on some symbolic names:
  11269. .INDENT 0.0
  11270. .TP
  11271. .B \fBKP*\fP
  11272. Keypad names. Behavior varies by backend (whether they implement this, and
  11273. on how they treat numlock), but typically, mpv tries to map keys on the
  11274. keypad to separate names, even if they produce the same text as normal keys.
  11275. .TP
  11276. .B \fBMOUSE_BTN*\fP, \fBMBTN*\fP
  11277. Various mouse buttons.
  11278. .sp
  11279. Depending on backend, the mouse wheel might also be represented as a button.
  11280. In addition, \fBMOUSE_BTN3\fP to \fBMOUSE_BTN6\fP are deprecated aliases for
  11281. \fBWHEEL_UP\fP, \fBWHEEL_DOWN\fP, \fBWHEEL_LEFT\fP, \fBWHEEL_RIGHT\fP\&.
  11282. .sp
  11283. \fBMBTN*\fP are aliases for \fBMOUSE_BTN*\fP\&.
  11284. .TP
  11285. .B \fBWHEEL_*\fP
  11286. Mouse wheels (typically).
  11287. .TP
  11288. .B \fBAXIS_*\fP
  11289. Deprecated aliases for \fBWHEEL_*\fP\&.
  11290. .TP
  11291. .B \fB*_DBL\fP
  11292. Mouse button double clicks.
  11293. .TP
  11294. .B \fBMOUSE_MOVE\fP, \fBMOUSE_ENTER\fP, \fBMOUSE_LEAVE\fP
  11295. Emitted by mouse move events. Enter/leave happens when the mouse enters or
  11296. leave the mpv window (or the current mouse region, using the deprecated
  11297. mouse region input section mechanism).
  11298. .TP
  11299. .B \fBCLOSE_WIN\fP
  11300. Pseudo key emitted when closing the mpv window using the OS window manager
  11301. (for example, by clicking the close button in the window title bar).
  11302. .TP
  11303. .B \fBGAMEPAD_*\fP
  11304. Keys emitted by the SDL gamepad backend.
  11305. .TP
  11306. .B \fBUNMAPPED\fP
  11307. Pseudo\-key that matches any unmapped key. (You should probably avoid this
  11308. if possible, because it might change behavior or get removed in the future.)
  11309. .TP
  11310. .B \fBANY_UNICODE\fP
  11311. Pseudo\-key that matches any key that produces text. (You should probably
  11312. avoid this if possible, because it might change behavior or get removed in
  11313. the future.)
  11314. .UNINDENT
  11315. .SS Flat command syntax
  11316. .sp
  11317. This is the syntax used in input.conf, and referred to "input.conf syntax" in
  11318. a number of other places.
  11319. .sp
  11320. \fB<command> ::= [<prefixes>] <command_name> (<argument>)*\fP
  11321. \fB<argument> ::= (<string> | " <quoted_string> " )\fP
  11322. .sp
  11323. \fBcommand_name\fP is an unquoted string with the command name itself. See
  11324. \fI\%List of Input Commands\fP for a list.
  11325. .sp
  11326. Arguments are separated by whitespace. This applies even to string arguments.
  11327. For this reason, string arguments should be quoted with \fB"\fP\&. If a string
  11328. argument contains spaces or certain special characters, quoting and possibly
  11329. escaping is mandatory, or the command cannot be parsed correctly.
  11330. .sp
  11331. Inside quotes, C\-style escaping can be used. JSON escapes according to RFC 8259,
  11332. minus surrogate pair escapes, should be a safe subset that can be used.
  11333. .SS Commands specified as arrays
  11334. .sp
  11335. This applies to certain APIs, such as \fBmp.commandv()\fP or
  11336. \fBmp.command_native()\fP (with array parameters) in Lua scripting, or
  11337. \fBmpv_command()\fP or \fBmpv_command_node()\fP (with MPV_FORMAT_NODE_ARRAY) in the
  11338. C libmpv client API.
  11339. .sp
  11340. The command as well as all arguments are passed as a single array. Similar to
  11341. the \fI\%Flat command syntax\fP, you can first pass prefixes as strings (each as
  11342. separate array item), then the command name as string, and then each argument
  11343. as string or a native value.
  11344. .sp
  11345. Since these APIs pass arguments as separate strings or native values, they do
  11346. not expect quotes, and do support escaping. Technically, there is the input.conf
  11347. parser, which first splits the command string into arguments, and then invokes
  11348. argument parsers for each argument. The input.conf parser normally handles
  11349. quotes and escaping. The array command APIs mentioned above pass strings
  11350. directly to the argument parsers, or can sidestep them by the ability to pass
  11351. non\-string values.
  11352. .sp
  11353. Sometimes commands have string arguments, that in turn are actually parsed by
  11354. other components (e.g. filter strings with \fBvf add\fP) \- in these cases, you
  11355. you would have to double\-escape in input.conf, but not with the array APIs.
  11356. .sp
  11357. For complex commands, consider using \fI\%Named arguments\fP instead, which should
  11358. give slightly more compatibility. Some commands do not support named arguments
  11359. and inherently take an array, though.
  11360. .SS Named arguments
  11361. .sp
  11362. This applies to certain APIs, such as \fBmp.command_native()\fP (with tables that
  11363. have string keys) in Lua scripting, or \fBmpv_command_node()\fP (with
  11364. MPV_FORMAT_NODE_MAP) in the C libmpv client API.
  11365. .sp
  11366. Like with array commands, quoting and escaping is inherently not needed in the
  11367. normal case.
  11368. .sp
  11369. The name of each command is defined in each command description in the
  11370. \fI\%List of Input Commands\fP\&. \fB\-\-input\-cmdlist\fP also lists them.
  11371. .sp
  11372. Some commands do not support named arguments (e.g. \fBrun\fP command). You need
  11373. to use APIs that pass arguments as arrays.
  11374. .sp
  11375. Named arguments are not supported in the "flat" input.conf syntax, which means
  11376. you cannot use them for key bindings in input.conf at all.
  11377. .SS List of Input Commands
  11378. .sp
  11379. Commands with parameters have the parameter name enclosed in \fB<\fP / \fB>\fP\&.
  11380. Don\(aqt add those to the actual command. Optional arguments are enclosed in
  11381. \fB[\fP / \fB]\fP\&. If you don\(aqt pass them, they will be set to a default value.
  11382. .sp
  11383. Remember to quote string arguments in input.conf (see \fI\%Flat command syntax\fP).
  11384. .INDENT 0.0
  11385. .TP
  11386. .B \fBignore\fP
  11387. Use this to "block" keys that should be unbound, and do nothing. Useful for
  11388. disabling default bindings, without disabling all bindings with
  11389. \fB\-\-no\-input\-default\-bindings\fP\&.
  11390. .TP
  11391. .B \fBseek <target> [<flags>]\fP
  11392. Change the playback position. By default, seeks by a relative amount of
  11393. seconds.
  11394. .sp
  11395. The second argument consists of flags controlling the seek mode:
  11396. .INDENT 7.0
  11397. .TP
  11398. .B relative (default)
  11399. Seek relative to current position (a negative value seeks backwards).
  11400. .TP
  11401. .B absolute
  11402. Seek to a given time (a negative value starts from the end of the file).
  11403. .TP
  11404. .B absolute\-percent
  11405. Seek to a given percent position.
  11406. .TP
  11407. .B relative\-percent
  11408. Seek relative to current position in percent.
  11409. .TP
  11410. .B keyframes
  11411. Always restart playback at keyframe boundaries (fast).
  11412. .TP
  11413. .B exact
  11414. Always do exact/hr/precise seeks (slow).
  11415. .UNINDENT
  11416. .sp
  11417. Multiple flags can be combined, e.g.: \fBabsolute+keyframes\fP\&.
  11418. .sp
  11419. By default, \fBkeyframes\fP is used for \fBrelative\fP, \fBrelative\-percent\fP,
  11420. and \fBabsolute\-percent\fP seeks, while \fBexact\fP is used for \fBabsolute\fP
  11421. seeks.
  11422. .sp
  11423. Before mpv 0.9, the \fBkeyframes\fP and \fBexact\fP flags had to be passed as
  11424. 3rd parameter (essentially using a space instead of \fB+\fP). The 3rd
  11425. parameter is still parsed, but is considered deprecated.
  11426. .TP
  11427. .B \fBrevert\-seek [<flags>]\fP
  11428. Undoes the \fBseek\fP command, and some other commands that seek (but not
  11429. necessarily all of them). Calling this command once will jump to the
  11430. playback position before the seek. Calling it a second time undoes the
  11431. \fBrevert\-seek\fP command itself. This only works within a single file.
  11432. .sp
  11433. The first argument is optional, and can change the behavior:
  11434. .INDENT 7.0
  11435. .TP
  11436. .B mark
  11437. Mark the current time position. The next normal \fBrevert\-seek\fP command
  11438. will seek back to this point, no matter how many seeks happened since
  11439. last time.
  11440. .UNINDENT
  11441. .sp
  11442. Using it without any arguments gives you the default behavior.
  11443. .TP
  11444. .B \fBframe\-step\fP
  11445. Play one frame, then pause. Does nothing with audio\-only playback.
  11446. .TP
  11447. .B \fBframe\-back\-step\fP
  11448. Go back by one frame, then pause. Note that this can be very slow (it tries
  11449. to be precise, not fast), and sometimes fails to behave as expected. How
  11450. well this works depends on whether precise seeking works correctly (e.g.
  11451. see the \fB\-\-hr\-seek\-demuxer\-offset\fP option). Video filters or other video
  11452. post\-processing that modifies timing of frames (e.g. deinterlacing) should
  11453. usually work, but might make backstepping silently behave incorrectly in
  11454. corner cases. Using \fB\-\-hr\-seek\-framedrop=no\fP should help, although it
  11455. might make precise seeking slower.
  11456. .sp
  11457. This does not work with audio\-only playback.
  11458. .TP
  11459. .B \fBset <name> <value>\fP
  11460. Set the given property or option to the given value.
  11461. .TP
  11462. .B \fBadd <name> [<value>]\fP
  11463. Add the given value to the property or option. On overflow or underflow,
  11464. clamp the property to the maximum. If \fB<value>\fP is omitted, assume \fB1\fP\&.
  11465. .TP
  11466. .B \fBcycle <name> [<value>]\fP
  11467. Cycle the given property or option. The second argument can be \fBup\fP or
  11468. \fBdown\fP to set the cycle direction. On overflow, set the property back to
  11469. the minimum, on underflow set it to the maximum. If \fBup\fP or \fBdown\fP is
  11470. omitted, assume \fBup\fP\&.
  11471. .TP
  11472. .B \fBmultiply <name> <value>\fP
  11473. Similar to \fBadd\fP, but multiplies the property or option with the numeric
  11474. value.
  11475. .TP
  11476. .B \fBscreenshot <flags>\fP
  11477. Take a screenshot.
  11478. .sp
  11479. Multiple flags are available (some can be combined with \fB+\fP):
  11480. .INDENT 7.0
  11481. .TP
  11482. .B <subtitles> (default)
  11483. Save the video image, in its original resolution, and with subtitles.
  11484. Some video outputs may still include the OSD in the output under certain
  11485. circumstances.
  11486. .TP
  11487. .B <video>
  11488. Like \fBsubtitles\fP, but typically without OSD or subtitles. The exact
  11489. behavior depends on the selected video output.
  11490. .TP
  11491. .B <window>
  11492. Save the contents of the mpv window. Typically scaled, with OSD and
  11493. subtitles. The exact behavior depends on the selected video output, and
  11494. if no support is available, this will act like \fBvideo\fP\&.
  11495. .TP
  11496. .B <each\-frame>
  11497. Take a screenshot each frame. Issue this command again to stop taking
  11498. screenshots. Note that you should disable frame\-dropping when using
  11499. this mode \- or you might receive duplicate images in cases when a
  11500. frame was dropped. This flag can be combined with the other flags,
  11501. e.g. \fBvideo+each\-frame\fP\&.
  11502. .UNINDENT
  11503. .sp
  11504. Older mpv versions required passing \fBsingle\fP and \fBeach\-frame\fP as
  11505. second argument (and did not have flags). This syntax is still understood,
  11506. but deprecated and might be removed in the future.
  11507. .sp
  11508. If you combine this command with another one using \fB;\fP, you can use the
  11509. \fBasync\fP flag to make encoding/writing the image file asynchronous. For
  11510. normal standalone commands, this is always asynchronous, and the flag has
  11511. no effect. (This behavior changed with mpv 0.29.0.)
  11512. .TP
  11513. .B \fBscreenshot\-to\-file <filename> <flags>\fP
  11514. Take a screenshot and save it to a given file. The format of the file will
  11515. be guessed by the extension (and \fB\-\-screenshot\-format\fP is ignored \- the
  11516. behavior when the extension is missing or unknown is arbitrary).
  11517. .sp
  11518. The second argument is like the first argument to \fBscreenshot\fP and
  11519. supports \fBsubtitles\fP, \fBvideo\fP, \fBwindow\fP\&.
  11520. .sp
  11521. If the file already exists, it\(aqs overwritten.
  11522. .sp
  11523. Like all input command parameters, the filename is subject to property
  11524. expansion as described in \fI\%Property Expansion\fP\&.
  11525. .TP
  11526. .B \fBplaylist\-next <flags>\fP
  11527. Go to the next entry on the playlist.
  11528. .sp
  11529. First argument:
  11530. .INDENT 7.0
  11531. .TP
  11532. .B weak (default)
  11533. If the last file on the playlist is currently played, do nothing.
  11534. .TP
  11535. .B force
  11536. Terminate playback if there are no more files on the playlist.
  11537. .UNINDENT
  11538. .TP
  11539. .B \fBplaylist\-prev <flags>\fP
  11540. Go to the previous entry on the playlist.
  11541. .sp
  11542. First argument:
  11543. .INDENT 7.0
  11544. .TP
  11545. .B weak (default)
  11546. If the first file on the playlist is currently played, do nothing.
  11547. .TP
  11548. .B force
  11549. Terminate playback if the first file is being played.
  11550. .UNINDENT
  11551. .TP
  11552. .B \fBloadfile <url> [<flags> [<options>]]\fP
  11553. Load the given file or URL and play it.
  11554. .sp
  11555. Second argument:
  11556. .INDENT 7.0
  11557. .TP
  11558. .B <replace> (default)
  11559. Stop playback of the current file, and play the new file immediately.
  11560. .TP
  11561. .B <append>
  11562. Append the file to the playlist.
  11563. .TP
  11564. .B <append\-play>
  11565. Append the file, and if nothing is currently playing, start playback.
  11566. (Always starts with the added file, even if the playlist was not empty
  11567. before running this command.)
  11568. .UNINDENT
  11569. .sp
  11570. The third argument is a list of options and values which should be set
  11571. while the file is playing. It is of the form \fBopt1=value1,opt2=value2,..\fP\&.
  11572. Not all options can be changed this way. Some options require a restart
  11573. of the player.
  11574. .TP
  11575. .B \fBloadlist <url> [<flags>]\fP
  11576. Load the given playlist file or URL (like \fB\-\-playlist\fP).
  11577. .sp
  11578. Second argument:
  11579. .INDENT 7.0
  11580. .TP
  11581. .B <replace> (default)
  11582. Stop playback and replace the internal playlist with the new one.
  11583. .TP
  11584. .B <append>
  11585. Append the new playlist at the end of the current internal playlist.
  11586. .UNINDENT
  11587. .TP
  11588. .B \fBplaylist\-clear\fP
  11589. Clear the playlist, except the currently played file.
  11590. .TP
  11591. .B \fBplaylist\-remove <index>\fP
  11592. Remove the playlist entry at the given index. Index values start counting
  11593. with 0. The special value \fBcurrent\fP removes the current entry. Note that
  11594. removing the current entry also stops playback and starts playing the next
  11595. entry.
  11596. .TP
  11597. .B \fBplaylist\-move <index1> <index2>\fP
  11598. Move the playlist entry at index1, so that it takes the place of the
  11599. entry index2. (Paradoxically, the moved playlist entry will not have
  11600. the index value index2 after moving if index1 was lower than index2,
  11601. because index2 refers to the target entry, not the index the entry
  11602. will have after moving.)
  11603. .TP
  11604. .B \fBplaylist\-shuffle\fP
  11605. Shuffle the playlist. This is similar to what is done on start if the
  11606. \fB\-\-shuffle\fP option is used.
  11607. .TP
  11608. .B \fBplaylist\-unshuffle\fP
  11609. Attempt to revert the previous \fBplaylist\-shuffle\fP command. This works
  11610. only once (multiple successive \fBplaylist\-unshuffle\fP commands do nothing).
  11611. May not work correctly if new recursive playlists have been opened since
  11612. a \fBplaylist\-shuffle\fP command.
  11613. .TP
  11614. .B \fBrun <command> [<arg1> [<arg2> [...]]]\fP
  11615. Run the given command. Unlike in MPlayer/mplayer2 and earlier versions of
  11616. mpv (0.2.x and older), this doesn\(aqt call the shell. Instead, the command
  11617. is run directly, with each argument passed separately. Each argument is
  11618. expanded like in \fI\%Property Expansion\fP\&.
  11619. .sp
  11620. This command has a variable number of arguments, and cannot be used with
  11621. named arguments.
  11622. .sp
  11623. The program is run in a detached way. mpv doesn\(aqt wait until the command
  11624. is completed, but continues playback right after spawning it.
  11625. .sp
  11626. To get the old behavior, use \fB/bin/sh\fP and \fB\-c\fP as the first two
  11627. arguments.
  11628. .INDENT 7.0
  11629. .INDENT 3.5
  11630. .IP "Example"
  11631. .sp
  11632. \fBrun "/bin/sh" "\-c" "echo ${title} > /tmp/playing"\fP
  11633. .sp
  11634. This is not a particularly good example, because it doesn\(aqt handle
  11635. escaping, and a specially prepared file might allow an attacker to
  11636. execute arbitrary shell commands. It is recommended to write a small
  11637. shell script, and call that with \fBrun\fP\&.
  11638. .UNINDENT
  11639. .UNINDENT
  11640. .TP
  11641. .B \fBsubprocess\fP
  11642. Similar to \fBrun\fP, but gives more control about process execution to the
  11643. caller, and does does not detach the process.
  11644. .sp
  11645. You can avoid blocking until the process terminates by running this command
  11646. asynchronously. (For example \fBmp.command_native_async()\fP in Lua scripting.)
  11647. .sp
  11648. This has the following named arguments. The order of them is not guaranteed,
  11649. so you should always call them with named arguments, see \fI\%Named arguments\fP\&.
  11650. .INDENT 7.0
  11651. .TP
  11652. .B \fBargs\fP (\fBMPV_FORMAT_NODE_ARRAY[MPV_FORMAT_STRING]\fP)
  11653. Array of strings with the command as first argument, and subsequent
  11654. command line arguments following. This is just like the \fBrun\fP command
  11655. argument list.
  11656. .sp
  11657. The first array entry is either an absolute path to the executable, or
  11658. a filename with no path components, in which case the \fBPATH\fP
  11659. environment variable. On Unix, this is equivalent to \fBposix_spawnp\fP
  11660. and \fBexecvp\fP behavior.
  11661. .TP
  11662. .B \fBplayback_only\fP (\fBMPV_FORMAT_FLAG\fP)
  11663. Boolean indicating whether the process should be killed when playback
  11664. terminates (optional, default: yes). If enabled, stopping playback
  11665. will automatically kill the process, and you can\(aqt start it outside of
  11666. playback.
  11667. .TP
  11668. .B \fBcapture_size\fP (\fBMPV_FORMAT_INT64\fP)
  11669. Integer setting the maximum number of stdout plus stderr bytes that can
  11670. be captured (optional, default: 64MB). If the number of bytes exceeds
  11671. this, capturing is stopped. The limit is per captured stream.
  11672. .TP
  11673. .B \fBcapture_stdout\fP (\fBMPV_FORMAT_FLAG\fP)
  11674. Capture all data the process outputs to stdout and return it once the
  11675. process ends (optional, default: no).
  11676. .TP
  11677. .B \fBcapture_stderr\fP (\fBMPV_FORMAT_FLAG\fP)
  11678. Same as \fBcapture_stdout\fP, but for stderr.
  11679. .UNINDENT
  11680. .sp
  11681. The command returns the following result (as \fBMPV_FORMAT_NODE_MAP\fP):
  11682. .INDENT 7.0
  11683. .TP
  11684. .B \fBstatus\fP (\fBMPV_FORMAT_INT64\fP)
  11685. The raw exit status of the process. It will be negative on error. The
  11686. meaning of negative values is undefined, other than meaning error (and
  11687. does not necessarily correspond to OS low level exit status values).
  11688. .sp
  11689. On Windows, it can happen that a negative return value is returned
  11690. even if the process exits gracefully, because the win32 \fBUINT\fP exit
  11691. code is assigned to an \fBint\fP variable before being set as \fBint64_t\fP
  11692. field in the result map. This might be fixed later.
  11693. .TP
  11694. .B \fBstdout\fP (\fBMPV_FORMAT_BYTE_ARRAY\fP)
  11695. Captured stdout stream, limited to \fBcapture_size\fP\&.
  11696. .TP
  11697. .B \fBstderr\fP (\fBMPV_FORMAT_BYTE_ARRAY\fP)
  11698. Same as \fBstdout\fP, but for stderr.
  11699. .TP
  11700. .B \fBerror_string\fP (\fBMPV_FORMAT_STRING\fP)
  11701. Empty string if the process exited gracefully. The string \fBkilled\fP if
  11702. the process was terminated in an unusual way. The string \fBinit\fP if the
  11703. process could not be started.
  11704. .sp
  11705. On Windows, \fBkilled\fP is only returned when the process has been
  11706. killed by mpv as a result of \fBplayback_only\fP being set to \fByes\fP\&.
  11707. .TP
  11708. .B \fBkilled_by_us\fP (\fBMPV_FORMAT_FLAG\fP)
  11709. Set to \fByes\fP if the process has been killed by mpv, for example as a
  11710. result of \fBplayback_only\fP being set to \fByes\fP, aborting the command
  11711. (e.g. by \fBmp.abort_async_command()\fP), or if the player is about to
  11712. exit.
  11713. .UNINDENT
  11714. .sp
  11715. Note that the command itself will always return success as long as the
  11716. parameters are correct. Whether the process could be spawned or whether
  11717. it was somehow killed or returned an error status has to be queried from
  11718. the result value.
  11719. .sp
  11720. This command can be asynchronously aborted via API.
  11721. .sp
  11722. In all cases, the subprocess will be terminated on player exit. Also see
  11723. \fI\%Asynchronous command details\fP\&. Only the \fBrun\fP command can start
  11724. processes in a truly detached way.
  11725. .INDENT 7.0
  11726. .INDENT 3.5
  11727. .IP "Warning"
  11728. .sp
  11729. Don\(aqt forget to set the \fBplayback_only\fP field if you want the command
  11730. run while the player is in idle mode, or if you don\(aqt want that end of
  11731. playback kills the command.
  11732. .UNINDENT
  11733. .UNINDENT
  11734. .TP
  11735. .B \fBquit [<code>]\fP
  11736. Exit the player. If an argument is given, it\(aqs used as process exit code.
  11737. .TP
  11738. .B \fBquit\-watch\-later [<code>]\fP
  11739. Exit player, and store current playback position. Playing that file later
  11740. will seek to the previous position on start. The (optional) argument is
  11741. exactly as in the \fBquit\fP command.
  11742. .TP
  11743. .B \fBsub\-add <url> [<flags> [<title> [<lang>]]]\fP
  11744. Load the given subtitle file or stream. By default, it is selected as
  11745. current subtitle after loading.
  11746. .sp
  11747. The \fBflags\fP argument is one of the following values:
  11748. .sp
  11749. <select>
  11750. .INDENT 7.0
  11751. .INDENT 3.5
  11752. Select the subtitle immediately (default).
  11753. .UNINDENT
  11754. .UNINDENT
  11755. .sp
  11756. <auto>
  11757. .INDENT 7.0
  11758. .INDENT 3.5
  11759. Don\(aqt select the subtitle. (Or in some special situations, let the
  11760. default stream selection mechanism decide.)
  11761. .UNINDENT
  11762. .UNINDENT
  11763. .sp
  11764. <cached>
  11765. .INDENT 7.0
  11766. .INDENT 3.5
  11767. Select the subtitle. If a subtitle with the same filename was already
  11768. added, that one is selected, instead of loading a duplicate entry.
  11769. (In this case, title/language are ignored, and if the was changed since
  11770. it was loaded, these changes won\(aqt be reflected.)
  11771. .UNINDENT
  11772. .UNINDENT
  11773. .sp
  11774. The \fBtitle\fP argument sets the track title in the UI.
  11775. .sp
  11776. The \fBlang\fP argument sets the track language, and can also influence
  11777. stream selection with \fBflags\fP set to \fBauto\fP\&.
  11778. .TP
  11779. .B \fBsub\-remove [<id>]\fP
  11780. Remove the given subtitle track. If the \fBid\fP argument is missing, remove
  11781. the current track. (Works on external subtitle files only.)
  11782. .TP
  11783. .B \fBsub\-reload [<id>]\fP
  11784. Reload the given subtitle tracks. If the \fBid\fP argument is missing, reload
  11785. the current track. (Works on external subtitle files only.)
  11786. .sp
  11787. This works by unloading and re\-adding the subtitle track.
  11788. .TP
  11789. .B \fBsub\-step <skip>\fP
  11790. Change subtitle timing such, that the subtitle event after the next
  11791. \fB<skip>\fP subtitle events is displayed. \fB<skip>\fP can be negative to step
  11792. backwards.
  11793. .TP
  11794. .B \fBsub\-seek <skip>\fP
  11795. Seek to the next (skip set to 1) or the previous (skip set to \-1) subtitle.
  11796. This is similar to \fBsub\-step\fP, except that it seeks video and audio
  11797. instead of adjusting the subtitle delay.
  11798. .sp
  11799. For embedded subtitles (like with Matroska), this works only with subtitle
  11800. events that have already been displayed, or are within a short prefetch
  11801. range.
  11802. .TP
  11803. .B \fBprint\-text <text>\fP
  11804. Print text to stdout. The string can contain properties (see
  11805. \fI\%Property Expansion\fP). Take care to put the argument in quotes.
  11806. .TP
  11807. .B \fBshow\-text <text> [<duration>|\-1 [<level>]]\fP
  11808. Show text on the OSD. The string can contain properties, which are expanded
  11809. as described in \fI\%Property Expansion\fP\&. This can be used to show playback
  11810. time, filename, and so on.
  11811. .INDENT 7.0
  11812. .TP
  11813. .B <duration>
  11814. The time in ms to show the message for. By default, it uses the same
  11815. value as \fB\-\-osd\-duration\fP\&.
  11816. .TP
  11817. .B <level>
  11818. The minimum OSD level to show the text at (see \fB\-\-osd\-level\fP).
  11819. .UNINDENT
  11820. .TP
  11821. .B \fBexpand\-text <string>\fP
  11822. Property\-expand the argument and return the expanded string. This can be
  11823. used only through the client API or from a script using
  11824. \fBmp.command_native\fP\&. (see \fI\%Property Expansion\fP).
  11825. .TP
  11826. .B \fBexpand\-path "<string>"\fP
  11827. Expand a path\(aqs double\-tilde placeholders into a platform\-specific path.
  11828. As \fBexpand\-text\fP, this can only be used through the client API or from
  11829. a script using \fBmp.command_native\fP\&.
  11830. .INDENT 7.0
  11831. .INDENT 3.5
  11832. .IP "Example"
  11833. .sp
  11834. \fBmp.osd_message(mp.command_native({"expand\-path", "~~home/"}))\fP
  11835. .sp
  11836. This line of Lua would show the location of the user\(aqs mpv
  11837. configuration directory on the OSD.
  11838. .UNINDENT
  11839. .UNINDENT
  11840. .TP
  11841. .B \fBshow\-progress\fP
  11842. Show the progress bar, the elapsed time and the total duration of the file
  11843. on the OSD.
  11844. .TP
  11845. .B \fBwrite\-watch\-later\-config\fP
  11846. Write the resume config file that the \fBquit\-watch\-later\fP command writes,
  11847. but continue playback normally.
  11848. .TP
  11849. .B \fBstop\fP
  11850. Stop playback and clear playlist. With default settings, this is
  11851. essentially like \fBquit\fP\&. Useful for the client API: playback can be
  11852. stopped without terminating the player.
  11853. .TP
  11854. .B \fBmouse <x> <y> [<button> [<mode>]]\fP
  11855. Send a mouse event with given coordinate (\fB<x>\fP, \fB<y>\fP).
  11856. .sp
  11857. Second argument:
  11858. .INDENT 7.0
  11859. .TP
  11860. .B <button>
  11861. The button number of clicked mouse button. This should be one of 0\-19.
  11862. If \fB<button>\fP is omitted, only the position will be updated.
  11863. .UNINDENT
  11864. .sp
  11865. Third argument:
  11866. .INDENT 7.0
  11867. .TP
  11868. .B <single> (default)
  11869. The mouse event represents regular single click.
  11870. .TP
  11871. .B <double>
  11872. The mouse event represents double\-click.
  11873. .UNINDENT
  11874. .TP
  11875. .B \fBkeypress <name>\fP
  11876. Send a key event through mpv\(aqs input handler, triggering whatever
  11877. behavior is configured to that key. \fBname\fP uses the \fBinput.conf\fP
  11878. naming scheme for keys and modifiers. Useful for the client API: key events
  11879. can be sent to libmpv to handle internally.
  11880. .TP
  11881. .B \fBkeydown <name>\fP
  11882. Similar to \fBkeypress\fP, but sets the \fBKEYDOWN\fP flag so that if the key is
  11883. bound to a repeatable command, it will be run repeatedly with mpv\(aqs key
  11884. repeat timing until the \fBkeyup\fP command is called.
  11885. .TP
  11886. .B \fBkeyup [<name>]\fP
  11887. Set the \fBKEYUP\fP flag, stopping any repeated behavior that had been
  11888. triggered. \fBname\fP is optional. If \fBname\fP is not given or is an
  11889. empty string, \fBKEYUP\fP will be set on all keys. Otherwise, \fBKEYUP\fP will
  11890. only be set on the key specified by \fBname\fP\&.
  11891. .TP
  11892. .B \fBkeybind <name> <command>\fP
  11893. Binds a key to an input command. \fBcommand\fP must be a complete command
  11894. containing all the desired arguments and flags. Both \fBname\fP and
  11895. \fBcommand\fP use the \fBinput.conf\fP naming scheme. This is primarily
  11896. useful for the client API.
  11897. .TP
  11898. .B \fBaudio\-add <url> [<flags> [<title> [<lang>]]]\fP
  11899. Load the given audio file. See \fBsub\-add\fP command.
  11900. .TP
  11901. .B \fBaudio\-remove [<id>]\fP
  11902. Remove the given audio track. See \fBsub\-remove\fP command.
  11903. .TP
  11904. .B \fBaudio\-reload [<id>]\fP
  11905. Reload the given audio tracks. See \fBsub\-reload\fP command.
  11906. .TP
  11907. .B \fBvideo\-add <url> [<flags> [<title> [<lang>]]]\fP
  11908. Load the given video file. See \fBsub\-add\fP command.
  11909. .TP
  11910. .B \fBvideo\-remove [<id>]\fP
  11911. Remove the given video track. See \fBsub\-remove\fP command.
  11912. .TP
  11913. .B \fBvideo\-reload [<id>]\fP
  11914. Reload the given video tracks. See \fBsub\-reload\fP command.
  11915. .TP
  11916. .B \fBrescan\-external\-files [<mode>]\fP
  11917. Rescan external files according to the current \fB\-\-sub\-auto\fP and
  11918. \fB\-\-audio\-file\-auto\fP settings. This can be used to auto\-load external
  11919. files \fIafter\fP the file was loaded.
  11920. .sp
  11921. The \fBmode\fP argument is one of the following:
  11922. .INDENT 7.0
  11923. .TP
  11924. .B <reselect> (default)
  11925. Select the default audio and subtitle streams, which typically selects
  11926. external files with the highest preference. (The implementation is not
  11927. perfect, and could be improved on request.)
  11928. .TP
  11929. .B <keep\-selection>
  11930. Do not change current track selections.
  11931. .UNINDENT
  11932. .UNINDENT
  11933. .SS Input Commands that are Possibly Subject to Change
  11934. .INDENT 0.0
  11935. .TP
  11936. .B \fBaf <operation> <value>\fP
  11937. Change audio filter chain. See \fBvf\fP command.
  11938. .TP
  11939. .B \fBvf <operation> <value>\fP
  11940. Change video filter chain.
  11941. .sp
  11942. The semantics are exactly the same as with option parsing (see
  11943. \fI\%VIDEO FILTERS\fP). As such the text below is a redundant and incomplete
  11944. summary.
  11945. .sp
  11946. The first argument decides what happens:
  11947. .INDENT 7.0
  11948. .TP
  11949. .B <set>
  11950. Overwrite the previous filter chain with the new one.
  11951. .TP
  11952. .B <add>
  11953. Append the new filter chain to the previous one.
  11954. .TP
  11955. .B <toggle>
  11956. Check if the given filter (with the exact parameters) is already
  11957. in the video chain. If yes, remove the filter. If no, add the filter.
  11958. (If several filters are passed to the command, this is done for
  11959. each filter.)
  11960. .sp
  11961. A special variant is combining this with labels, and using \fB@name\fP
  11962. without filter name and parameters as filter entry. This toggles the
  11963. enable/disable flag.
  11964. .TP
  11965. .B <del>
  11966. Remove the given filters from the video chain. Unlike in the other
  11967. cases, the second parameter is a comma separated list of filter names
  11968. or integer indexes. \fB0\fP would denote the first filter. Negative
  11969. indexes start from the last filter, and \fB\-1\fP denotes the last
  11970. filter. Deprecated.
  11971. .TP
  11972. .B <clr>
  11973. Remove all filters. Note that like the other sub\-commands, this does
  11974. not control automatically inserted filters.
  11975. .UNINDENT
  11976. .sp
  11977. The argument is always needed. E.g. in case of \fBclr\fP use \fBvf clr ""\fP\&.
  11978. .sp
  11979. You can assign labels to filter by prefixing them with \fB@name:\fP (where
  11980. \fBname\fP is a user\-chosen arbitrary identifier). Labels can be used to
  11981. refer to filters by name in all of the filter chain modification commands.
  11982. For \fBadd\fP, using an already used label will replace the existing filter.
  11983. .sp
  11984. The \fBvf\fP command shows the list of requested filters on the OSD after
  11985. changing the filter chain. This is roughly equivalent to
  11986. \fBshow\-text ${vf}\fP\&. Note that auto\-inserted filters for format conversion
  11987. are not shown on the list, only what was requested by the user.
  11988. .sp
  11989. Normally, the commands will check whether the video chain is recreated
  11990. successfully, and will undo the operation on failure. If the command is run
  11991. before video is configured (can happen if the command is run immediately
  11992. after opening a file and before a video frame is decoded), this check can\(aqt
  11993. be run. Then it can happen that creating the video chain fails.
  11994. .INDENT 7.0
  11995. .INDENT 3.5
  11996. .IP "Example for input.conf"
  11997. .INDENT 0.0
  11998. .IP \(bu 2
  11999. \fBa vf set flip\fP turn video upside\-down on the \fBa\fP key
  12000. .IP \(bu 2
  12001. \fBb vf set ""\fP remove all video filters on \fBb\fP
  12002. .IP \(bu 2
  12003. \fBc vf toggle gradfun\fP toggle debanding on \fBc\fP
  12004. .UNINDENT
  12005. .UNINDENT
  12006. .UNINDENT
  12007. .INDENT 7.0
  12008. .INDENT 3.5
  12009. .IP "Example how to toggle disabled filters at runtime"
  12010. .INDENT 0.0
  12011. .IP \(bu 2
  12012. Add something like \fBvf\-add=@deband:!gradfun\fP to \fBmpv.conf\fP\&.
  12013. The \fB@deband:\fP is the label, an arbitrary, user\-given name for this
  12014. filter entry. The \fB!\fP before the filter name disables the filter by
  12015. default. Everything after this is the normal filter name and possibly
  12016. filter parameters, like in the normal \fB\-\-vf\fP syntax.
  12017. .IP \(bu 2
  12018. Add \fBa vf toggle @deband\fP to \fBinput.conf\fP\&. This toggles the
  12019. "disabled" flag for the filter with the label \fBdeband\fP when the
  12020. \fBa\fP key is hit.
  12021. .UNINDENT
  12022. .UNINDENT
  12023. .UNINDENT
  12024. .TP
  12025. .B \fBcycle\-values [<"!reverse">] <property> <value1> [<value2> [...]]\fP
  12026. Cycle through a list of values. Each invocation of the command will set the
  12027. given property to the next value in the list. The command will use the
  12028. current value of the property/option, and use it to determine the current
  12029. position in the list of values. Once it has found it, it will set the
  12030. next value in the list (wrapping around to the first item if needed).
  12031. .sp
  12032. This command has a variable number of arguments, and cannot be used with
  12033. named arguments.
  12034. .sp
  12035. The special argument \fB!reverse\fP can be used to cycle the value list in
  12036. reverse. The only advantage is that you don\(aqt need to reverse the value
  12037. list yourself when adding a second key binding for cycling backwards.
  12038. .TP
  12039. .B \fBenable\-section <name> [<flags>]\fP
  12040. This command is deprecated, except for mpv\-internal uses.
  12041. .sp
  12042. Enable all key bindings in the named input section.
  12043. .sp
  12044. The enabled input sections form a stack. Bindings in sections on the top of
  12045. the stack are preferred to lower sections. This command puts the section
  12046. on top of the stack. If the section was already on the stack, it is
  12047. implicitly removed beforehand. (A section cannot be on the stack more than
  12048. once.)
  12049. .sp
  12050. The \fBflags\fP parameter can be a combination (separated by \fB+\fP) of the
  12051. following flags:
  12052. .INDENT 7.0
  12053. .TP
  12054. .B <exclusive>
  12055. All sections enabled before the newly enabled section are disabled.
  12056. They will be re\-enabled as soon as all exclusive sections above them
  12057. are removed. In other words, the new section shadows all previous
  12058. sections.
  12059. .TP
  12060. .B <allow\-hide\-cursor>
  12061. This feature can\(aqt be used through the public API.
  12062. .TP
  12063. .B <allow\-vo\-dragging>
  12064. Same.
  12065. .UNINDENT
  12066. .TP
  12067. .B \fBdisable\-section <name>\fP
  12068. This command is deprecated, except for mpv\-internal uses.
  12069. .sp
  12070. Disable the named input section. Undoes \fBenable\-section\fP\&.
  12071. .TP
  12072. .B \fBdefine\-section <name> <contents> [<flags>]\fP
  12073. This command is deprecated, except for mpv\-internal uses.
  12074. .sp
  12075. Create a named input section, or replace the contents of an already existing
  12076. input section. The \fBcontents\fP parameter uses the same syntax as the
  12077. \fBinput.conf\fP file (except that using the section syntax in it is not
  12078. allowed), including the need to separate bindings with a newline character.
  12079. .sp
  12080. If the \fBcontents\fP parameter is an empty string, the section is removed.
  12081. .sp
  12082. The section with the name \fBdefault\fP is the normal input section.
  12083. .sp
  12084. In general, input sections have to be enabled with the \fBenable\-section\fP
  12085. command, or they are ignored.
  12086. .sp
  12087. The last parameter has the following meaning:
  12088. .INDENT 7.0
  12089. .TP
  12090. .B <default> (also used if parameter omitted)
  12091. Use a key binding defined by this section only if the user hasn\(aqt
  12092. already bound this key to a command.
  12093. .TP
  12094. .B <force>
  12095. Always bind a key. (The input section that was made active most recently
  12096. wins if there are ambiguities.)
  12097. .UNINDENT
  12098. .sp
  12099. This command can be used to dispatch arbitrary keys to a script or a client
  12100. API user. If the input section defines \fBscript\-binding\fP commands, it is
  12101. also possible to get separate events on key up/down, and relatively detailed
  12102. information about the key state. The special key name \fBunmapped\fP can be
  12103. used to match any unmapped key.
  12104. .TP
  12105. .B \fBoverlay\-add <id> <x> <y> <file> <offset> <fmt> <w> <h> <stride>\fP
  12106. Add an OSD overlay sourced from raw data. This might be useful for scripts
  12107. and applications controlling mpv, and which want to display things on top
  12108. of the video window.
  12109. .sp
  12110. Overlays are usually displayed in screen resolution, but with some VOs,
  12111. the resolution is reduced to that of the video\(aqs. You can read the
  12112. \fBosd\-width\fP and \fBosd\-height\fP properties. At least with \fB\-\-vo\-xv\fP and
  12113. anamorphic video (such as DVD), \fBosd\-par\fP should be read as well, and the
  12114. overlay should be aspect\-compensated.
  12115. .sp
  12116. This has the following named arguments. The order of them is not guaranteed,
  12117. so you should always call them with named arguments, see \fI\%Named arguments\fP\&.
  12118. .sp
  12119. \fBid\fP is an integer between 0 and 63 identifying the overlay element. The
  12120. ID can be used to add multiple overlay parts, update a part by using this
  12121. command with an already existing ID, or to remove a part with
  12122. \fBoverlay\-remove\fP\&. Using a previously unused ID will add a new overlay,
  12123. while reusing an ID will update it.
  12124. .sp
  12125. \fBx\fP and \fBy\fP specify the position where the OSD should be displayed.
  12126. .sp
  12127. \fBfile\fP specifies the file the raw image data is read from. It can be
  12128. either a numeric UNIX file descriptor prefixed with \fB@\fP (e.g. \fB@4\fP),
  12129. or a filename. The file will be mapped into memory with \fBmmap()\fP,
  12130. copied, and unmapped before the command returns (changed in mpv 0.18.1).
  12131. .sp
  12132. It is also possible to pass a raw memory address for use as bitmap memory
  12133. by passing a memory address as integer prefixed with an \fB&\fP character.
  12134. Passing the wrong thing here will crash the player. This mode might be
  12135. useful for use with libmpv. The \fBoffset\fP parameter is simply added to the
  12136. memory address (since mpv 0.8.0, ignored before).
  12137. .sp
  12138. \fBoffset\fP is the byte offset of the first pixel in the source file.
  12139. (The current implementation always mmap\(aqs the whole file from position 0 to
  12140. the end of the image, so large offsets should be avoided. Before mpv 0.8.0,
  12141. the offset was actually passed directly to \fBmmap\fP, but it was changed to
  12142. make using it easier.)
  12143. .sp
  12144. \fBfmt\fP is a string identifying the image format. Currently, only \fBbgra\fP
  12145. is defined. This format has 4 bytes per pixels, with 8 bits per component.
  12146. The least significant 8 bits are blue, and the most significant 8 bits
  12147. are alpha (in little endian, the components are B\-G\-R\-A, with B as first
  12148. byte). This uses premultiplied alpha: every color component is already
  12149. multiplied with the alpha component. This means the numeric value of each
  12150. component is equal to or smaller than the alpha component. (Violating this
  12151. rule will lead to different results with different VOs: numeric overflows
  12152. resulting from blending broken alpha values is considered something that
  12153. shouldn\(aqt happen, and consequently implementations don\(aqt ensure that you
  12154. get predictable behavior in this case.)
  12155. .sp
  12156. \fBw\fP, \fBh\fP, and \fBstride\fP specify the size of the overlay. \fBw\fP is the
  12157. visible width of the overlay, while \fBstride\fP gives the width in bytes in
  12158. memory. In the simple case, and with the \fBbgra\fP format, \fBstride==4*w\fP\&.
  12159. In general, the total amount of memory accessed is \fBstride * h\fP\&.
  12160. (Technically, the minimum size would be \fBstride * (h \- 1) + w * 4\fP, but
  12161. for simplicity, the player will access all \fBstride * h\fP bytes.)
  12162. .sp
  12163. \fBNOTE:\fP
  12164. .INDENT 7.0
  12165. .INDENT 3.5
  12166. Before mpv 0.18.1, you had to do manual "double buffering" when updating
  12167. an overlay by replacing it with a different memory buffer. Since mpv
  12168. 0.18.1, the memory is simply copied and doesn\(aqt reference any of the
  12169. memory indicated by the command\(aqs arguments after the commend returns.
  12170. If you want to use this command before mpv 0.18.1, reads the old docs
  12171. to see how to handle this correctly.
  12172. .UNINDENT
  12173. .UNINDENT
  12174. .TP
  12175. .B \fBoverlay\-remove <id>\fP
  12176. Remove an overlay added with \fBoverlay\-add\fP and the same ID. Does nothing
  12177. if no overlay with this ID exists.
  12178. .TP
  12179. .B \fBosd\-overlay\fP
  12180. Add/update/remove an OSD overlay.
  12181. .sp
  12182. (Although this sounds similar to \fBoverlay\-add\fP, \fBosd\-overlay\fP is for
  12183. text overlays, while \fBoverlay\-add\fP is for bitmaps. Maybe \fBoverlay\-add\fP
  12184. will be merged into \fBosd\-overlay\fP to remove this oddity.)
  12185. .sp
  12186. You can use this to add text overlays in ASS format. ASS has advanced
  12187. positioning and rendering tags, which can be used to render almost any kind
  12188. of vector graphics.
  12189. .sp
  12190. This command accepts the following parameters:
  12191. .INDENT 7.0
  12192. .TP
  12193. .B \fBid\fP
  12194. Arbitrary integer that identifies the overlay. Multiple overlays can be
  12195. added by calling this command with different \fBid\fP parameters. Calling
  12196. this command with the same \fBid\fP replaces the previously set overlay.
  12197. .sp
  12198. There is a separate namespace for each libmpv client (i.e. IPC
  12199. connection, script), so IDs can be made up and assigned by the API user
  12200. without conflicting with other API users.
  12201. .sp
  12202. If the libmpv client is destroyed, all overlays associated with it are
  12203. also deleted. In particular, connecting via \fB\-\-input\-ipc\-server\fP,
  12204. adding an overlay, and disconnecting will remove the overlay immediately
  12205. again.
  12206. .TP
  12207. .B \fBformat\fP
  12208. String that gives the type of the overlay. Accepts the following values:
  12209. .INDENT 7.0
  12210. .TP
  12211. .B \fBass\-events\fP
  12212. The \fBdata\fP parameter is a string. The string is split on the
  12213. newline character. Every line is turned into the \fBText\fP part of
  12214. a \fBDialogue\fP ASS event. Timing is unused (but behavior of timing
  12215. dependent ASS tags may change in future mpv versions).
  12216. .sp
  12217. Note that it\(aqs better to put multiple lines into \fBdata\fP, instead
  12218. of adding multiple OSD overlays.
  12219. .sp
  12220. This provides 2 ASS \fBStyles\fP\&. \fBOSD\fP contains the text style as
  12221. defined by the current \fB\-\-osd\-...\fP options. \fBDefault\fP is
  12222. similar, and contains style that \fBOSD\fP would have if all options
  12223. were set to the default.
  12224. .sp
  12225. In addition, the \fBres_x\fP and \fBres_y\fP options specify the value
  12226. of the ASS \fBPlayResX\fP and \fBPlayResY\fP header fields. If \fBres_y\fP
  12227. is set to 0, \fBPlayResY\fP is initialized to an arbitrary default
  12228. value (but note that the default for this command is 720, not 0).
  12229. If \fBres_x\fP is set to 0, \fBPlayResX\fP is set based on \fBres_y\fP
  12230. such that a virtual ASS pixel has a square pixel aspect ratio.
  12231. .TP
  12232. .B \fBnone\fP
  12233. Special value that causes the overlay to be removed. Most parameters
  12234. other than \fBid\fP and \fBformat\fP are mostly ignored.
  12235. .UNINDENT
  12236. .TP
  12237. .B \fBdata\fP
  12238. String defining the overlay contents according to the \fBformat\fP
  12239. parameter.
  12240. .TP
  12241. .B \fBres_x\fP, \fBres_y\fP
  12242. Used if \fBformat\fP is set to \fBass\-events\fP (see description there).
  12243. Optional, defaults to 0/720.
  12244. .TP
  12245. .B \fBz\fP
  12246. The Z order of the overlay. Optional, defaults to 0.
  12247. .sp
  12248. Note that Z order between different overlays of different formats is
  12249. static, and cannot be changed (currently, this means that bitmap
  12250. overlays added by \fBoverlay\-add\fP are always on top of the ASS overlays
  12251. added by \fBosd\-overlay\fP). In addition, the builtin OSD components are
  12252. always below any of the custom OSD. (This includes subtitles of any kind
  12253. as well as text rendered by \fBshow\-text\fP\&.)
  12254. .sp
  12255. It\(aqs possible that future mpv versions will randomly change how Z order
  12256. between different OSD formats and builtin OSD is handled.
  12257. .UNINDENT
  12258. .sp
  12259. Note: always use named arguments (\fBmpv_command_node()\fP). Scripts should
  12260. use the \fBmp.create_osd_overlay()\fP helper instead of invoking this command
  12261. directly.
  12262. .TP
  12263. .B \fBscript\-message [<arg1> [<arg2> [...]]]\fP
  12264. Send a message to all clients, and pass it the following list of arguments.
  12265. What this message means, how many arguments it takes, and what the arguments
  12266. mean is fully up to the receiver and the sender. Every client receives the
  12267. message, so be careful about name clashes (or use \fBscript\-message\-to\fP).
  12268. .sp
  12269. This command has a variable number of arguments, and cannot be used with
  12270. named arguments.
  12271. .TP
  12272. .B \fBscript\-message\-to <target> [<arg1> [<arg2> [...]]]\fP
  12273. Same as \fBscript\-message\fP, but send it only to the client named
  12274. \fB<target>\fP\&. Each client (scripts etc.) has a unique name. For example,
  12275. Lua scripts can get their name via \fBmp.get_script_name()\fP\&.
  12276. .sp
  12277. This command has a variable number of arguments, and cannot be used with
  12278. named arguments.
  12279. .TP
  12280. .B \fBscript\-binding <name>\fP
  12281. Invoke a script\-provided key binding. This can be used to remap key
  12282. bindings provided by external Lua scripts.
  12283. .sp
  12284. The argument is the name of the binding.
  12285. .sp
  12286. It can optionally be prefixed with the name of the script, using \fB/\fP as
  12287. separator, e.g. \fBscript\-binding scriptname/bindingname\fP\&.
  12288. .sp
  12289. For completeness, here is how this command works internally. The details
  12290. could change any time. On any matching key event, \fBscript\-message\-to\fP
  12291. or \fBscript\-message\fP is called (depending on whether the script name is
  12292. included), with the following arguments:
  12293. .INDENT 7.0
  12294. .IP 1. 3
  12295. The string \fBkey\-binding\fP\&.
  12296. .IP 2. 3
  12297. The name of the binding (as established above).
  12298. .IP 3. 3
  12299. The key state as string (see below).
  12300. .IP 4. 3
  12301. The key name (since mpv 0.15.0).
  12302. .IP 5. 3
  12303. The text the key would produce, or empty string if not applicable.
  12304. .UNINDENT
  12305. .sp
  12306. The 5th argument is only set if no modifiers are present (using the shift
  12307. key with a letter is normally not emitted as having a modifier, and results
  12308. in upper case text instead, but some backends may mess up).
  12309. .sp
  12310. The key state consists of 2 characters:
  12311. .INDENT 7.0
  12312. .IP 1. 3
  12313. One of \fBd\fP (key was pressed down), \fBu\fP (was released), \fBr\fP (key
  12314. is still down, and was repeated; only if key repeat is enabled for this
  12315. binding), \fBp\fP (key was pressed; happens if up/down can\(aqt be tracked).
  12316. .IP 2. 3
  12317. Whether the event originates from the mouse, either \fBm\fP (mouse button)
  12318. or \fB\-\fP (something else).
  12319. .UNINDENT
  12320. .sp
  12321. Future versions can add more arguments and more key state characters to
  12322. support more input peculiarities.
  12323. .TP
  12324. .B \fBab\-loop\fP
  12325. Cycle through A\-B loop states. The first command will set the \fBA\fP point
  12326. (the \fBab\-loop\-a\fP property); the second the \fBB\fP point, and the third
  12327. will clear both points.
  12328. .TP
  12329. .B \fBdrop\-buffers\fP
  12330. Drop audio/video/demuxer buffers, and restart from fresh. Might help with
  12331. unseekable streams that are going out of sync.
  12332. This command might be changed or removed in the future.
  12333. .TP
  12334. .B \fBscreenshot\-raw [<flags>]\fP
  12335. Return a screenshot in memory. This can be used only through the client
  12336. API. The MPV_FORMAT_NODE_MAP returned by this command has the \fBw\fP, \fBh\fP,
  12337. \fBstride\fP fields set to obvious contents. The \fBformat\fP field is set to
  12338. \fBbgr0\fP by default. This format is organized as \fBB8G8R8X8\fP (where \fBB\fP
  12339. is the LSB). The contents of the padding \fBX\fP are undefined. The \fBdata\fP
  12340. field is of type MPV_FORMAT_BYTE_ARRAY with the actual image data. The image
  12341. is freed as soon as the result mpv_node is freed. As usual with client API
  12342. semantics, you are not allowed to write to the image data.
  12343. .sp
  12344. The \fBstride\fP is the number of bytes from a pixel at \fB(x0, y0)\fP to the
  12345. pixel at \fB(x0, y0 + 1)\fP\&. This can be larger than \fBw * 4\fP if the image
  12346. was cropped, or if there is padding. This number can be negative as well.
  12347. You access a pixel with \fBbyte_index = y * stride + x * 4\fP (assuming the
  12348. \fBbgr0\fP format).
  12349. .sp
  12350. The \fBflags\fP argument is like the first argument to \fBscreenshot\fP and
  12351. supports \fBsubtitles\fP, \fBvideo\fP, \fBwindow\fP\&.
  12352. .TP
  12353. .B \fBvf\-command <label> <command> <argument>\fP
  12354. Send a command to the filter with the given \fB<label>\fP\&. Use \fBall\fP to send
  12355. it to all filters at once. The command and argument string is filter
  12356. specific. Currently, this only works with the \fBlavfi\fP filter \- see
  12357. the libavfilter documentation for which commands a filter supports.
  12358. .sp
  12359. Note that the \fB<label>\fP is a mpv filter label, not a libavfilter filter
  12360. name.
  12361. .TP
  12362. .B \fBaf\-command <label> <command> <argument>\fP
  12363. Same as \fBvf\-command\fP, but for audio filters.
  12364. .TP
  12365. .B \fBapply\-profile <name>\fP
  12366. Apply the contents of a named profile. This is like using \fBprofile=name\fP
  12367. in a config file, except you can map it to a key binding to change it at
  12368. runtime.
  12369. .sp
  12370. There is no such thing as "unapplying" a profile \- applying a profile
  12371. merely sets all option values listed within the profile.
  12372. .TP
  12373. .B \fBload\-script <filename>\fP
  12374. Load a script, similar to the \fB\-\-script\fP option. Whether this waits for
  12375. the script to finish initialization or not changed multiple times, and the
  12376. future behavior is left undefined.
  12377. .TP
  12378. .B \fBchange\-list <name> <operation> <value>\fP
  12379. This command changes list options as described in \fI\%List Options\fP\&. The
  12380. \fB<name>\fP parameter is the normal option name, while \fB<operation>\fP is
  12381. the suffix or action used on the option.
  12382. .sp
  12383. Some operations take no value, but the command still requires the value
  12384. parameter. In these cases, the value must be an empty string.
  12385. .INDENT 7.0
  12386. .INDENT 3.5
  12387. .IP "Example"
  12388. .sp
  12389. \fBchange\-list glsl\-shaders append file.glsl\fP
  12390. .sp
  12391. Add a filename to the \fBglsl\-shaders\fP list. The command line
  12392. equivalent is \fB\-\-glsl\-shaders\-append=file.glsl\fP or alternatively
  12393. \fB\-\-glsl\-shader=file.glsl\fP\&.
  12394. .UNINDENT
  12395. .UNINDENT
  12396. .TP
  12397. .B \fBdump\-cache <start> <end> <filename>\fP
  12398. Dump the current cache to the given filename. The \fB<filename>\fP file is
  12399. overwritten if it already exists. \fB<start>\fP and \fB<end>\fP give the
  12400. time range of what to dump. If no data is cached at the given time range,
  12401. nothing may be dumped (creating a file with no packets).
  12402. .sp
  12403. Dumping a larger part of the cache will freeze the player. No effort was
  12404. made to fix this, as this feature was meant mostly for creating small
  12405. excerpts.
  12406. .sp
  12407. See \fB\-\-stream\-record\fP for various caveats that mostly apply to this
  12408. command too, as both use the same underlying code for writing the output
  12409. file.
  12410. .sp
  12411. If \fB<filename>\fP is an empty string, an ongoing \fBdump\-cache\fP is stopped.
  12412. .sp
  12413. If \fB<end>\fP is \fBno\fP, then continuous dumping is enabled. Then, after
  12414. dumping the existing parts of the cache, anything read from network is
  12415. appended to the cache as well. This behaves similar to \fB\-\-stream\-record\fP
  12416. (although it does not conflict with that option, and they can be both active
  12417. at the same time).
  12418. .sp
  12419. If the \fB<end>\fP time is after the cache, the command will _not_ wait and
  12420. write newly received data to it.
  12421. .sp
  12422. The end of the resulting file may be slightly damaged or incomplete at the
  12423. end. (Not enough effort was made to ensure that the end lines up properly.)
  12424. .sp
  12425. Note that this command will finish only once dumping ends. That means it
  12426. works similar to the \fBscreenshot\fP command, just that it can block much
  12427. longer. If continuous dumping is used, the command will not finish until
  12428. playback is stopped, an error happens, another \fBdump\-cache\fP command is
  12429. run, or an API like \fBmp.abort_async_command\fP was called to explicitly stop
  12430. the command. See \fI\%Synchronous vs. Asynchronous\fP\&.
  12431. .sp
  12432. \fBNOTE:\fP
  12433. .INDENT 7.0
  12434. .INDENT 3.5
  12435. This was mostly created for network streams. For local files, there may
  12436. be much better methods to create excerpts and such. There are tons of
  12437. much more user\-friendly Lua scripts, that will reencode parts of a file
  12438. by spawning a separate instance of \fBffmpeg\fP\&. With network streams,
  12439. this is not that easily possible, as the stream would have to be
  12440. downloaded again. Even if \fB\-\-stream\-record\fP is used to record the
  12441. stream to the local filesystem, there may be problems, because the
  12442. recorded file is still written to.
  12443. .UNINDENT
  12444. .UNINDENT
  12445. .sp
  12446. This command is experimental, and all details about it may change in the
  12447. future.
  12448. .TP
  12449. .B \fBab\-loop\-dump\-cache <filename>\fP
  12450. Essentially calls \fBdump\-cache\fP with the current AB\-loop points as
  12451. arguments. Like \fBdump\-cache\fP, this will overwrite the file at
  12452. \fB<filename>\fP\&. Likewise, if the B point is set to \fBno\fP, it will enter
  12453. continuous dumping after the existing cache was dumped.
  12454. .sp
  12455. The author reserves the right to remove this command if enough motivation
  12456. is found to move this functionality to a trivial Lua script.
  12457. .TP
  12458. .B \fBab\-loop\-align\-cache\fP
  12459. Re\-adjust the A/B loop points to the start and end within the cache the
  12460. \fBab\-loop\-dump\-cache\fP command will (probably) dump. Basically, it aligns
  12461. the times on keyframes. The guess might be off especially at the end (due to
  12462. granularity issues due to remuxing). If the cache shrinks in the meantime,
  12463. the points set by the command will not be the effective parameters either.
  12464. .sp
  12465. This command has an even more uncertain future than \fBab\-loop\-dump\-cache\fP
  12466. and might disappear without replacement if the author decides it\(aqs useless.
  12467. .UNINDENT
  12468. .sp
  12469. Undocumented commands: \fBao\-reload\fP (experimental/internal).
  12470. .SS Hooks
  12471. .sp
  12472. Hooks are synchronous events between player core and a script or similar. This
  12473. applies to client API (including the Lua scripting interface). Normally,
  12474. events are supposed to be asynchronous, and the hook API provides an awkward
  12475. and obscure way to handle events that require stricter coordination. There are
  12476. no API stability guarantees made. Not following the protocol exactly can make
  12477. the player freeze randomly. Basically, nobody should use this API.
  12478. .sp
  12479. The C API is described in the header files. The Lua API is described in the
  12480. Lua section.
  12481. .sp
  12482. The following hooks are currently defined:
  12483. .INDENT 0.0
  12484. .TP
  12485. .B \fBon_load\fP
  12486. Called when a file is to be opened, before anything is actually done.
  12487. For example, you could read and write the \fBstream\-open\-filename\fP
  12488. property to redirect an URL to something else (consider support for
  12489. streaming sites which rarely give the user a direct media URL), or
  12490. you could set per\-file options with by setting the property
  12491. \fBfile\-local\-options/<option name>\fP\&. The player will wait until all
  12492. hooks are run.
  12493. .TP
  12494. .B \fBon_load_fail\fP
  12495. Called after after a file has been opened, but failed to. This can be
  12496. used to provide a fallback in case native demuxers failed to recognize
  12497. the file, instead of always running before the native demuxers like
  12498. \fBon_load\fP\&. Demux will only be retried if \fBstream\-open\-filename\fP
  12499. was changed.
  12500. .TP
  12501. .B \fBon_preloaded\fP
  12502. Called after a file has been opened, and before tracks are selected and
  12503. decoders are created. This has some usefulness if an API users wants
  12504. to select tracks manually, based on the set of available tracks. It\(aqs
  12505. also useful to initialize \fB\-\-lavfi\-complex\fP in a specific way by API,
  12506. without having to "probe" the available streams at first.
  12507. .sp
  12508. Note that this does not yet apply default track selection. Which operations
  12509. exactly can be done and not be done, and what information is available and
  12510. what is not yet available yet, is all subject to change.
  12511. .TP
  12512. .B \fBon_unload\fP
  12513. Run before closing a file, and before actually uninitializing
  12514. everything. It\(aqs not possible to resume playback in this state.
  12515. .UNINDENT
  12516. .SS Legacy hook API
  12517. .sp
  12518. \fBWARNING:\fP
  12519. .INDENT 0.0
  12520. .INDENT 3.5
  12521. The legacy API is deprecated and will be removed soon.
  12522. .UNINDENT
  12523. .UNINDENT
  12524. .sp
  12525. There are two special commands involved. Also, the client must listen for
  12526. client messages (\fBMPV_EVENT_CLIENT_MESSAGE\fP in the C API).
  12527. .INDENT 0.0
  12528. .TP
  12529. .B \fBhook\-add <hook\-name> <id> <priority>\fP
  12530. Subscribe to the hook identified by the first argument (basically, the
  12531. name of event). The \fBid\fP argument is an arbitrary integer chosen by the
  12532. user. \fBpriority\fP is used to sort all hook handlers globally across all
  12533. clients. Each client can register multiple hook handlers (even for the
  12534. same hook\-name). Once the hook is registered, it cannot be unregistered.
  12535. .sp
  12536. When a specific event happens, all registered handlers are run serially.
  12537. This uses a protocol every client has to follow explicitly. When a hook
  12538. handler is run, a client message (\fBMPV_EVENT_CLIENT_MESSAGE\fP) is sent to
  12539. the client which registered the hook. This message has the following
  12540. arguments:
  12541. .INDENT 7.0
  12542. .IP 1. 3
  12543. the string \fBhook_run\fP
  12544. .IP 2. 3
  12545. the \fBid\fP argument the hook was registered with as string (this can be
  12546. used to correctly handle multiple hooks registered by the same client,
  12547. as long as the \fBid\fP argument is unique in the client)
  12548. .IP 3. 3
  12549. something undefined, used by the hook mechanism to track hook execution
  12550. .UNINDENT
  12551. .sp
  12552. Upon receiving this message, the client can handle the event. While doing
  12553. this, the player core will still react to requests, but playback will
  12554. typically be stopped.
  12555. .sp
  12556. When the client is done, it must continue the core\(aqs hook execution by
  12557. running the \fBhook\-ack\fP command.
  12558. .TP
  12559. .B \fBhook\-ack <string>\fP
  12560. Run the next hook in the global chain of hooks. The argument is the 3rd
  12561. argument of the client message that starts hook execution for the
  12562. current client.
  12563. .UNINDENT
  12564. .SS Input Command Prefixes
  12565. .sp
  12566. These prefixes are placed between key name and the actual command. Multiple
  12567. prefixes can be specified. They are separated by whitespace.
  12568. .INDENT 0.0
  12569. .TP
  12570. .B \fBosd\-auto\fP
  12571. Use the default behavior for this command. This is the default for
  12572. \fBinput.conf\fP commands. Some libmpv/scripting/IPC APIs do not use this as
  12573. default, but use \fBno\-osd\fP instead.
  12574. .TP
  12575. .B \fBno\-osd\fP
  12576. Do not use any OSD for this command.
  12577. .TP
  12578. .B \fBosd\-bar\fP
  12579. If possible, show a bar with this command. Seek commands will show the
  12580. progress bar, property changing commands may show the newly set value.
  12581. .TP
  12582. .B \fBosd\-msg\fP
  12583. If possible, show an OSD message with this command. Seek command show
  12584. the current playback time, property changing commands show the newly set
  12585. value as text.
  12586. .TP
  12587. .B \fBosd\-msg\-bar\fP
  12588. Combine osd\-bar and osd\-msg.
  12589. .TP
  12590. .B \fBraw\fP
  12591. Do not expand properties in string arguments. (Like \fB"${property\-name}"\fP\&.)
  12592. This is the default for some libmpv/scripting/IPC APIs.
  12593. .TP
  12594. .B \fBexpand\-properties\fP
  12595. All string arguments are expanded as described in \fI\%Property Expansion\fP\&.
  12596. This is the default for \fBinput.conf\fP commands.
  12597. .TP
  12598. .B \fBrepeatable\fP
  12599. For some commands, keeping a key pressed doesn\(aqt run the command repeatedly.
  12600. This prefix forces enabling key repeat in any case.
  12601. .TP
  12602. .B \fBasync\fP
  12603. Allow asynchronous execution (if possible). Note that only a few commands
  12604. will support this (usually this is explicitly documented). Some commands
  12605. are asynchronous by default (or rather, their effects might manifest
  12606. after completion of the command). The semantics of this flag might change
  12607. in the future. Set it only if you don\(aqt rely on the effects of this command
  12608. being fully realized when it returns. See \fI\%Synchronous vs. Asynchronous\fP\&.
  12609. .TP
  12610. .B \fBsync\fP
  12611. Allow synchronous execution (if possible). Normally, all commands are
  12612. synchronous by default, but some are asynchronous by default for
  12613. compatibility with older behavior.
  12614. .UNINDENT
  12615. .sp
  12616. All of the osd prefixes are still overridden by the global \fB\-\-osd\-level\fP
  12617. settings.
  12618. .SS Synchronous vs. Asynchronous
  12619. .sp
  12620. The \fBasync\fP and \fBsync\fP prefix matter only for how the issuer of the command
  12621. waits on the completion of the command. Normally it does not affect how the
  12622. command behaves by itself. There are the following cases:
  12623. .INDENT 0.0
  12624. .IP \(bu 2
  12625. Normal input.conf commands are always run asynchronously. Slow running
  12626. commands are queued up or run in parallel.
  12627. .IP \(bu 2
  12628. "Multi" input.conf commands (1 key binding, concatenated with \fB;\fP) will be
  12629. executed in order, except for commands that are async (either prefixed with
  12630. \fBasync\fP, or async by default for some commands). The async commands are
  12631. run in a detached manner, possibly in parallel to the remaining sync commands
  12632. in the list.
  12633. .IP \(bu 2
  12634. Normal Lua and libmpv commands (e.g. \fBmpv_command()\fP) are run in a blocking
  12635. manner, unless the \fBasync\fP prefix is used, or the command is async by
  12636. default. This means in the sync case the caller will block, even if the core
  12637. continues playback. Async mode runs the command in a detached manner.
  12638. .IP \(bu 2
  12639. Async libmpv command API (e.g. \fBmpv_command_async()\fP) never blocks the
  12640. caller, and always notify their completion with a message. The \fBsync\fP and
  12641. \fBasync\fP prefixes make no difference.
  12642. .IP \(bu 2
  12643. Lua also provides APIs for running async commands, which behave similar to the
  12644. C counterparts.
  12645. .IP \(bu 2
  12646. In all cases, async mode can still run commands in a synchronous manner, even
  12647. in detached mode. This can for example happen in cases when a command does not
  12648. have an asynchronous implementation. The async libmpv API still never blocks
  12649. the caller in these cases.
  12650. .UNINDENT
  12651. .sp
  12652. Before mpv 0.29.0, the \fBasync\fP prefix was only used by screenshot commands,
  12653. and made them run the file saving code in a detached manner. This is the
  12654. default now, and \fBasync\fP changes behavior only in the ways mentioned above.
  12655. .sp
  12656. Currently the following commands have different waiting characteristics with
  12657. sync vs. async: sub\-add, audio\-add, sub\-reload, audio\-reload,
  12658. rescan\-external\-files, screenshot, screenshot\-to\-file, dump\-cache,
  12659. ab\-loop\-dump\-cache.
  12660. .SS Asynchronous command details
  12661. .sp
  12662. On the API level, every asynchronous command is bound to the context which
  12663. started it. For example, an asynchronous command started by \fBmpv_command_async\fP
  12664. is bound to the \fBmpv_handle\fP passed to the function. Only this \fBmpv_handle\fP
  12665. receives the completion notification (\fBMPV_EVENT_COMMAND_REPLY\fP), and only
  12666. this handle can abort a still running command directly. If the \fBmpv_handle\fP is
  12667. destroyed, any still running async. commands started by it are terminated.
  12668. .sp
  12669. The scripting APIs and JSON IPC give each script/connection its own implicit
  12670. \fBmpv_handle\fP\&.
  12671. .sp
  12672. If the player is closed, the core may abort all pending async. commands on its
  12673. own (like a forced \fBmpv_abort_async_command()\fP call for each pending command
  12674. on behalf of the API user). This happens at the same time \fBMPV_EVENT_SHUTDOWN\fP
  12675. is sent, and there is no way to prevent this.
  12676. .SS Input Sections
  12677. .sp
  12678. Input sections group a set of bindings, and enable or disable them at once.
  12679. In \fBinput.conf\fP, each key binding is assigned to an input section, rather
  12680. than actually having explicit text sections.
  12681. .sp
  12682. See also: \fBenable\-section\fP and \fBdisable\-section\fP commands.
  12683. .sp
  12684. Predefined bindings:
  12685. .INDENT 0.0
  12686. .TP
  12687. .B \fBdefault\fP
  12688. Bindings without input section are implicitly assigned to this section. It
  12689. is enabled by default during normal playback.
  12690. .TP
  12691. .B \fBencode\fP
  12692. Section which is active in encoding mode. It is enabled exclusively, so
  12693. that bindings in the \fBdefault\fP sections are ignored.
  12694. .UNINDENT
  12695. .SS Properties
  12696. .sp
  12697. Properties are used to set mpv options during runtime, or to query arbitrary
  12698. information. They can be manipulated with the \fBset\fP/\fBadd\fP/\fBcycle\fP
  12699. commands, and retrieved with \fBshow\-text\fP, or anything else that uses property
  12700. expansion. (See \fI\%Property Expansion\fP\&.)
  12701. .sp
  12702. The property name is annotated with RW to indicate whether the property is
  12703. generally writable.
  12704. .sp
  12705. If an option is referenced, the property will normally take/return exactly the
  12706. same values as the option. In these cases, properties are merely a way to change
  12707. an option at runtime.
  12708. .SS Property list
  12709. .sp
  12710. \fBNOTE:\fP
  12711. .INDENT 0.0
  12712. .INDENT 3.5
  12713. Most options can be set as runtime via properties as well. Just remove the
  12714. leading \fB\-\-\fP from the option name. These are not documented. Only
  12715. properties which do not exist as option with the same name, or which have
  12716. very different behavior from the options are documented below.
  12717. .UNINDENT
  12718. .UNINDENT
  12719. .INDENT 0.0
  12720. .TP
  12721. .B \fBaudio\-speed\-correction\fP, \fBvideo\-speed\-correction\fP
  12722. Factor multiplied with \fBspeed\fP at which the player attempts to play the
  12723. file. Usually it\(aqs exactly 1. (Display sync mode will make this useful.)
  12724. .sp
  12725. OSD formatting will display it in the form of \fB+1.23456%\fP, with the number
  12726. being \fB(raw \- 1) * 100\fP for the given raw property value.
  12727. .TP
  12728. .B \fBdisplay\-sync\-active\fP
  12729. Return whether \fB\-\-video\-sync=display\fP is actually active.
  12730. .TP
  12731. .B \fBfilename\fP
  12732. Currently played file, with path stripped. If this is an URL, try to undo
  12733. percent encoding as well. (The result is not necessarily correct, but
  12734. looks better for display purposes. Use the \fBpath\fP property to get an
  12735. unmodified filename.)
  12736. .sp
  12737. This has a sub\-property:
  12738. .INDENT 7.0
  12739. .TP
  12740. .B \fBfilename/no\-ext\fP
  12741. Like the \fBfilename\fP property, but if the text contains a \fB\&.\fP, strip
  12742. all text after the last \fB\&.\fP\&. Usually this removes the file extension.
  12743. .UNINDENT
  12744. .TP
  12745. .B \fBfile\-size\fP
  12746. Length in bytes of the source file/stream. (This is the same as
  12747. \fB${stream\-end}\fP\&. For segmented/multi\-part files, this will return the
  12748. size of the main or manifest file, whatever it is.)
  12749. .TP
  12750. .B \fBestimated\-frame\-count\fP
  12751. Total number of frames in current file.
  12752. .sp
  12753. \fBNOTE:\fP
  12754. .INDENT 7.0
  12755. .INDENT 3.5
  12756. This is only an estimate. (It\(aqs computed from two unreliable
  12757. quantities: fps and stream length.)
  12758. .UNINDENT
  12759. .UNINDENT
  12760. .TP
  12761. .B \fBestimated\-frame\-number\fP
  12762. Number of current frame in current stream.
  12763. .sp
  12764. \fBNOTE:\fP
  12765. .INDENT 7.0
  12766. .INDENT 3.5
  12767. This is only an estimate. (It\(aqs computed from two unreliable
  12768. quantities: fps and possibly rounded timestamps.)
  12769. .UNINDENT
  12770. .UNINDENT
  12771. .TP
  12772. .B \fBpath\fP
  12773. Full path of the currently played file. Usually this is exactly the same
  12774. string you pass on the mpv command line or the \fBloadfile\fP command, even
  12775. if it\(aqs a relative path. If you expect an absolute path, you will have to
  12776. determine it yourself, for example by using the \fBworking\-directory\fP
  12777. property.
  12778. .TP
  12779. .B \fBstream\-open\-filename\fP
  12780. The full path to the currently played media. This is different only from
  12781. \fBpath\fP in special cases. In particular, if \fB\-\-ytdl=yes\fP is used, and
  12782. the URL is detected by \fByoutube\-dl\fP, then the script will set this
  12783. property to the actual media URL. This property should be set only during
  12784. the \fBon_load\fP or \fBon_load_fail\fP hooks, otherwise it will have no effect
  12785. (or may do something implementation defined in the future). The property is
  12786. reset if playback of the current media ends.
  12787. .TP
  12788. .B \fBmedia\-title\fP
  12789. If the currently played file has a \fBtitle\fP tag, use that.
  12790. .sp
  12791. Otherwise, return the \fBfilename\fP property.
  12792. .TP
  12793. .B \fBfile\-format\fP
  12794. Symbolic name of the file format. In some cases, this is a comma\-separated
  12795. list of format names, e.g. mp4 is \fBmov,mp4,m4a,3gp,3g2,mj2\fP (the list
  12796. may grow in the future for any format).
  12797. .TP
  12798. .B \fBcurrent\-demuxer\fP
  12799. Name of the current demuxer. (This is useless.)
  12800. .sp
  12801. (Renamed from \fBdemuxer\fP\&.)
  12802. .TP
  12803. .B \fBstream\-path\fP
  12804. Filename (full path) of the stream layer filename. (This is probably
  12805. useless and is almost never different from \fBpath\fP\&.)
  12806. .TP
  12807. .B \fBstream\-pos\fP
  12808. Raw byte position in source stream. Technically, this returns the position
  12809. of the most recent packet passed to a decoder.
  12810. .TP
  12811. .B \fBstream\-end\fP
  12812. Raw end position in bytes in source stream.
  12813. .TP
  12814. .B \fBduration\fP
  12815. Duration of the current file in seconds. If the duration is unknown, the
  12816. property is unavailable. Note that the file duration is not always exactly
  12817. known, so this is an estimate.
  12818. .sp
  12819. This replaces the \fBlength\fP property, which was deprecated after the
  12820. mpv 0.9 release. (The semantics are the same.)
  12821. .TP
  12822. .B \fBavsync\fP
  12823. Last A/V synchronization difference. Unavailable if audio or video is
  12824. disabled.
  12825. .TP
  12826. .B \fBtotal\-avsync\-change\fP
  12827. Total A\-V sync correction done. Unavailable if audio or video is
  12828. disabled.
  12829. .TP
  12830. .B \fBdecoder\-frame\-drop\-count\fP
  12831. Video frames dropped by decoder, because video is too far behind audio (when
  12832. using \fB\-\-framedrop=decoder\fP). Sometimes, this may be incremented in other
  12833. situations, e.g. when video packets are damaged, or the decoder doesn\(aqt
  12834. follow the usual rules. Unavailable if video is disabled.
  12835. .sp
  12836. \fBdrop\-frame\-count\fP is a deprecated alias.
  12837. .TP
  12838. .B \fBframe\-drop\-count\fP
  12839. Frames dropped by VO (when using \fB\-\-framedrop=vo\fP).
  12840. .sp
  12841. \fBvo\-drop\-frame\-count\fP is a deprecated alias.
  12842. .TP
  12843. .B \fBmistimed\-frame\-count\fP
  12844. Number of video frames that were not timed correctly in display\-sync mode
  12845. for the sake of keeping A/V sync. This does not include external
  12846. circumstances, such as video rendering being too slow or the graphics
  12847. driver somehow skipping a vsync. It does not include rounding errors either
  12848. (which can happen especially with bad source timestamps). For example,
  12849. using the \fBdisplay\-desync\fP mode should never change this value from 0.
  12850. .TP
  12851. .B \fBvsync\-ratio\fP
  12852. For how many vsyncs a frame is displayed on average. This is available if
  12853. display\-sync is active only. For 30 FPS video on a 60 Hz screen, this will
  12854. be 2. This is the moving average of what actually has been scheduled, so
  12855. 24 FPS on 60 Hz will never remain exactly on 2.5, but jitter depending on
  12856. the last frame displayed.
  12857. .TP
  12858. .B \fBvo\-delayed\-frame\-count\fP
  12859. Estimated number of frames delayed due to external circumstances in
  12860. display\-sync mode. Note that in general, mpv has to guess that this is
  12861. happening, and the guess can be inaccurate.
  12862. .TP
  12863. .B \fBpercent\-pos\fP (RW)
  12864. Position in current file (0\-100). The advantage over using this instead of
  12865. calculating it out of other properties is that it properly falls back to
  12866. estimating the playback position from the byte position, if the file
  12867. duration is not known.
  12868. .TP
  12869. .B \fBtime\-pos\fP (RW)
  12870. Position in current file in seconds.
  12871. .TP
  12872. .B \fBtime\-start\fP
  12873. Deprecated. Always returns 0. Before mpv 0.14, this used to return the start
  12874. time of the file (could affect e.g. transport streams). See
  12875. \fB\-\-rebase\-start\-time\fP option.
  12876. .TP
  12877. .B \fBtime\-remaining\fP
  12878. Remaining length of the file in seconds. Note that the file duration is not
  12879. always exactly known, so this is an estimate.
  12880. .TP
  12881. .B \fBaudio\-pts\fP (R)
  12882. Current audio playback position in current file in seconds. Unlike time\-pos,
  12883. this updates more often than once per frame. For audio\-only files, it is
  12884. mostly equivalent to time\-pos, while for video\-only files this property is
  12885. not available.
  12886. .TP
  12887. .B \fBplaytime\-remaining\fP
  12888. \fBtime\-remaining\fP scaled by the current \fBspeed\fP\&.
  12889. .TP
  12890. .B \fBplayback\-time\fP (RW)
  12891. Position in current file in seconds. Unlike \fBtime\-pos\fP, the time is
  12892. clamped to the range of the file. (Inaccurate file durations etc. could
  12893. make it go out of range. Useful on attempts to seek outside of the file,
  12894. as the seek target time is considered the current position during seeking.)
  12895. .TP
  12896. .B \fBchapter\fP (RW)
  12897. Current chapter number. The number of the first chapter is 0.
  12898. .TP
  12899. .B \fBedition\fP (RW)
  12900. Current MKV edition number. Setting this property to a different value will
  12901. restart playback. The number of the first edition is 0.
  12902. .sp
  12903. Before mpv 0.31.0, this showed the actual edition selected at runtime, if
  12904. you didn\(aqt set the option or property manually. With mpv 0.31.0 and later,
  12905. this strictly returns the user\-set option or property value, and the
  12906. \fBcurrent\-edition\fP property was added to return the runtime selected
  12907. edition (this matters with \fB\-\-edition=auto\fP, the default).
  12908. .TP
  12909. .B \fBcurrent\-edition\fP
  12910. Currently selected edition. This property is unavailable if no file is
  12911. loaded, or the file has no editions. (Matroska files make a difference
  12912. between having no editions and a single edition, which will be reflected by
  12913. the property, although in practice it does not matter.)
  12914. .TP
  12915. .B \fBchapters\fP
  12916. Number of chapters.
  12917. .TP
  12918. .B \fBeditions\fP
  12919. Number of MKV editions.
  12920. .TP
  12921. .B \fBedition\-list\fP
  12922. List of editions, current entry marked. Currently, the raw property value
  12923. is useless.
  12924. .sp
  12925. This has a number of sub\-properties. Replace \fBN\fP with the 0\-based edition
  12926. index.
  12927. .INDENT 7.0
  12928. .TP
  12929. .B \fBedition\-list/count\fP
  12930. Number of editions. If there are no editions, this can be 0 or 1 (1
  12931. if there\(aqs a useless dummy edition).
  12932. .TP
  12933. .B \fBedition\-list/N/id\fP
  12934. Edition ID as integer. Use this to set the \fBedition\fP property.
  12935. Currently, this is the same as the edition index.
  12936. .TP
  12937. .B \fBedition\-list/N/default\fP
  12938. \fByes\fP if this is the default edition, \fBno\fP otherwise.
  12939. .TP
  12940. .B \fBedition\-list/N/title\fP
  12941. Edition title as stored in the file. Not always available.
  12942. .UNINDENT
  12943. .sp
  12944. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  12945. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  12946. the following contents:
  12947. .INDENT 7.0
  12948. .INDENT 3.5
  12949. .sp
  12950. .nf
  12951. .ft C
  12952. MPV_FORMAT_NODE_ARRAY
  12953. MPV_FORMAT_NODE_MAP (for each edition)
  12954. "id" MPV_FORMAT_INT64
  12955. "title" MPV_FORMAT_STRING
  12956. "default" MPV_FORMAT_FLAG
  12957. .ft P
  12958. .fi
  12959. .UNINDENT
  12960. .UNINDENT
  12961. .TP
  12962. .B \fBmetadata\fP
  12963. Metadata key/value pairs.
  12964. .sp
  12965. If the property is accessed with Lua\(aqs \fBmp.get_property_native\fP, this
  12966. returns a table with metadata keys mapping to metadata values. If it is
  12967. accessed with the client API, this returns a \fBMPV_FORMAT_NODE_MAP\fP,
  12968. with tag keys mapping to tag values.
  12969. .sp
  12970. For OSD, it returns a formatted list. Trying to retrieve this property as
  12971. a raw string doesn\(aqt work.
  12972. .sp
  12973. This has a number of sub\-properties:
  12974. .INDENT 7.0
  12975. .TP
  12976. .B \fBmetadata/by\-key/<key>\fP
  12977. Value of metadata entry \fB<key>\fP\&.
  12978. .TP
  12979. .B \fBmetadata/list/count\fP
  12980. Number of metadata entries.
  12981. .TP
  12982. .B \fBmetadata/list/N/key\fP
  12983. Key name of the Nth metadata entry. (The first entry is \fB0\fP).
  12984. .TP
  12985. .B \fBmetadata/list/N/value\fP
  12986. Value of the Nth metadata entry.
  12987. .TP
  12988. .B \fBmetadata/<key>\fP
  12989. Old version of \fBmetadata/by\-key/<key>\fP\&. Use is discouraged, because
  12990. the metadata key string could conflict with other sub\-properties.
  12991. .UNINDENT
  12992. .sp
  12993. The layout of this property might be subject to change. Suggestions are
  12994. welcome how exactly this property should work.
  12995. .sp
  12996. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  12997. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  12998. the following contents:
  12999. .INDENT 7.0
  13000. .INDENT 3.5
  13001. .sp
  13002. .nf
  13003. .ft C
  13004. MPV_FORMAT_NODE_MAP
  13005. (key and string value for each metadata entry)
  13006. .ft P
  13007. .fi
  13008. .UNINDENT
  13009. .UNINDENT
  13010. .TP
  13011. .B \fBfiltered\-metadata\fP
  13012. Like \fBmetadata\fP, but includes only fields listed in the \fB\-\-display\-tags\fP
  13013. option. This is the same set of tags that is printed to the terminal.
  13014. .TP
  13015. .B \fBchapter\-metadata\fP
  13016. Metadata of current chapter. Works similar to \fBmetadata\fP property. It
  13017. also allows the same access methods (using sub\-properties).
  13018. .sp
  13019. Per\-chapter metadata is very rare. Usually, only the chapter name
  13020. (\fBtitle\fP) is set.
  13021. .sp
  13022. For accessing other information, like chapter start, see the
  13023. \fBchapter\-list\fP property.
  13024. .TP
  13025. .B \fBvf\-metadata/<filter\-label>\fP
  13026. Metadata added by video filters. Accessed by the filter label,
  13027. which, if not explicitly specified using the \fB@filter\-label:\fP syntax,
  13028. will be \fB<filter\-name>NN\fP\&.
  13029. .sp
  13030. Works similar to \fBmetadata\fP property. It allows the same access
  13031. methods (using sub\-properties).
  13032. .sp
  13033. An example of this kind of metadata are the cropping parameters
  13034. added by \fB\-\-vf=lavfi=cropdetect\fP\&.
  13035. .TP
  13036. .B \fBaf\-metadata/<filter\-label>\fP
  13037. Equivalent to \fBvf\-metadata/<filter\-label>\fP, but for audio filters.
  13038. .TP
  13039. .B \fBidle\-active\fP
  13040. Return \fByes\fP if no file is loaded, but the player is staying around
  13041. because of the \fB\-\-idle\fP option.
  13042. .sp
  13043. (Renamed from \fBidle\fP\&.)
  13044. .TP
  13045. .B \fBcore\-idle\fP
  13046. Return \fByes\fP if the playback core is paused, otherwise \fBno\fP\&. This can
  13047. be different \fBpause\fP in special situations, such as when the player
  13048. pauses itself due to low network cache.
  13049. .sp
  13050. This also returns \fByes\fP if playback is restarting or if nothing is
  13051. playing at all. In other words, it\(aqs only \fBno\fP if there\(aqs actually
  13052. video playing. (Behavior since mpv 0.7.0.)
  13053. .TP
  13054. .B \fBcache\-speed\fP (R)
  13055. Current I/O read speed between the cache and the lower layer (like network).
  13056. This gives the number bytes per seconds over a 1 second window (using
  13057. the type \fBMPV_FORMAT_INT64\fP for the client API).
  13058. .TP
  13059. .B \fBdemuxer\-cache\-duration\fP
  13060. Approximate duration of video buffered in the demuxer, in seconds. The
  13061. guess is very unreliable, and often the property will not be available
  13062. at all, even if data is buffered.
  13063. .TP
  13064. .B \fBdemuxer\-cache\-time\fP
  13065. Approximate time of video buffered in the demuxer, in seconds. Same as
  13066. \fBdemuxer\-cache\-duration\fP but returns the last timestamp of buffered
  13067. data in demuxer.
  13068. .TP
  13069. .B \fBdemuxer\-cache\-idle\fP
  13070. Returns \fByes\fP if the demuxer is idle, which means the demuxer cache is
  13071. filled to the requested amount, and is currently not reading more data.
  13072. .TP
  13073. .B \fBdemuxer\-cache\-state\fP
  13074. Various undocumented or half\-documented things.
  13075. .sp
  13076. Each entry in \fBseekable\-ranges\fP represents a region in the demuxer cache
  13077. that can be seeked to. If there are multiple demuxers active, this only
  13078. returns information about the "main" demuxer, but might be changed in
  13079. future to return unified information about all demuxers. The ranges are in
  13080. arbitrary order. Often, ranges will overlap for a bit, before being joined.
  13081. In broken corner cases, ranges may overlap all over the place.
  13082. .sp
  13083. The end of a seek range is usually smaller than the value returned by the
  13084. \fBdemuxer\-cache\-time\fP property, because that property returns the guessed
  13085. buffering amount, while the seek ranges represent the buffered data that
  13086. can actually be used for cached seeking.
  13087. .sp
  13088. \fBbof\-cached\fP indicates whether the seek range with the lowest timestamp
  13089. points to the beginning of the stream (BOF). This implies you cannot seek
  13090. before this position at all. \fBeof\-cached\fP indicates whether the seek range
  13091. with the highest timestamp points to the end of the stream (EOF). If both
  13092. \fBbof\-cached\fP and \fBeof\-cached\fP are set to \fByes\fP, and there\(aqs only 1
  13093. cache range, the entire stream is cached.
  13094. .sp
  13095. \fBfw\-bytes\fP is the number of bytes of packets buffered in the range
  13096. starting from the current decoding position. This is a rough estimate
  13097. (may not account correctly for various overhead), and stops at the
  13098. demuxer position (it ignores seek ranges after it).
  13099. .sp
  13100. \fBfile\-cache\-bytes\fP is the number of bytes stored in the file cache. This
  13101. includes all overhead, and possibly unused data (like pruned data). This
  13102. member is missing if the file cache is not active.
  13103. .sp
  13104. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13105. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13106. the following contents:
  13107. .INDENT 7.0
  13108. .INDENT 3.5
  13109. .sp
  13110. .nf
  13111. .ft C
  13112. MPV_FORMAT_NODE_MAP
  13113. "seekable\-ranges" MPV_FORMAT_NODE_ARRAY
  13114. MPV_FORMAT_NODE_MAP
  13115. "start" MPV_FORMAT_DOUBLE
  13116. "end" MPV_FORMAT_DOUBLE
  13117. "bof\-cached" MPV_FORMAT_FLAG
  13118. "eof\-cached" MPV_FORMAT_FLAG
  13119. "fw\-bytes" MPV_FORMAT_INT64
  13120. "file\-cache\-bytes" MPV_FORMAT_INT64
  13121. .ft P
  13122. .fi
  13123. .UNINDENT
  13124. .UNINDENT
  13125. .sp
  13126. Other fields (might be changed or removed in the future):
  13127. .INDENT 7.0
  13128. .TP
  13129. .B \fBeof\fP
  13130. True if the reader thread has hit the end of the file.
  13131. .TP
  13132. .B \fBunderrun\fP
  13133. True if the reader thread could not satisfy a decoder\(aqs request for a
  13134. new packet.
  13135. .TP
  13136. .B \fBidle\fP
  13137. True if the thread is currently not reading.
  13138. .TP
  13139. .B \fBtotal\-bytes\fP
  13140. Sum of packet bytes (plus some overhead estimation) of the entire packet
  13141. queue, including cached seekable ranges.
  13142. .UNINDENT
  13143. .TP
  13144. .B \fBdemuxer\-via\-network\fP
  13145. Returns \fByes\fP if the stream demuxed via the main demuxer is most likely
  13146. played via network. What constitutes "network" is not always clear, might
  13147. be used for other types of untrusted streams, could be wrong in certain
  13148. cases, and its definition might be changing. Also, external files (like
  13149. separate audio files or streams) do not influence the value of this
  13150. property (currently).
  13151. .TP
  13152. .B \fBdemuxer\-start\-time\fP (R)
  13153. Returns the start time reported by the demuxer in fractional seconds.
  13154. .TP
  13155. .B \fBpaused\-for\-cache\fP
  13156. Returns \fByes\fP when playback is paused because of waiting for the cache.
  13157. .TP
  13158. .B \fBcache\-buffering\-state\fP
  13159. Return the percentage (0\-100) of the cache fill status until the player
  13160. will unpause (related to \fBpaused\-for\-cache\fP).
  13161. .TP
  13162. .B \fBeof\-reached\fP
  13163. Returns \fByes\fP if end of playback was reached, \fBno\fP otherwise. Note
  13164. that this is usually interesting only if \fB\-\-keep\-open\fP is enabled,
  13165. since otherwise the player will immediately play the next file (or exit
  13166. or enter idle mode), and in these cases the \fBeof\-reached\fP property will
  13167. logically be cleared immediately after it\(aqs set.
  13168. .TP
  13169. .B \fBseeking\fP
  13170. Returns \fByes\fP if the player is currently seeking, or otherwise trying
  13171. to restart playback. (It\(aqs possible that it returns \fByes\fP while a file
  13172. is loaded. This is because the same underlying code is used for seeking and
  13173. resyncing.)
  13174. .TP
  13175. .B \fBmixer\-active\fP
  13176. Return \fByes\fP if the audio mixer is active, \fBno\fP otherwise.
  13177. .sp
  13178. This option is relatively useless. Before mpv 0.18.1, it could be used to
  13179. infer behavior of the \fBvolume\fP property.
  13180. .TP
  13181. .B \fBao\-volume\fP (RW)
  13182. System volume. This property is available only if mpv audio output is
  13183. currently active, and only if the underlying implementation supports volume
  13184. control. What this option does depends on the API. For example, on ALSA
  13185. this usually changes system\-wide audio, while with PulseAudio this controls
  13186. per\-application volume.
  13187. .TP
  13188. .B \fBao\-mute\fP (RW)
  13189. Similar to \fBao\-volume\fP, but controls the mute state. May be unimplemented
  13190. even if \fBao\-volume\fP works.
  13191. .TP
  13192. .B \fBaudio\-codec\fP
  13193. Audio codec selected for decoding.
  13194. .TP
  13195. .B \fBaudio\-codec\-name\fP
  13196. Audio codec.
  13197. .TP
  13198. .B \fBaudio\-params\fP
  13199. Audio format as output by the audio decoder.
  13200. This has a number of sub\-properties:
  13201. .INDENT 7.0
  13202. .TP
  13203. .B \fBaudio\-params/format\fP
  13204. The sample format as string. This uses the same names as used in other
  13205. places of mpv.
  13206. .TP
  13207. .B \fBaudio\-params/samplerate\fP
  13208. Samplerate.
  13209. .TP
  13210. .B \fBaudio\-params/channels\fP
  13211. The channel layout as a string. This is similar to what the
  13212. \fB\-\-audio\-channels\fP accepts.
  13213. .TP
  13214. .B \fBaudio\-params/hr\-channels\fP
  13215. As \fBchannels\fP, but instead of the possibly cryptic actual layout
  13216. sent to the audio device, return a hopefully more human readable form.
  13217. (Usually only \fBaudio\-out\-params/hr\-channels\fP makes sense.)
  13218. .TP
  13219. .B \fBaudio\-params/channel\-count\fP
  13220. Number of audio channels. This is redundant to the \fBchannels\fP field
  13221. described above.
  13222. .UNINDENT
  13223. .sp
  13224. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13225. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13226. the following contents:
  13227. .INDENT 7.0
  13228. .INDENT 3.5
  13229. .sp
  13230. .nf
  13231. .ft C
  13232. MPV_FORMAT_NODE_MAP
  13233. "format" MPV_FORMAT_STRING
  13234. "samplerate" MPV_FORMAT_INT64
  13235. "channels" MPV_FORMAT_STRING
  13236. "channel\-count" MPV_FORMAT_INT64
  13237. "hr\-channels" MPV_FORMAT_STRING
  13238. .ft P
  13239. .fi
  13240. .UNINDENT
  13241. .UNINDENT
  13242. .TP
  13243. .B \fBaudio\-out\-params\fP
  13244. Same as \fBaudio\-params\fP, but the format of the data written to the audio
  13245. API.
  13246. .TP
  13247. .B \fBcolormatrix\fP (R)
  13248. Redirects to \fBvideo\-params/colormatrix\fP\&. This parameter (as well as
  13249. similar ones) can be overridden with the \fBformat\fP video filter.
  13250. .TP
  13251. .B \fBcolormatrix\-input\-range\fP (R)
  13252. See \fBcolormatrix\fP\&.
  13253. .TP
  13254. .B \fBcolormatrix\-primaries\fP (R)
  13255. See \fBcolormatrix\fP\&.
  13256. .TP
  13257. .B \fBhwdec\fP (RW)
  13258. Reflects the \fB\-\-hwdec\fP option.
  13259. .sp
  13260. Writing to it may change the currently used hardware decoder, if possible.
  13261. (Internally, the player may reinitialize the decoder, and will perform a
  13262. seek to refresh the video properly.) You can watch the other hwdec
  13263. properties to see whether this was successful.
  13264. .sp
  13265. Unlike in mpv 0.9.x and before, this does not return the currently active
  13266. hardware decoder. Since mpv 0.18.0, \fBhwdec\-current\fP is available for
  13267. this purpose.
  13268. .TP
  13269. .B \fBhwdec\-current\fP
  13270. Return the current hardware decoding in use. If decoding is active, return
  13271. one of the values used by the \fBhwdec\fP option/property. \fBno\fP indicates
  13272. software decoding. If no decoder is loaded, the property is unavailable.
  13273. .TP
  13274. .B \fBhwdec\-interop\fP
  13275. This returns the currently loaded hardware decoding/output interop driver.
  13276. This is known only once the VO has opened (and possibly later). With some
  13277. VOs (like \fBgpu\fP), this might be never known in advance, but only when
  13278. the decoder attempted to create the hw decoder successfully. (Using
  13279. \fB\-\-gpu\-hwdec\-interop\fP can load it eagerly.) If there are multiple
  13280. drivers loaded, they will be separated by \fB,\fP\&.
  13281. .sp
  13282. If no VO is active or no interop driver is known, this property is
  13283. unavailable.
  13284. .sp
  13285. This does not necessarily use the same values as \fBhwdec\fP\&. There can be
  13286. multiple interop drivers for the same hardware decoder, depending on
  13287. platform and VO.
  13288. .TP
  13289. .B \fBvideo\-format\fP
  13290. Video format as string.
  13291. .TP
  13292. .B \fBvideo\-codec\fP
  13293. Video codec selected for decoding.
  13294. .TP
  13295. .B \fBwidth\fP, \fBheight\fP
  13296. Video size. This uses the size of the video as decoded, or if no video
  13297. frame has been decoded yet, the (possibly incorrect) container indicated
  13298. size.
  13299. .TP
  13300. .B \fBvideo\-params\fP
  13301. Video parameters, as output by the decoder (with overrides like aspect
  13302. etc. applied). This has a number of sub\-properties:
  13303. .INDENT 7.0
  13304. .TP
  13305. .B \fBvideo\-params/pixelformat\fP
  13306. The pixel format as string. This uses the same names as used in other
  13307. places of mpv.
  13308. .TP
  13309. .B \fBvideo\-params/average\-bpp\fP
  13310. Average bits\-per\-pixel as integer. Subsampled planar formats use a
  13311. different resolution, which is the reason this value can sometimes be
  13312. odd or confusing. Can be unavailable with some formats.
  13313. .TP
  13314. .B \fBvideo\-params/plane\-depth\fP
  13315. Bit depth for each color component as integer. This is only exposed
  13316. for planar or single\-component formats, and is unavailable for other
  13317. formats.
  13318. .TP
  13319. .B \fBvideo\-params/w\fP, \fBvideo\-params/h\fP
  13320. Video size as integers, with no aspect correction applied.
  13321. .TP
  13322. .B \fBvideo\-params/dw\fP, \fBvideo\-params/dh\fP
  13323. Video size as integers, scaled for correct aspect ratio.
  13324. .TP
  13325. .B \fBvideo\-params/aspect\fP
  13326. Display aspect ratio as float.
  13327. .TP
  13328. .B \fBvideo\-params/par\fP
  13329. Pixel aspect ratio.
  13330. .TP
  13331. .B \fBvideo\-params/colormatrix\fP
  13332. The colormatrix in use as string. (Exact values subject to change.)
  13333. .TP
  13334. .B \fBvideo\-params/colorlevels\fP
  13335. The colorlevels as string. (Exact values subject to change.)
  13336. .TP
  13337. .B \fBvideo\-params/primaries\fP
  13338. The primaries in use as string. (Exact values subject to change.)
  13339. .TP
  13340. .B \fBvideo\-params/gamma\fP
  13341. The gamma function in use as string. (Exact values subject to change.)
  13342. .TP
  13343. .B \fBvideo\-params/sig\-peak\fP
  13344. The video file\(aqs tagged signal peak as float.
  13345. .TP
  13346. .B \fBvideo\-params/light\fP
  13347. The light type in use as a string. (Exact values subject to change.)
  13348. .TP
  13349. .B \fBvideo\-params/chroma\-location\fP
  13350. Chroma location as string. (Exact values subject to change.)
  13351. .TP
  13352. .B \fBvideo\-params/rotate\fP
  13353. Intended display rotation in degrees (clockwise).
  13354. .TP
  13355. .B \fBvideo\-params/stereo\-in\fP
  13356. Source file stereo 3D mode. (See the \fBformat\fP video filter\(aqs
  13357. \fBstereo\-in\fP option.)
  13358. .UNINDENT
  13359. .sp
  13360. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13361. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13362. the following contents:
  13363. .INDENT 7.0
  13364. .INDENT 3.5
  13365. .sp
  13366. .nf
  13367. .ft C
  13368. MPV_FORMAT_NODE_MAP
  13369. "pixelformat" MPV_FORMAT_STRING
  13370. "w" MPV_FORMAT_INT64
  13371. "h" MPV_FORMAT_INT64
  13372. "dw" MPV_FORMAT_INT64
  13373. "dh" MPV_FORMAT_INT64
  13374. "aspect" MPV_FORMAT_DOUBLE
  13375. "par" MPV_FORMAT_DOUBLE
  13376. "colormatrix" MPV_FORMAT_STRING
  13377. "colorlevels" MPV_FORMAT_STRING
  13378. "primaries" MPV_FORMAT_STRING
  13379. "gamma" MPV_FORMAT_STRING
  13380. "sig\-peak" MPV_FORMAT_DOUBLE
  13381. "light" MPV_FORMAT_STRING
  13382. "chroma\-location" MPV_FORMAT_STRING
  13383. "rotate" MPV_FORMAT_INT64
  13384. "stereo\-in" MPV_FORMAT_STRING
  13385. .ft P
  13386. .fi
  13387. .UNINDENT
  13388. .UNINDENT
  13389. .TP
  13390. .B \fBdwidth\fP, \fBdheight\fP
  13391. Video display size. This is the video size after filters and aspect scaling
  13392. have been applied. The actual video window size can still be different
  13393. from this, e.g. if the user resized the video window manually.
  13394. .sp
  13395. These have the same values as \fBvideo\-out\-params/dw\fP and
  13396. \fBvideo\-out\-params/dh\fP\&.
  13397. .TP
  13398. .B \fBvideo\-dec\-params\fP
  13399. Exactly like \fBvideo\-params\fP, but no overrides applied.
  13400. .TP
  13401. .B \fBvideo\-out\-params\fP
  13402. Same as \fBvideo\-params\fP, but after video filters have been applied. If
  13403. there are no video filters in use, this will contain the same values as
  13404. \fBvideo\-params\fP\&. Note that this is still not necessarily what the video
  13405. window uses, since the user can change the window size, and all real VOs
  13406. do their own scaling independently from the filter chain.
  13407. .sp
  13408. Has the same sub\-properties as \fBvideo\-params\fP\&.
  13409. .TP
  13410. .B \fBvideo\-frame\-info\fP
  13411. Approximate information of the current frame. Note that if any of these
  13412. are used on OSD, the information might be off by a few frames due to OSD
  13413. redrawing and frame display being somewhat disconnected, and you might
  13414. have to pause and force a redraw.
  13415. .sp
  13416. Sub\-properties:
  13417. .INDENT 7.0
  13418. .INDENT 3.5
  13419. .sp
  13420. .nf
  13421. .ft C
  13422. video\-frame\-info/picture\-type
  13423. video\-frame\-info/interlaced
  13424. video\-frame\-info/tff
  13425. video\-frame\-info/repeat
  13426. .ft P
  13427. .fi
  13428. .UNINDENT
  13429. .UNINDENT
  13430. .TP
  13431. .B \fBcontainer\-fps\fP
  13432. Container FPS. This can easily contain bogus values. For videos that use
  13433. modern container formats or video codecs, this will often be incorrect.
  13434. .sp
  13435. (Renamed from \fBfps\fP\&.)
  13436. .TP
  13437. .B \fBestimated\-vf\-fps\fP
  13438. Estimated/measured FPS of the video filter chain output. (If no filters
  13439. are used, this corresponds to decoder output.) This uses the average of
  13440. the 10 past frame durations to calculate the FPS. It will be inaccurate
  13441. if frame\-dropping is involved (such as when framedrop is explicitly
  13442. enabled, or after precise seeking). Files with imprecise timestamps (such
  13443. as Matroska) might lead to unstable results.
  13444. .TP
  13445. .B \fBwindow\-scale\fP (RW)
  13446. Window size multiplier. Setting this will resize the video window to the
  13447. values contained in \fBdwidth\fP and \fBdheight\fP multiplied with the value
  13448. set with this property. Setting \fB1\fP will resize to original video size
  13449. (or to be exact, the size the video filters output). \fB2\fP will set the
  13450. double size, \fB0.5\fP halves the size.
  13451. .sp
  13452. See \fBcurrent\-window\-scale\fP for the value derived from the actual window
  13453. size.
  13454. .sp
  13455. Since mpv 0.31.0, this always returns the previously set value (or the
  13456. default value), instead of the value implied by the actual window size.
  13457. Before mpv 0.31.0, this returned what \fBcurrent\-window\-scale\fP returns now,
  13458. after the window was created.
  13459. .TP
  13460. .B \fBcurrent\-window\-scale\fP
  13461. The \fBwindow\-scale\fP value calculated from the current window size. This
  13462. has the same value as \fBwindow\-scale\fP if the window size was not changed
  13463. since setting the option, and the window size was not restricted in other
  13464. ways. The property is unavailable if no video is active.
  13465. .TP
  13466. .B \fBdisplay\-names\fP
  13467. Names of the displays that the mpv window covers. On X11, these
  13468. are the xrandr names (LVDS1, HDMI1, DP1, VGA1, etc.). On Windows, these
  13469. are the GDI names (\e.DISPLAY1, \e.DISPLAY2, etc.) and the first display
  13470. in the list will be the one that Windows considers associated with the
  13471. window (as determined by the MonitorFromWindow API.) On macOS these are the
  13472. Display Product Names as used in the System Information and only one display
  13473. name is returned since a window can only be on one screen.
  13474. .TP
  13475. .B \fBdisplay\-fps\fP
  13476. The refresh rate of the current display. Currently, this is the lowest FPS
  13477. of any display covered by the video, as retrieved by the underlying system
  13478. APIs (e.g. xrandr on X11). It is not the measured FPS. It\(aqs not necessarily
  13479. available on all platforms. Note that any of the listed facts may change
  13480. any time without a warning.
  13481. .sp
  13482. Writing to this property is deprecated. It has the same effect as writing to
  13483. \fBoverride\-display\-fps\fP\&. Since mpv 0.31.0, this property is unavailable
  13484. if no display FPS was reported (e.g. if no video is active), while in older
  13485. versions, it returned the \fB\-\-display\-fps\fP option value.
  13486. .TP
  13487. .B \fBestimated\-display\-fps\fP
  13488. Only available if display\-sync mode (as selected by \fB\-\-video\-sync\fP) is
  13489. active. Returns the actual rate at which display refreshes seem to occur,
  13490. measured by system time.
  13491. .TP
  13492. .B \fBvsync\-jitter\fP
  13493. Estimated deviation factor of the vsync duration.
  13494. .TP
  13495. .B \fBdisplay\-hidpi\-scale\fP
  13496. The HiDPI scale factor as reported by the windowing backend. If no VO is
  13497. active, or if the VO does not report a value, this property is unavailable.
  13498. It may be saner to report an absolute DPI, however, this is the way HiDPI
  13499. support is implemented on most OS APIs. See also \fB\-\-hidpi\-window\-scale\fP\&.
  13500. .TP
  13501. .B \fBvideo\-aspect\fP (RW)
  13502. Deprecated. This is tied to \fB\-\-video\-aspect\-override\fP, but always
  13503. reports the current video aspect if video is active.
  13504. .sp
  13505. The read and write components of this option can be split up into
  13506. \fBvideo\-params/aspect\fP and \fBvideo\-aspect\-override\fP respectively.
  13507. .TP
  13508. .B \fBosd\-width\fP, \fBosd\-height\fP
  13509. Last known OSD width (can be 0). This is needed if you want to use the
  13510. \fBoverlay\-add\fP command. It gives you the actual OSD size, which can be
  13511. different from the window size in some cases.
  13512. .sp
  13513. Alias to \fBosd\-dimensions/w\fP and \fBosd\-dimensions/h\fP\&.
  13514. .TP
  13515. .B \fBosd\-par\fP
  13516. Last known OSD display pixel aspect (can be 0).
  13517. .sp
  13518. Alias to \fBosd\-dimensions/osd\-par\fP\&.
  13519. .TP
  13520. .B \fBosd\-dimensions\fP
  13521. Last known OSD dimensions.
  13522. .sp
  13523. Has the following sub\-properties (which can be read as \fBMPV_FORMAT_NODE\fP
  13524. or Lua table with \fBmp.get_property_native\fP):
  13525. .INDENT 7.0
  13526. .TP
  13527. .B \fBw\fP
  13528. Size of the VO window in OSD render units (usually pixels, but may be
  13529. scaled pixels with VOs like \fBxv\fP).
  13530. .TP
  13531. .B \fBh\fP
  13532. Size of the VO window in OSD render units,
  13533. .TP
  13534. .B \fBpar\fP
  13535. Pixel aspect ratio of the OSD (usually 1).
  13536. .TP
  13537. .B \fBaspect\fP
  13538. Display aspect ratio of the VO window. (Computing from the properties
  13539. above.)
  13540. .TP
  13541. .B \fBmt\fP, \fBmb\fP, \fBml\fP, \fBmr\fP
  13542. OSD to video margins (top, bottom, left, right). This describes the
  13543. area into which the video is rendered.
  13544. .UNINDENT
  13545. .sp
  13546. Any of these properties may be unavailable or set to dummy values if the
  13547. VO window is not created or visible.
  13548. .TP
  13549. .B \fBsub\-text\fP
  13550. Return the current subtitle text regardless of sub visibility.
  13551. Formatting is stripped. If the subtitle is not text\-based
  13552. (i.e. DVD/BD subtitles), an empty string is returned.
  13553. .sp
  13554. This property is experimental and might be removed in the future.
  13555. .TP
  13556. .B \fBsub\-start\fP
  13557. Return the current subtitle start time (in seconds). If there\(aqs multiple
  13558. current subtitles, returns the first start time. If no current subtitle is
  13559. present null is returned instead.
  13560. .TP
  13561. .B \fBsub\-end\fP
  13562. Return the current subtitle start time (in seconds). If there\(aqs multiple
  13563. current subtitles, return the last end time. If no current subtitle is
  13564. present, or if it\(aqs present but has unknown or incorrect duration, null
  13565. is returned instead.
  13566. .TP
  13567. .B \fBplaylist\-pos\fP (RW)
  13568. Current position on playlist. The first entry is on position 0. Writing
  13569. to the property will restart playback at the written entry.
  13570. .TP
  13571. .B \fBplaylist\-pos\-1\fP (RW)
  13572. Same as \fBplaylist\-pos\fP, but 1\-based.
  13573. .TP
  13574. .B \fBplaylist\-count\fP
  13575. Number of total playlist entries.
  13576. .TP
  13577. .B \fBplaylist\fP
  13578. Playlist, current entry marked. Currently, the raw property value is
  13579. useless.
  13580. .sp
  13581. This has a number of sub\-properties. Replace \fBN\fP with the 0\-based playlist
  13582. entry index.
  13583. .INDENT 7.0
  13584. .TP
  13585. .B \fBplaylist/count\fP
  13586. Number of playlist entries (same as \fBplaylist\-count\fP).
  13587. .TP
  13588. .B \fBplaylist/N/filename\fP
  13589. Filename of the Nth entry.
  13590. .TP
  13591. .B \fBplaylist/N/current\fP, \fBplaylist/N/playing\fP
  13592. \fByes\fP if this entry is currently playing (or being loaded).
  13593. Unavailable or \fBno\fP otherwise. When changing files, \fBcurrent\fP and
  13594. \fBplaying\fP can be different, because the currently playing file hasn\(aqt
  13595. been unloaded yet; in this case, \fBcurrent\fP refers to the new
  13596. selection. (Since mpv 0.7.0.)
  13597. .TP
  13598. .B \fBplaylist/N/title\fP
  13599. Name of the Nth entry. Only available if the playlist file contains
  13600. such fields, and only if mpv\(aqs parser supports it for the given
  13601. playlist format.
  13602. .UNINDENT
  13603. .sp
  13604. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13605. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13606. the following contents:
  13607. .INDENT 7.0
  13608. .INDENT 3.5
  13609. .sp
  13610. .nf
  13611. .ft C
  13612. MPV_FORMAT_NODE_ARRAY
  13613. MPV_FORMAT_NODE_MAP (for each playlist entry)
  13614. "filename" MPV_FORMAT_STRING
  13615. "current" MPV_FORMAT_FLAG (might be missing; since mpv 0.7.0)
  13616. "playing" MPV_FORMAT_FLAG (same)
  13617. "title" MPV_FORMAT_STRING (optional)
  13618. .ft P
  13619. .fi
  13620. .UNINDENT
  13621. .UNINDENT
  13622. .TP
  13623. .B \fBtrack\-list\fP
  13624. List of audio/video/sub tracks, current entry marked. Currently, the raw
  13625. property value is useless.
  13626. .sp
  13627. This has a number of sub\-properties. Replace \fBN\fP with the 0\-based track
  13628. index.
  13629. .INDENT 7.0
  13630. .TP
  13631. .B \fBtrack\-list/count\fP
  13632. Total number of tracks.
  13633. .TP
  13634. .B \fBtrack\-list/N/id\fP
  13635. The ID as it\(aqs used for \fB\-sid\fP/\fB\-\-aid\fP/\fB\-\-vid\fP\&. This is unique
  13636. within tracks of the same type (sub/audio/video), but otherwise not.
  13637. .TP
  13638. .B \fBtrack\-list/N/type\fP
  13639. String describing the media type. One of \fBaudio\fP, \fBvideo\fP, \fBsub\fP\&.
  13640. .TP
  13641. .B \fBtrack\-list/N/src\-id\fP
  13642. Track ID as used in the source file. Not always available. (It is
  13643. missing if the format has no native ID, if the track is a pseudo\-track
  13644. that does not exist in this way in the actual file, or if the format
  13645. is handled by libavformat, and the format was not whitelisted as having
  13646. track IDs.)
  13647. .TP
  13648. .B \fBtrack\-list/N/title\fP
  13649. Track title as it is stored in the file. Not always available.
  13650. .TP
  13651. .B \fBtrack\-list/N/lang\fP
  13652. Track language as identified by the file. Not always available.
  13653. .TP
  13654. .B \fBtrack\-list/N/albumart\fP
  13655. \fByes\fP if this is a video track that consists of a single picture,
  13656. \fBno\fP or unavailable otherwise. This is used for video tracks that are
  13657. really attached pictures in audio files.
  13658. .TP
  13659. .B \fBtrack\-list/N/default\fP
  13660. \fByes\fP if the track has the default flag set in the file, \fBno\fP
  13661. otherwise.
  13662. .TP
  13663. .B \fBtrack\-list/N/forced\fP
  13664. \fByes\fP if the track has the forced flag set in the file, \fBno\fP
  13665. otherwise.
  13666. .TP
  13667. .B \fBtrack\-list/N/codec\fP
  13668. The codec name used by this track, for example \fBh264\fP\&. Unavailable
  13669. in some rare cases.
  13670. .TP
  13671. .B \fBtrack\-list/N/external\fP
  13672. \fByes\fP if the track is an external file, \fBno\fP otherwise. This is
  13673. set for separate subtitle files.
  13674. .TP
  13675. .B \fBtrack\-list/N/external\-filename\fP
  13676. The filename if the track is from an external file, unavailable
  13677. otherwise.
  13678. .TP
  13679. .B \fBtrack\-list/N/selected\fP
  13680. \fByes\fP if the track is currently decoded, \fBno\fP otherwise.
  13681. .TP
  13682. .B \fBtrack\-list/N/ff\-index\fP
  13683. The stream index as usually used by the FFmpeg utilities. Note that
  13684. this can be potentially wrong if a demuxer other than libavformat
  13685. (\fB\-\-demuxer=lavf\fP) is used. For mkv files, the index will usually
  13686. match even if the default (builtin) demuxer is used, but there is
  13687. no hard guarantee.
  13688. .TP
  13689. .B \fBtrack\-list/N/decoder\-desc\fP
  13690. If this track is being decoded, the human\-readable decoder name,
  13691. .TP
  13692. .B \fBtrack\-list/N/demux\-w\fP, \fBtrack\-list/N/demux\-h\fP
  13693. Video size hint as indicated by the container. (Not always accurate.)
  13694. .TP
  13695. .B \fBtrack\-list/N/demux\-channel\-count\fP
  13696. Number of audio channels as indicated by the container. (Not always
  13697. accurate \- in particular, the track could be decoded as a different
  13698. number of channels.)
  13699. .TP
  13700. .B \fBtrack\-list/N/demux\-channels\fP
  13701. Channel layout as indicated by the container. (Not always accurate.)
  13702. .TP
  13703. .B \fBtrack\-list/N/demux\-samplerate\fP
  13704. Audio sample rate as indicated by the container. (Not always accurate.)
  13705. .TP
  13706. .B \fBtrack\-list/N/demux\-fps\fP
  13707. Video FPS as indicated by the container. (Not always accurate.)
  13708. .TP
  13709. .B \fBtrack\-list/N/demux\-bitrate\fP
  13710. Audio average bitrate, in bits per second. (Not always accurate.)
  13711. .TP
  13712. .B \fBtrack\-list/N/demux\-rotation\fP
  13713. Video clockwise rotation metadata, in degrees.
  13714. .TP
  13715. .B \fBtrack\-list/N/demux\-par\fP
  13716. Pixel aspect ratio.
  13717. .TP
  13718. .B \fBtrack\-list/N/audio\-channels\fP (deprecated)
  13719. Deprecated alias for \fBtrack\-list/N/demux\-channel\-count\fP\&.
  13720. .TP
  13721. .B \fBtrack\-list/N/replaygain\-track\-peak\fP, \fBtrack\-list/N/replaygain\-track\-gain\fP
  13722. Per\-track replaygain values. Only available for audio tracks with
  13723. corresponding information stored in the source file.
  13724. .TP
  13725. .B \fBtrack\-list/N/replaygain\-album\-peak\fP, \fBtrack\-list/N/replaygain\-album\-gain\fP
  13726. Per\-album replaygain values. If the file has per\-track but no per\-album
  13727. information, the per\-album values will be copied from the per\-track
  13728. values currently. It\(aqs possible that future mpv versions will make
  13729. these properties unavailable instead in this case.
  13730. .UNINDENT
  13731. .sp
  13732. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13733. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13734. the following contents:
  13735. .INDENT 7.0
  13736. .INDENT 3.5
  13737. .sp
  13738. .nf
  13739. .ft C
  13740. MPV_FORMAT_NODE_ARRAY
  13741. MPV_FORMAT_NODE_MAP (for each track)
  13742. "id" MPV_FORMAT_INT64
  13743. "type" MPV_FORMAT_STRING
  13744. "src\-id" MPV_FORMAT_INT64
  13745. "title" MPV_FORMAT_STRING
  13746. "lang" MPV_FORMAT_STRING
  13747. "albumart" MPV_FORMAT_FLAG
  13748. "default" MPV_FORMAT_FLAG
  13749. "forced" MPV_FORMAT_FLAG
  13750. "selected" MPV_FORMAT_FLAG
  13751. "external" MPV_FORMAT_FLAG
  13752. "external\-filename" MPV_FORMAT_STRING
  13753. "codec" MPV_FORMAT_STRING
  13754. "ff\-index" MPV_FORMAT_INT64
  13755. "decoder\-desc" MPV_FORMAT_STRING
  13756. "demux\-w" MPV_FORMAT_INT64
  13757. "demux\-h" MPV_FORMAT_INT64
  13758. "demux\-channel\-count" MPV_FORMAT_INT64
  13759. "demux\-channels" MPV_FORMAT_STRING
  13760. "demux\-samplerate" MPV_FORMAT_INT64
  13761. "demux\-fps" MPV_FORMAT_DOUBLE
  13762. "demux\-bitrate" MPV_FORMAT_INT64
  13763. "demux\-rotation" MPV_FORMAT_INT64
  13764. "demux\-par" MPV_FORMAT_DOUBLE
  13765. "audio\-channels" MPV_FORMAT_INT64
  13766. "replaygain\-track\-peak" MPV_FORMAT_DOUBLE
  13767. "replaygain\-track\-gain" MPV_FORMAT_DOUBLE
  13768. "replaygain\-album\-peak" MPV_FORMAT_DOUBLE
  13769. "replaygain\-album\-gain" MPV_FORMAT_DOUBLE
  13770. .ft P
  13771. .fi
  13772. .UNINDENT
  13773. .UNINDENT
  13774. .TP
  13775. .B \fBchapter\-list\fP
  13776. List of chapters, current entry marked. Currently, the raw property value
  13777. is useless.
  13778. .sp
  13779. This has a number of sub\-properties. Replace \fBN\fP with the 0\-based chapter
  13780. index.
  13781. .INDENT 7.0
  13782. .TP
  13783. .B \fBchapter\-list/count\fP
  13784. Number of chapters.
  13785. .TP
  13786. .B \fBchapter\-list/N/title\fP
  13787. Chapter title as stored in the file. Not always available.
  13788. .TP
  13789. .B \fBchapter\-list/N/time\fP
  13790. Chapter start time in seconds as float.
  13791. .UNINDENT
  13792. .sp
  13793. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13794. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13795. the following contents:
  13796. .INDENT 7.0
  13797. .INDENT 3.5
  13798. .sp
  13799. .nf
  13800. .ft C
  13801. MPV_FORMAT_NODE_ARRAY
  13802. MPV_FORMAT_NODE_MAP (for each chapter)
  13803. "title" MPV_FORMAT_STRING
  13804. "time" MPV_FORMAT_DOUBLE
  13805. .ft P
  13806. .fi
  13807. .UNINDENT
  13808. .UNINDENT
  13809. .TP
  13810. .B \fBaf\fP, \fBvf\fP (RW)
  13811. See \fB\-\-vf\fP/\fB\-\-af\fP and the \fBvf\fP/\fBaf\fP command.
  13812. .sp
  13813. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13814. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13815. the following contents:
  13816. .INDENT 7.0
  13817. .INDENT 3.5
  13818. .sp
  13819. .nf
  13820. .ft C
  13821. MPV_FORMAT_NODE_ARRAY
  13822. MPV_FORMAT_NODE_MAP (for each filter entry)
  13823. "name" MPV_FORMAT_STRING
  13824. "label" MPV_FORMAT_STRING [optional]
  13825. "enabled" MPV_FORMAT_FLAG [optional]
  13826. "params" MPV_FORMAT_NODE_MAP [optional]
  13827. "key" MPV_FORMAT_STRING
  13828. "value" MPV_FORMAT_STRING
  13829. .ft P
  13830. .fi
  13831. .UNINDENT
  13832. .UNINDENT
  13833. .sp
  13834. It\(aqs also possible to write the property using this format.
  13835. .TP
  13836. .B \fBseekable\fP
  13837. Return whether it\(aqs generally possible to seek in the current file.
  13838. .TP
  13839. .B \fBpartially\-seekable\fP
  13840. Return \fByes\fP if the current file is considered seekable, but only because
  13841. the cache is active. This means small relative seeks may be fine, but larger
  13842. seeks may fail anyway. Whether a seek will succeed or not is generally not
  13843. known in advance.
  13844. .sp
  13845. If this property returns true, \fBseekable\fP will also return true.
  13846. .TP
  13847. .B \fBplayback\-abort\fP
  13848. Return whether playback is stopped or is to be stopped. (Useful in obscure
  13849. situations like during \fBon_load\fP hook processing, when the user can
  13850. stop playback, but the script has to explicitly end processing.)
  13851. .TP
  13852. .B \fBcursor\-autohide\fP (RW)
  13853. See \fB\-\-cursor\-autohide\fP\&. Setting this to a new value will always update
  13854. the cursor, and reset the internal timer.
  13855. .TP
  13856. .B \fBosd\-sym\-cc\fP
  13857. Inserts the current OSD symbol as opaque OSD control code (cc). This makes
  13858. sense only with the \fBshow\-text\fP command or options which set OSD messages.
  13859. The control code is implementation specific and is useless for anything else.
  13860. .TP
  13861. .B \fBosd\-ass\-cc\fP
  13862. \fB${osd\-ass\-cc/0}\fP disables escaping ASS sequences of text in OSD,
  13863. \fB${osd\-ass\-cc/1}\fP enables it again. By default, ASS sequences are
  13864. escaped to avoid accidental formatting, and this property can disable
  13865. this behavior. Note that the properties return an opaque OSD control
  13866. code, which only makes sense for the \fBshow\-text\fP command or options
  13867. which set OSD messages.
  13868. .INDENT 7.0
  13869. .INDENT 3.5
  13870. .IP "Example"
  13871. .INDENT 0.0
  13872. .IP \(bu 2
  13873. \fB\-\-osd\-status\-msg=\(aqThis is ${osd\-ass\-cc/0}{\e\eb1}bold text\(aq\fP
  13874. .IP \(bu 2
  13875. \fBshow\-text "This is ${osd\-ass\-cc/0}{\eb1}bold text"\fP
  13876. .UNINDENT
  13877. .UNINDENT
  13878. .UNINDENT
  13879. .sp
  13880. Any ASS override tags as understood by libass can be used.
  13881. .sp
  13882. Note that you need to escape the \fB\e\fP character, because the string is
  13883. processed for C escape sequences before passing it to the OSD code.
  13884. .sp
  13885. A list of tags can be found here: \fI\%http://docs.aegisub.org/latest/ASS_Tags/\fP
  13886. .TP
  13887. .B \fBvo\-configured\fP
  13888. Return whether the VO is configured right now. Usually this corresponds to
  13889. whether the video window is visible. If the \fB\-\-force\-window\fP option is
  13890. used, this is usually always returns \fByes\fP\&.
  13891. .TP
  13892. .B \fBvo\-passes\fP
  13893. Contains introspection about the VO\(aqs active render passes and their
  13894. execution times. Not implemented by all VOs.
  13895. .sp
  13896. This is further subdivided into two frame types, \fBvo\-passes/fresh\fP for
  13897. fresh frames (which have to be uploaded, scaled, etc.) and
  13898. \fBvo\-passes/redraw\fP for redrawn frames (which only have to be re\-painted).
  13899. The number of passes for any given subtype can change from frame to frame,
  13900. and should not be relied upon.
  13901. .sp
  13902. Each frame type has a number of further sub\-properties. Replace \fBTYPE\fP
  13903. with the frame type, \fBN\fP with the 0\-based pass index, and \fBM\fP with the
  13904. 0\-based sample index.
  13905. .INDENT 7.0
  13906. .TP
  13907. .B \fBvo\-passes/TYPE/count\fP
  13908. Number of passes.
  13909. .TP
  13910. .B \fBvo\-passes/TYPE/N/desc\fP
  13911. Human\-friendy description of the pass.
  13912. .TP
  13913. .B \fBvo\-passes/TYPE/N/last\fP
  13914. Last measured execution time, in nanoseconds.
  13915. .TP
  13916. .B \fBvo\-passes/TYPE/N/avg\fP
  13917. Average execution time of this pass, in nanoseconds. The exact
  13918. timeframe varies, but it should generally be a handful of seconds.
  13919. .TP
  13920. .B \fBvo\-passes/TYPE/N/peak\fP
  13921. The peak execution time (highest value) within this averaging range, in
  13922. nanoseconds.
  13923. .TP
  13924. .B \fBvo\-passes/TYPE/N/count\fP
  13925. The number of samples for this pass.
  13926. .TP
  13927. .B \fBvo\-passes/TYPE/N/samples/M\fP
  13928. The raw execution time of a specific sample for this pass, in
  13929. nanoseconds.
  13930. .UNINDENT
  13931. .sp
  13932. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13933. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13934. the following contents:
  13935. .INDENT 7.0
  13936. .INDENT 3.5
  13937. .sp
  13938. .nf
  13939. .ft C
  13940. MPV_FORMAT_NODE_MAP
  13941. "TYPE" MPV_FORMAT_NODE_ARRAY
  13942. MPV_FORMAT_NODE_MAP
  13943. "desc" MPV_FORMAT_STRING
  13944. "last" MPV_FORMAT_INT64
  13945. "avg" MPV_FORMAT_INT64
  13946. "peak" MPV_FORMAT_INT64
  13947. "count" MPV_FORMAT_INT64
  13948. "samples" MPV_FORMAT_NODE_ARRAY
  13949. MP_FORMAT_INT64
  13950. .ft P
  13951. .fi
  13952. .UNINDENT
  13953. .UNINDENT
  13954. .sp
  13955. Note that directly accessing this structure via subkeys is not supported,
  13956. the only access is through aforementioned \fBMPV_FORMAT_NODE\fP\&.
  13957. .TP
  13958. .B \fBvideo\-bitrate\fP, \fBaudio\-bitrate\fP, \fBsub\-bitrate\fP
  13959. Bitrate values calculated on the packet level. This works by dividing the
  13960. bit size of all packets between two keyframes by their presentation
  13961. timestamp distance. (This uses the timestamps are stored in the file, so
  13962. e.g. playback speed does not influence the returned values.) In particular,
  13963. the video bitrate will update only per keyframe, and show the "past"
  13964. bitrate. To make the property more UI friendly, updates to these properties
  13965. are throttled in a certain way.
  13966. .sp
  13967. The unit is bits per second. OSD formatting turns these values in kilobits
  13968. (or megabits, if appropriate), which can be prevented by using the
  13969. raw property value, e.g. with \fB${=video\-bitrate}\fP\&.
  13970. .sp
  13971. Note that the accuracy of these properties is influenced by a few factors.
  13972. If the underlying demuxer rewrites the packets on demuxing (done for some
  13973. file formats), the bitrate might be slightly off. If timestamps are bad
  13974. or jittery (like in Matroska), even constant bitrate streams might show
  13975. fluctuating bitrate.
  13976. .sp
  13977. How exactly these values are calculated might change in the future.
  13978. .sp
  13979. In earlier versions of mpv, these properties returned a static (but bad)
  13980. guess using a completely different method.
  13981. .TP
  13982. .B \fBpacket\-video\-bitrate\fP, \fBpacket\-audio\-bitrate\fP, \fBpacket\-sub\-bitrate\fP
  13983. Old and deprecated properties for \fBvideo\-bitrate\fP, \fBaudio\-bitrate\fP,
  13984. \fBsub\-bitrate\fP\&. They behave exactly the same, but return a value in
  13985. kilobits. Also, they don\(aqt have any OSD formatting, though the same can be
  13986. achieved with e.g. \fB${=video\-bitrate}\fP\&.
  13987. .sp
  13988. These properties shouldn\(aqt be used anymore.
  13989. .TP
  13990. .B \fBaudio\-device\-list\fP
  13991. Return the list of discovered audio devices. This is mostly for use with
  13992. the client API, and reflects what \fB\-\-audio\-device=help\fP with the command
  13993. line player returns.
  13994. .sp
  13995. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  13996. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  13997. the following contents:
  13998. .INDENT 7.0
  13999. .INDENT 3.5
  14000. .sp
  14001. .nf
  14002. .ft C
  14003. MPV_FORMAT_NODE_ARRAY
  14004. MPV_FORMAT_NODE_MAP (for each device entry)
  14005. "name" MPV_FORMAT_STRING
  14006. "description" MPV_FORMAT_STRING
  14007. .ft P
  14008. .fi
  14009. .UNINDENT
  14010. .UNINDENT
  14011. .sp
  14012. The \fBname\fP is what is to be passed to the \fB\-\-audio\-device\fP option (and
  14013. often a rather cryptic audio API\-specific ID), while \fBdescription\fP is
  14014. human readable free form text. The description is set to the device name
  14015. (minus mpv\-specific \fB<driver>/\fP prefix) if no description is available
  14016. or the description would have been an empty string.
  14017. .sp
  14018. The special entry with the name set to \fBauto\fP selects the default audio
  14019. output driver and the default device.
  14020. .sp
  14021. The property can be watched with the property observation mechanism in
  14022. the client API and in Lua scripts. (Technically, change notification is
  14023. enabled the first time this property is read.)
  14024. .TP
  14025. .B \fBaudio\-device\fP (RW)
  14026. Set the audio device. This directly reads/writes the \fB\-\-audio\-device\fP
  14027. option, but on write accesses, the audio output will be scheduled for
  14028. reloading.
  14029. .sp
  14030. Writing this property while no audio output is active will not automatically
  14031. enable audio. (This is also true in the case when audio was disabled due to
  14032. reinitialization failure after a previous write access to \fBaudio\-device\fP\&.)
  14033. .sp
  14034. This property also doesn\(aqt tell you which audio device is actually in use.
  14035. .sp
  14036. How these details are handled may change in the future.
  14037. .TP
  14038. .B \fBcurrent\-vo\fP
  14039. Current video output driver (name as used with \fB\-\-vo\fP).
  14040. .TP
  14041. .B \fBcurrent\-ao\fP
  14042. Current audio output driver (name as used with \fB\-\-ao\fP).
  14043. .TP
  14044. .B \fBshared\-script\-properties\fP (RW)
  14045. This is a key/value map of arbitrary strings shared between scripts for
  14046. general use. The player itself does not use any data in it (although some
  14047. builtin scripts may). The property is not preserved across player restarts.
  14048. .sp
  14049. This is very primitive, inefficient, and annoying to use. It\(aqs a makeshift
  14050. solution which could go away any time (for example, when a better solution
  14051. becomes available). This is also why this property has an annoying name. You
  14052. should avoid using it, unless you absolutely have to.
  14053. .sp
  14054. Lua scripting has helpers starting with \fButils.shared_script_property_\fP\&.
  14055. They are undocumented because you should not use this property. If you still
  14056. think you must, you should use the helpers instead of the property directly.
  14057. .sp
  14058. You are supposed to use the \fBchange\-list\fP command to modify the contents.
  14059. Reading, modifying, and writing the property manually could data loss if two
  14060. scripts update different keys at the same time due to lack of
  14061. synchronization. The Lua helpers take care of this.
  14062. .sp
  14063. (There is no way to ensure synchronization if two scripts try to update the
  14064. same key at the same time.)
  14065. .TP
  14066. .B \fBworking\-directory\fP
  14067. Return the working directory of the mpv process. Can be useful for JSON IPC
  14068. users, because the command line player usually works with relative paths.
  14069. .TP
  14070. .B \fBprotocol\-list\fP
  14071. List of protocol prefixes potentially recognized by the player. They are
  14072. returned without trailing \fB://\fP suffix (which is still always required).
  14073. In some cases, the protocol will not actually be supported (consider
  14074. \fBhttps\fP if ffmpeg is not compiled with TLS support).
  14075. .TP
  14076. .B \fBdecoder\-list\fP
  14077. List of decoders supported. This lists decoders which can be passed to
  14078. \fB\-\-vd\fP and \fB\-\-ad\fP\&.
  14079. .INDENT 7.0
  14080. .TP
  14081. .B \fBcodec\fP
  14082. Canonical codec name, which identifies the format the decoder can
  14083. handle.
  14084. .TP
  14085. .B \fBdriver\fP
  14086. The name of the decoder itself. Often, this is the same as \fBcodec\fP\&.
  14087. Sometimes it can be different. It is used to distinguish multiple
  14088. decoders for the same codec.
  14089. .TP
  14090. .B \fBdescription\fP
  14091. Human readable description of the decoder and codec.
  14092. .UNINDENT
  14093. .sp
  14094. When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
  14095. or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
  14096. the following contents:
  14097. .INDENT 7.0
  14098. .INDENT 3.5
  14099. .sp
  14100. .nf
  14101. .ft C
  14102. MPV_FORMAT_NODE_ARRAY
  14103. MPV_FORMAT_NODE_MAP (for each decoder entry)
  14104. "codec" MPV_FORMAT_STRING
  14105. "driver" MPV_FORMAT_STRING
  14106. "description" MPV_FORMAT_STRING
  14107. .ft P
  14108. .fi
  14109. .UNINDENT
  14110. .UNINDENT
  14111. .TP
  14112. .B \fBencoder\-list\fP
  14113. List of libavcodec encoders. This has the same format as \fBdecoder\-list\fP\&.
  14114. The encoder names (\fBdriver\fP entries) can be passed to \fB\-\-ovc\fP and
  14115. \fB\-\-oac\fP (without the \fBlavc:\fP prefix required by \fB\-\-vd\fP and \fB\-\-ad\fP).
  14116. .TP
  14117. .B \fBdemuxer\-lavf\-list\fP
  14118. List of available libavformat demuxers\(aq names. This can be used to check
  14119. for support for a specific format or use with \fB\-\-demuxer\-lavf\-format\fP\&.
  14120. .TP
  14121. .B \fBmpv\-version\fP
  14122. Return the mpv version/copyright string. Depending on how the binary was
  14123. built, it might contain either a release version, or just a git hash.
  14124. .TP
  14125. .B \fBmpv\-configuration\fP
  14126. Return the configuration arguments which were passed to the build system
  14127. (typically the way \fB\&./waf configure ...\fP was invoked).
  14128. .TP
  14129. .B \fBffmpeg\-version\fP
  14130. Return the contents of the \fBav_version_info()\fP API call. This is a string
  14131. which identifies the build in some way, either through a release version
  14132. number, or a git hash. This applies to Libav as well (the property is
  14133. still named the same.) This property is unavailable if mpv is linked against
  14134. older FFmpeg and Libav versions.
  14135. .TP
  14136. .B \fBoptions/<name>\fP (RW)
  14137. Read\-only access to value of option \fB\-\-<name>\fP\&. Most options can be
  14138. changed at runtime by writing to this property. Note that many options
  14139. require reloading the file for changes to take effect. If there is an
  14140. equivalent property, prefer setting the property instead.
  14141. .sp
  14142. There shouldn\(aqt be any reason to access \fBoptions/<name>\fP instead of
  14143. \fB<name>\fP, except in situations in which the properties have different
  14144. behavior or conflicting semantics.
  14145. .TP
  14146. .B \fBfile\-local\-options/<name>\fP
  14147. Similar to \fBoptions/<name>\fP, but when setting an option through this
  14148. property, the option is reset to its old value once the current file has
  14149. stopped playing. Trying to write an option while no file is playing (or
  14150. is being loaded) results in an error.
  14151. .sp
  14152. (Note that if an option is marked as file\-local, even \fBoptions/\fP will
  14153. access the local value, and the \fBold\fP value, which will be restored on
  14154. end of playback, cannot be read or written until end of playback.)
  14155. .TP
  14156. .B \fBoption\-info/<name>\fP
  14157. Additional per\-option information.
  14158. .sp
  14159. This has a number of sub\-properties. Replace \fB<name>\fP with the name of
  14160. a top\-level option. No guarantee of stability is given to any of these
  14161. sub\-properties \- they may change radically in the feature.
  14162. .INDENT 7.0
  14163. .TP
  14164. .B \fBoption\-info/<name>/name\fP
  14165. Returns the name of the option.
  14166. .TP
  14167. .B \fBoption\-info/<name>/type\fP
  14168. Return the name of the option type, like \fBString\fP or \fBInteger\fP\&.
  14169. For many complex types, this isn\(aqt very accurate.
  14170. .TP
  14171. .B \fBoption\-info/<name>/set\-from\-commandline\fP
  14172. Return \fByes\fP if the option was set from the mpv command line,
  14173. \fBno\fP otherwise. What this is set to if the option is e.g. changed
  14174. at runtime is left undefined (meaning it could change in the future).
  14175. .TP
  14176. .B \fBoption\-info/<name>/set\-locally\fP
  14177. Return \fByes\fP if the option was set per\-file. This is the case with
  14178. automatically loaded profiles, file\-dir configs, and other cases. It
  14179. means the option value will be restored to the value before playback
  14180. start when playback ends.
  14181. .TP
  14182. .B \fBoption\-info/<name>/default\-value\fP
  14183. The default value of the option. May not always be available.
  14184. .TP
  14185. .B \fBoption\-info/<name>/min\fP, \fBoption\-info/<name>/max\fP
  14186. Integer minimum and maximum values allowed for the option. Only
  14187. available if the options are numeric, and the minimum/maximum has been
  14188. set internally. It\(aqs also possible that only one of these is set.
  14189. .TP
  14190. .B \fBoption\-info/<name>/choices\fP
  14191. If the option is a choice option, the possible choices. Choices that
  14192. are integers may or may not be included (they can be implied by \fBmin\fP
  14193. and \fBmax\fP). Note that options which behave like choice options, but
  14194. are not actual choice options internally, may not have this info
  14195. available.
  14196. .UNINDENT
  14197. .TP
  14198. .B \fBproperty\-list\fP
  14199. Return the list of top\-level properties.
  14200. .TP
  14201. .B \fBprofile\-list\fP
  14202. Return the list of profiles and their contents. This is highly
  14203. implementation\-specific, and may change any time. Currently, it returns
  14204. an array of options for each profile. Each option has a name and a value,
  14205. with the value currently always being a string. Note that the options array
  14206. is not a map, as order matters and duplicate entries are possible. Recursive
  14207. profiles are not expanded, and show up as special \fBprofile\fP options.
  14208. .TP
  14209. .B \fBcommand\-list\fP
  14210. Return the list of input commands. This returns an array of maps, where
  14211. each map node represents a command. This map currently only has a single
  14212. entry: \fBname\fP for the name of the command. (This property is supposed to
  14213. be a replacement for \fB\-\-input\-cmdlist\fP\&. The option dumps some more
  14214. information, but it\(aqs a valid feature request to extend this property if
  14215. needed.)
  14216. .TP
  14217. .B \fBinput\-bindings\fP
  14218. Return list of current input key bindings. This returns an array of maps,
  14219. where each map node represents a binding for a single key/command. This map
  14220. has the following entries:
  14221. .INDENT 7.0
  14222. .TP
  14223. .B \fBkey\fP
  14224. The key name. This is normalized and may look slightly different from
  14225. how it was specified in the source (e.g. in input.conf).
  14226. .TP
  14227. .B \fBcmd\fP
  14228. The command mapped to the key. (Currently, this is exactly the same
  14229. string as specified in the source, other than stripping whitespace and
  14230. comments. It\(aqs possible that it will be normalized in the future.)
  14231. .TP
  14232. .B \fBis_weak\fP
  14233. If set to true, any existing and active user bindings will take priority.
  14234. .TP
  14235. .B \fBowner\fP
  14236. If this entry exists, the name of the script (or similar) which added
  14237. this binding.
  14238. .TP
  14239. .B \fBsection\fP
  14240. Name of the section this binding is part of. This is a rarely used
  14241. mechanism. This entry may be removed or change meaning in the future.
  14242. .TP
  14243. .B \fBpriority\fP
  14244. A number. Bindings with a higher value are preferred over bindings
  14245. with a lower value. If the value is negative, this binding is inactive
  14246. and will not be triggered by input. Note that mpv does not use this
  14247. value internally, and matching of bindings may work slightly differently
  14248. in some cases. In addition, this value is dynamic and can change around
  14249. at runtime.
  14250. .TP
  14251. .B \fBcomment\fP
  14252. If available, the comment following the command on the same line. (For
  14253. example, the input.conf entry \fBf cycle bla # toggle bla\fP would
  14254. result in an entry with \fBcomment = "toggle bla", cmd = "cycle bla"\fP\&.)
  14255. .UNINDENT
  14256. .sp
  14257. This property is read\-only, and change notification is not supported.
  14258. Currently, there is no mechanism to change key bindings at runtime, other
  14259. than scripts adding or removing their own bindings.
  14260. .UNINDENT
  14261. .SS Inconsistencies between options and properties
  14262. .sp
  14263. You can access (almost) all options as properties, though there are some
  14264. caveats with some properties (due to historical reasons):
  14265. .INDENT 0.0
  14266. .TP
  14267. .B \fBvid\fP, \fBaid\fP, \fBsid\fP
  14268. While playback is active, these result the actually active tracks. For
  14269. example, if you set \fBaid=5\fP, and the currently played file contains no
  14270. audio track with ID 5, the \fBaid\fP property will return \fBno\fP\&.
  14271. .sp
  14272. Before mpv 0.31.0, you could set existing tracks at runtime only.
  14273. .TP
  14274. .B \fBdisplay\-fps\fP
  14275. This inconsistent behavior is deprecated. Post\-deprecation, the reported
  14276. value and the option value are cleanly separated (\fBoverride\-display\-fps\fP
  14277. for the option value).
  14278. .TP
  14279. .B \fBvf\fP, \fBaf\fP
  14280. If you set the properties during playback, and the filter chain fails to
  14281. reinitialize, the option will be set, but the runtime filter chain does not
  14282. change. On the other hand, the next video to be played will fail, because
  14283. the initial filter chain cannot be created.
  14284. .sp
  14285. This behavior changed in mpv 0.31.0. Before this, the new value was rejected
  14286. \fIiff\fP video (for \fBvf\fP) or audio (for \fBaf\fP) was active. If playback was
  14287. not active, the behavior was the same as the current behavior.
  14288. .TP
  14289. .B \fBplaylist\fP
  14290. The property is read\-only and returns the current internal playlist. The
  14291. option is for loading playlist during command line parsing. For client API
  14292. uses, you should use the \fBloadlist\fP command instead.
  14293. .TP
  14294. .B \fBprofile\fP, \fBinclude\fP
  14295. These are write\-only, and will perform actions as they are written to,
  14296. exactly as if they were used on the mpv CLI commandline. Their only use is
  14297. when using libmpv before \fBmpv_initialize()\fP, which in turn is probably
  14298. only useful in encoding mode. Normal libmpv users should use other
  14299. mechanisms, such as the \fBapply\-profile\fP command, and the
  14300. \fBmpv_load_config_file\fP API function. Avoid these properties.
  14301. .UNINDENT
  14302. .SS Property Expansion
  14303. .sp
  14304. All string arguments to input commands as well as certain options (like
  14305. \fB\-\-term\-playing\-msg\fP) are subject to property expansion. Note that property
  14306. expansion does not work in places where e.g. numeric parameters are expected.
  14307. (For example, the \fBadd\fP command does not do property expansion. The \fBset\fP
  14308. command is an exception and not a general rule.)
  14309. .INDENT 0.0
  14310. .INDENT 3.5
  14311. .IP "Example for input.conf"
  14312. .INDENT 0.0
  14313. .TP
  14314. .B \fBi show\-text "Filename: ${filename}"\fP
  14315. shows the filename of the current file when pressing the \fBi\fP key
  14316. .UNINDENT
  14317. .UNINDENT
  14318. .UNINDENT
  14319. .sp
  14320. Within \fBinput.conf\fP, property expansion can be inhibited by putting the
  14321. \fBraw\fP prefix in front of commands.
  14322. .sp
  14323. The following expansions are supported:
  14324. .INDENT 0.0
  14325. .TP
  14326. .B \fB${NAME}\fP
  14327. Expands to the value of the property \fBNAME\fP\&. If retrieving the property
  14328. fails, expand to an error string. (Use \fB${NAME:}\fP with a trailing
  14329. \fB:\fP to expand to an empty string instead.)
  14330. If \fBNAME\fP is prefixed with \fB=\fP, expand to the raw value of the property
  14331. (see section below).
  14332. .TP
  14333. .B \fB${NAME:STR}\fP
  14334. Expands to the value of the property \fBNAME\fP, or \fBSTR\fP if the
  14335. property cannot be retrieved. \fBSTR\fP is expanded recursively.
  14336. .TP
  14337. .B \fB${?NAME:STR}\fP
  14338. Expands to \fBSTR\fP (recursively) if the property \fBNAME\fP is available.
  14339. .TP
  14340. .B \fB${!NAME:STR}\fP
  14341. Expands to \fBSTR\fP (recursively) if the property \fBNAME\fP cannot be
  14342. retrieved.
  14343. .TP
  14344. .B \fB${?NAME==VALUE:STR}\fP
  14345. Expands to \fBSTR\fP (recursively) if the property \fBNAME\fP expands to a
  14346. string equal to \fBVALUE\fP\&. You can prefix \fBNAME\fP with \fB=\fP in order to
  14347. compare the raw value of a property (see section below). If the property
  14348. is unavailable, or other errors happen when retrieving it, the value is
  14349. never considered equal.
  14350. Note that \fBVALUE\fP can\(aqt contain any of the characters \fB:\fP or \fB}\fP\&.
  14351. Also, it is possible that escaping with \fB"\fP or \fB%\fP might be added in
  14352. the future, should the need arise.
  14353. .TP
  14354. .B \fB${!NAME==VALUE:STR}\fP
  14355. Same as with the \fB?\fP variant, but \fBSTR\fP is expanded if the value is
  14356. not equal. (Using the same semantics as with \fB?\fP\&.)
  14357. .TP
  14358. .B \fB$$\fP
  14359. Expands to \fB$\fP\&.
  14360. .TP
  14361. .B \fB$}\fP
  14362. Expands to \fB}\fP\&. (To produce this character inside recursive
  14363. expansion.)
  14364. .TP
  14365. .B \fB$>\fP
  14366. Disable property expansion and special handling of \fB$\fP for the rest
  14367. of the string.
  14368. .UNINDENT
  14369. .sp
  14370. In places where property expansion is allowed, C\-style escapes are often
  14371. accepted as well. Example:
  14372. .INDENT 0.0
  14373. .INDENT 3.5
  14374. .INDENT 0.0
  14375. .IP \(bu 2
  14376. \fB\en\fP becomes a newline character
  14377. .IP \(bu 2
  14378. \fB\e\e\fP expands to \fB\e\fP
  14379. .UNINDENT
  14380. .UNINDENT
  14381. .UNINDENT
  14382. .SS Raw and Formatted Properties
  14383. .sp
  14384. Normally, properties are formatted as human\-readable text, meant to be
  14385. displayed on OSD or on the terminal. It is possible to retrieve an unformatted
  14386. (raw) value from a property by prefixing its name with \fB=\fP\&. These raw values
  14387. can be parsed by other programs and follow the same conventions as the options
  14388. associated with the properties.
  14389. .INDENT 0.0
  14390. .INDENT 3.5
  14391. .IP "Examples"
  14392. .INDENT 0.0
  14393. .IP \(bu 2
  14394. \fB${time\-pos}\fP expands to \fB00:14:23\fP (if playback position is at 14
  14395. minutes 23 seconds)
  14396. .IP \(bu 2
  14397. \fB${=time\-pos}\fP expands to \fB863.4\fP (same time, plus 400 milliseconds \-
  14398. milliseconds are normally not shown in the formatted case)
  14399. .UNINDENT
  14400. .UNINDENT
  14401. .UNINDENT
  14402. .sp
  14403. Sometimes, the difference in amount of information carried by raw and formatted
  14404. property values can be rather big. In some cases, raw values have more
  14405. information, like higher precision than seconds with \fBtime\-pos\fP\&. Sometimes
  14406. it is the other way around, e.g. \fBaid\fP shows track title and language in the
  14407. formatted case, but only the track number if it is raw.
  14408. .SH ON SCREEN CONTROLLER
  14409. .sp
  14410. The On Screen Controller (short: OSC) is a minimal GUI integrated with mpv to
  14411. offer basic mouse\-controllability. It is intended to make interaction easier
  14412. for new users and to enable precise and direct seeking.
  14413. .sp
  14414. The OSC is enabled by default if mpv was compiled with Lua support. It can be
  14415. disabled entirely using the \fB\-\-osc=no\fP option.
  14416. .SS Using the OSC
  14417. .sp
  14418. By default, the OSC will show up whenever the mouse is moved inside the
  14419. player window and will hide if the mouse is not moved outside the OSC for
  14420. 0.5 seconds or if the mouse leaves the window.
  14421. .SS The Interface
  14422. .INDENT 0.0
  14423. .INDENT 3.5
  14424. .sp
  14425. .nf
  14426. .ft C
  14427. +\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+
  14428. | pl prev | pl next | title | cache |
  14429. +\-\-\-\-\-\-+\-\-+\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-+
  14430. | play | skip | skip | time | seekbar | time | audio | sub | vol | fs |
  14431. | | back | frwd | elapsed | | left | | | | |
  14432. +\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-+
  14433. .ft P
  14434. .fi
  14435. .UNINDENT
  14436. .UNINDENT
  14437. .INDENT 0.0
  14438. .TP
  14439. .B pl prev
  14440. .TS
  14441. center;
  14442. |l|l|.
  14443. _
  14444. T{
  14445. left\-click
  14446. T} T{
  14447. play previous file in playlist
  14448. T}
  14449. _
  14450. T{
  14451. right\-click
  14452. T} T{
  14453. show playlist
  14454. T}
  14455. _
  14456. T{
  14457. shift+L\-click
  14458. T} T{
  14459. show playlist
  14460. T}
  14461. _
  14462. .TE
  14463. .TP
  14464. .B pl next
  14465. .TS
  14466. center;
  14467. |l|l|.
  14468. _
  14469. T{
  14470. left\-click
  14471. T} T{
  14472. play next file in playlist
  14473. T}
  14474. _
  14475. T{
  14476. right\-click
  14477. T} T{
  14478. show playlist
  14479. T}
  14480. _
  14481. T{
  14482. shift+L\-click
  14483. T} T{
  14484. show playlist
  14485. T}
  14486. _
  14487. .TE
  14488. .TP
  14489. .B title
  14490. .nf
  14491. Displays current media\-title, filename, or custom title
  14492. .fi
  14493. .sp
  14494. .TS
  14495. center;
  14496. |l|l|.
  14497. _
  14498. T{
  14499. left\-click
  14500. T} T{
  14501. show playlist position and length and full title
  14502. T}
  14503. _
  14504. T{
  14505. right\-click
  14506. T} T{
  14507. show filename
  14508. T}
  14509. _
  14510. .TE
  14511. .TP
  14512. .B cache
  14513. .nf
  14514. Shows current cache fill status
  14515. .fi
  14516. .sp
  14517. .TP
  14518. .B play
  14519. .TS
  14520. center;
  14521. |l|l|.
  14522. _
  14523. T{
  14524. left\-click
  14525. T} T{
  14526. toggle play/pause
  14527. T}
  14528. _
  14529. .TE
  14530. .TP
  14531. .B skip back
  14532. .TS
  14533. center;
  14534. |l|l|.
  14535. _
  14536. T{
  14537. left\-click
  14538. T} T{
  14539. go to beginning of chapter / previous chapter
  14540. T}
  14541. _
  14542. T{
  14543. right\-click
  14544. T} T{
  14545. show chapters
  14546. T}
  14547. _
  14548. T{
  14549. shift+L\-click
  14550. T} T{
  14551. show chapters
  14552. T}
  14553. _
  14554. .TE
  14555. .TP
  14556. .B skip frwd
  14557. .TS
  14558. center;
  14559. |l|l|.
  14560. _
  14561. T{
  14562. left\-click
  14563. T} T{
  14564. go to next chapter
  14565. T}
  14566. _
  14567. T{
  14568. right\-click
  14569. T} T{
  14570. show chapters
  14571. T}
  14572. _
  14573. T{
  14574. shift+L\-click
  14575. T} T{
  14576. show chapters
  14577. T}
  14578. _
  14579. .TE
  14580. .TP
  14581. .B time elapsed
  14582. .nf
  14583. Shows current playback position timestamp
  14584. .fi
  14585. .sp
  14586. .TS
  14587. center;
  14588. |l|l|.
  14589. _
  14590. T{
  14591. left\-click
  14592. T} T{
  14593. toggle displaying timecodes with milliseconds
  14594. T}
  14595. _
  14596. .TE
  14597. .TP
  14598. .B seekbar
  14599. .nf
  14600. Indicates current playback position and position of chapters
  14601. .fi
  14602. .sp
  14603. .TS
  14604. center;
  14605. |l|l|.
  14606. _
  14607. T{
  14608. left\-click
  14609. T} T{
  14610. seek to position
  14611. T}
  14612. _
  14613. .TE
  14614. .TP
  14615. .B time left
  14616. .nf
  14617. Shows remaining playback time timestamp
  14618. .fi
  14619. .sp
  14620. .TS
  14621. center;
  14622. |l|l|.
  14623. _
  14624. T{
  14625. left\-click
  14626. T} T{
  14627. toggle between total and remaining time
  14628. T}
  14629. _
  14630. .TE
  14631. .TP
  14632. .B audio and sub
  14633. .nf
  14634. Displays selected track and amount of available tracks
  14635. .fi
  14636. .sp
  14637. .TS
  14638. center;
  14639. |l|l|.
  14640. _
  14641. T{
  14642. left\-click
  14643. T} T{
  14644. cycle audio/sub tracks forward
  14645. T}
  14646. _
  14647. T{
  14648. right\-click
  14649. T} T{
  14650. cycle audio/sub tracks backwards
  14651. T}
  14652. _
  14653. T{
  14654. shift+L\-click
  14655. T} T{
  14656. show available audio/sub tracks
  14657. T}
  14658. _
  14659. .TE
  14660. .TP
  14661. .B vol
  14662. .TS
  14663. center;
  14664. |l|l|.
  14665. _
  14666. T{
  14667. left\-click
  14668. T} T{
  14669. toggle mute
  14670. T}
  14671. _
  14672. T{
  14673. mouse wheel
  14674. T} T{
  14675. volume up/down
  14676. T}
  14677. _
  14678. .TE
  14679. .TP
  14680. .B fs
  14681. .TS
  14682. center;
  14683. |l|l|.
  14684. _
  14685. T{
  14686. left\-click
  14687. T} T{
  14688. toggle fullscreen
  14689. T}
  14690. _
  14691. .TE
  14692. .UNINDENT
  14693. .SS Key Bindings
  14694. .sp
  14695. These key bindings are active by default if nothing else is already bound to
  14696. these keys. In case of collision, the function needs to be bound to a
  14697. different key. See the \fI\%Script Commands\fP section.
  14698. .TS
  14699. center;
  14700. |l|l|.
  14701. _
  14702. T{
  14703. del
  14704. T} T{
  14705. Cycles visibility between never / auto (mouse\-move) / always
  14706. T}
  14707. _
  14708. .TE
  14709. .SS Configuration
  14710. .sp
  14711. The OSC offers limited configuration through a config file
  14712. \fBscript\-opts/osc.conf\fP placed in mpv\(aqs user dir and through the
  14713. \fB\-\-script\-opts\fP command\-line option. Options provided through the command\-line
  14714. will override those from the config file.
  14715. .SS Config Syntax
  14716. .sp
  14717. The config file must exactly follow the following syntax:
  14718. .INDENT 0.0
  14719. .INDENT 3.5
  14720. .sp
  14721. .nf
  14722. .ft C
  14723. # this is a comment
  14724. optionA=value1
  14725. optionB=value2
  14726. .ft P
  14727. .fi
  14728. .UNINDENT
  14729. .UNINDENT
  14730. .sp
  14731. \fB#\fP can only be used at the beginning of a line and there may be no
  14732. spaces around the \fB=\fP or anywhere else.
  14733. .SS Command\-line Syntax
  14734. .sp
  14735. To avoid collisions with other scripts, all options need to be prefixed with
  14736. \fBosc\-\fP\&.
  14737. .sp
  14738. Example:
  14739. .INDENT 0.0
  14740. .INDENT 3.5
  14741. .sp
  14742. .nf
  14743. .ft C
  14744. \-\-script\-opts=osc\-optionA=value1,osc\-optionB=value2
  14745. .ft P
  14746. .fi
  14747. .UNINDENT
  14748. .UNINDENT
  14749. .SS Configurable Options
  14750. .INDENT 0.0
  14751. .TP
  14752. .B \fBlayout\fP
  14753. Default: bottombar
  14754. .sp
  14755. The layout for the OSC. Currently available are: box, slimbox,
  14756. bottombar and topbar. Default pre\-0.21.0 was \(aqbox\(aq.
  14757. .TP
  14758. .B \fBseekbarstyle\fP
  14759. Default: bar
  14760. .sp
  14761. Sets the style of the playback position marker and overall shape
  14762. of the seekbar: \fBbar\fP, \fBdiamond\fP or \fBknob\fP\&.
  14763. .TP
  14764. .B \fBseekbarhandlesize\fP
  14765. Default: 0.6
  14766. .sp
  14767. Size ratio of the seek handle if \fBseekbarstyle\fP is set to \fBdimaond\fP
  14768. or \fBknob\fP\&. This is relative to the full height of the seekbar.
  14769. .TP
  14770. .B \fBseekbarkeyframes\fP
  14771. Default: yes
  14772. .sp
  14773. Controls the mode used to seek when dragging the seekbar. By default,
  14774. keyframes are used. If set to false, exact seeking on mouse drags
  14775. will be used instead. Keyframes are preferred, but exact seeks may be
  14776. useful in cases where keyframes cannot be found. Note that using exact
  14777. seeks can potentially make mouse dragging much slower.
  14778. .TP
  14779. .B \fBseekrangestyle\fP
  14780. Default: inverted
  14781. .sp
  14782. Display seekable ranges on the seekbar. \fBbar\fP shows them on the full
  14783. height of the bar, \fBline\fP as a thick line and \fBinverted\fP as a thin
  14784. line that is inverted over playback position markers. \fBnone\fP will hide
  14785. them. Additionally, \fBslider\fP will show a permanent handle inside the seekbar
  14786. with cached ranges marked inside. Note that these will look differently
  14787. based on the seekbarstyle option. Also, \fBslider\fP does not work with
  14788. \fBseekbarstyle\fP set to \fBbar\fP\&.
  14789. .TP
  14790. .B \fBseekrangeseparate\fP
  14791. Default: yes
  14792. .sp
  14793. Controls whether to show line\-style seekable ranges on top of the
  14794. seekbar or separately if \fBseekbarstyle\fP is set to \fBbar\fP\&.
  14795. .TP
  14796. .B \fBseekrangealpha\fP
  14797. Default: 200
  14798. .sp
  14799. Alpha of the seekable ranges, 0 (opaque) to 255 (fully transparent).
  14800. .TP
  14801. .B \fBdeadzonesize\fP
  14802. Default: 0.5
  14803. .sp
  14804. Size of the deadzone. The deadzone is an area that makes the mouse act
  14805. like leaving the window. Movement there won\(aqt make the OSC show up and
  14806. it will hide immediately if the mouse enters it. The deadzone starts
  14807. at the window border opposite to the OSC and the size controls how much
  14808. of the window it will span. Values between 0.0 and 1.0, where 0 means the
  14809. OSC will always popup with mouse movement in the window, and 1 means the
  14810. OSC will only show up when the mouse hovers it. Default pre\-0.21.0 was 0.
  14811. .TP
  14812. .B \fBminmousemove\fP
  14813. Default: 0
  14814. .sp
  14815. Minimum amount of pixels the mouse has to move between ticks to make
  14816. the OSC show up. Default pre\-0.21.0 was 3.
  14817. .TP
  14818. .B \fBshowwindowed\fP
  14819. Default: yes
  14820. .sp
  14821. Enable the OSC when windowed
  14822. .TP
  14823. .B \fBshowfullscreen\fP
  14824. Default: yes
  14825. .sp
  14826. Enable the OSC when fullscreen
  14827. .TP
  14828. .B \fBscalewindowed\fP
  14829. Default: 1.0
  14830. .sp
  14831. Scale factor of the OSC when windowed.
  14832. .TP
  14833. .B \fBscalefullscreen\fP
  14834. Default: 1.0
  14835. .sp
  14836. Scale factor of the OSC when fullscreen
  14837. .TP
  14838. .B \fBscaleforcedwindow\fP
  14839. Default: 2.0
  14840. .sp
  14841. Scale factor of the OSC when rendered on a forced (dummy) window
  14842. .TP
  14843. .B \fBvidscale\fP
  14844. Default: yes
  14845. .sp
  14846. Scale the OSC with the video
  14847. \fBno\fP tries to keep the OSC size constant as much as the window size allows
  14848. .TP
  14849. .B \fBvalign\fP
  14850. Default: 0.8
  14851. .sp
  14852. Vertical alignment, \-1 (top) to 1 (bottom)
  14853. .TP
  14854. .B \fBhalign\fP
  14855. Default: 0.0
  14856. .sp
  14857. Horizontal alignment, \-1 (left) to 1 (right)
  14858. .TP
  14859. .B \fBbarmargin\fP
  14860. Default: 0
  14861. .sp
  14862. Margin from bottom (bottombar) or top (topbar), in pixels
  14863. .TP
  14864. .B \fBboxalpha\fP
  14865. Default: 80
  14866. .sp
  14867. Alpha of the background box, 0 (opaque) to 255 (fully transparent)
  14868. .TP
  14869. .B \fBhidetimeout\fP
  14870. Default: 500
  14871. .sp
  14872. Duration in ms until the OSC hides if no mouse movement, must not be
  14873. negative
  14874. .TP
  14875. .B \fBfadeduration\fP
  14876. Default: 200
  14877. .sp
  14878. Duration of fade out in ms, 0 = no fade
  14879. .TP
  14880. .B \fBtitle\fP
  14881. Default: ${media\-title}
  14882. .sp
  14883. String that supports property expansion that will be displayed as
  14884. OSC title.
  14885. ASS tags are escaped, and newlines and trailing slashes are stripped.
  14886. .TP
  14887. .B \fBtooltipborder\fP
  14888. Default: 1
  14889. .sp
  14890. Size of the tooltip outline when using bottombar or topbar layouts
  14891. .TP
  14892. .B \fBtimetotal\fP
  14893. Default: no
  14894. .sp
  14895. Show total time instead of time remaining
  14896. .TP
  14897. .B \fBtimems\fP
  14898. Default: no
  14899. .sp
  14900. Display timecodes with milliseconds
  14901. .TP
  14902. .B \fBvisibility\fP
  14903. Default: auto (auto hide/show on mouse move)
  14904. .sp
  14905. Also supports \fBnever\fP and \fBalways\fP
  14906. .TP
  14907. .B \fBboxmaxchars\fP
  14908. Default: 80
  14909. .sp
  14910. Max chars for the osc title at the box layout. mpv does not measure the
  14911. text width on screen and so it needs to limit it by number of chars. The
  14912. default is conservative to allow wide fonts to be used without overflow.
  14913. However, with many common fonts a bigger number can be used. YMMV.
  14914. .TP
  14915. .B \fBboxvideo\fP
  14916. Default: no
  14917. .sp
  14918. Whether to overlay the osc over the video (\fBno\fP), or to box the video
  14919. within the areas not covered by the osc (\fByes\fP). If this option is set,
  14920. the osc may overwrite the \fB\-\-video\-margin\-ratio\-*\fP options, even if the
  14921. user has set them. (It will not overwrite them if all of them are set to
  14922. default values.)
  14923. .sp
  14924. Currently, this is supported for the \fBbottombar\fP and \fBtopbar\fP layout
  14925. only. The other layouts do not change if this option is set. Separately,
  14926. if window controls are present (see below), they will be affected
  14927. regardless of which osc layout is in use.
  14928. .sp
  14929. The border is static and appears even if the OSC is configured to appear
  14930. only on mouse interaction. If the OSC is invisible, the border is simply
  14931. filled with the background color (black by default).
  14932. .sp
  14933. This currently still makes the OSC overlap with subtitles (if the
  14934. \fB\-\-sub\-use\-margins\fP option is set to \fByes\fP, the default). This may be
  14935. fixed later.
  14936. .sp
  14937. This does not work correctly with video outputs like \fB\-\-vo=xv\fP, which
  14938. render OSD into the unscaled video.
  14939. .TP
  14940. .B \fBwindowcontrols\fP
  14941. Default: auto (Show window controls if there is no window border)
  14942. .sp
  14943. Whether to show window management controls over the video, and if so,
  14944. which side of the window to place them. This may be desirable when the
  14945. window has no decorations, either because they have been explicitly
  14946. disabled (\fBborder=no\fP) or because the current platform doesn\(aqt support
  14947. them (eg: gnome\-shell with wayland).
  14948. .sp
  14949. The set of window controls is fixed, offering \fBminimize\fP, \fBmaximize\fP,
  14950. and \fBquit\fP\&. Not all platforms implement \fBminimize\fP and \fBmaximize\fP,
  14951. but \fBquit\fP will always work.
  14952. .TP
  14953. .B \fBwindowcontrols_alignment\fP
  14954. Default: right
  14955. .sp
  14956. If window controls are shown, indicates which side should they be aligned
  14957. to.
  14958. .sp
  14959. Supports \fBleft\fP and \fBright\fP which will place the controls on those
  14960. respective sides.
  14961. .TP
  14962. .B \fBgreenandgrumpy\fP
  14963. Default: no
  14964. .sp
  14965. Set to \fByes\fP to reduce festivity (i.e. disable santa hat in December.)
  14966. .UNINDENT
  14967. .SS Script Commands
  14968. .sp
  14969. The OSC script listens to certain script commands. These commands can bound
  14970. in \fBinput.conf\fP, or sent by other scripts.
  14971. .INDENT 0.0
  14972. .TP
  14973. .B \fBosc\-message\fP
  14974. Show a message on screen using the OSC. First argument is the message,
  14975. second the duration in seconds.
  14976. .TP
  14977. .B \fBosc\-visibility\fP
  14978. Controls visibility mode \fBnever\fP / \fBauto\fP (on mouse move) / \fBalways\fP
  14979. and also \fBcycle\fP to cycle between the modes
  14980. .UNINDENT
  14981. .sp
  14982. Example
  14983. .sp
  14984. You could put this into \fBinput.conf\fP to hide the OSC with the \fBa\fP key and
  14985. to set auto mode (the default) with \fBb\fP:
  14986. .INDENT 0.0
  14987. .INDENT 3.5
  14988. .sp
  14989. .nf
  14990. .ft C
  14991. a script\-message osc\-visibility never
  14992. b script\-message osc\-visibility auto
  14993. .ft P
  14994. .fi
  14995. .UNINDENT
  14996. .UNINDENT
  14997. .INDENT 0.0
  14998. .TP
  14999. .B \fBosc\-playlist\fP, \fBosc\-chapterlist\fP, \fBosc\-tracklist\fP
  15000. Shows a limited view of the respective type of list using the OSC. First
  15001. argument is duration in seconds.
  15002. .UNINDENT
  15003. .SH STATS
  15004. .sp
  15005. This builtin script displays information and statistics for the currently
  15006. played file. It is enabled by default if mpv was compiled with Lua support.
  15007. It can be disabled entirely using the \fB\-\-load\-stats\-overlay=no\fP option.
  15008. .SS Usage
  15009. .sp
  15010. The following key bindings are active by default unless something else is
  15011. already bound to them:
  15012. .TS
  15013. center;
  15014. |l|l|.
  15015. _
  15016. T{
  15017. i
  15018. T} T{
  15019. Show stats for a fixed duration
  15020. T}
  15021. _
  15022. T{
  15023. I
  15024. T} T{
  15025. Toggle stats (shown until toggled again)
  15026. T}
  15027. _
  15028. .TE
  15029. .sp
  15030. While the stats are visible on screen the following key bindings are active,
  15031. regardless of existing bindings. They allow you to switch between \fIpages\fP of
  15032. stats:
  15033. .TS
  15034. center;
  15035. |l|l|.
  15036. _
  15037. T{
  15038. 1
  15039. T} T{
  15040. Show usual stats
  15041. T}
  15042. _
  15043. T{
  15044. 2
  15045. T} T{
  15046. Show frame timings
  15047. T}
  15048. _
  15049. T{
  15050. 3
  15051. T} T{
  15052. Input cache stats
  15053. T}
  15054. _
  15055. .TE
  15056. .SS Font
  15057. .sp
  15058. For optimal visual experience, a font with support for many font weights and
  15059. monospaced digits is recommended. By default, the open source font
  15060. \fI\%Source Sans Pro\fP is used.
  15061. .SS Configuration
  15062. .sp
  15063. This script can be customized through a config file \fBscript\-opts/stats.conf\fP
  15064. placed in mpv\(aqs user directory and through the \fB\-\-script\-opts\fP command\-line
  15065. option. The configuration syntax is described in \fI\%ON SCREEN CONTROLLER\fP\&.
  15066. .SS Configurable Options
  15067. .INDENT 0.0
  15068. .TP
  15069. .B \fBkey_oneshot\fP
  15070. Default: i
  15071. .TP
  15072. .B \fBkey_toggle\fP
  15073. Default: I
  15074. .sp
  15075. Key bindings to display stats.
  15076. .TP
  15077. .B \fBkey_page_1\fP
  15078. Default: 1
  15079. .TP
  15080. .B \fBkey_page_2\fP
  15081. Default: 2
  15082. .TP
  15083. .B \fBkey_page_3\fP
  15084. Default: 3
  15085. .sp
  15086. Key bindings for page switching while stats are displayed.
  15087. .TP
  15088. .B \fBduration\fP
  15089. Default: 4
  15090. .sp
  15091. How long the stats are shown in seconds (oneshot).
  15092. .TP
  15093. .B \fBredraw_delay\fP
  15094. Default: 1
  15095. .sp
  15096. How long it takes to refresh the displayed stats in seconds (toggling).
  15097. .TP
  15098. .B \fBpersistent_overlay\fP
  15099. Default: no
  15100. .sp
  15101. When \fIno\fP, other scripts printing text to the screen can overwrite the
  15102. displayed stats. When \fIyes\fP, displayed stats are persistently shown for the
  15103. respective duration. This can result in overlapping text when multiple
  15104. scripts decide to print text at the same time.
  15105. .TP
  15106. .B \fBplot_perfdata\fP
  15107. Default: yes
  15108. .sp
  15109. Show graphs for performance data (page 2).
  15110. .TP
  15111. .B \fBplot_vsync_ratio\fP
  15112. Default: yes
  15113. .TP
  15114. .B \fBplot_vsync_jitter\fP
  15115. Default: yes
  15116. .sp
  15117. Show graphs for vsync and jitter values (page 1). Only when toggled.
  15118. .TP
  15119. .B \fBflush_graph_data\fP
  15120. Default: yes
  15121. .sp
  15122. Clear data buffers used for drawing graphs when toggling.
  15123. .TP
  15124. .B \fBfont\fP
  15125. Default: Source Sans Pro
  15126. .sp
  15127. Font name. Should support as many font weights as possible for optimal
  15128. visual experience.
  15129. .TP
  15130. .B \fBfont_mono\fP
  15131. Default: Source Sans Pro
  15132. .sp
  15133. Font name for parts where monospaced characters are necessary to align
  15134. text. Currently, monospaced digits are sufficient.
  15135. .TP
  15136. .B \fBfont_size\fP
  15137. Default: 8
  15138. .sp
  15139. Font size used to render text.
  15140. .TP
  15141. .B \fBfont_color\fP
  15142. Default: FFFFFF
  15143. .sp
  15144. Font color.
  15145. .TP
  15146. .B \fBborder_size\fP
  15147. Default: 0.8
  15148. .sp
  15149. Size of border drawn around the font.
  15150. .TP
  15151. .B \fBborder_color\fP
  15152. Default: 262626
  15153. .sp
  15154. Color of drawn border.
  15155. .TP
  15156. .B \fBalpha\fP
  15157. Default: 11
  15158. .sp
  15159. Transparency for drawn text.
  15160. .TP
  15161. .B \fBplot_bg_border_color\fP
  15162. Default: 0000FF
  15163. .sp
  15164. Border color used for drawing graphs.
  15165. .TP
  15166. .B \fBplot_bg_color\fP
  15167. Default: 262626
  15168. .sp
  15169. Background color used for drawing graphs.
  15170. .TP
  15171. .B \fBplot_color\fP
  15172. Default: FFFFFF
  15173. .sp
  15174. Color used for drawing graphs.
  15175. .UNINDENT
  15176. .sp
  15177. Note: colors are given as hexadecimal values and use ASS tag order: BBGGRR
  15178. (blue green red).
  15179. .SS Different key bindings
  15180. .sp
  15181. A different key binding can be defined with the aforementioned options
  15182. \fBkey_oneshot\fP and \fBkey_toggle\fP but also with commands in \fBinput.conf\fP,
  15183. for example:
  15184. .INDENT 0.0
  15185. .INDENT 3.5
  15186. .sp
  15187. .nf
  15188. .ft C
  15189. e script\-binding stats/display\-stats
  15190. E script\-binding stats/display\-stats\-toggle
  15191. .ft P
  15192. .fi
  15193. .UNINDENT
  15194. .UNINDENT
  15195. .sp
  15196. Using \fBinput.conf\fP, it is also possible to directly display a certain page:
  15197. .INDENT 0.0
  15198. .INDENT 3.5
  15199. .sp
  15200. .nf
  15201. .ft C
  15202. i script\-binding stats/display\-page\-1
  15203. e script\-binding stats/display\-page\-2
  15204. .ft P
  15205. .fi
  15206. .UNINDENT
  15207. .UNINDENT
  15208. .SH CONSOLE
  15209. .sp
  15210. The console is a REPL for mpv input commands. It is displayed on the video
  15211. window. It also shows log messages. It can be disabled entirely using the
  15212. \fB\-\-load\-osd\-console=no\fP option.
  15213. .SS Keybindings
  15214. .INDENT 0.0
  15215. .TP
  15216. .B \(ga
  15217. Show the console.
  15218. .TP
  15219. .B ESC
  15220. Hide the console.
  15221. .TP
  15222. .B ENTER
  15223. Run the typed command.
  15224. .TP
  15225. .B Shift+ENTER
  15226. Type a literal newline character.
  15227. .TP
  15228. .B Ctrl+LEFT and Ctrl+RIGHT
  15229. Move cursor to previous/next word.
  15230. .TP
  15231. .B UP and DOWN
  15232. Navigate command history.
  15233. .TP
  15234. .B PGUP
  15235. Go to the first command in the history.
  15236. .TP
  15237. .B PGDN
  15238. Stop navigating command history.
  15239. .TP
  15240. .B INSERT
  15241. Toggle insert mode.
  15242. .TP
  15243. .B Shift+INSERT
  15244. Paste text (uses the primary selection on X11.)
  15245. .TP
  15246. .B TAB
  15247. Complete the command or property name at the cursor.
  15248. .TP
  15249. .B Ctrl+C
  15250. Clear current line.
  15251. .TP
  15252. .B Ctrl+K.
  15253. Delete text from the cursor to the end of the line.
  15254. .TP
  15255. .B Ctrl+L
  15256. Clear all log messages from the console.
  15257. .TP
  15258. .B Ctrl+U
  15259. Delete text from the cursor to the beginning of the line.
  15260. .TP
  15261. .B Ctrl+V
  15262. Paste text (uses the clipboard on X11.)
  15263. .TP
  15264. .B Ctrl+W
  15265. Delete text from the cursor to the beginning of the current word.
  15266. .UNINDENT
  15267. .SS Commands
  15268. .INDENT 0.0
  15269. .TP
  15270. .B \fBscript\-message\-to console type <text>\fP
  15271. Show the console and pre\-fill it with the provided text.
  15272. .UNINDENT
  15273. .SS Known issues
  15274. .INDENT 0.0
  15275. .IP \(bu 2
  15276. Pasting text is slow on Windows
  15277. .IP \(bu 2
  15278. Non\-ASCII keyboard input has restrictions
  15279. .IP \(bu 2
  15280. The cursor keys move between Unicode code\-points, not grapheme clusters
  15281. .UNINDENT
  15282. .SS Configuration
  15283. .sp
  15284. This script can be customized through a config file \fBscript\-opts/console.conf\fP
  15285. placed in mpv\(aqs user directory and through the \fB\-\-script\-opts\fP command\-line
  15286. option. The configuration syntax is described in \fI\%ON SCREEN CONTROLLER\fP\&.
  15287. .sp
  15288. Key bindings can be changed in a standard way, see for example stats.lua
  15289. documentation.
  15290. .SS Configurable Options
  15291. .INDENT 0.0
  15292. .TP
  15293. .B \fBscale\fP
  15294. Default: 1
  15295. .sp
  15296. All drawing is scaled by this value, including the text borders and the
  15297. cursor.
  15298. .sp
  15299. If the VO backend in use has HiDPI scale reporting implemented, the option
  15300. value is scaled with the reported HiDPI scale.
  15301. .TP
  15302. .B \fBfont\fP
  15303. Default: unset (picks a hardcoded font depending on detected platform)
  15304. .sp
  15305. Set the font used for the REPL and the console. This probably doesn\(aqt
  15306. have to be a monospaced font.
  15307. .TP
  15308. .B \fBfont_size\fP
  15309. Default: 16
  15310. .sp
  15311. Set the font size used for the REPL and the console. This will be
  15312. multiplied by "scale."
  15313. .UNINDENT
  15314. .SH LUA SCRIPTING
  15315. .sp
  15316. mpv can load Lua scripts. Scripts passed to the \fB\-\-script\fP option, or found in
  15317. the \fBscripts\fP subdirectory of the mpv configuration directory (usually
  15318. \fB~/.config/mpv/scripts/\fP) will be loaded on program start. mpv also appends the
  15319. \fBscripts\fP subdirectory to the end of Lua\(aqs path so you can import scripts from
  15320. there too. Since it\(aqs added to the end, don\(aqt name scripts you want to import
  15321. the same as Lua libraries because they will be overshadowed by them.
  15322. .sp
  15323. mpv provides the built\-in module \fBmp\fP, which contains functions to send
  15324. commands to the mpv core and to retrieve information about playback state, user
  15325. settings, file information, and so on.
  15326. .sp
  15327. These scripts can be used to control mpv in a similar way to slave mode.
  15328. Technically, the Lua code uses the client API internally.
  15329. .SS Example
  15330. .sp
  15331. A script which leaves fullscreen mode when the player is paused:
  15332. .INDENT 0.0
  15333. .INDENT 3.5
  15334. .sp
  15335. .nf
  15336. .ft C
  15337. function on_pause_change(name, value)
  15338. if value == true then
  15339. mp.set_property("fullscreen", "no")
  15340. end
  15341. end
  15342. mp.observe_property("pause", "bool", on_pause_change)
  15343. .ft P
  15344. .fi
  15345. .UNINDENT
  15346. .UNINDENT
  15347. .SS Details on the script initialization and lifecycle
  15348. .sp
  15349. Your script will be loaded by the player at program start from the \fBscripts\fP
  15350. configuration subdirectory, or from a path specified with the \fB\-\-script\fP
  15351. option. Some scripts are loaded internally (like \fB\-\-osc\fP). Each script runs in
  15352. its own thread. Your script is first run "as is", and once that is done, the event loop
  15353. is entered. This event loop will dispatch events received by mpv and call your
  15354. own event handlers which you have registered with \fBmp.register_event\fP, or
  15355. timers added with \fBmp.add_timeout\fP or similar. Note that since the
  15356. script starts execution concurrently with player initialization, some properties
  15357. may not be populated with meaningful values until the relevant subsystems have
  15358. initialized.
  15359. .sp
  15360. When the player quits, all scripts will be asked to terminate. This happens via
  15361. a \fBshutdown\fP event, which by default will make the event loop return. If your
  15362. script got into an endless loop, mpv will probably behave fine during playback,
  15363. but it won\(aqt terminate when quitting, because it\(aqs waiting on your script.
  15364. .sp
  15365. Internally, the C code will call the Lua function \fBmp_event_loop\fP after
  15366. loading a Lua script. This function is normally defined by the default prelude
  15367. loaded before your script (see \fBplayer/lua/defaults.lua\fP in the mpv sources).
  15368. The event loop will wait for events and dispatch events registered with
  15369. \fBmp.register_event\fP\&. It will also handle timers added with \fBmp.add_timeout\fP
  15370. and similar (by waiting with a timeout).
  15371. .sp
  15372. Since mpv 0.6.0, the player will wait until the script is fully loaded before
  15373. continuing normal operation. The player considers a script as fully loaded as
  15374. soon as it starts waiting for mpv events (or it exits). In practice this means
  15375. the player will more or less hang until the script returns from the main chunk
  15376. (and \fBmp_event_loop\fP is called), or the script calls \fBmp_event_loop\fP or
  15377. \fBmp.dispatch_events\fP directly. This is done to make it possible for a script
  15378. to fully setup event handlers etc. before playback actually starts. In older
  15379. mpv versions, this happened asynchronously. With mpv 0.29.0, this changes
  15380. slightly, and it merely waits for scripts to be loaded in this manner before
  15381. starting playback as part of the player initialization phase. Scripts run though
  15382. initialization in parallel. This might change again.
  15383. .SS mp functions
  15384. .sp
  15385. The \fBmp\fP module is preloaded, although it can be loaded manually with
  15386. \fBrequire \(aqmp\(aq\fP\&. It provides the core client API.
  15387. .INDENT 0.0
  15388. .TP
  15389. .B \fBmp.command(string)\fP
  15390. Run the given command. This is similar to the commands used in input.conf.
  15391. See \fI\%List of Input Commands\fP\&.
  15392. .sp
  15393. By default, this will show something on the OSD (depending on the command),
  15394. as if it was used in \fBinput.conf\fP\&. See \fI\%Input Command Prefixes\fP how
  15395. to influence OSD usage per command.
  15396. .sp
  15397. Returns \fBtrue\fP on success, or \fBnil, error\fP on error.
  15398. .TP
  15399. .B \fBmp.commandv(arg1, arg2, ...)\fP
  15400. Similar to \fBmp.command\fP, but pass each command argument as separate
  15401. parameter. This has the advantage that you don\(aqt have to care about
  15402. quoting and escaping in some cases.
  15403. .sp
  15404. Example:
  15405. .INDENT 7.0
  15406. .INDENT 3.5
  15407. .sp
  15408. .nf
  15409. .ft C
  15410. mp.command("loadfile " .. filename .. " append")
  15411. mp.commandv("loadfile", filename, "append")
  15412. .ft P
  15413. .fi
  15414. .UNINDENT
  15415. .UNINDENT
  15416. .sp
  15417. These two commands are equivalent, except that the first version breaks
  15418. if the filename contains spaces or certain special characters.
  15419. .sp
  15420. Note that properties are \fInot\fP expanded. You can use either \fBmp.command\fP,
  15421. the \fBexpand\-properties\fP prefix, or the \fBmp.get_property\fP family of
  15422. functions.
  15423. .sp
  15424. Unlike \fBmp.command\fP, this will not use OSD by default either (except
  15425. for some OSD\-specific commands).
  15426. .TP
  15427. .B \fBmp.command_native(table [,def])\fP
  15428. Similar to \fBmp.commandv\fP, but pass the argument list as table. This has
  15429. the advantage that in at least some cases, arguments can be passed as
  15430. native types. It also allows you to use named argument.
  15431. .sp
  15432. If the table is an array, each array item is like an argument in
  15433. \fBmp.commandv()\fP (but can be a native type instead of a string).
  15434. .sp
  15435. If the table contains string keys, it\(aqs interpreted as command with named
  15436. arguments. This requires at least an entry with the key \fBname\fP to be
  15437. present, which must be a string, and contains the command name. The special
  15438. entry \fB_flags\fP is optional, and if present, must be an array of
  15439. \fI\%Input Command Prefixes\fP to apply. All other entries are interpreted as
  15440. arguments.
  15441. .sp
  15442. Returns a result table on success (usually empty), or \fBdef, error\fP on
  15443. error. \fBdef\fP is the second parameter provided to the function, and is
  15444. nil if it\(aqs missing.
  15445. .TP
  15446. .B \fBmp.command_native_async(table [,fn])\fP
  15447. Like \fBmp.command_native()\fP, but the command is ran asynchronously (as far
  15448. as possible), and upon completion, fn is called. fn has two arguments:
  15449. \fBfn(success, result, error)\fP\&. \fBsuccess\fP is always a Boolean and is true
  15450. if the command was successful, otherwise false. The second parameter is
  15451. the result value (can be nil) in case of success, nil otherwise (as returned
  15452. by \fBmp.command_native()\fP). The third parameter is the error string in case
  15453. of an error, nil otherwise.
  15454. .sp
  15455. Returns a table with undefined contents, which can be used as argument for
  15456. \fBmp.abort_async_command\fP\&.
  15457. .sp
  15458. If starting the command failed for some reason, \fBnil, error\fP is returned,
  15459. and \fBfn\fP is called indicating failure, using the same error value.
  15460. .TP
  15461. .B \fBmp.abort_async_command(t)\fP
  15462. Abort a \fBmp.command_native_async\fP call. The argument is the return value
  15463. of that command (which starts asynchronous execution of the command).
  15464. Whether this works and how long it takes depends on the command and the
  15465. situation. The abort call itself is asynchronous. Does not return anything.
  15466. .TP
  15467. .B \fBmp.get_property(name [,def])\fP
  15468. Return the value of the given property as string. These are the same
  15469. properties as used in input.conf. See \fI\%Properties\fP for a list of
  15470. properties. The returned string is formatted similar to \fB${=name}\fP
  15471. (see \fI\%Property Expansion\fP).
  15472. .sp
  15473. Returns the string on success, or \fBdef, error\fP on error. \fBdef\fP is the
  15474. second parameter provided to the function, and is nil if it\(aqs missing.
  15475. .TP
  15476. .B \fBmp.get_property_osd(name [,def])\fP
  15477. Similar to \fBmp.get_property\fP, but return the property value formatted for
  15478. OSD. This is the same string as printed with \fB${name}\fP when used in
  15479. input.conf.
  15480. .sp
  15481. Returns the string on success, or \fBdef, error\fP on error. \fBdef\fP is the
  15482. second parameter provided to the function, and is an empty string if it\(aqs
  15483. missing. Unlike \fBget_property()\fP, assigning the return value to a variable
  15484. will always result in a string.
  15485. .TP
  15486. .B \fBmp.get_property_bool(name [,def])\fP
  15487. Similar to \fBmp.get_property\fP, but return the property value as Boolean.
  15488. .sp
  15489. Returns a Boolean on success, or \fBdef, error\fP on error.
  15490. .TP
  15491. .B \fBmp.get_property_number(name [,def])\fP
  15492. Similar to \fBmp.get_property\fP, but return the property value as number.
  15493. .sp
  15494. Note that while Lua does not distinguish between integers and floats,
  15495. mpv internals do. This function simply request a double float from mpv,
  15496. and mpv will usually convert integer property values to float.
  15497. .sp
  15498. Returns a number on success, or \fBdef, error\fP on error.
  15499. .TP
  15500. .B \fBmp.get_property_native(name [,def])\fP
  15501. Similar to \fBmp.get_property\fP, but return the property value using the best
  15502. Lua type for the property. Most time, this will return a string, Boolean,
  15503. or number. Some properties (for example \fBchapter\-list\fP) are returned as
  15504. tables.
  15505. .sp
  15506. Returns a value on success, or \fBdef, error\fP on error. Note that \fBnil\fP
  15507. might be a possible, valid value too in some corner cases.
  15508. .TP
  15509. .B \fBmp.set_property(name, value)\fP
  15510. Set the given property to the given string value. See \fBmp.get_property\fP
  15511. and \fI\%Properties\fP for more information about properties.
  15512. .sp
  15513. Returns true on success, or \fBnil, error\fP on error.
  15514. .TP
  15515. .B \fBmp.set_property_bool(name, value)\fP
  15516. Similar to \fBmp.set_property\fP, but set the given property to the given
  15517. Boolean value.
  15518. .TP
  15519. .B \fBmp.set_property_number(name, value)\fP
  15520. Similar to \fBmp.set_property\fP, but set the given property to the given
  15521. numeric value.
  15522. .sp
  15523. Note that while Lua does not distinguish between integers and floats,
  15524. mpv internals do. This function will test whether the number can be
  15525. represented as integer, and if so, it will pass an integer value to mpv,
  15526. otherwise a double float.
  15527. .TP
  15528. .B \fBmp.set_property_native(name, value)\fP
  15529. Similar to \fBmp.set_property\fP, but set the given property using its native
  15530. type.
  15531. .sp
  15532. Since there are several data types which cannot represented natively in
  15533. Lua, this might not always work as expected. For example, while the Lua
  15534. wrapper can do some guesswork to decide whether a Lua table is an array
  15535. or a map, this would fail with empty tables. Also, there are not many
  15536. properties for which it makes sense to use this, instead of
  15537. \fBset_property\fP, \fBset_property_bool\fP, \fBset_property_number\fP\&.
  15538. For these reasons, this function should probably be avoided for now, except
  15539. for properties that use tables natively.
  15540. .TP
  15541. .B \fBmp.get_time()\fP
  15542. Return the current mpv internal time in seconds as a number. This is
  15543. basically the system time, with an arbitrary offset.
  15544. .TP
  15545. .B \fBmp.add_key_binding(key, name|fn [,fn [,flags]])\fP
  15546. Register callback to be run on a key binding. The binding will be mapped to
  15547. the given \fBkey\fP, which is a string describing the physical key. This uses
  15548. the same key names as in input.conf, and also allows combinations
  15549. (e.g. \fBctrl+a\fP). If the key is empty or \fBnil\fP, no physical key is
  15550. registered, but the user still can create own bindings (see below).
  15551. .sp
  15552. After calling this function, key presses will cause the function \fBfn\fP to
  15553. be called (unless the user remapped the key with another binding).
  15554. .sp
  15555. The \fBname\fP argument should be a short symbolic string. It allows the user
  15556. to remap the key binding via input.conf using the \fBscript\-message\fP
  15557. command, and the name of the key binding (see below for
  15558. an example). The name should be unique across other bindings in the same
  15559. script \- if not, the previous binding with the same name will be
  15560. overwritten. You can omit the name, in which case a random name is generated
  15561. internally. (Omitting works as follows: either pass \fBnil\fP for \fBname\fP,
  15562. or pass the \fBfn\fP argument in place of the name. The latter is not
  15563. recommended and is handled for compatibility only.)
  15564. .sp
  15565. The last argument is used for optional flags. This is a table, which can
  15566. have the following entries:
  15567. .INDENT 7.0
  15568. .INDENT 3.5
  15569. .INDENT 0.0
  15570. .TP
  15571. .B \fBrepeatable\fP
  15572. If set to \fBtrue\fP, enables key repeat for this specific binding.
  15573. .TP
  15574. .B \fBcomplex\fP
  15575. If set to \fBtrue\fP, then \fBfn\fP is called on both key up and down
  15576. events (as well as key repeat, if enabled), with the first
  15577. argument being a table. This table has the following entries (and
  15578. may contain undocumented ones):
  15579. .INDENT 7.0
  15580. .TP
  15581. .B \fBevent\fP
  15582. Set to one of the strings \fBdown\fP, \fBrepeat\fP, \fBup\fP or
  15583. \fBpress\fP (the latter if key up/down can\(aqt be tracked).
  15584. .TP
  15585. .B \fBis_mouse\fP
  15586. Boolean Whether the event was caused by a mouse button.
  15587. .TP
  15588. .B \fBkey_name\fP
  15589. The name of they key that triggered this, or \fBnil\fP if invoked
  15590. artificially. If the key name is unknown, it\(aqs an empty string.
  15591. .TP
  15592. .B \fBkey_text\fP
  15593. Text if triggered by a text key, otherwise \fBnil\fP\&. See
  15594. description of \fBscript\-binding\fP command for details (this
  15595. field is equivalent to the 5th argument).
  15596. .UNINDENT
  15597. .UNINDENT
  15598. .UNINDENT
  15599. .UNINDENT
  15600. .sp
  15601. Internally, key bindings are dispatched via the \fBscript\-message\-to\fP or
  15602. \fBscript\-binding\fP input commands and \fBmp.register_script_message\fP\&.
  15603. .sp
  15604. Trying to map multiple commands to a key will essentially prefer a random
  15605. binding, while the other bindings are not called. It is guaranteed that
  15606. user defined bindings in the central input.conf are preferred over bindings
  15607. added with this function (but see \fBmp.add_forced_key_binding\fP).
  15608. .sp
  15609. Example:
  15610. .INDENT 7.0
  15611. .INDENT 3.5
  15612. .sp
  15613. .nf
  15614. .ft C
  15615. function something_handler()
  15616. print("the key was pressed")
  15617. end
  15618. mp.add_key_binding("x", "something", something_handler)
  15619. .ft P
  15620. .fi
  15621. .UNINDENT
  15622. .UNINDENT
  15623. .sp
  15624. This will print the message \fBthe key was pressed\fP when \fBx\fP was pressed.
  15625. .sp
  15626. The user can remap these key bindings. Then the user has to put the
  15627. following into their input.conf to remap the command to the \fBy\fP key:
  15628. .INDENT 7.0
  15629. .INDENT 3.5
  15630. .sp
  15631. .nf
  15632. .ft C
  15633. y script\-binding something
  15634. .ft P
  15635. .fi
  15636. .UNINDENT
  15637. .UNINDENT
  15638. .sp
  15639. This will print the message when the key \fBy\fP is pressed. (\fBx\fP will
  15640. still work, unless the user remaps it.)
  15641. .sp
  15642. You can also explicitly send a message to a named script only. Assume the
  15643. above script was using the filename \fBfooscript.lua\fP:
  15644. .INDENT 7.0
  15645. .INDENT 3.5
  15646. .sp
  15647. .nf
  15648. .ft C
  15649. y script\-binding fooscript/something
  15650. .ft P
  15651. .fi
  15652. .UNINDENT
  15653. .UNINDENT
  15654. .TP
  15655. .B \fBmp.add_forced_key_binding(...)\fP
  15656. This works almost the same as \fBmp.add_key_binding\fP, but registers the
  15657. key binding in a way that will overwrite the user\(aqs custom bindings in their
  15658. input.conf. (\fBmp.add_key_binding\fP overwrites default key bindings only,
  15659. but not those by the user\(aqs input.conf.)
  15660. .TP
  15661. .B \fBmp.remove_key_binding(name)\fP
  15662. Remove a key binding added with \fBmp.add_key_binding\fP or
  15663. \fBmp.add_forced_key_binding\fP\&. Use the same name as you used when adding
  15664. the bindings. It\(aqs not possible to remove bindings for which you omitted
  15665. the name.
  15666. .TP
  15667. .B \fBmp.register_event(name, fn)\fP
  15668. Call a specific function when an event happens. The event name is a string,
  15669. and the function fn is a Lua function value.
  15670. .sp
  15671. Some events have associated data. This is put into a Lua table and passed
  15672. as argument to fn. The Lua table by default contains a \fBname\fP field,
  15673. which is a string containing the event name. If the event has an error
  15674. associated, the \fBerror\fP field is set to a string describing the error,
  15675. on success it\(aqs not set.
  15676. .sp
  15677. If multiple functions are registered for the same event, they are run in
  15678. registration order, which the first registered function running before all
  15679. the other ones.
  15680. .sp
  15681. Returns true if such an event exists, false otherwise.
  15682. .sp
  15683. See \fI\%Events\fP and \fI\%List of events\fP for details.
  15684. .TP
  15685. .B \fBmp.unregister_event(fn)\fP
  15686. Undo \fBmp.register_event(..., fn)\fP\&. This removes all event handlers that
  15687. are equal to the \fBfn\fP parameter. This uses normal Lua \fB==\fP comparison,
  15688. so be careful when dealing with closures.
  15689. .TP
  15690. .B \fBmp.observe_property(name, type, fn)\fP
  15691. Watch a property for changes. If the property \fBname\fP is changed, then
  15692. the function \fBfn(name)\fP will be called. \fBtype\fP can be \fBnil\fP, or be
  15693. set to one of \fBnone\fP, \fBnative\fP, \fBbool\fP, \fBstring\fP, or \fBnumber\fP\&.
  15694. \fBnone\fP is the same as \fBnil\fP\&. For all other values, the new value of
  15695. the property will be passed as second argument to \fBfn\fP, using
  15696. \fBmp.get_property_<type>\fP to retrieve it. This means if \fBtype\fP is for
  15697. example \fBstring\fP, \fBfn\fP is roughly called as in
  15698. \fBfn(name, mp.get_property_string(name))\fP\&.
  15699. .sp
  15700. If possible, change events are coalesced. If a property is changed a bunch
  15701. of times in a row, only the last change triggers the change function. (The
  15702. exact behavior depends on timing and other things.)
  15703. .sp
  15704. If a property is unavailable, or on error, the value argument to \fBfn\fP is
  15705. \fBnil\fP\&. (The \fBobserve_property()\fP call always succeeds, even if a
  15706. property does not exist.)
  15707. .sp
  15708. In some cases the function is not called even if the property changes.
  15709. This depends on the property, and it\(aqs a valid feature request to ask for
  15710. better update handling of a specific property.
  15711. .sp
  15712. If the \fBtype\fP is \fBnone\fP or \fBnil\fP, sporadic property change events are
  15713. possible. This means the change function \fBfn\fP can be called even if the
  15714. property doesn\(aqt actually change.
  15715. .sp
  15716. You always get an initial change notification. This is meant to initialize
  15717. the user\(aqs state to the current value of the property.
  15718. .TP
  15719. .B \fBmp.unobserve_property(fn)\fP
  15720. Undo \fBmp.observe_property(..., fn)\fP\&. This removes all property handlers
  15721. that are equal to the \fBfn\fP parameter. This uses normal Lua \fB==\fP
  15722. comparison, so be careful when dealing with closures.
  15723. .TP
  15724. .B \fBmp.add_timeout(seconds, fn)\fP
  15725. Call the given function fn when the given number of seconds has elapsed.
  15726. Note that the number of seconds can be fractional. For now, the timer\(aqs
  15727. resolution may be as low as 50 ms, although this will be improved in the
  15728. future.
  15729. .sp
  15730. This is a one\-shot timer: it will be removed when it\(aqs fired.
  15731. .sp
  15732. Returns a timer object. See \fBmp.add_periodic_timer\fP for details.
  15733. .TP
  15734. .B \fBmp.add_periodic_timer(seconds, fn)\fP
  15735. Call the given function periodically. This is like \fBmp.add_timeout\fP, but
  15736. the timer is re\-added after the function fn is run.
  15737. .INDENT 7.0
  15738. .TP
  15739. .B Returns a timer object. The timer object provides the following methods:
  15740. .INDENT 7.0
  15741. .TP
  15742. .B \fBstop()\fP
  15743. Disable the timer. Does nothing if the timer is already disabled.
  15744. This will remember the current elapsed time when stopping, so that
  15745. \fBresume()\fP essentially unpauses the timer.
  15746. .TP
  15747. .B \fBkill()\fP
  15748. Disable the timer. Resets the elapsed time. \fBresume()\fP will
  15749. restart the timer.
  15750. .TP
  15751. .B \fBresume()\fP
  15752. Restart the timer. If the timer was disabled with \fBstop()\fP, this
  15753. will resume at the time it was stopped. If the timer was disabled
  15754. with \fBkill()\fP, or if it\(aqs a previously fired one\-shot timer (added
  15755. with \fBadd_timeout()\fP), this starts the timer from the beginning,
  15756. using the initially configured timeout.
  15757. .TP
  15758. .B \fBis_enabled()\fP
  15759. Whether the timer is currently enabled or was previously disabled
  15760. (e.g. by \fBstop()\fP or \fBkill()\fP).
  15761. .TP
  15762. .B \fBtimeout\fP (RW)
  15763. This field contains the current timeout period. This value is not
  15764. updated as time progresses. It\(aqs only used to calculate when the
  15765. timer should fire next when the timer expires.
  15766. .sp
  15767. If you write this, you can call \fBt:kill() ; t:resume()\fP to reset
  15768. the current timeout to the new one. (\fBt:stop()\fP won\(aqt use the
  15769. new timeout.)
  15770. .TP
  15771. .B \fBoneshot\fP (RW)
  15772. Whether the timer is periodic (\fBfalse\fP) or fires just once
  15773. (\fBtrue\fP). This value is used when the timer expires (but before
  15774. the timer callback function fn is run).
  15775. .UNINDENT
  15776. .UNINDENT
  15777. .sp
  15778. Note that these are methods, and you have to call them using \fB:\fP instead
  15779. of \fB\&.\fP (Refer to \fI\%http://www.lua.org/manual/5.2/manual.html#3.4.9\fP .)
  15780. .sp
  15781. Example:
  15782. .INDENT 7.0
  15783. .INDENT 3.5
  15784. .sp
  15785. .nf
  15786. .ft C
  15787. seconds = 0
  15788. timer = mp.add_periodic_timer(1, function()
  15789. print("called every second")
  15790. # stop it after 10 seconds
  15791. seconds = seconds + 1
  15792. if seconds >= 10 then
  15793. timer:kill()
  15794. end
  15795. end)
  15796. .ft P
  15797. .fi
  15798. .UNINDENT
  15799. .UNINDENT
  15800. .TP
  15801. .B \fBmp.get_opt(key)\fP
  15802. Return a setting from the \fB\-\-script\-opts\fP option. It\(aqs up to the user and
  15803. the script how this mechanism is used. Currently, all scripts can access
  15804. this equally, so you should be careful about collisions.
  15805. .TP
  15806. .B \fBmp.get_script_name()\fP
  15807. Return the name of the current script. The name is usually made of the
  15808. filename of the script, with directory and file extension removed. If
  15809. there are several scripts which would have the same name, it\(aqs made unique
  15810. by appending a number.
  15811. .INDENT 7.0
  15812. .INDENT 3.5
  15813. .IP "Example"
  15814. .sp
  15815. The script \fB/path/to/fooscript.lua\fP becomes \fBfooscript\fP\&.
  15816. .UNINDENT
  15817. .UNINDENT
  15818. .TP
  15819. .B \fBmp.osd_message(text [,duration])\fP
  15820. Show an OSD message on the screen. \fBduration\fP is in seconds, and is
  15821. optional (uses \fB\-\-osd\-duration\fP by default).
  15822. .UNINDENT
  15823. .SS Advanced mp functions
  15824. .sp
  15825. These also live in the \fBmp\fP module, but are documented separately as they
  15826. are useful only in special situations.
  15827. .INDENT 0.0
  15828. .TP
  15829. .B \fBmp.suspend()\fP
  15830. This function has been deprecated in mpv 0.21.0 and does nothing starting
  15831. with mpv 0.23.0 (no replacement).
  15832. .TP
  15833. .B \fBmp.resume()\fP
  15834. This function has been deprecated in mpv 0.21.0 and does nothing starting
  15835. with mpv 0.23.0 (no replacement).
  15836. .TP
  15837. .B \fBmp.resume_all()\fP
  15838. This function has been deprecated in mpv 0.21.0 and does nothing starting
  15839. with mpv 0.23.0 (no replacement).
  15840. .TP
  15841. .B \fBmp.get_wakeup_pipe()\fP
  15842. Calls \fBmpv_get_wakeup_pipe()\fP and returns the read end of the wakeup
  15843. pipe. This is deprecated, but still works. (See \fBclient.h\fP for details.)
  15844. .TP
  15845. .B \fBmp.get_next_timeout()\fP
  15846. Return the relative time in seconds when the next timer (\fBmp.add_timeout\fP
  15847. and similar) expires. If there is no timer, return \fBnil\fP\&.
  15848. .TP
  15849. .B \fBmp.dispatch_events([allow_wait])\fP
  15850. This can be used to run custom event loops. If you want to have direct
  15851. control what the Lua script does (instead of being called by the default
  15852. event loop), you can set the global variable \fBmp_event_loop\fP to your
  15853. own function running the event loop. From your event loop, you should call
  15854. \fBmp.dispatch_events()\fP to dequeue and dispatch mpv events.
  15855. .sp
  15856. If the \fBallow_wait\fP parameter is set to \fBtrue\fP, the function will block
  15857. until the next event is received or the next timer expires. Otherwise (and
  15858. this is the default behavior), it returns as soon as the event loop is
  15859. emptied. It\(aqs strongly recommended to use \fBmp.get_next_timeout()\fP and
  15860. \fBmp.get_wakeup_pipe()\fP if you\(aqre interested in properly working
  15861. notification of new events and working timers.
  15862. .TP
  15863. .B \fBmp.register_idle(fn)\fP
  15864. Register an event loop idle handler. Idle handlers are called before the
  15865. script goes to sleep after handling all new events. This can be used for
  15866. example to delay processing of property change events: if you\(aqre observing
  15867. multiple properties at once, you might not want to act on each property
  15868. change, but only when all change notifications have been received.
  15869. .TP
  15870. .B \fBmp.unregister_idle(fn)\fP
  15871. Undo \fBmp.register_idle(fn)\fP\&. This removes all idle handlers that
  15872. are equal to the \fBfn\fP parameter. This uses normal Lua \fB==\fP comparison,
  15873. so be careful when dealing with closures.
  15874. .TP
  15875. .B \fBmp.enable_messages(level)\fP
  15876. Set the minimum log level of which mpv message output to receive. These
  15877. messages are normally printed to the terminal. By calling this function,
  15878. you can set the minimum log level of messages which should be received with
  15879. the \fBlog\-message\fP event. See the description of this event for details.
  15880. The level is a string, see \fBmsg.log\fP for allowed log levels.
  15881. .TP
  15882. .B \fBmp.register_script_message(name, fn)\fP
  15883. This is a helper to dispatch \fBscript\-message\fP or \fBscript\-message\-to\fP
  15884. invocations to Lua functions. \fBfn\fP is called if \fBscript\-message\fP or
  15885. \fBscript\-message\-to\fP (with this script as destination) is run
  15886. with \fBname\fP as first parameter. The other parameters are passed to \fBfn\fP\&.
  15887. If a message with the given name is already registered, it\(aqs overwritten.
  15888. .sp
  15889. Used by \fBmp.add_key_binding\fP, so be careful about name collisions.
  15890. .TP
  15891. .B \fBmp.unregister_script_message(name)\fP
  15892. Undo a previous registration with \fBmp.register_script_message\fP\&. Does
  15893. nothing if the \fBname\fP wasn\(aqt registered.
  15894. .TP
  15895. .B \fBmp.create_osd_overlay(format)\fP
  15896. Create an OSD overlay. This is a very thin wrapper around the \fBosd\-overlay\fP
  15897. command. The function returns a table, which mostly contains fields that
  15898. will be passed to \fBosd\-overlay\fP\&. The \fBformat\fP parameter is used to
  15899. initialize the \fBformat\fP field. The \fBdata\fP field contains the text to
  15900. be used as overlay. For details, see the \fBosd\-overlay\fP command.
  15901. .sp
  15902. In addition, it provides the following methods:
  15903. .INDENT 7.0
  15904. .TP
  15905. .B \fBupdate()\fP
  15906. Commit the OSD overlay to the screen, or in other words, run the
  15907. \fBosd\-overlay\fP command with the current fields of the overlay table.
  15908. .TP
  15909. .B \fBremove()\fP
  15910. Remove the overlay from the screen. A \fBupdate()\fP call will add it
  15911. again.
  15912. .UNINDENT
  15913. .sp
  15914. Example:
  15915. .INDENT 7.0
  15916. .INDENT 3.5
  15917. .sp
  15918. .nf
  15919. .ft C
  15920. ov = mp.create_osd_overlay("ass\-events")
  15921. ov.data = "{\e\ean5}{\e\eb1}hello world!"
  15922. ov:update()
  15923. .ft P
  15924. .fi
  15925. .UNINDENT
  15926. .UNINDENT
  15927. .sp
  15928. The advantage of using this wrapper (as opposed to running \fBosd\-overlay\fP
  15929. directly) is that the \fBid\fP field is allocated automatically.
  15930. .TP
  15931. .B \fBmp.get_osd_size()\fP
  15932. Returns a tuple of \fBosd_width, osd_height, osd_par\fP\&. The first two give
  15933. the size of the OSD in pixels (for video ouputs like \fB\-\-vo=xv\fP, this may
  15934. be "scaled" pixels). The third is the display pixel aspect ratio.
  15935. .sp
  15936. May return invalid/nonsense values if OSD is not initialized yet.
  15937. .UNINDENT
  15938. .SS mp.msg functions
  15939. .sp
  15940. This module allows outputting messages to the terminal, and can be loaded
  15941. with \fBrequire \(aqmp.msg\(aq\fP\&.
  15942. .INDENT 0.0
  15943. .TP
  15944. .B \fBmsg.log(level, ...)\fP
  15945. The level parameter is the message priority. It\(aqs a string and one of
  15946. \fBfatal\fP, \fBerror\fP, \fBwarn\fP, \fBinfo\fP, \fBv\fP, \fBdebug\fP, \fBtrace\fP\&. The
  15947. user\(aqs settings will determine which of these messages will be
  15948. visible. Normally, all messages are visible, except \fBv\fP, \fBdebug\fP and
  15949. \fBtrace\fP\&.
  15950. .sp
  15951. The parameters after that are all converted to strings. Spaces are inserted
  15952. to separate multiple parameters.
  15953. .sp
  15954. You don\(aqt need to add newlines.
  15955. .TP
  15956. .B \fBmsg.fatal(...)\fP, \fBmsg.error(...)\fP, \fBmsg.warn(...)\fP, \fBmsg.info(...)\fP, \fBmsg.verbose(...)\fP, \fBmsg.debug(...)\fP, \fBmsg.trace(...)\fP
  15957. All of these are shortcuts and equivalent to the corresponding
  15958. \fBmsg.log(level, ...)\fP call.
  15959. .UNINDENT
  15960. .SS mp.options functions
  15961. .sp
  15962. mpv comes with a built\-in module to manage options from config\-files and the
  15963. command\-line. All you have to do is to supply a table with default options to
  15964. the read_options function. The function will overwrite the default values
  15965. with values found in the config\-file and the command\-line (in that order).
  15966. .INDENT 0.0
  15967. .TP
  15968. .B \fBoptions.read_options(table [, identifier [, on_update]])\fP
  15969. A \fBtable\fP with key\-value pairs. The type of the default values is
  15970. important for converting the values read from the config file or
  15971. command\-line back. Do not use \fBnil\fP as a default value!
  15972. .sp
  15973. The \fBidentifier\fP is used to identify the config\-file and the command\-line
  15974. options. These needs to unique to avoid collisions with other scripts.
  15975. Defaults to \fBmp.get_script_name()\fP if the parameter is \fBnil\fP or missing.
  15976. .sp
  15977. The \fBon_update\fP parameter enables run\-time updates of all matching option
  15978. values via the \fBscript\-opts\fP option/property. If any of the matching
  15979. options changes, the values in the \fBtable\fP (which was originally passed to
  15980. the function) are changed, and \fBon_update(list)\fP is called. \fBlist\fP is
  15981. a table where each updated option has a \fBlist[option_name] = true\fP entry.
  15982. There is no initial \fBon_update()\fP call. This never re\-reads the config file.
  15983. \fBscript\-opts\fP is always applied on the original config file, ignoring
  15984. previous \fBscript\-opts\fP values (for example, if an option is removed from
  15985. \fBscript\-opts\fP at runtime, the option will have the value in the config
  15986. file). \fBtable\fP entries are only written for option values whose values
  15987. effectively change (this is important if the script changes \fBtable\fP
  15988. entries independently).
  15989. .UNINDENT
  15990. .sp
  15991. Example implementation:
  15992. .INDENT 0.0
  15993. .INDENT 3.5
  15994. .sp
  15995. .nf
  15996. .ft C
  15997. require \(aqmp.options\(aq
  15998. local options = {
  15999. optionA = "defaultvalueA",
  16000. optionB = \-0.5,
  16001. optionC = true,
  16002. }
  16003. read_options(options, "myscript")
  16004. print(options.optionA)
  16005. .ft P
  16006. .fi
  16007. .UNINDENT
  16008. .UNINDENT
  16009. .sp
  16010. The config file will be stored in \fBscript\-opts/identifier.conf\fP in mpv\(aqs user
  16011. folder. Comment lines can be started with # and stray spaces are not removed.
  16012. Boolean values will be represented with yes/no.
  16013. .sp
  16014. Example config:
  16015. .INDENT 0.0
  16016. .INDENT 3.5
  16017. .sp
  16018. .nf
  16019. .ft C
  16020. # comment
  16021. optionA=Hello World
  16022. optionB=9999
  16023. optionC=no
  16024. .ft P
  16025. .fi
  16026. .UNINDENT
  16027. .UNINDENT
  16028. .sp
  16029. Command\-line options are read from the \fB\-\-script\-opts\fP parameter. To avoid
  16030. collisions, all keys have to be prefixed with \fBidentifier\-\fP\&.
  16031. .sp
  16032. Example command\-line:
  16033. .INDENT 0.0
  16034. .INDENT 3.5
  16035. .sp
  16036. .nf
  16037. .ft C
  16038. \-\-script\-opts=myscript\-optionA=TEST,myscript\-optionB=0,myscript\-optionC=yes
  16039. .ft P
  16040. .fi
  16041. .UNINDENT
  16042. .UNINDENT
  16043. .SS mp.utils functions
  16044. .sp
  16045. This built\-in module provides generic helper functions for Lua, and have
  16046. strictly speaking nothing to do with mpv or video/audio playback. They are
  16047. provided for convenience. Most compensate for Lua\(aqs scarce standard library.
  16048. .sp
  16049. Be warned that any of these functions might disappear any time. They are not
  16050. strictly part of the guaranteed API.
  16051. .INDENT 0.0
  16052. .TP
  16053. .B \fButils.getcwd()\fP
  16054. Returns the directory that mpv was launched from. On error, \fBnil, error\fP
  16055. is returned.
  16056. .TP
  16057. .B \fButils.readdir(path [, filter])\fP
  16058. Enumerate all entries at the given path on the filesystem, and return them
  16059. as array. Each entry is a directory entry (without the path).
  16060. The list is unsorted (in whatever order the operating system returns it).
  16061. .sp
  16062. If the \fBfilter\fP argument is given, it must be one of the following
  16063. strings:
  16064. .INDENT 7.0
  16065. .INDENT 3.5
  16066. .INDENT 0.0
  16067. .TP
  16068. .B \fBfiles\fP
  16069. List regular files only. This excludes directories, special files
  16070. (like UNIX device files or FIFOs), and dead symlinks. It includes
  16071. UNIX symlinks to regular files.
  16072. .TP
  16073. .B \fBdirs\fP
  16074. List directories only, or symlinks to directories. \fB\&.\fP and \fB\&..\fP
  16075. are not included.
  16076. .TP
  16077. .B \fBnormal\fP
  16078. Include the results of both \fBfiles\fP and \fBdirs\fP\&. (This is the
  16079. default.)
  16080. .TP
  16081. .B \fBall\fP
  16082. List all entries, even device files, dead symlinks, FIFOs, and the
  16083. \fB\&.\fP and \fB\&..\fP entries.
  16084. .UNINDENT
  16085. .UNINDENT
  16086. .UNINDENT
  16087. .sp
  16088. On error, \fBnil, error\fP is returned.
  16089. .TP
  16090. .B \fButils.file_info(path)\fP
  16091. Stats the given path for information and returns a table with the
  16092. following entries:
  16093. .INDENT 7.0
  16094. .INDENT 3.5
  16095. .INDENT 0.0
  16096. .TP
  16097. .B \fBmode\fP
  16098. protection bits (on Windows, always 755 (octal) for directories
  16099. and 644 (octal) for files)
  16100. .TP
  16101. .B \fBsize\fP
  16102. size in bytes
  16103. .TP
  16104. .B \fBatime\fP
  16105. time of last access
  16106. .TP
  16107. .B \fBmtime\fP
  16108. time of last modification
  16109. .TP
  16110. .B \fBctime\fP
  16111. time of last metadata change (Linux) / time of creation (Windows)
  16112. .TP
  16113. .B \fBis_file\fP
  16114. Whether \fBpath\fP is a regular file (boolean)
  16115. .TP
  16116. .B \fBis_dir\fP
  16117. Whether \fBpath\fP is a directory (boolean)
  16118. .UNINDENT
  16119. .UNINDENT
  16120. .UNINDENT
  16121. .sp
  16122. \fBmode\fP and \fBsize\fP are integers.
  16123. Timestamps (\fBatime\fP, \fBmtime\fP and \fBctime\fP) are integer seconds since
  16124. the Unix epoch (Unix time).
  16125. The booleans \fBis_file\fP and \fBis_dir\fP are provided as a convenience;
  16126. they can be and are derived from \fBmode\fP\&.
  16127. .sp
  16128. On error (eg. path does not exist), \fBnil, error\fP is returned.
  16129. .TP
  16130. .B \fButils.split_path(path)\fP
  16131. Split a path into directory component and filename component, and return
  16132. them. The first return value is always the directory. The second return
  16133. value is the trailing part of the path, the directory entry.
  16134. .TP
  16135. .B \fButils.join_path(p1, p2)\fP
  16136. Return the concatenation of the 2 paths. Tries to be clever. For example,
  16137. if \fB\(gap2\fP is an absolute path, p2 is returned without change.
  16138. .TP
  16139. .B \fButils.subprocess(t)\fP
  16140. Runs an external process and waits until it exits. Returns process status
  16141. and the captured output. This is a legacy wrapper around calling the
  16142. \fBsubprocess\fP command with \fBmp.command_native\fP\&. It does the following
  16143. things:
  16144. .INDENT 7.0
  16145. .IP \(bu 2
  16146. copy the table \fBt\fP
  16147. .IP \(bu 2
  16148. rename \fBcancellable\fP field to \fBplayback_only\fP
  16149. .IP \(bu 2
  16150. rename \fBmax_size\fP to \fBcapture_size\fP
  16151. .IP \(bu 2
  16152. set \fBcapture_stdout\fP field to \fBtrue\fP if unset
  16153. .IP \(bu 2
  16154. set \fBname\fP field to \fBsubprocess\fP
  16155. .IP \(bu 2
  16156. call \fBmp.command_native(copied_t)\fP
  16157. .IP \(bu 2
  16158. if the command failed, create a dummy result table
  16159. .IP \(bu 2
  16160. copy \fBerror_string\fP to \fBerror\fP field if the string is non\-empty
  16161. .IP \(bu 2
  16162. return the result table
  16163. .UNINDENT
  16164. .sp
  16165. It is recommended to use \fBmp.command_native\fP or \fBmp.command_native_async\fP
  16166. directly, instead of calling this legacy wrapper. It is for compatibility
  16167. only.
  16168. .sp
  16169. See the \fBsubprocess\fP documentation for semantics and further parameters.
  16170. .TP
  16171. .B \fButils.subprocess_detached(t)\fP
  16172. Runs an external process and detaches it from mpv\(aqs control.
  16173. .sp
  16174. The parameter \fBt\fP is a table. The function reads the following entries:
  16175. .INDENT 7.0
  16176. .INDENT 3.5
  16177. .INDENT 0.0
  16178. .TP
  16179. .B \fBargs\fP
  16180. Array of strings of the same semantics as the \fBargs\fP used in the
  16181. \fBsubprocess\fP function.
  16182. .UNINDENT
  16183. .UNINDENT
  16184. .UNINDENT
  16185. .sp
  16186. The function returns \fBnil\fP\&.
  16187. .sp
  16188. This is a legacy wrapper around calling the \fBrun\fP command with
  16189. \fBmp.commandv\fP and other functions.
  16190. .TP
  16191. .B \fButils.getpid()\fP
  16192. Returns the process ID of the running mpv process. This can be used to identify
  16193. the calling mpv when launching (detached) subprocesses.
  16194. .TP
  16195. .B \fButils.parse_json(str [, trail])\fP
  16196. Parses the given string argument as JSON, and returns it as a Lua table. On
  16197. error, returns \fBnil, error\fP\&. (Currently, \fBerror\fP is just a string
  16198. reading \fBerror\fP, because there is no fine\-grained error reporting of any
  16199. kind.)
  16200. .sp
  16201. The returned value uses similar conventions as \fBmp.get_property_native()\fP
  16202. to distinguish empty objects and arrays.
  16203. .sp
  16204. If the \fBtrail\fP parameter is \fBtrue\fP (or any value equal to \fBtrue\fP),
  16205. then trailing non\-whitespace text is tolerated by the function, and the
  16206. trailing text is returned as 3rd return value. (The 3rd return value is
  16207. always there, but with \fBtrail\fP set, no error is raised.)
  16208. .TP
  16209. .B \fButils.format_json(v)\fP
  16210. Format the given Lua table (or value) as a JSON string and return it. On
  16211. error, returns \fBnil, error\fP\&. (Errors usually only happen on value types
  16212. incompatible with JSON.)
  16213. .sp
  16214. The argument value uses similar conventions as \fBmp.set_property_native()\fP
  16215. to distinguish empty objects and arrays.
  16216. .TP
  16217. .B \fButils.to_string(v)\fP
  16218. Turn the given value into a string. Formats tables and their contents. This
  16219. doesn\(aqt do anything special; it is only needed because Lua is terrible.
  16220. .UNINDENT
  16221. .SS Events
  16222. .sp
  16223. Events are notifications from player core to scripts. You can register an
  16224. event handler with \fBmp.register_event\fP\&.
  16225. .sp
  16226. Note that all scripts (and other parts of the player) receive events equally,
  16227. and there\(aqs no such thing as blocking other scripts from receiving events.
  16228. .sp
  16229. Example:
  16230. .INDENT 0.0
  16231. .INDENT 3.5
  16232. .sp
  16233. .nf
  16234. .ft C
  16235. function my_fn(event)
  16236. print("start of playback!")
  16237. end
  16238. mp.register_event("file\-loaded", my_fn)
  16239. .ft P
  16240. .fi
  16241. .UNINDENT
  16242. .UNINDENT
  16243. .SS List of events
  16244. .INDENT 0.0
  16245. .TP
  16246. .B \fBstart\-file\fP
  16247. Happens right before a new file is loaded. When you receive this, the
  16248. player is loading the file (or possibly already done with it).
  16249. .TP
  16250. .B \fBend\-file\fP
  16251. Happens after a file was unloaded. Typically, the player will load the
  16252. next file right away, or quit if this was the last file.
  16253. .sp
  16254. The event has the \fBreason\fP field, which takes one of these values:
  16255. .INDENT 7.0
  16256. .TP
  16257. .B \fBeof\fP
  16258. The file has ended. This can (but doesn\(aqt have to) include
  16259. incomplete files or broken network connections under
  16260. circumstances.
  16261. .TP
  16262. .B \fBstop\fP
  16263. Playback was ended by a command.
  16264. .TP
  16265. .B \fBquit\fP
  16266. Playback was ended by sending the quit command.
  16267. .TP
  16268. .B \fBerror\fP
  16269. An error happened. In this case, an \fBerror\fP field is present with
  16270. the error string.
  16271. .TP
  16272. .B \fBredirect\fP
  16273. Happens with playlists and similar. Details see
  16274. \fBMPV_END_FILE_REASON_REDIRECT\fP in the C API.
  16275. .TP
  16276. .B \fBunknown\fP
  16277. Unknown. Normally doesn\(aqt happen, unless the Lua API is out of sync
  16278. with the C API. (Likewise, it could happen that your script gets
  16279. reason strings that did not exist yet at the time your script was
  16280. written.)
  16281. .UNINDENT
  16282. .TP
  16283. .B \fBfile\-loaded\fP
  16284. Happens after a file was loaded and begins playback.
  16285. .TP
  16286. .B \fBseek\fP
  16287. Happens on seeking. (This might include cases when the player seeks
  16288. internally, even without user interaction. This includes e.g. segment
  16289. changes when playing ordered chapters Matroska files.)
  16290. .TP
  16291. .B \fBplayback\-restart\fP
  16292. Start of playback after seek or after file was loaded.
  16293. .TP
  16294. .B \fBidle\fP
  16295. Idle mode is entered. This happens when playback ended, and the player was
  16296. started with \fB\-\-idle\fP or \fB\-\-force\-window\fP\&. This mode is implicitly ended
  16297. when the \fBstart\-file\fP or \fBshutdown\fP events happen.
  16298. .TP
  16299. .B \fBtick\fP
  16300. Called after a video frame was displayed. This is a hack, and you should
  16301. avoid using it. Use timers instead and maybe watch pausing/unpausing events
  16302. to avoid wasting CPU when the player is paused.
  16303. .TP
  16304. .B \fBshutdown\fP
  16305. Sent when the player quits, and the script should terminate. Normally
  16306. handled automatically. See \fI\%Details on the script initialization and lifecycle\fP\&.
  16307. .TP
  16308. .B \fBlog\-message\fP
  16309. Receives messages enabled with \fBmp.enable_messages\fP\&. The message data
  16310. is contained in the table passed as first parameter to the event handler.
  16311. The table contains, in addition to the default event fields, the following
  16312. fields:
  16313. .INDENT 7.0
  16314. .TP
  16315. .B \fBprefix\fP
  16316. The module prefix, identifies the sender of the message. This is what
  16317. the terminal player puts in front of the message text when using the
  16318. \fB\-\-v\fP option, and is also what is used for \fB\-\-msg\-level\fP\&.
  16319. .TP
  16320. .B \fBlevel\fP
  16321. The log level as string. See \fBmsg.log\fP for possible log level names.
  16322. Note that later versions of mpv might add new levels or remove
  16323. (undocumented) existing ones.
  16324. .TP
  16325. .B \fBtext\fP
  16326. The log message. The text will end with a newline character. Sometimes
  16327. it can contain multiple lines.
  16328. .UNINDENT
  16329. .sp
  16330. Keep in mind that these messages are meant to be hints for humans. You
  16331. should not parse them, and prefix/level/text of messages might change
  16332. any time.
  16333. .TP
  16334. .B \fBget\-property\-reply\fP
  16335. Undocumented (not useful for Lua scripts).
  16336. .TP
  16337. .B \fBset\-property\-reply\fP
  16338. Undocumented (not useful for Lua scripts).
  16339. .TP
  16340. .B \fBcommand\-reply\fP
  16341. Undocumented (not useful for Lua scripts).
  16342. .TP
  16343. .B \fBclient\-message\fP
  16344. Undocumented (used internally).
  16345. .TP
  16346. .B \fBvideo\-reconfig\fP
  16347. Happens on video output or filter reconfig.
  16348. .TP
  16349. .B \fBaudio\-reconfig\fP
  16350. Happens on audio output or filter reconfig.
  16351. .UNINDENT
  16352. .sp
  16353. The following events also happen, but are deprecated: \fBtracks\-changed\fP,
  16354. \fBtrack\-switched\fP, \fBpause\fP, \fBunpause\fP, \fBmetadata\-update\fP,
  16355. \fBchapter\-change\fP\&. Use \fBmp.observe_property()\fP instead.
  16356. .SS Extras
  16357. .sp
  16358. This documents experimental features, or features that are "too special" to
  16359. guarantee a stable interface.
  16360. .INDENT 0.0
  16361. .TP
  16362. .B \fBmp.add_hook(type, priority, fn)\fP
  16363. Add a hook callback for \fBtype\fP (a string identifying a certain kind of
  16364. hook). These hooks allow the player to call script functions and wait for
  16365. their result (normally, the Lua scripting interface is asynchronous from
  16366. the point of view of the player core). \fBpriority\fP is an arbitrary integer
  16367. that allows ordering among hooks of the same kind. Using the value 50 is
  16368. recommended as neutral default value. \fBfn\fP is the function that will be
  16369. called during execution of the hook.
  16370. .sp
  16371. See \fI\%Hooks\fP for currently existing hooks and what they do \- only the hook
  16372. list is interesting; handling hook execution is done by the Lua script
  16373. function automatically.
  16374. .UNINDENT
  16375. .SH JAVASCRIPT
  16376. .sp
  16377. JavaScript support in mpv is near identical to its Lua support. Use this section
  16378. as reference on differences and availability of APIs, but otherwise you should
  16379. refer to the Lua documentation for API details and general scripting in mpv.
  16380. .SS Example
  16381. .sp
  16382. JavaScript code which leaves fullscreen mode when the player is paused:
  16383. .INDENT 0.0
  16384. .INDENT 3.5
  16385. .sp
  16386. .nf
  16387. .ft C
  16388. function on_pause_change(name, value) {
  16389. if (value == true)
  16390. mp.set_property("fullscreen", "no");
  16391. }
  16392. mp.observe_property("pause", "bool", on_pause_change);
  16393. .ft P
  16394. .fi
  16395. .UNINDENT
  16396. .UNINDENT
  16397. .SS Similarities with Lua
  16398. .sp
  16399. mpv tries to load a script file as JavaScript if it has a \fB\&.js\fP extension, but
  16400. otherwise, the documented Lua options, script directories, loading, etc apply to
  16401. JavaScript files too.
  16402. .sp
  16403. Script initialization and lifecycle is the same as with Lua, and most of the Lua
  16404. functions at the modules \fBmp\fP, \fBmp.utils\fP, \fBmp.msg\fP and \fBmp.options\fP are
  16405. available to JavaScript with identical APIs \- including running commands,
  16406. getting/setting properties, registering events/key\-bindings/hooks, etc.
  16407. .SS Differences from Lua
  16408. .sp
  16409. No need to load modules. \fBmp\fP, \fBmp.utils\fP, \fBmp.msg\fP and \fBmp.options\fP
  16410. are preloaded, and you can use e.g. \fBvar cwd = mp.utils.getcwd();\fP without
  16411. prior setup.
  16412. .sp
  16413. Errors are slightly different. Where the Lua APIs return \fBnil\fP for error,
  16414. the JavaScript ones return \fBundefined\fP\&. Where Lua returns \fBsomething, error\fP
  16415. JavaScript returns only \fBsomething\fP \- and makes \fBerror\fP available via
  16416. \fBmp.last_error()\fP\&. Note that only some of the functions have this additional
  16417. \fBerror\fP value \- typically the same ones which have it in Lua.
  16418. .sp
  16419. Standard APIs are preferred. For instance \fBsetTimeout\fP and \fBJSON.stringify\fP
  16420. are available, but \fBmp.add_timeout\fP and \fBmp.utils.format_json\fP are not.
  16421. .sp
  16422. No standard library. This means that interaction with anything outside of mpv is
  16423. limited to the available APIs, typically via \fBmp.utils\fP\&. However, some file
  16424. functions were added, and CommonJS \fBrequire\fP is available too \- where the
  16425. loaded modules have the same privileges as normal scripts.
  16426. .SS Language features \- ECMAScript 5
  16427. .sp
  16428. The scripting backend which mpv currently uses is MuJS \- a compatible minimal
  16429. ES5 interpreter. As such, \fBString.substring\fP is implemented for instance,
  16430. while the common but non\-standard \fBString.substr\fP is not. Please consult the
  16431. MuJS pages on language features and platform support \- \fI\%http://mujs.com\fP .
  16432. .SS Unsupported Lua APIs and their JS alternatives
  16433. .sp
  16434. \fBmp.add_timeout(seconds, fn)\fP JS: \fBid = setTimeout(fn, ms)\fP
  16435. .sp
  16436. \fBmp.add_periodic_timer(seconds, fn)\fP JS: \fBid = setInterval(fn, ms)\fP
  16437. .sp
  16438. \fButils.parse_json(str [, trail])\fP JS: \fBJSON.parse(str)\fP
  16439. .sp
  16440. \fButils.format_json(v)\fP JS: \fBJSON.stringify(v)\fP
  16441. .sp
  16442. \fButils.to_string(v)\fP see \fBdump\fP below.
  16443. .sp
  16444. \fBmp.suspend()\fP JS: none (deprecated).
  16445. .sp
  16446. \fBmp.resume()\fP JS: none (deprecated).
  16447. .sp
  16448. \fBmp.resume_all()\fP JS: none (deprecated).
  16449. .sp
  16450. \fBmp.get_next_timeout()\fP see event loop below.
  16451. .sp
  16452. \fBmp.dispatch_events([allow_wait])\fP see event loop below.
  16453. .SS Scripting APIs \- identical to Lua
  16454. .sp
  16455. (LE) \- Last\-Error, indicates that \fBmp.last_error()\fP can be used after the
  16456. call to test for success (empty string) or failure (non empty reason string).
  16457. Where the Lua APIs use \fBnil\fP to indicate error, JS APIs use \fBundefined\fP\&.
  16458. .sp
  16459. \fBmp.command(string)\fP (LE)
  16460. .sp
  16461. \fBmp.commandv(arg1, arg2, ...)\fP (LE)
  16462. .sp
  16463. \fBmp.command_native(table [,def])\fP (LE)
  16464. .sp
  16465. \fBid = mp.command_native_async(table [,fn])\fP (LE) Notes: \fBid\fP is true\-thy on
  16466. success, \fBfn\fP is called always a\-sync, \fBerror\fP is empty string on success.
  16467. .sp
  16468. \fBmp.abort_async_command(id)\fP
  16469. .sp
  16470. \fBmp.get_property(name [,def])\fP (LE)
  16471. .sp
  16472. \fBmp.get_property_osd(name [,def])\fP (LE)
  16473. .sp
  16474. \fBmp.get_property_bool(name [,def])\fP (LE)
  16475. .sp
  16476. \fBmp.get_property_number(name [,def])\fP (LE)
  16477. .sp
  16478. \fBmp.get_property_native(name [,def])\fP (LE)
  16479. .sp
  16480. \fBmp.set_property(name, value)\fP (LE)
  16481. .sp
  16482. \fBmp.set_property_bool(name, value)\fP (LE)
  16483. .sp
  16484. \fBmp.set_property_number(name, value)\fP (LE)
  16485. .sp
  16486. \fBmp.set_property_native(name, value)\fP (LE)
  16487. .sp
  16488. \fBmp.get_time()\fP
  16489. .sp
  16490. \fBmp.add_key_binding(key, name|fn [,fn [,flags]])\fP
  16491. .sp
  16492. \fBmp.add_forced_key_binding(...)\fP
  16493. .sp
  16494. \fBmp.remove_key_binding(name)\fP
  16495. .sp
  16496. \fBmp.register_event(name, fn)\fP
  16497. .sp
  16498. \fBmp.unregister_event(fn)\fP
  16499. .sp
  16500. \fBmp.observe_property(name, type, fn)\fP
  16501. .sp
  16502. \fBmp.unobserve_property(fn)\fP
  16503. .sp
  16504. \fBmp.get_opt(key)\fP
  16505. .sp
  16506. \fBmp.get_script_name()\fP
  16507. .sp
  16508. \fBmp.osd_message(text [,duration])\fP
  16509. .sp
  16510. \fBmp.get_wakeup_pipe()\fP
  16511. .sp
  16512. \fBmp.register_idle(fn)\fP
  16513. .sp
  16514. \fBmp.unregister_idle(fn)\fP
  16515. .sp
  16516. \fBmp.enable_messages(level)\fP
  16517. .sp
  16518. \fBmp.register_script_message(name, fn)\fP
  16519. .sp
  16520. \fBmp.unregister_script_message(name)\fP
  16521. .sp
  16522. \fBmp.create_osd_overlay(format)\fP
  16523. .sp
  16524. \fBmp.get_osd_size()\fP (returned object has properties: width, height, aspect)
  16525. .sp
  16526. \fBmp.msg.log(level, ...)\fP
  16527. .sp
  16528. \fBmp.msg.fatal(...)\fP
  16529. .sp
  16530. \fBmp.msg.error(...)\fP
  16531. .sp
  16532. \fBmp.msg.warn(...)\fP
  16533. .sp
  16534. \fBmp.msg.info(...)\fP
  16535. .sp
  16536. \fBmp.msg.verbose(...)\fP
  16537. .sp
  16538. \fBmp.msg.debug(...)\fP
  16539. .sp
  16540. \fBmp.msg.trace(...)\fP
  16541. .sp
  16542. \fBmp.utils.getcwd()\fP (LE)
  16543. .sp
  16544. \fBmp.utils.readdir(path [, filter])\fP (LE)
  16545. .sp
  16546. \fBmp.utils.file_info(path)\fP (LE)
  16547. .sp
  16548. \fBmp.utils.split_path(path)\fP
  16549. .sp
  16550. \fBmp.utils.join_path(p1, p2)\fP
  16551. .sp
  16552. \fBmp.utils.subprocess(t)\fP
  16553. .sp
  16554. \fBmp.utils.subprocess_detached(t)\fP
  16555. .sp
  16556. \fBmp.utils.getpid()\fP (LE)
  16557. .sp
  16558. \fBmp.add_hook(type, priority, fn)\fP
  16559. .sp
  16560. \fBmp.options.read_options(obj [, identifier [, on_update]])\fP (types:
  16561. string/boolean/number)
  16562. .SS Additional utilities
  16563. .INDENT 0.0
  16564. .TP
  16565. .B \fBmp.last_error()\fP
  16566. If used after an API call which updates last error, returns an empty string
  16567. if the API call succeeded, or a non\-empty error reason string otherwise.
  16568. .TP
  16569. .B \fBError.stack\fP (string)
  16570. When using \fBtry { ... } catch(e) { ... }\fP, then \fBe.stack\fP is the stack
  16571. trace of the error \- if it was created using the \fBError(...)\fP constructor.
  16572. .TP
  16573. .B \fBprint\fP (global)
  16574. A convenient alias to \fBmp.msg.info\fP\&.
  16575. .TP
  16576. .B \fBdump\fP (global)
  16577. Like \fBprint\fP but also expands objects and arrays recursively.
  16578. .TP
  16579. .B \fBmp.utils.getenv(name)\fP
  16580. Returns the value of the host environment variable \fBname\fP, or
  16581. \fBundefined\fP if the variable is not defined.
  16582. .TP
  16583. .B \fBmp.utils.get_user_path(path)\fP
  16584. Expands (mpv) meta paths like \fB~/x\fP, \fB~~/y\fP, \fB~~desktop/z\fP etc.
  16585. \fBread_file\fP, \fBwrite_file\fP and \fBrequire\fP already use this internaly.
  16586. .TP
  16587. .B \fBmp.utils.read_file(fname [,max])\fP
  16588. Returns the content of file \fBfname\fP as string. If \fBmax\fP is provided and
  16589. not negative, limit the read to \fBmax\fP bytes.
  16590. .TP
  16591. .B \fBmp.utils.write_file(fname, str)\fP
  16592. (Over)write file \fBfname\fP with text content \fBstr\fP\&. \fBfname\fP must be
  16593. prefixed with \fBfile://\fP as simple protection against accidental arguments
  16594. switch, e.g. \fBmp.utils.write_file("file://~/abc.txt", "hello world")\fP\&.
  16595. .UNINDENT
  16596. .sp
  16597. Note: \fBread_file\fP and \fBwrite_file\fP throw on errors, allow text content only.
  16598. .INDENT 0.0
  16599. .TP
  16600. .B \fBmp.get_time_ms()\fP
  16601. Same as \fBmp.get_time()\fP but in ms instead of seconds.
  16602. .TP
  16603. .B \fBmp.get_script_file()\fP
  16604. Returns the file name of the current script.
  16605. .TP
  16606. .B \fBexit()\fP (global)
  16607. Make the script exit at the end of the current event loop iteration.
  16608. Note: please remove added key bindings before calling \fBexit()\fP\&.
  16609. .TP
  16610. .B \fBmp.utils.compile_js(fname, content_str)\fP
  16611. Compiles the JS code \fBcontent_str\fP as file name \fBfname\fP (without loading
  16612. anything from the filesystem), and returns it as a function. Very similar
  16613. to a \fBFunction\fP constructor, but shows at stack traces as \fBfname\fP\&.
  16614. .TP
  16615. .B \fBmp.module_paths\fP
  16616. Global modules search paths array for the \fBrequire\fP function (see below).
  16617. .UNINDENT
  16618. .SS Timers (global)
  16619. .sp
  16620. The standard HTML/node.js timers are available:
  16621. .sp
  16622. \fBid = setTimeout(fn [,duration [,arg1 [,arg2...]]])\fP
  16623. .sp
  16624. \fBid = setTimeout(code_string [,duration])\fP
  16625. .sp
  16626. \fBclearTimeout(id)\fP
  16627. .sp
  16628. \fBid = setInterval(fn [,duration [,arg1 [,arg2...]]])\fP
  16629. .sp
  16630. \fBid = setInterval(code_string [,duration])\fP
  16631. .sp
  16632. \fBclearInterval(id)\fP
  16633. .sp
  16634. \fBsetTimeout\fP and \fBsetInterval\fP return id, and later call \fBfn\fP (or execute
  16635. \fBcode_string\fP) after \fBduration\fP ms. Interval also repeat every \fBduration\fP\&.
  16636. .sp
  16637. \fBduration\fP has a minimum and default value of 0, \fBcode_string\fP is
  16638. a plain string which is evaluated as JS code, and \fB[,arg1 [,arg2..]]\fP are used
  16639. as arguments (if provided) when calling back \fBfn\fP\&.
  16640. .sp
  16641. The \fBclear...(id)\fP functions cancel timer \fBid\fP, and are irreversible.
  16642. .sp
  16643. Note: timers always call back asynchronously, e.g. \fBsetTimeout(fn)\fP will never
  16644. call \fBfn\fP before returning. \fBfn\fP will be called either at the end of this
  16645. event loop iteration or at a later event loop iteration. This is true also for
  16646. intervals \- which also never call back twice at the same event loop iteration.
  16647. .sp
  16648. Additionally, timers are processed after the event queue is empty, so it\(aqs valid
  16649. to use \fBsetTimeout(fn)\fP as a one\-time idle observer.
  16650. .SS CommonJS modules and \fBrequire(id)\fP
  16651. .sp
  16652. CommonJS Modules are a standard system where scripts can export common functions
  16653. for use by other scripts. Specifically, a module is a script which adds
  16654. properties (functions, etc) to its pre\-existing \fBexports\fP object, which
  16655. another script can access with \fBrequire(module\-id)\fP\&. This runs the module and
  16656. returns its \fBexports\fP object. Further calls to \fBrequire\fP for the same module
  16657. will return its cached \fBexports\fP object without running the module again.
  16658. .sp
  16659. Modules and \fBrequire\fP are supported, standard compliant, and generally similar
  16660. to node.js. However, most node.js modules won\(aqt run due to missing modules such
  16661. as \fBfs\fP, \fBprocess\fP, etc, but some node.js modules with minimal dependencies
  16662. do work. In general, this is for mpv modules and not a node.js replacement.
  16663. .sp
  16664. A \fB\&.js\fP file extension is always added to \fBid\fP, e.g. \fBrequire("./foo")\fP
  16665. will load the file \fB\&./foo.js\fP and return its \fBexports\fP object.
  16666. .sp
  16667. An id is relative (to the script which \fBrequire\fP\(aqd it) if it starts with
  16668. \fB\&./\fP or \fB\&../\fP\&. Otherwise, it\(aqs considered a "top\-level id" (CommonJS term).
  16669. .sp
  16670. Top level id is evaluated as absolute filesystem path if possible, e.g. \fB/x/y\fP
  16671. or \fB~/x\fP\&. Otherwise, it\(aqs considered a global module id and searched at
  16672. \fBscripts/modules.js/\fP in mpv config dirs \- in normal config search order. E.g.
  16673. \fBrequire("x")\fP is searched as file \fBx.js\fP at those dirs, and id \fBfoo/x\fP is
  16674. searched as file \fBx.js\fP inside dir \fBfoo\fP at those dirs.
  16675. .sp
  16676. Search paths for global module id\(aqs are at the array \fBmp.module_paths\fP, which
  16677. is searched in order. Initially it contains one item: \fB~~/scripts/modules.js\fP
  16678. such that it behaves as described above. Modifying it will affect future
  16679. \fBrequire\fP calls with global module id\(aqs which are not already loaded/cached.
  16680. .sp
  16681. No \fBglobal\fP variable, but a module\(aqs \fBthis\fP at its top lexical scope is the
  16682. global object \- also in strict mode. If you have a module which needs \fBglobal\fP
  16683. as the global object, you could do \fBthis.global = this;\fP before \fBrequire\fP\&.
  16684. .sp
  16685. Functions and variables declared at a module don\(aqt pollute the global object.
  16686. .SS The event loop
  16687. .sp
  16688. The event loop poll/dispatch mpv events as long as the queue is not empty, then
  16689. processes the timers, then waits for the next event, and repeats this forever.
  16690. .sp
  16691. You could put this code at your script to replace the built\-in event loop, and
  16692. also print every event which mpv sends to your script:
  16693. .INDENT 0.0
  16694. .INDENT 3.5
  16695. .sp
  16696. .nf
  16697. .ft C
  16698. function mp_event_loop() {
  16699. var wait = 0;
  16700. do {
  16701. var e = mp.wait_event(wait);
  16702. dump(e); // there could be a lot of prints...
  16703. if (e.event != "none") {
  16704. mp.dispatch_event(e);
  16705. wait = 0;
  16706. } else {
  16707. wait = mp.process_timers() / 1000;
  16708. if (wait != 0) {
  16709. mp.notify_idle_observers();
  16710. wait = mp.peek_timers_wait() / 1000;
  16711. }
  16712. }
  16713. } while (mp.keep_running);
  16714. }
  16715. .ft P
  16716. .fi
  16717. .UNINDENT
  16718. .UNINDENT
  16719. .sp
  16720. \fBmp_event_loop\fP is a name which mpv tries to call after the script loads.
  16721. The internal implementation is similar to this (without \fBdump\fP though..).
  16722. .sp
  16723. \fBe = mp.wait_event(wait)\fP returns when the next mpv event arrives, or after
  16724. \fBwait\fP seconds if positive and no mpv events arrived. \fBwait\fP value of 0
  16725. returns immediately (with \fBe.event == "none"\fP if the queue is empty).
  16726. .sp
  16727. \fBmp.dispatch_event(e)\fP calls back the handlers registered for \fBe.event\fP,
  16728. if there are such (event handlers, property observers, script messages, etc).
  16729. .sp
  16730. \fBmp.process_timers()\fP calls back the already\-added, non\-canceled due timers,
  16731. and returns the duration in ms till the next due timer (possibly 0), or \-1 if
  16732. there are no pending timers. Must not be called recursively.
  16733. .sp
  16734. \fBmp.notify_idle_observers()\fP calls back the idle observers, which we do when
  16735. we\(aqre about to sleep (wait != 0), but the observers may add timers or take
  16736. non\-negligible duration to complete, so we re\-calculate \fBwait\fP afterwards.
  16737. .sp
  16738. \fBmp.peek_timers_wait()\fP returns the same values as \fBmp.process_timers()\fP
  16739. but without doing anything. Invalid result if called from a timer callback.
  16740. .sp
  16741. Note: \fBexit()\fP is also registered for the \fBshutdown\fP event, and its
  16742. implementation is a simple \fBmp.keep_running = false\fP\&.
  16743. .SH JSON IPC
  16744. .sp
  16745. mpv can be controlled by external programs using the JSON\-based IPC protocol.
  16746. It can be enabled by specifying the path to a unix socket or a named pipe using
  16747. the option \fB\-\-input\-ipc\-server\fP\&. Clients can connect to this socket and send
  16748. commands to the player or receive events from it.
  16749. .sp
  16750. \fBWARNING:\fP
  16751. .INDENT 0.0
  16752. .INDENT 3.5
  16753. This is not intended to be a secure network protocol. It is explicitly
  16754. insecure: there is no authentication, no encryption, and the commands
  16755. themselves are insecure too. For example, the \fBrun\fP command is exposed,
  16756. which can run arbitrary system commands. The use\-case is controlling the
  16757. player locally. This is not different from the MPlayer slave protocol.
  16758. .UNINDENT
  16759. .UNINDENT
  16760. .SS Socat example
  16761. .sp
  16762. You can use the \fBsocat\fP tool to send commands (and receive replies) from the
  16763. shell. Assuming mpv was started with:
  16764. .INDENT 0.0
  16765. .INDENT 3.5
  16766. .sp
  16767. .nf
  16768. .ft C
  16769. mpv file.mkv \-\-input\-ipc\-server=/tmp/mpvsocket
  16770. .ft P
  16771. .fi
  16772. .UNINDENT
  16773. .UNINDENT
  16774. .sp
  16775. Then you can control it using socat:
  16776. .INDENT 0.0
  16777. .INDENT 3.5
  16778. .sp
  16779. .nf
  16780. .ft C
  16781. > echo \(aq{ "command": ["get_property", "playback\-time"] }\(aq | socat \- /tmp/mpvsocket
  16782. {"data":190.482000,"error":"success"}
  16783. .ft P
  16784. .fi
  16785. .UNINDENT
  16786. .UNINDENT
  16787. .sp
  16788. In this case, socat copies data between stdin/stdout and the mpv socket
  16789. connection.
  16790. .sp
  16791. See the \fB\-\-idle\fP option how to make mpv start without exiting immediately or
  16792. playing a file.
  16793. .sp
  16794. It\(aqs also possible to send input.conf style text\-only commands:
  16795. .INDENT 0.0
  16796. .INDENT 3.5
  16797. .sp
  16798. .nf
  16799. .ft C
  16800. > echo \(aqshow\-text ${playback\-time}\(aq | socat \- /tmp/mpvsocket
  16801. .ft P
  16802. .fi
  16803. .UNINDENT
  16804. .UNINDENT
  16805. .sp
  16806. But you won\(aqt get a reply over the socket. (This particular command shows the
  16807. playback time on the player\(aqs OSD.)
  16808. .SS Command Prompt example
  16809. .sp
  16810. Unfortunately, it\(aqs not as easy to test the IPC protocol on Windows, since
  16811. Windows ports of socat (in Cygwin and MSYS2) don\(aqt understand named pipes. In
  16812. the absence of a simple tool to send and receive from bidirectional pipes, the
  16813. \fBecho\fP command can be used to send commands, but not receive replies from the
  16814. command prompt.
  16815. .sp
  16816. Assuming mpv was started with:
  16817. .INDENT 0.0
  16818. .INDENT 3.5
  16819. .sp
  16820. .nf
  16821. .ft C
  16822. mpv file.mkv \-\-input\-ipc\-server=\e\e.\epipe\empvsocket
  16823. .ft P
  16824. .fi
  16825. .UNINDENT
  16826. .UNINDENT
  16827. .sp
  16828. You can send commands from a command prompt:
  16829. .INDENT 0.0
  16830. .INDENT 3.5
  16831. .sp
  16832. .nf
  16833. .ft C
  16834. echo show\-text ${playback\-time} >\e\e.\epipe\empvsocket
  16835. .ft P
  16836. .fi
  16837. .UNINDENT
  16838. .UNINDENT
  16839. .sp
  16840. To be able to simultaneously read and write from the IPC pipe, like on Linux,
  16841. it\(aqs necessary to write an external program that uses overlapped file I/O (or
  16842. some wrapper like .NET\(aqs NamedPipeClientStream.)
  16843. .SS Protocol
  16844. .sp
  16845. The protocol uses UTF\-8\-only JSON as defined by RFC\-8259. Unlike standard JSON,
  16846. "u" escape sequences are not allowed to construct surrogate pairs. To avoid
  16847. getting conflicts, encode all text characters including and above codepoint
  16848. U+0020 as UTF\-8. mpv might output broken UTF\-8 in corner cases (see "UTF\-8"
  16849. section below).
  16850. .sp
  16851. Clients can execute commands on the player by sending JSON messages of the
  16852. following form:
  16853. .INDENT 0.0
  16854. .INDENT 3.5
  16855. .sp
  16856. .nf
  16857. .ft C
  16858. { "command": ["command_name", "param1", "param2", ...] }
  16859. .ft P
  16860. .fi
  16861. .UNINDENT
  16862. .UNINDENT
  16863. .sp
  16864. where \fBcommand_name\fP is the name of the command to be executed, followed by a
  16865. list of parameters. Parameters must be formatted as native JSON values
  16866. (integers, strings, booleans, ...). Every message \fBmust\fP be terminated with
  16867. \fB\en\fP\&. Additionally, \fB\en\fP must not appear anywhere inside the message. In
  16868. practice this means that messages should be minified before being sent to mpv.
  16869. .sp
  16870. mpv will then send back a reply indicating whether the command was run
  16871. correctly, and an additional field holding the command\-specific return data (it
  16872. can also be null).
  16873. .INDENT 0.0
  16874. .INDENT 3.5
  16875. .sp
  16876. .nf
  16877. .ft C
  16878. { "error": "success", "data": null }
  16879. .ft P
  16880. .fi
  16881. .UNINDENT
  16882. .UNINDENT
  16883. .sp
  16884. mpv will also send events to clients with JSON messages of the following form:
  16885. .INDENT 0.0
  16886. .INDENT 3.5
  16887. .sp
  16888. .nf
  16889. .ft C
  16890. { "event": "event_name" }
  16891. .ft P
  16892. .fi
  16893. .UNINDENT
  16894. .UNINDENT
  16895. .sp
  16896. where \fBevent_name\fP is the name of the event. Additional event\-specific fields
  16897. can also be present. See \fI\%List of events\fP for a list of all supported events.
  16898. .sp
  16899. Because events can occur at any time, it may be difficult at times to determine
  16900. which response goes with which command. Commands may optionally include a
  16901. \fBrequest_id\fP which, if provided in the command request, will be copied
  16902. verbatim into the response. mpv does not intrepret the \fBrequest_id\fP in any
  16903. way; it is solely for the use of the requester. The only requirement is that
  16904. the \fBrequest_id\fP field must be an integer (a number without fractional parts
  16905. in the range \fB\-2^63..2^63\-1\fP). Using other types is deprecated and will
  16906. currently show a warning. In the future, this will raise an error.
  16907. .sp
  16908. For example, this request:
  16909. .INDENT 0.0
  16910. .INDENT 3.5
  16911. .sp
  16912. .nf
  16913. .ft C
  16914. { "command": ["get_property", "time\-pos"], "request_id": 100 }
  16915. .ft P
  16916. .fi
  16917. .UNINDENT
  16918. .UNINDENT
  16919. .sp
  16920. Would generate this response:
  16921. .INDENT 0.0
  16922. .INDENT 3.5
  16923. .sp
  16924. .nf
  16925. .ft C
  16926. { "error": "success", "data": 1.468135, "request_id": 100 }
  16927. .ft P
  16928. .fi
  16929. .UNINDENT
  16930. .UNINDENT
  16931. .sp
  16932. If you don\(aqt specify a \fBrequest_id\fP, command replies will set it to 0.
  16933. .sp
  16934. Commands may run asynchronously in the future, instead of blocking the socket
  16935. until a reply is sent.
  16936. .sp
  16937. All commands, replies, and events are separated from each other with a line
  16938. break character (\fB\en\fP).
  16939. .sp
  16940. If the first character (after skipping whitespace) is not \fB{\fP, the command
  16941. will be interpreted as non\-JSON text command, as they are used in input.conf
  16942. (or \fBmpv_command_string()\fP in the client API). Additionally, lines starting
  16943. with \fB#\fP and empty lines are ignored.
  16944. .sp
  16945. Currently, embedded 0 bytes terminate the current line, but you should not
  16946. rely on this.
  16947. .SS Commands
  16948. .sp
  16949. In addition to the commands described in \fI\%List of Input Commands\fP, a few
  16950. extra commands can also be used as part of the protocol:
  16951. .INDENT 0.0
  16952. .TP
  16953. .B \fBclient_name\fP
  16954. Return the name of the client as string. This is the string \fBipc\-N\fP with
  16955. N being an integer number.
  16956. .TP
  16957. .B \fBget_time_us\fP
  16958. Return the current mpv internal time in microseconds as a number. This is
  16959. basically the system time, with an arbitrary offset.
  16960. .TP
  16961. .B \fBget_property\fP
  16962. Return the value of the given property. The value will be sent in the data
  16963. field of the replay message.
  16964. .sp
  16965. Example:
  16966. .INDENT 7.0
  16967. .INDENT 3.5
  16968. .sp
  16969. .nf
  16970. .ft C
  16971. { "command": ["get_property", "volume"] }
  16972. { "data": 50.0, "error": "success" }
  16973. .ft P
  16974. .fi
  16975. .UNINDENT
  16976. .UNINDENT
  16977. .TP
  16978. .B \fBget_property_string\fP
  16979. Like \fBget_property\fP, but the resulting data will always be a string.
  16980. .sp
  16981. Example:
  16982. .INDENT 7.0
  16983. .INDENT 3.5
  16984. .sp
  16985. .nf
  16986. .ft C
  16987. { "command": ["get_property_string", "volume"] }
  16988. { "data": "50.000000", "error": "success" }
  16989. .ft P
  16990. .fi
  16991. .UNINDENT
  16992. .UNINDENT
  16993. .TP
  16994. .B \fBset_property\fP
  16995. Set the given property to the given value. See \fI\%Properties\fP for more
  16996. information about properties.
  16997. .sp
  16998. Example:
  16999. .INDENT 7.0
  17000. .INDENT 3.5
  17001. .sp
  17002. .nf
  17003. .ft C
  17004. { "command": ["set_property", "pause", true] }
  17005. { "error": "success" }
  17006. .ft P
  17007. .fi
  17008. .UNINDENT
  17009. .UNINDENT
  17010. .TP
  17011. .B \fBset_property_string\fP
  17012. Alias for \fBset_property\fP\&. Both commands accept native values and strings.
  17013. .TP
  17014. .B \fBobserve_property\fP
  17015. Watch a property for changes. If the given property is changed, then an
  17016. event of type \fBproperty\-change\fP will be generated
  17017. .sp
  17018. Example:
  17019. .INDENT 7.0
  17020. .INDENT 3.5
  17021. .sp
  17022. .nf
  17023. .ft C
  17024. { "command": ["observe_property", 1, "volume"] }
  17025. { "error": "success" }
  17026. { "event": "property\-change", "id": 1, "data": 52.0, "name": "volume" }
  17027. .ft P
  17028. .fi
  17029. .UNINDENT
  17030. .UNINDENT
  17031. .sp
  17032. \fBWARNING:\fP
  17033. .INDENT 7.0
  17034. .INDENT 3.5
  17035. If the connection is closed, the IPC client is destroyed internally,
  17036. and the observed properties are unregistered. This happens for example
  17037. when sending commands to a socket with separate \fBsocat\fP invocations.
  17038. This can make it seem like property observation does not work. You must
  17039. keep the IPC connection open to make it work.
  17040. .UNINDENT
  17041. .UNINDENT
  17042. .TP
  17043. .B \fBobserve_property_string\fP
  17044. Like \fBobserve_property\fP, but the resulting data will always be a string.
  17045. .sp
  17046. Example:
  17047. .INDENT 7.0
  17048. .INDENT 3.5
  17049. .sp
  17050. .nf
  17051. .ft C
  17052. { "command": ["observe_property_string", 1, "volume"] }
  17053. { "error": "success" }
  17054. { "event": "property\-change", "id": 1, "data": "52.000000", "name": "volume" }
  17055. .ft P
  17056. .fi
  17057. .UNINDENT
  17058. .UNINDENT
  17059. .TP
  17060. .B \fBunobserve_property\fP
  17061. Undo \fBobserve_property\fP or \fBobserve_property_string\fP\&. This requires the
  17062. numeric id passed to the observed command as argument.
  17063. .sp
  17064. Example:
  17065. .INDENT 7.0
  17066. .INDENT 3.5
  17067. .sp
  17068. .nf
  17069. .ft C
  17070. { "command": ["unobserve_property", 1] }
  17071. { "error": "success" }
  17072. .ft P
  17073. .fi
  17074. .UNINDENT
  17075. .UNINDENT
  17076. .TP
  17077. .B \fBrequest_log_messages\fP
  17078. Enable output of mpv log messages. They will be received as events. The
  17079. parameter to this command is the log\-level (see \fBmpv_request_log_messages\fP
  17080. C API function).
  17081. .sp
  17082. Log message output is meant for humans only (mostly for debugging).
  17083. Attempting to retrieve information by parsing these messages will just
  17084. lead to breakages with future mpv releases. Instead, make a feature request,
  17085. and ask for a proper event that returns the information you need.
  17086. .TP
  17087. .B \fBenable_event\fP, \fBdisable_event\fP
  17088. Enables or disables the named event. Mirrors the \fBmpv_request_event\fP C
  17089. API function. If the string \fBall\fP is used instead of an event name, all
  17090. events are enabled or disabled.
  17091. .sp
  17092. By default, most events are enabled, and there is not much use for this
  17093. command.
  17094. .TP
  17095. .B \fBget_version\fP
  17096. Returns the client API version the C API of the remote mpv instance
  17097. provides.
  17098. .sp
  17099. See also: \fBDOCS/client\-api\-changes.rst\fP\&.
  17100. .UNINDENT
  17101. .SS UTF\-8
  17102. .sp
  17103. Normally, all strings are in UTF\-8. Sometimes it can happen that strings are
  17104. in some broken encoding (often happens with file tags and such, and filenames
  17105. on many Unixes are not required to be in UTF\-8 either). This means that mpv
  17106. sometimes sends invalid JSON. If that is a problem for the client application\(aqs
  17107. parser, it should filter the raw data for invalid UTF\-8 sequences and perform
  17108. the desired replacement, before feeding the data to its JSON parser.
  17109. .sp
  17110. mpv will not attempt to construct invalid UTF\-8 with broken "u" escape
  17111. sequences. This includes surrogate pairs.
  17112. .SS JSON extensions
  17113. .sp
  17114. The following non\-standard extensions are supported:
  17115. .INDENT 0.0
  17116. .INDENT 3.5
  17117. .INDENT 0.0
  17118. .IP \(bu 2
  17119. a list or object item can have a trailing ","
  17120. .IP \(bu 2
  17121. object syntax accepts "=" in addition of ":"
  17122. .IP \(bu 2
  17123. object keys can be unquoted, if they start with a character in "A\-Za\-z_"
  17124. and contain only characters in "A\-Za\-z0\-9_"
  17125. .IP \(bu 2
  17126. byte escapes with "xAB" are allowed (with AB being a 2 digit hex number)
  17127. .UNINDENT
  17128. .UNINDENT
  17129. .UNINDENT
  17130. .sp
  17131. Example:
  17132. .INDENT 0.0
  17133. .INDENT 3.5
  17134. .sp
  17135. .nf
  17136. .ft C
  17137. { objkey = "value\ex0A" }
  17138. .ft P
  17139. .fi
  17140. .UNINDENT
  17141. .UNINDENT
  17142. .sp
  17143. Is equivalent to:
  17144. .INDENT 0.0
  17145. .INDENT 3.5
  17146. .sp
  17147. .nf
  17148. .ft C
  17149. { "objkey": "value\en" }
  17150. .ft P
  17151. .fi
  17152. .UNINDENT
  17153. .UNINDENT
  17154. .SH CHANGELOG
  17155. .sp
  17156. There is no real changelog, but you can look at the following things:
  17157. .INDENT 0.0
  17158. .IP \(bu 2
  17159. The release changelog, which should contain most user\-visible changes,
  17160. including new features and bug fixes:
  17161. .sp
  17162. \fI\%https://github.com/mpv\-player/mpv/releases\fP
  17163. .IP \(bu 2
  17164. The git log, which is the "real" changelog
  17165. .IP \(bu 2
  17166. The files \fBclient\-api\-changes.rst\fP and \fBinterface\-changes.rst\fP in the
  17167. \fBDOCS\fP sub directoryon the git repository, which document API and user
  17168. interface changes (the latter usually documents breaking changes only, rather
  17169. than additions).
  17170. .IP \(bu 2
  17171. The file \fBmplayer\-changes.rst\fP in the \fBDOCS\fP sub directory on the git
  17172. repository, which used to be in place of this section. It documents some
  17173. changes that happened since mplayer2 forked off MPlayer. (Not updated
  17174. anymore.)
  17175. .UNINDENT
  17176. .SH EMBEDDING INTO OTHER PROGRAMS (LIBMPV)
  17177. .sp
  17178. mpv can be embedded into other programs as video/audio playback backend. The
  17179. recommended way to do so is using libmpv. See \fBlibmpv/client.h\fP in the mpv
  17180. source code repository. This provides a C API. Bindings for other languages
  17181. might be available (see wiki).
  17182. .sp
  17183. Since libmpv merely allows access to underlying mechanisms that can control
  17184. mpv, further documentation is spread over a few places:
  17185. .INDENT 0.0
  17186. .IP \(bu 2
  17187. \fI\%https://github.com/mpv\-player/mpv/blob/master/libmpv/client.h\fP
  17188. .IP \(bu 2
  17189. \fI\%http://mpv.io/manual/master/#options\fP
  17190. .IP \(bu 2
  17191. \fI\%http://mpv.io/manual/master/#list\-of\-input\-commands\fP
  17192. .IP \(bu 2
  17193. \fI\%http://mpv.io/manual/master/#properties\fP
  17194. .IP \(bu 2
  17195. \fI\%https://github.com/mpv\-player/mpv\-examples/tree/master/libmpv\fP
  17196. .UNINDENT
  17197. .SH C PLUGINS
  17198. .sp
  17199. You can write C plugins for mpv. These use the libmpv API, although they do not
  17200. use the libmpv library itself.
  17201. .sp
  17202. Currently, they must be explicitly enabled at build time with
  17203. \fB\-\-enable\-cplugins\fP\&. They are available on Linux/BSD platforms only.
  17204. .SS C plugins location
  17205. .sp
  17206. C plugins are put into the mpv scripts directory in its config directory
  17207. (see the \fI\%FILES\fP section for details). They must have a \fB\&.so\fP file extension.
  17208. They can also be explicitly loaded with the \fB\-\-script\fP option.
  17209. .SS API
  17210. .sp
  17211. A C plugin must export the following function:
  17212. .INDENT 0.0
  17213. .INDENT 3.5
  17214. .sp
  17215. .nf
  17216. .ft C
  17217. int mpv_open_cplugin(mpv_handle *handle)
  17218. .ft P
  17219. .fi
  17220. .UNINDENT
  17221. .UNINDENT
  17222. .sp
  17223. The plugin function will be called on loading time. This function does not
  17224. return as long as your plugin is loaded (it runs in its own thread). The
  17225. \fBhandle\fP will be deallocated as soon as the plugin function returns.
  17226. .sp
  17227. The return value is interpreted as error status. A value of \fB0\fP is
  17228. interpreted as success, while \fB\-1\fP signals an error. In the latter case,
  17229. the player prints an uninformative error message that loading failed.
  17230. .sp
  17231. Return values other than \fB0\fP and \fB\-1\fP are reserved, and trigger undefined
  17232. behavior.
  17233. .sp
  17234. Within the plugin function, you can call libmpv API functions. The \fBhandle\fP
  17235. is created by \fBmpv_create_client()\fP (or actually an internal equivalent),
  17236. and belongs to you. You can call \fBmpv_wait_event()\fP to wait for things
  17237. happening, and so on.
  17238. .sp
  17239. Note that the player might block until your plugin calls \fBmpv_wait_event()\fP
  17240. for the first time. This gives you a chance to install initial hooks etc.
  17241. before playback begins.
  17242. .sp
  17243. The details are quite similar to Lua scripts.
  17244. .SS Linkage to libmpv
  17245. .sp
  17246. The current implementation requires that your plugins are \fBnot\fP linked against
  17247. libmpv. What your plugins uses are not symbols from a libmpv binary, but
  17248. symbols from the mpv host binary.
  17249. .SS Examples
  17250. .sp
  17251. See:
  17252. .INDENT 0.0
  17253. .IP \(bu 2
  17254. \fI\%https://github.com/mpv\-player/mpv\-examples/tree/master/cplugins\fP
  17255. .UNINDENT
  17256. .SH ENVIRONMENT VARIABLES
  17257. .sp
  17258. There are a number of environment variables that can be used to control the
  17259. behavior of mpv.
  17260. .INDENT 0.0
  17261. .TP
  17262. .B \fBHOME\fP, \fBXDG_CONFIG_HOME\fP
  17263. Used to determine mpv config directory. If \fBXDG_CONFIG_HOME\fP is not set,
  17264. \fB$HOME/.config/mpv\fP is used.
  17265. .sp
  17266. \fB$HOME/.mpv\fP is always added to the list of config search paths with a
  17267. lower priority.
  17268. .TP
  17269. .B \fBXDG_CONFIG_DIRS\fP
  17270. If set, XDG\-style system configuration directories are used. Otherwise,
  17271. the UNIX convention (\fBPREFIX/etc/mpv/\fP) is used.
  17272. .TP
  17273. .B \fBMPV_HOME\fP
  17274. Directory where mpv looks for user settings. Overrides \fBHOME\fP, and mpv
  17275. will try to load the config file as \fB$MPV_HOME/mpv.conf\fP\&.
  17276. .TP
  17277. .B \fBMPV_VERBOSE\fP (see also \fB\-v\fP and \fB\-\-msg\-level\fP)
  17278. Set the initial verbosity level across all message modules (default: 0).
  17279. This is an integer, and the resulting verbosity corresponds to the number
  17280. of \fB\-\-v\fP options passed to the command line.
  17281. .TP
  17282. .B \fBMPV_LEAK_REPORT\fP
  17283. If set to \fB1\fP, enable internal talloc leak reporting. If set to another
  17284. value, disable leak reporting. If unset, use the default, which normally is
  17285. \fB0\fP\&. If mpv was built with \fB\-\-enable\-ta\-leak\-report\fP, the default is
  17286. \fB1\fP\&. If leak reporting was disabled at compile time (\fBNDEBUG\fP in
  17287. custom \fBCFLAGS\fP), this environment variable is ignored.
  17288. .TP
  17289. .B \fBLADSPA_PATH\fP
  17290. Specifies the search path for LADSPA plugins. If it is unset, fully
  17291. qualified path names must be used.
  17292. .TP
  17293. .B \fBDISPLAY\fP
  17294. Standard X11 display name to use.
  17295. .TP
  17296. .B FFmpeg/Libav:
  17297. This library accesses various environment variables. However, they are not
  17298. centrally documented, and documenting them is not our job. Therefore, this
  17299. list is incomplete.
  17300. .sp
  17301. Notable environment variables:
  17302. .INDENT 7.0
  17303. .TP
  17304. .B \fBhttp_proxy\fP
  17305. URL to proxy for \fBhttp://\fP and \fBhttps://\fP URLs.
  17306. .TP
  17307. .B \fBno_proxy\fP
  17308. List of domain patterns for which no proxy should be used.
  17309. List entries are separated by \fB,\fP\&. Patterns can include \fB*\fP\&.
  17310. .UNINDENT
  17311. .TP
  17312. .B libdvdcss:
  17313. .INDENT 7.0
  17314. .TP
  17315. .B \fBDVDCSS_CACHE\fP
  17316. Specify a directory in which to store title key values. This will
  17317. speed up descrambling of DVDs which are in the cache. The
  17318. \fBDVDCSS_CACHE\fP directory is created if it does not exist, and a
  17319. subdirectory is created named after the DVD\(aqs title or manufacturing
  17320. date. If \fBDVDCSS_CACHE\fP is not set or is empty, libdvdcss will use
  17321. the default value which is \fB${HOME}/.dvdcss/\fP under Unix and
  17322. the roaming application data directory (\fB%APPDATA%\fP) under
  17323. Windows. The special value "off" disables caching.
  17324. .TP
  17325. .B \fBDVDCSS_METHOD\fP
  17326. Sets the authentication and decryption method that libdvdcss will use
  17327. to read scrambled discs. Can be one of \fBtitle\fP, \fBkey\fP or \fBdisc\fP\&.
  17328. .INDENT 7.0
  17329. .TP
  17330. .B key
  17331. is the default method. libdvdcss will use a set of calculated
  17332. player keys to try to get the disc key. This can fail if the drive
  17333. does not recognize any of the player keys.
  17334. .TP
  17335. .B disc
  17336. is a fallback method when key has failed. Instead of using player
  17337. keys, libdvdcss will crack the disc key using a brute force
  17338. algorithm. This process is CPU intensive and requires 64 MB of
  17339. memory to store temporary data.
  17340. .TP
  17341. .B title
  17342. is the fallback when all other methods have failed. It does not
  17343. rely on a key exchange with the DVD drive, but rather uses a crypto
  17344. attack to guess the title key. On rare cases this may fail because
  17345. there is not enough encrypted data on the disc to perform a
  17346. statistical attack, but on the other hand it is the only way to
  17347. decrypt a DVD stored on a hard disc, or a DVD with the wrong region
  17348. on an RPC2 drive.
  17349. .UNINDENT
  17350. .TP
  17351. .B \fBDVDCSS_RAW_DEVICE\fP
  17352. Specify the raw device to use. Exact usage will depend on your
  17353. operating system, the Linux utility to set up raw devices is raw(8)
  17354. for instance. Please note that on most operating systems, using a raw
  17355. device requires highly aligned buffers: Linux requires a 2048 bytes
  17356. alignment (which is the size of a DVD sector).
  17357. .TP
  17358. .B \fBDVDCSS_VERBOSE\fP
  17359. Sets the libdvdcss verbosity level.
  17360. .INDENT 7.0
  17361. .TP
  17362. .B 0
  17363. Outputs no messages at all.
  17364. .TP
  17365. .B 1
  17366. Outputs error messages to stderr.
  17367. .TP
  17368. .B 2
  17369. Outputs error messages and debug messages to stderr.
  17370. .UNINDENT
  17371. .TP
  17372. .B \fBDVDREAD_NOKEYS\fP
  17373. Skip retrieving all keys on startup. Currently disabled.
  17374. .TP
  17375. .B \fBHOME\fP
  17376. FIXME: Document this.
  17377. .UNINDENT
  17378. .UNINDENT
  17379. .SH EXIT CODES
  17380. .sp
  17381. Normally \fBmpv\fP returns 0 as exit code after finishing playback successfully.
  17382. If errors happen, the following exit codes can be returned:
  17383. .INDENT 0.0
  17384. .INDENT 3.5
  17385. .INDENT 0.0
  17386. .TP
  17387. .B 1
  17388. Error initializing mpv. This is also returned if unknown options are
  17389. passed to mpv.
  17390. .TP
  17391. .B 2
  17392. The file passed to mpv couldn\(aqt be played. This is somewhat fuzzy:
  17393. currently, playback of a file is considered to be successful if
  17394. initialization was mostly successful, even if playback fails
  17395. immediately after initialization.
  17396. .TP
  17397. .B 3
  17398. There were some files that could be played, and some files which
  17399. couldn\(aqt (using the definition of success from above).
  17400. .TP
  17401. .B 4
  17402. Quit due to a signal, Ctrl+c in a VO window (by default), or from the
  17403. default quit key bindings in encoding mode.
  17404. .UNINDENT
  17405. .UNINDENT
  17406. .UNINDENT
  17407. .sp
  17408. Note that quitting the player manually will always lead to exit code 0,
  17409. overriding the exit code that would be returned normally. Also, the \fBquit\fP
  17410. input command can take an exit code: in this case, that exit code is returned.
  17411. .SH FILES
  17412. .sp
  17413. For Windows\-specifics, see \fI\%FILES ON WINDOWS\fP section.
  17414. .INDENT 0.0
  17415. .TP
  17416. .B \fB/usr/local/etc/mpv/mpv.conf\fP
  17417. mpv system\-wide settings (depends on \fB\-\-prefix\fP passed to configure \- mpv
  17418. in default configuration will use \fB/usr/local/etc/mpv/\fP as config
  17419. directory, while most Linux distributions will set it to \fB/etc/mpv/\fP).
  17420. .TP
  17421. .B \fB~/.config/mpv/mpv.conf\fP
  17422. mpv user settings (see \fI\%CONFIGURATION FILES\fP section)
  17423. .TP
  17424. .B \fB~/.config/mpv/input.conf\fP
  17425. key bindings (see \fI\%INPUT.CONF\fP section)
  17426. .TP
  17427. .B \fB~/.config/mpv/fonts.conf\fP
  17428. Fontconfig fonts.conf that is customized for mpv. You should include system
  17429. fonts.conf in this file or mpv would not know about fonts that you already
  17430. have in the system.
  17431. .sp
  17432. Only available when libass is built with fontconfig.
  17433. .TP
  17434. .B \fB~/.config/mpv/subfont.ttf\fP
  17435. fallback subtitle font
  17436. .TP
  17437. .B \fB~/.config/mpv/fonts/\fP
  17438. Font files in this directory are used by mpv/libass for subtitles. Useful
  17439. if you do not want to install fonts to your system. Note that files in this
  17440. directory are loaded into memory before being used by mpv. If you have a
  17441. lot of fonts, consider using fonts.conf (see above) to include additional
  17442. fonts, which is more memory\-efficient.
  17443. .TP
  17444. .B \fB~/.config/mpv/scripts/\fP
  17445. All files in this directory are loaded as if they were passed to the
  17446. \fB\-\-script\fP option. They are loaded in alphabetical order. Directory entries
  17447. other than files are ignored. Files with unknown extension lead to an
  17448. initialization error. Files with \fB\&.disable\fP extension are ignored. The
  17449. \fB\-\-load\-scripts=no\fP option disables loading these files.
  17450. .TP
  17451. .B \fB~/.config/mpv/watch_later/\fP
  17452. Contains temporary config files needed for resuming playback of files with
  17453. the watch later feature. See for example the \fBQ\fP key binding, or the
  17454. \fBquit\-watch\-later\fP input command.
  17455. .sp
  17456. Each file is a small config file which is loaded if the corresponding media
  17457. file is loaded. It contains the playback position and some (not necessarily
  17458. all) settings that were changed during playback. The filenames are hashed
  17459. from the full paths of the media files. It\(aqs in general not possible to
  17460. extract the media filename from this hash. However, you can set the
  17461. \fB\-\-write\-filename\-in\-watch\-later\-config\fP option, and the player will
  17462. add the media filename to the contents of the resume config file.
  17463. .TP
  17464. .B \fB~/.config/mpv/script\-opts/osc.conf\fP
  17465. This is loaded by the OSC script. See the \fI\%ON SCREEN CONTROLLER\fP docs
  17466. for details.
  17467. .sp
  17468. Other files in this directory are specific to the corresponding scripts
  17469. as well, and the mpv core doesn\(aqt touch them.
  17470. .UNINDENT
  17471. .sp
  17472. Note that the environment variables \fB$XDG_CONFIG_HOME\fP and \fB$MPV_HOME\fP can
  17473. override the standard directory \fB~/.config/mpv/\fP\&.
  17474. .sp
  17475. Also, the old config location at \fB~/.mpv/\fP is still read, and if the XDG
  17476. variant does not exist, will still be preferred.
  17477. .SH FILES ON WINDOWS
  17478. .sp
  17479. On win32 (if compiled with MinGW, but not Cygwin), the default config file
  17480. locations are different. They are generally located under \fB%APPDATA%/mpv/\fP\&.
  17481. For example, the path to mpv.conf is \fB%APPDATA%/mpv/mpv.conf\fP, which maps to
  17482. a system and user\-specific path, for example
  17483. .INDENT 0.0
  17484. .INDENT 3.5
  17485. \fBC:\eusers\eUSERNAME\eAppData\eRoaming\empv\empv.conf\fP
  17486. .UNINDENT
  17487. .UNINDENT
  17488. .sp
  17489. You can find the exact path by running \fBecho %APPDATA%\empv\empv.conf\fP in cmd.exe.
  17490. .sp
  17491. Other config files (such as \fBinput.conf\fP) are in the same directory. See the
  17492. \fI\%FILES\fP section above.
  17493. .sp
  17494. The environment variable \fB$MPV_HOME\fP completely overrides these, like on
  17495. UNIX.
  17496. .sp
  17497. If a directory named \fBportable_config\fP next to the mpv.exe exists, all
  17498. config will be loaded from this directory only. Watch later config files are
  17499. written to this directory as well. (This exists on Windows only and is redundant
  17500. with \fB$MPV_HOME\fP\&. However, since Windows is very scripting unfriendly, a
  17501. wrapper script just setting \fB$MPV_HOME\fP, like you could do it on other
  17502. systems, won\(aqt work. \fBportable_config\fP is provided for convenience to get
  17503. around this restriction.)
  17504. .sp
  17505. Config files located in the same directory as \fBmpv.exe\fP are loaded with
  17506. lower priority. Some config files are loaded only once, which means that
  17507. e.g. of 2 \fBinput.conf\fP files located in two config directories, only the
  17508. one from the directory with higher priority will be loaded.
  17509. .sp
  17510. A third config directory with the lowest priority is the directory named \fBmpv\fP
  17511. in the same directory as \fBmpv.exe\fP\&. This used to be the directory with the
  17512. highest priority, but is now discouraged to use and might be removed in the
  17513. future.
  17514. .sp
  17515. Note that mpv likes to mix \fB/\fP and \fB\e\fP path separators for simplicity.
  17516. kernel32.dll accepts this, but cmd.exe does not.
  17517. .SH COPYRIGHT
  17518. GPLv2+
  17519. .\" Generated by docutils manpage writer.
  17520. .