summaryrefslogtreecommitdiff
path: root/media
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-07-02 21:28:38 -0700
committerMichael Forney <mforney@mforney.org>2016-07-02 21:45:13 -0700
commit254cb4b343fb256e98fbcc92dccefd95bff65f3e (patch)
treeeb5196991067b659c7b76de8dc49f6b4a64206b5 /media
parent52b92b6ff3985b81d8ef513fea3d4d8b3c4bc6e5 (diff)
Add mpv 0.18.0
Diffstat (limited to 'media')
-rw-r--r--media/gen.rc1
-rw-r--r--media/mpv/.rev1
-rw-r--r--media/mpv/config.h172
-rw-r--r--media/mpv/file2string.awk23
-rw-r--r--media/mpv/gen.rc57
-rw-r--r--media/mpv/gensources.awk12
-rw-r--r--media/mpv/patch/0001-Include-poll.h-instead-of-sys-poll.h.patch43
-rw-r--r--media/mpv/patch/0002-Add-generated-ebml-sources.patch978
-rw-r--r--media/mpv/patch/0003-Add-generated-man-page.patch13870
-rw-r--r--media/mpv/sources.awk19
-rw-r--r--media/mpv/sources.txt286
m---------media/mpv/src0
12 files changed, 15462 insertions, 0 deletions
diff --git a/media/gen.rc b/media/gen.rc
index a4141763..d4ef5b52 100644
--- a/media/gen.rc
+++ b/media/gen.rc
@@ -1,2 +1,3 @@
subgen alsa-lib
subgen ffmpeg
+subgen mpv
diff --git a/media/mpv/.rev b/media/mpv/.rev
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/media/mpv/.rev
@@ -0,0 +1 @@
+1
diff --git a/media/mpv/config.h b/media/mpv/config.h
new file mode 100644
index 00000000..35a3b6e6
--- /dev/null
+++ b/media/mpv/config.h
@@ -0,0 +1,172 @@
+#ifndef W_CONFIG_H_WAF
+#define W_CONFIG_H_WAF
+
+#define DEFAULT_DVD_DEVICE "/dev/sr0"
+#define DEFAULT_CDROM_DEVICE "/dev/sr0"
+#define HAVE_CPLAYER 1
+#define HAVE_LIBMPV_SHARED 0
+#define HAVE_LIBMPV_STATIC 0
+#define HAVE_STATIC_BUILD 0
+#define HAVE_BUILD_DATE 1
+#define HAVE_OPTIMIZE 1
+#define HAVE_DEBUG_BUILD 1
+#define HAVE_MANPAGE_BUILD 0
+#define HAVE_HTML_BUILD 0
+#define HAVE_PDF_BUILD 0
+#define HAVE_LIBDL 1
+#define HAVE_DLOPEN 0
+#define HAVE_VF_DLOPEN_FILTERS 0
+#define HAVE_ZSH_COMP 0
+#define HAVE_ASM 1
+#define HAVE_TEST 0
+#define HAVE_CLANG_DATABASE 0
+#define HAVE_NOEXECSTACK 0
+#define HAVE_LIBM 1
+#define HAVE_MINGW 0
+#define HAVE_POSIX 1
+#define HAVE_POSIX_OR_MINGW 1
+#define HAVE_WIN32 0
+#define HAVE_WIN32_INTERNAL_PTHREADS 0
+#define HAVE_PTHREADS 1
+#define HAVE_STDATOMIC 1
+#define HAVE_ATOMIC_BUILTINS 0
+#define HAVE_SYNC_BUILTINS 0
+#define HAVE_ATOMICS 1
+#define HAVE_C11_TLS 1
+#define HAVE_LIBRT 1
+#define HAVE_ICONV 1
+#define HAVE_DOS_PATHS 0
+#define HAVE_TERMIOS_H 1
+#define HAVE_SYS_TERMIOS_H 0
+#define HAVE_TERMIOS 1
+#define HAVE_SHM 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_POSIX_SPAWN 1
+#define HAVE_SUBPROCESS 1
+#define HAVE_GLOB 1
+#define HAVE_GLOB_WIN32_REPLACEMENT 0
+#define HAVE_FCHMOD 1
+#define HAVE_VT_H 1
+#define HAVE_GBM_H 0
+#define HAVE_GLIBC_THREAD_NAME 0
+#define HAVE_OSX_THREAD_NAME 0
+#define HAVE_BSD_THREAD_NAME 0
+#define HAVE_NETBSD_THREAD_NAME 0
+#define HAVE_BSD_FSTATFS 0
+#define HAVE_LINUX_FSTATFS 1
+#define HAVE_LIBSMBCLIENT 0
+#define HAVE_LUA 0
+#define HAVE_LIBASS 0
+#define HAVE_LIBASS_OSD 0
+#define HAVE_DUMMY_OSD 1
+#define HAVE_ZLIB 1
+#define HAVE_ENCODING 0
+#define HAVE_LIBBLURAY 0
+#define HAVE_DVDREAD 0
+#define HAVE_DVDNAV 0
+#define HAVE_CDDA 0
+#define HAVE_ENCA 0
+#define HAVE_LIBGUESS 0
+#define HAVE_UCHARDET 0
+#define HAVE_RUBBERBAND 0
+#define HAVE_LCMS2 0
+#define HAVE_VAPOURSYNTH 0
+#define HAVE_VAPOURSYNTH_LAZY 0
+#define HAVE_VAPOURSYNTH_CORE 0
+#define HAVE_LIBARCHIVE 0
+#define HAVE_SDL2 0
+#define HAVE_SDL1 0
+#define HAVE_OSS_AUDIO_4FRONT 0
+#define HAVE_OSS_AUDIO_NATIVE 1
+#define HAVE_OSS_AUDIO_SUNAUDIO 0
+#define HAVE_OSS_AUDIO 0
+#define HAVE_RSOUND 0
+#define HAVE_SNDIO 0
+#define HAVE_PULSE 0
+#define HAVE_JACK 0
+#define HAVE_OPENAL 0
+#define HAVE_OPENSLES 0
+#define HAVE_ALSA 1
+#define HAVE_COREAUDIO 0
+#define HAVE_WASAPI 0
+#define HAVE_COCOA 0
+#define HAVE_DRM 1
+#define HAVE_GBM 0
+#define HAVE_WAYLAND 0
+#define HAVE_X11 0
+#define HAVE_XSS 0
+#define HAVE_XEXT 0
+#define HAVE_XV 0
+#define HAVE_XINERAMA 0
+#define HAVE_XRANDR 0
+#define HAVE_GL_COCOA 0
+#define HAVE_GL_X11 0
+#define HAVE_EGL_X11 0
+#define HAVE_EGL_DRM 0
+#define HAVE_GL_WAYLAND 0
+#define HAVE_GL_WIN32 0
+#define HAVE_GL_DXINTEROP 0
+#define HAVE_EGL_ANGLE 0
+#define HAVE_VDPAU 0
+#define HAVE_VDPAU_GL_X11 0
+#define HAVE_VAAPI 0
+#define HAVE_VAAPI_X11 0
+#define HAVE_VAAPI_WAYLAND 0
+#define HAVE_VAAPI_DRM 0
+#define HAVE_VAAPI_GLX 0
+#define HAVE_VAAPI_X_EGL 0
+#define HAVE_VAAPI_EGL 0
+#define HAVE_CACA 0
+#define HAVE_JPEG 0
+#define HAVE_DIRECT3D 0
+#define HAVE_ANDROID 0
+#define HAVE_RPI 0
+#define HAVE_STANDARD_GL 0
+#define HAVE_ANDROID_GL 0
+#define HAVE_ANY_GL 0
+#define HAVE_PLAIN_GL 0
+#define HAVE_GL 0
+#define HAVE_EGL_HELPERS 0
+#define HAVE_LIBAV 1
+#define HAVE_LIBSWRESAMPLE 1
+#define HAVE_LIBAVRESAMPLE 0
+#define HAVE_RESAMPLER 1
+#define HAVE_LIBAVFILTER 1
+#define HAVE_LIBAVDEVICE 1
+#define HAVE_AVCODEC_CHROMA_POS_API 1
+#define HAVE_AVFRAME_METADATA 1
+#define HAVE_AVFRAME_SKIP_SAMPLES 1
+#define HAVE_AV_PIX_FMT_MMAL 1
+#define HAVE_AV_VERSION_INFO 1
+#define HAVE_AV_NEW_PIXDESC 0
+#define HAVE_AV_AVPACKET_INT64_DURATION 0
+#define HAVE_AV_SUBTITLE_NOPICT 0
+#define HAVE_AVCODEC_PROFILE_NAME 0
+#define HAVE_AVCODEC_NEW_CODEC_API 0
+#define HAVE_AVCODEC_HAS_CODECPAR 0
+#define HAVE_AVUTIL_HAS_HWCONTEXT 0
+#define HAVE_AVUTIL_ST2084 0
+#define HAVE_VAAPI_HWACCEL 0
+#define HAVE_VIDEOTOOLBOX_VIDEOTOOLBOX_H 0
+#define HAVE_VIDEO_TOOLBOX_VIDEO_TOOLBOX_H 0
+#define HAVE_VIDEOTOOLBOX_HWACCEL 0
+#define HAVE_VIDEOTOOLBOX_GL 0
+#define HAVE_VDPAU_HWACCEL 0
+#define HAVE_D3D_HWACCEL 0
+#define HAVE_SSE4_INTRINSICS 0
+#define HAVE_TV 0
+#define HAVE_SYS_VIDEOIO_H 0
+#define HAVE_VIDEODEV 1
+#define HAVE_TV_V4L2 0
+#define HAVE_LIBV4L2 0
+#define HAVE_AUDIO_INPUT 0
+#define HAVE_DVBIN 0
+#define HAVE_WIN32_EXECUTABLE 0
+#define HAVE_APPLE_REMOTE 0
+#define HAVE_SYS_SOUNDCARD_H (HAVE_OSS_AUDIO_NATIVE || HAVE_OSS_AUDIO_4FRONT)
+#define HAVE_SOUNDCARD_H HAVE_OSS_AUDIO_SUNAUDIO
+#define CONFIGURATION "./waf configure --disable-libass --disable-gl"
+#define MPV_CONFDIR "/etc/mpv"
+#define FULLCONFIG "asm atomics audio-input av-pix-fmt-mmal av-version-info avcodec-chroma-pos-api avframe-metadata avframe-skip-samples build-date c11-tls cplayer debug-build dlopen dummy-osd dvbin encoding fchmod glob iconv libav libavdevice libavfilter libdl libm librt libswresample linux-fstatfs nanosleep optimize oss-audio oss-audio-native posix posix-or-mingw posix-spawn pthreads resampler shm stdatomic subprocess termios tv tv-v4l2 videodev vt.h zlib"
+
+#endif /* W_CONFIG_H_WAF */
diff --git a/media/mpv/file2string.awk b/media/mpv/file2string.awk
new file mode 100644
index 00000000..113d1729
--- /dev/null
+++ b/media/mpv/file2string.awk
@@ -0,0 +1,23 @@
+BEGIN {
+ for (n = 0; n < 256; ++n)
+ ord[sprintf("%c", n)] = n
+}
+
+FNR == 1 {
+ print "/* Generated from " FILENAME " */"
+}
+
+{
+ printf "\""
+ s = $0
+ while (length(s) > 0) {
+ i = match(s, "[^][A-Za-z0-9!#%&'()*+,./:;<=>^_{|}~ -]")
+ if (i == 0) {
+ printf "%s", s
+ break
+ }
+ printf "%s\\%03o", substr(s, 1, i-1), ord[substr(s, i, 1)]
+ s = substr(s, i+1)
+ }
+ printf "\\012\"\n"
+}
diff --git a/media/mpv/gen.rc b/media/mpv/gen.rc
new file mode 100644
index 00000000..afd4a6b2
--- /dev/null
+++ b/media/mpv/gen.rc
@@ -0,0 +1,57 @@
+cflags\
+ -Wno-deprecated-declarations\
+ -isystem '$builddir'/core/zlib/include\
+ -isystem '$builddir'/media/alsa-lib/include\
+ -isystem '$builddir'/media/ffmpeg/include\
+ -isystem desktop/libdrm/src\
+ -isystem desktop/libdrm/src/include/drm\
+ -isystem media/ffmpeg/src\
+ -I '$dir' \
+ -I '$outdir' \
+ -I '$srcdir'
+
+
+rule versionhdr 'sh $srcdir/version.sh --cwd=$srcdir --versionh=$out'
+build '$outdir'/version.h versionhdr '|' '$srcdir'/version.sh
+
+build '$outdir'/input/input_conf.h awk '$srcdir'/etc/input.conf ; with\
+ expr '-f $dir/file2string.awk'
+
+deps=(\
+ phony/^(\
+ core/zlib\
+ media/alsa-lib\
+ media/ffmpeg\
+ )^/headers\
+ '$outdir'/^(version.h input/input_conf.h)\
+)
+
+srcs=(\
+ osdep/^(main-fn-unix.c terminal-unix.c timer-linux.c)\
+ ta/^(ta.c ta_talloc.c ta_utils.c)\
+ `{awk -f sources.awk 'sources=sources.txt' config.h}\
+)
+checkstatus
+
+exe mpv -d $"deps $srcs '$builddir'/^(\
+ media/ffmpeg/^(\
+ libavformat.a\
+ libavfilter.a\
+ libavcodec.a\
+ libavdevice.a\
+ libavutil.a\
+ libswresample.a\
+ libswscale.a\
+ )\
+ desktop/libdrm/libdrm.a\
+ media/alsa-lib/libasound.a\
+ core/libressl/libssl.a\
+ core/libressl/libcrypto.a\
+ core/openbsd/libbsd.a\
+ core/zlib/libz.a\
+)
+file bin/mpv '$outdir'/mpv 755
+file share/man/man1/mpv.1 '$srcdir'/DOCS/man/mpv.1 644
+
+gen_inputs='$dir'/^(sources.awk sources.txt config.h)
+fetch git
diff --git a/media/mpv/gensources.awk b/media/mpv/gensources.awk
new file mode 100644
index 00000000..f33c00df
--- /dev/null
+++ b/media/mpv/gensources.awk
@@ -0,0 +1,12 @@
+# usage: awk -f gensources.awk src/wscript_build.py >sources.txt
+
+BEGIN {
+ FS = "\""
+}
+
+/ +\(.*\),$/ {
+ if (NF == 3)
+ print $2
+ else if (NF == 5)
+ print $2, $4
+}
diff --git a/media/mpv/patch/0001-Include-poll.h-instead-of-sys-poll.h.patch b/media/mpv/patch/0001-Include-poll.h-instead-of-sys-poll.h.patch
new file mode 100644
index 00000000..701a2e06
--- /dev/null
+++ b/media/mpv/patch/0001-Include-poll.h-instead-of-sys-poll.h.patch
@@ -0,0 +1,43 @@
+From 34b600373bb9cd251e6e28c2732d43249f8f86d5 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sat, 2 Jul 2016 17:11:20 -0700
+Subject: [PATCH] Include poll.h instead of sys/poll.h
+
+---
+ video/out/drm_common.c | 2 +-
+ video/out/vo_drm.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/video/out/drm_common.c b/video/out/drm_common.c
+index a39db93..4ec2edc 100644
+--- a/video/out/drm_common.c
++++ b/video/out/drm_common.c
+@@ -16,9 +16,9 @@
+ */
+
+ #include <errno.h>
++#include <poll.h>
+ #include <signal.h>
+ #include <sys/ioctl.h>
+-#include <sys/poll.h>
+ #include <sys/vt.h>
+ #include <unistd.h>
+
+diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c
+index 5a7c613..b7c571d 100644
+--- a/video/out/vo_drm.c
++++ b/video/out/vo_drm.c
+@@ -18,9 +18,9 @@
+ #include <assert.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <poll.h>
+ #include <stdbool.h>
+ #include <sys/mman.h>
+-#include <sys/poll.h>
+ #include <unistd.h>
+
+ #include <libswscale/swscale.h>
+--
+2.9.0
+
diff --git a/media/mpv/patch/0002-Add-generated-ebml-sources.patch b/media/mpv/patch/0002-Add-generated-ebml-sources.patch
new file mode 100644
index 00000000..9d6c30a0
--- /dev/null
+++ b/media/mpv/patch/0002-Add-generated-ebml-sources.patch
@@ -0,0 +1,978 @@
+From c2e0ea2e238021df4cbe6672c2babf35d09f0ea9 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sat, 2 Jul 2016 17:32:27 -0700
+Subject: [PATCH] Add generated ebml sources
+
+These require perl to generate.
+---
+ demux/ebml_defs.c | 448 +++++++++++++++++++++++++++++++++++++++++++++++
+ demux/ebml_types.h | 502 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 950 insertions(+)
+ create mode 100644 demux/ebml_defs.c
+ create mode 100644 demux/ebml_types.h
+
+diff --git a/demux/ebml_defs.c b/demux/ebml_defs.c
+new file mode 100644
+index 0000000..230c184
+--- /dev/null
++++ b/demux/ebml_defs.c
+@@ -0,0 +1,448 @@
++/* Generated by TOOLS/matroska.pl, do not edit manually */
++
++
++E("EBMLVersion", ebml_version, EBML_TYPE_UINT)
++
++E("EBMLReadVersion", ebml_read_version, EBML_TYPE_UINT)
++
++E("EBMLMaxIDLength", ebml_max_id_length, EBML_TYPE_UINT)
++
++E("EBMLMaxSizeLength", ebml_max_size_length, EBML_TYPE_UINT)
++
++E("DocType", doc_type, EBML_TYPE_STR)
++
++E("DocTypeVersion", doc_type_version, EBML_TYPE_UINT)
++
++E("DocTypeReadVersion", doc_type_read_version, EBML_TYPE_UINT)
++
++#define N ebml
++E_S("EBML", 7)
++F(EBML_ID_DOCTYPE, doc_type, 0)
++F(EBML_ID_DOCTYPEREADVERSION, doc_type_read_version, 0)
++F(EBML_ID_DOCTYPEVERSION, doc_type_version, 0)
++F(EBML_ID_EBMLMAXIDLENGTH, ebml_max_id_length, 0)
++F(EBML_ID_EBMLMAXSIZELENGTH, ebml_max_size_length, 0)
++F(EBML_ID_EBMLREADVERSION, ebml_read_version, 0)
++F(EBML_ID_EBMLVERSION, ebml_version, 0)
++}};
++#undef N
++
++E("CRC32", crc32, EBML_TYPE_BINARY)
++
++E("Void", void, EBML_TYPE_BINARY)
++
++E("SeekID", seek_id, EBML_TYPE_EBML_ID)
++
++E("SeekPosition", seek_position, EBML_TYPE_UINT)
++
++#define N seek
++E_S("Seek", 2)
++F(MATROSKA_ID_SEEKID, seek_id, 0)
++F(MATROSKA_ID_SEEKPOSITION, seek_position, 0)
++}};
++#undef N
++
++#define N seek_head
++E_S("SeekHead", 1)
++F(MATROSKA_ID_SEEK, seek, 1)
++}};
++#undef N
++
++E("SegmentUID", segment_uid, EBML_TYPE_BINARY)
++
++E("PrevUID", prev_uid, EBML_TYPE_BINARY)
++
++E("NextUID", next_uid, EBML_TYPE_BINARY)
++
++E("TimecodeScale", timecode_scale, EBML_TYPE_UINT)
++
++E("DateUTC", date_utc, EBML_TYPE_SINT)
++
++E("Title", title, EBML_TYPE_STR)
++
++E("MuxingApp", muxing_app, EBML_TYPE_STR)
++
++E("WritingApp", writing_app, EBML_TYPE_STR)
++
++E("Duration", duration, EBML_TYPE_FLOAT)
++
++#define N info
++E_S("Info", 9)
++F(MATROSKA_ID_DATEUTC, date_utc, 0)
++F(MATROSKA_ID_DURATION, duration, 0)
++F(MATROSKA_ID_MUXINGAPP, muxing_app, 0)
++F(MATROSKA_ID_NEXTUID, next_uid, 0)
++F(MATROSKA_ID_PREVUID, prev_uid, 0)
++F(MATROSKA_ID_SEGMENTUID, segment_uid, 0)
++F(MATROSKA_ID_TIMECODESCALE, timecode_scale, 0)
++F(MATROSKA_ID_TITLE, title, 0)
++F(MATROSKA_ID_WRITINGAPP, writing_app, 0)
++}};
++#undef N
++
++E("Timecode", timecode, EBML_TYPE_UINT)
++
++E("Block", block, EBML_TYPE_BINARY)
++
++E("BlockDuration", block_duration, EBML_TYPE_UINT)
++
++E("ReferenceBlock", reference_block, EBML_TYPE_SINT)
++
++E("DiscardPadding", discard_padding, EBML_TYPE_SINT)
++
++#define N block_group
++E_S("BlockGroup", 4)
++F(MATROSKA_ID_BLOCK, block, 0)
++F(MATROSKA_ID_BLOCKDURATION, block_duration, 0)
++F(MATROSKA_ID_DISCARDPADDING, discard_padding, 0)
++F(MATROSKA_ID_REFERENCEBLOCK, reference_block, 1)
++}};
++#undef N
++
++E("SimpleBlock", simple_block, EBML_TYPE_BINARY)
++
++#define N cluster
++E_S("Cluster", 3)
++F(MATROSKA_ID_BLOCKGROUP, block_group, 1)
++F(MATROSKA_ID_SIMPLEBLOCK, simple_block, 1)
++F(MATROSKA_ID_TIMECODE, timecode, 0)
++}};
++#undef N
++
++E("TrackNumber", track_number, EBML_TYPE_UINT)
++
++E("TrackUID", track_uid, EBML_TYPE_UINT)
++
++E("TrackType", track_type, EBML_TYPE_UINT)
++
++E("FlagEnabled", flag_enabled, EBML_TYPE_UINT)
++
++E("FlagDefault", flag_default, EBML_TYPE_UINT)
++
++E("FlagForced", flag_forced, EBML_TYPE_UINT)
++
++E("FlagLacing", flag_lacing, EBML_TYPE_UINT)
++
++E("MinCache", min_cache, EBML_TYPE_UINT)
++
++E("MaxCache", max_cache, EBML_TYPE_UINT)
++
++E("DefaultDuration", default_duration, EBML_TYPE_UINT)
++
++E("TrackTimecodeScale", track_timecode_scale, EBML_TYPE_FLOAT)
++
++E("MaxBlockAdditionID", max_block_addition_id, EBML_TYPE_UINT)
++
++E("Name", name, EBML_TYPE_STR)
++
++E("Language", language, EBML_TYPE_STR)
++
++E("CodecID", codec_id, EBML_TYPE_STR)
++
++E("CodecPrivate", codec_private, EBML_TYPE_BINARY)
++
++E("CodecName", codec_name, EBML_TYPE_STR)
++
++E("CodecDecodeAll", codec_decode_all, EBML_TYPE_UINT)
++
++E("CodecDelay", codec_delay, EBML_TYPE_UINT)
++
++E("SeekPreRoll", seek_pre_roll, EBML_TYPE_UINT)
++
++E("FlagInterlaced", flag_interlaced, EBML_TYPE_UINT)
++
++E("PixelWidth", pixel_width, EBML_TYPE_UINT)
++
++E("PixelHeight", pixel_height, EBML_TYPE_UINT)
++
++E("DisplayWidth", display_width, EBML_TYPE_UINT)
++
++E("DisplayHeight", display_height, EBML_TYPE_UINT)
++
++E("DisplayUnit", display_unit, EBML_TYPE_UINT)
++
++E("FrameRate", frame_rate, EBML_TYPE_FLOAT)
++
++E("ColourSpace", colour_space, EBML_TYPE_BINARY)
++
++E("StereoMode", stereo_mode, EBML_TYPE_UINT)
++
++#define N video
++E_S("Video", 9)
++F(MATROSKA_ID_COLOURSPACE, colour_space, 0)
++F(MATROSKA_ID_DISPLAYHEIGHT, display_height, 0)
++F(MATROSKA_ID_DISPLAYUNIT, display_unit, 0)
++F(MATROSKA_ID_DISPLAYWIDTH, display_width, 0)
++F(MATROSKA_ID_FLAGINTERLACED, flag_interlaced, 0)
++F(MATROSKA_ID_FRAMERATE, frame_rate, 0)
++F(MATROSKA_ID_PIXELHEIGHT, pixel_height, 0)
++F(MATROSKA_ID_PIXELWIDTH, pixel_width, 0)
++F(MATROSKA_ID_STEREOMODE, stereo_mode, 0)
++}};
++#undef N
++
++E("SamplingFrequency", sampling_frequency, EBML_TYPE_FLOAT)
++
++E("OutputSamplingFrequency", output_sampling_frequency, EBML_TYPE_FLOAT)
++
++E("Channels", channels, EBML_TYPE_UINT)
++
++E("BitDepth", bit_depth, EBML_TYPE_UINT)
++
++#define N audio
++E_S("Audio", 4)
++F(MATROSKA_ID_BITDEPTH, bit_depth, 0)
++F(MATROSKA_ID_CHANNELS, channels, 0)
++F(MATROSKA_ID_OUTPUTSAMPLINGFREQUENCY, output_sampling_frequency, 0)
++F(MATROSKA_ID_SAMPLINGFREQUENCY, sampling_frequency, 0)
++}};
++#undef N
++
++E("ContentEncodingOrder", content_encoding_order, EBML_TYPE_UINT)
++
++E("ContentEncodingScope", content_encoding_scope, EBML_TYPE_UINT)
++
++E("ContentEncodingType", content_encoding_type, EBML_TYPE_UINT)
++
++E("ContentCompAlgo", content_comp_algo, EBML_TYPE_UINT)
++
++E("ContentCompSettings", content_comp_settings, EBML_TYPE_BINARY)
++
++#define N content_compression
++E_S("ContentCompression", 2)
++F(MATROSKA_ID_CONTENTCOMPALGO, content_comp_algo, 0)
++F(MATROSKA_ID_CONTENTCOMPSETTINGS, content_comp_settings, 0)
++}};
++#undef N
++
++#define N content_encoding
++E_S("ContentEncoding", 4)
++F(MATROSKA_ID_CONTENTCOMPRESSION, content_compression, 0)
++F(MATROSKA_ID_CONTENTENCODINGORDER, content_encoding_order, 0)
++F(MATROSKA_ID_CONTENTENCODINGSCOPE, content_encoding_scope, 0)
++F(MATROSKA_ID_CONTENTENCODINGTYPE, content_encoding_type, 0)
++}};
++#undef N
++
++#define N content_encodings
++E_S("ContentEncodings", 1)
++F(MATROSKA_ID_CONTENTENCODING, content_encoding, 1)
++}};
++#undef N
++
++#define N track_entry
++E_S("TrackEntry", 23)
++F(MATROSKA_ID_AUDIO, audio, 0)
++F(MATROSKA_ID_CODECDECODEALL, codec_decode_all, 0)
++F(MATROSKA_ID_CODECDELAY, codec_delay, 0)
++F(MATROSKA_ID_CODECID, codec_id, 0)
++F(MATROSKA_ID_CODECNAME, codec_name, 0)
++F(MATROSKA_ID_CODECPRIVATE, codec_private, 0)
++F(MATROSKA_ID_CONTENTENCODINGS, content_encodings, 0)
++F(MATROSKA_ID_DEFAULTDURATION, default_duration, 0)
++F(MATROSKA_ID_FLAGDEFAULT, flag_default, 0)
++F(MATROSKA_ID_FLAGENABLED, flag_enabled, 0)
++F(MATROSKA_ID_FLAGFORCED, flag_forced, 0)
++F(MATROSKA_ID_FLAGLACING, flag_lacing, 0)
++F(MATROSKA_ID_LANGUAGE, language, 0)
++F(MATROSKA_ID_MAXBLOCKADDITIONID, max_block_addition_id, 0)
++F(MATROSKA_ID_MAXCACHE, max_cache, 0)
++F(MATROSKA_ID_MINCACHE, min_cache, 0)
++F(MATROSKA_ID_NAME, name, 0)
++F(MATROSKA_ID_SEEKPREROLL, seek_pre_roll, 0)
++F(MATROSKA_ID_TRACKNUMBER, track_number, 0)
++F(MATROSKA_ID_TRACKTIMECODESCALE, track_timecode_scale, 0)
++F(MATROSKA_ID_TRACKTYPE, track_type, 0)
++F(MATROSKA_ID_TRACKUID, track_uid, 0)
++F(MATROSKA_ID_VIDEO, video, 0)
++}};
++#undef N
++
++#define N tracks
++E_S("Tracks", 1)
++F(MATROSKA_ID_TRACKENTRY, track_entry, 1)
++}};
++#undef N
++
++E("CueTime", cue_time, EBML_TYPE_UINT)
++
++E("CueTrack", cue_track, EBML_TYPE_UINT)
++
++E("CueClusterPosition", cue_cluster_position, EBML_TYPE_UINT)
++
++E("CueRelativePosition", cue_relative_position, EBML_TYPE_UINT)
++
++E("CueDuration", cue_duration, EBML_TYPE_UINT)
++
++#define N cue_track_positions
++E_S("CueTrackPositions", 4)
++F(MATROSKA_ID_CUECLUSTERPOSITION, cue_cluster_position, 0)
++F(MATROSKA_ID_CUEDURATION, cue_duration, 0)
++F(MATROSKA_ID_CUERELATIVEPOSITION, cue_relative_position, 0)
++F(MATROSKA_ID_CUETRACK, cue_track, 0)
++}};
++#undef N
++
++#define N cue_point
++E_S("CuePoint", 2)
++F(MATROSKA_ID_CUETIME, cue_time, 0)
++F(MATROSKA_ID_CUETRACKPOSITIONS, cue_track_positions, 1)
++}};
++#undef N
++
++#define N cues
++E_S("Cues", 1)
++F(MATROSKA_ID_CUEPOINT, cue_point, 1)
++}};
++#undef N
++
++E("FileDescription", file_description, EBML_TYPE_STR)
++
++E("FileName", file_name, EBML_TYPE_STR)
++
++E("FileMimeType", file_mime_type, EBML_TYPE_STR)
++
++E("FileData", file_data, EBML_TYPE_BINARY)
++
++E("FileUID", file_uid, EBML_TYPE_UINT)
++
++#define N attached_file
++E_S("AttachedFile", 5)
++F(MATROSKA_ID_FILEDATA, file_data, 0)
++F(MATROSKA_ID_FILEDESCRIPTION, file_description, 0)
++F(MATROSKA_ID_FILEMIMETYPE, file_mime_type, 0)
++F(MATROSKA_ID_FILENAME, file_name, 0)
++F(MATROSKA_ID_FILEUID, file_uid, 0)
++}};
++#undef N
++
++#define N attachments
++E_S("Attachments", 1)
++F(MATROSKA_ID_ATTACHEDFILE, attached_file, 1)
++}};
++#undef N
++
++E("EditionUID", edition_uid, EBML_TYPE_UINT)
++
++E("EditionFlagHidden", edition_flag_hidden, EBML_TYPE_UINT)
++
++E("EditionFlagDefault", edition_flag_default, EBML_TYPE_UINT)
++
++E("EditionFlagOrdered", edition_flag_ordered, EBML_TYPE_UINT)
++
++E("ChapterUID", chapter_uid, EBML_TYPE_UINT)
++
++E("ChapterTimeStart", chapter_time_start, EBML_TYPE_UINT)
++
++E("ChapterTimeEnd", chapter_time_end, EBML_TYPE_UINT)
++
++E("ChapterFlagHidden", chapter_flag_hidden, EBML_TYPE_UINT)
++
++E("ChapterFlagEnabled", chapter_flag_enabled, EBML_TYPE_UINT)
++
++E("ChapterSegmentUID", chapter_segment_uid, EBML_TYPE_BINARY)
++
++E("ChapterSegmentEditionUID", chapter_segment_edition_uid, EBML_TYPE_UINT)
++
++E("ChapString", chap_string, EBML_TYPE_STR)
++
++E("ChapLanguage", chap_language, EBML_TYPE_STR)
++
++E("ChapCountry", chap_country, EBML_TYPE_STR)
++
++#define N chapter_display
++E_S("ChapterDisplay", 3)
++F(MATROSKA_ID_CHAPCOUNTRY, chap_country, 1)
++F(MATROSKA_ID_CHAPLANGUAGE, chap_language, 1)
++F(MATROSKA_ID_CHAPSTRING, chap_string, 0)
++}};
++#undef N
++
++#define N chapter_atom
++E_S("ChapterAtom", 8)
++F(MATROSKA_ID_CHAPTERDISPLAY, chapter_display, 1)
++F(MATROSKA_ID_CHAPTERFLAGENABLED, chapter_flag_enabled, 0)
++F(MATROSKA_ID_CHAPTERFLAGHIDDEN, chapter_flag_hidden, 0)
++F(MATROSKA_ID_CHAPTERSEGMENTEDITIONUID, chapter_segment_edition_uid, 0)
++F(MATROSKA_ID_CHAPTERSEGMENTUID, chapter_segment_uid, 0)
++F(MATROSKA_ID_CHAPTERTIMEEND, chapter_time_end, 0)
++F(MATROSKA_ID_CHAPTERTIMESTART, chapter_time_start, 0)
++F(MATROSKA_ID_CHAPTERUID, chapter_uid, 0)
++}};
++#undef N
++
++#define N edition_entry
++E_S("EditionEntry", 5)
++F(MATROSKA_ID_CHAPTERATOM, chapter_atom, 1)
++F(MATROSKA_ID_EDITIONFLAGDEFAULT, edition_flag_default, 0)
++F(MATROSKA_ID_EDITIONFLAGHIDDEN, edition_flag_hidden, 0)
++F(MATROSKA_ID_EDITIONFLAGORDERED, edition_flag_ordered, 0)
++F(MATROSKA_ID_EDITIONUID, edition_uid, 0)
++}};
++#undef N
++
++#define N chapters
++E_S("Chapters", 1)
++F(MATROSKA_ID_EDITIONENTRY, edition_entry, 1)
++}};
++#undef N
++
++E("TargetTypeValue", target_type_value, EBML_TYPE_UINT)
++
++E("TargetTrackUID", target_track_uid, EBML_TYPE_UINT)
++
++E("TargetEditionUID", target_edition_uid, EBML_TYPE_UINT)
++
++E("TargetChapterUID", target_chapter_uid, EBML_TYPE_UINT)
++
++E("TargetAttachmentUID", target_attachment_uid, EBML_TYPE_UINT)
++
++#define N targets
++E_S("Targets", 5)
++F(MATROSKA_ID_TARGETATTACHMENTUID, target_attachment_uid, 0)
++F(MATROSKA_ID_TARGETCHAPTERUID, target_chapter_uid, 0)
++F(MATROSKA_ID_TARGETEDITIONUID, target_edition_uid, 0)
++F(MATROSKA_ID_TARGETTRACKUID, target_track_uid, 0)
++F(MATROSKA_ID_TARGETTYPEVALUE, target_type_value, 0)
++}};
++#undef N
++
++E("TagName", tag_name, EBML_TYPE_STR)
++
++E("TagLanguage", tag_language, EBML_TYPE_STR)
++
++E("TagString", tag_string, EBML_TYPE_STR)
++
++#define N simple_tag
++E_S("SimpleTag", 3)
++F(MATROSKA_ID_TAGLANGUAGE, tag_language, 0)
++F(MATROSKA_ID_TAGNAME, tag_name, 0)
++F(MATROSKA_ID_TAGSTRING, tag_string, 0)
++}};
++#undef N
++
++#define N tag
++E_S("Tag", 2)
++F(MATROSKA_ID_SIMPLETAG, simple_tag, 1)
++F(MATROSKA_ID_TARGETS, targets, 0)
++}};
++#undef N
++
++#define N tags
++E_S("Tags", 1)
++F(MATROSKA_ID_TAG, tag, 1)
++}};
++#undef N
++
++#define N segment
++E_S("Segment", 8)
++F(MATROSKA_ID_ATTACHMENTS, attachments, 0)
++F(MATROSKA_ID_CHAPTERS, chapters, 0)
++F(MATROSKA_ID_CLUSTER, cluster, 1)
++F(MATROSKA_ID_CUES, cues, 0)
++F(MATROSKA_ID_INFO, info, 1)
++F(MATROSKA_ID_SEEKHEAD, seek_head, 1)
++F(MATROSKA_ID_TAGS, tags, 1)
++F(MATROSKA_ID_TRACKS, tracks, 1)
++}};
++#undef N
+diff --git a/demux/ebml_types.h b/demux/ebml_types.h
+new file mode 100644
+index 0000000..3739ec5
+--- /dev/null
++++ b/demux/ebml_types.h
+@@ -0,0 +1,502 @@
++/* Generated by TOOLS/matroska.pl, do not edit manually */
++
++#define EBML_ID_EBMLVERSION 0x4286
++#define EBML_ID_EBMLREADVERSION 0x42f7
++#define EBML_ID_EBMLMAXIDLENGTH 0x42f2
++#define EBML_ID_EBMLMAXSIZELENGTH 0x42f3
++#define EBML_ID_DOCTYPE 0x4282
++#define EBML_ID_DOCTYPEVERSION 0x4287
++#define EBML_ID_DOCTYPEREADVERSION 0x4285
++#define EBML_ID_EBML 0x1a45dfa3
++#define EBML_ID_CRC32 0xbf
++#define EBML_ID_VOID 0xec
++#define MATROSKA_ID_SEEKID 0x53ab
++#define MATROSKA_ID_SEEKPOSITION 0x53ac
++#define MATROSKA_ID_SEEK 0x4dbb
++#define MATROSKA_ID_SEEKHEAD 0x114d9b74
++#define MATROSKA_ID_SEGMENTUID 0x73a4
++#define MATROSKA_ID_PREVUID 0x3cb923
++#define MATROSKA_ID_NEXTUID 0x3eb923
++#define MATROSKA_ID_TIMECODESCALE 0x2ad7b1
++#define MATROSKA_ID_DATEUTC 0x4461
++#define MATROSKA_ID_TITLE 0x7ba9
++#define MATROSKA_ID_MUXINGAPP 0x4d80
++#define MATROSKA_ID_WRITINGAPP 0x5741
++#define MATROSKA_ID_DURATION 0x4489
++#define MATROSKA_ID_INFO 0x1549a966
++#define MATROSKA_ID_TIMECODE 0xe7
++#define MATROSKA_ID_BLOCK 0xa1
++#define MATROSKA_ID_BLOCKDURATION 0x9b
++#define MATROSKA_ID_REFERENCEBLOCK 0xfb
++#define MATROSKA_ID_DISCARDPADDING 0x75A2
++#define MATROSKA_ID_BLOCKGROUP 0xa0
++#define MATROSKA_ID_SIMPLEBLOCK 0xa3
++#define MATROSKA_ID_CLUSTER 0x1f43b675
++#define MATROSKA_ID_TRACKNUMBER 0xd7
++#define MATROSKA_ID_TRACKUID 0x73c5
++#define MATROSKA_ID_TRACKTYPE 0x83
++#define MATROSKA_ID_FLAGENABLED 0xb9
++#define MATROSKA_ID_FLAGDEFAULT 0x88
++#define MATROSKA_ID_FLAGFORCED 0x55aa
++#define MATROSKA_ID_FLAGLACING 0x9c
++#define MATROSKA_ID_MINCACHE 0x6de7
++#define MATROSKA_ID_MAXCACHE 0x6df8
++#define MATROSKA_ID_DEFAULTDURATION 0x23e383
++#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314f
++#define MATROSKA_ID_MAXBLOCKADDITIONID 0x55ee
++#define MATROSKA_ID_NAME 0x536e
++#define MATROSKA_ID_LANGUAGE 0x22b59c
++#define MATROSKA_ID_CODECID 0x86
++#define MATROSKA_ID_CODECPRIVATE 0x63a2
++#define MATROSKA_ID_CODECNAME 0x258688
++#define MATROSKA_ID_CODECDECODEALL 0xaa
++#define MATROSKA_ID_CODECDELAY 0x56AA
++#define MATROSKA_ID_SEEKPREROLL 0x56BB
++#define MATROSKA_ID_FLAGINTERLACED 0x9a
++#define MATROSKA_ID_PIXELWIDTH 0xb0
++#define MATROSKA_ID_PIXELHEIGHT 0xba
++#define MATROSKA_ID_DISPLAYWIDTH 0x54b0
++#define MATROSKA_ID_DISPLAYHEIGHT 0x54ba
++#define MATROSKA_ID_DISPLAYUNIT 0x54b2
++#define MATROSKA_ID_FRAMERATE 0x2383e3
++#define MATROSKA_ID_COLOURSPACE 0x2eb524
++#define MATROSKA_ID_STEREOMODE 0x53b8
++#define MATROSKA_ID_VIDEO 0xe0
++#define MATROSKA_ID_SAMPLINGFREQUENCY 0xb5
++#define MATROSKA_ID_OUTPUTSAMPLINGFREQUENCY 0x78b5
++#define MATROSKA_ID_CHANNELS 0x9f
++#define MATROSKA_ID_BITDEPTH 0x6264
++#define MATROSKA_ID_AUDIO 0xe1
++#define MATROSKA_ID_CONTENTENCODINGORDER 0x5031
++#define MATROSKA_ID_CONTENTENCODINGSCOPE 0x5032
++#define MATROSKA_ID_CONTENTENCODINGTYPE 0x5033
++#define MATROSKA_ID_CONTENTCOMPALGO 0x4254
++#define MATROSKA_ID_CONTENTCOMPSETTINGS 0x4255
++#define MATROSKA_ID_CONTENTCOMPRESSION 0x5034
++#define MATROSKA_ID_CONTENTENCODING 0x6240
++#define MATROSKA_ID_CONTENTENCODINGS 0x6d80
++#define MATROSKA_ID_TRACKENTRY 0xae
++#define MATROSKA_ID_TRACKS 0x1654ae6b
++#define MATROSKA_ID_CUETIME 0xb3
++#define MATROSKA_ID_CUETRACK 0xf7
++#define MATROSKA_ID_CUECLUSTERPOSITION 0xf1
++#define MATROSKA_ID_CUERELATIVEPOSITION 0xf0
++#define MATROSKA_ID_CUEDURATION 0xb2
++#define MATROSKA_ID_CUETRACKPOSITIONS 0xb7
++#define MATROSKA_ID_CUEPOINT 0xbb
++#define MATROSKA_ID_CUES 0x1c53bb6b
++#define MATROSKA_ID_FILEDESCRIPTION 0x467e
++#define MATROSKA_ID_FILENAME 0x466e
++#define MATROSKA_ID_FILEMIMETYPE 0x4660
++#define MATROSKA_ID_FILEDATA 0x465c
++#define MATROSKA_ID_FILEUID 0x46ae
++#define MATROSKA_ID_ATTACHEDFILE 0x61a7
++#define MATROSKA_ID_ATTACHMENTS 0x1941a469
++#define MATROSKA_ID_EDITIONUID 0x45bc
++#define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45bd
++#define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45db
++#define MATROSKA_ID_EDITIONFLAGORDERED 0x45dd
++#define MATROSKA_ID_CHAPTERUID 0x73c4
++#define MATROSKA_ID_CHAPTERTIMESTART 0x91
++#define MATROSKA_ID_CHAPTERTIMEEND 0x92
++#define MATROSKA_ID_CHAPTERFLAGHIDDEN 0x98
++#define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598
++#define MATROSKA_ID_CHAPTERSEGMENTUID 0x6e67
++#define MATROSKA_ID_CHAPTERSEGMENTEDITIONUID 0x6ebc
++#define MATROSKA_ID_CHAPSTRING 0x85
++#define MATROSKA_ID_CHAPLANGUAGE 0x437c
++#define MATROSKA_ID_CHAPCOUNTRY 0x437e
++#define MATROSKA_ID_CHAPTERDISPLAY 0x80
++#define MATROSKA_ID_CHAPTERATOM 0xb6
++#define MATROSKA_ID_EDITIONENTRY 0x45b9
++#define MATROSKA_ID_CHAPTERS 0x1043a770
++#define MATROSKA_ID_TARGETTYPEVALUE 0x68ca
++#define MATROSKA_ID_TARGETTRACKUID 0x63c5
++#define MATROSKA_ID_TARGETEDITIONUID 0x63c9
++#define MATROSKA_ID_TARGETCHAPTERUID 0x63c4
++#define MATROSKA_ID_TARGETATTACHMENTUID 0x63c6
++#define MATROSKA_ID_TARGETS 0x63c0
++#define MATROSKA_ID_TAGNAME 0x45a3
++#define MATROSKA_ID_TAGLANGUAGE 0x447a
++#define MATROSKA_ID_TAGSTRING 0x4487
++#define MATROSKA_ID_SIMPLETAG 0x67c8
++#define MATROSKA_ID_TAG 0x7373
++#define MATROSKA_ID_TAGS 0x1254c367
++#define MATROSKA_ID_SEGMENT 0x18538067
++
++
++struct ebml_ebml {
++ char * doc_type;
++ uint64_t doc_type_read_version;
++ uint64_t doc_type_version;
++ uint64_t ebml_max_id_length;
++ uint64_t ebml_max_size_length;
++ uint64_t ebml_read_version;
++ uint64_t ebml_version;
++
++ int n_doc_type_version;
++ int n_doc_type_read_version;
++ int n_ebml_version;
++ int n_ebml_max_id_length;
++ int n_ebml_max_size_length;
++ int n_doc_type;
++ int n_ebml_read_version;
++};
++
++struct ebml_seek {
++ uint32_t seek_id;
++ uint64_t seek_position;
++
++ int n_seek_position;
++ int n_seek_id;
++};
++
++struct ebml_seek_head {
++ struct ebml_seek *seek;
++
++ int n_seek;
++};
++
++struct ebml_info {
++ int64_t date_utc;
++ double duration;
++ char * muxing_app;
++ struct bstr next_uid;
++ struct bstr prev_uid;
++ struct bstr segment_uid;
++ uint64_t timecode_scale;
++ char * title;
++ char * writing_app;
++
++ int n_segment_uid;
++ int n_prev_uid;
++ int n_next_uid;
++ int n_timecode_scale;
++ int n_date_utc;
++ int n_title;
++ int n_muxing_app;
++ int n_writing_app;
++ int n_duration;
++};
++
++struct ebml_block_group {
++ struct bstr block;
++ uint64_t block_duration;
++ int64_t discard_padding;
++ int64_t *reference_block;
++
++ int n_block;
++ int n_block_duration;
++ int n_reference_block;
++ int n_discard_padding;
++};
++
++struct ebml_cluster {
++ struct ebml_block_group *block_group;
++ struct bstr *simple_block;
++ uint64_t timecode;
++
++ int n_timecode;
++ int n_block_group;
++ int n_simple_block;
++};
++
++struct ebml_video {
++ struct bstr colour_space;
++ uint64_t display_height;
++ uint64_t display_unit;
++ uint64_t display_width;
++ uint64_t flag_interlaced;
++ double frame_rate;
++ uint64_t pixel_height;
++ uint64_t pixel_width;
++ uint64_t stereo_mode;
++
++ int n_flag_interlaced;
++ int n_pixel_width;
++ int n_pixel_height;
++ int n_display_width;
++ int n_display_height;
++ int n_display_unit;
++ int n_frame_rate;
++ int n_colour_space;
++ int n_stereo_mode;
++};
++
++struct ebml_audio {
++ uint64_t bit_depth;
++ uint64_t channels;
++ double output_sampling_frequency;
++ double sampling_frequency;
++
++ int n_sampling_frequency;
++ int n_output_sampling_frequency;
++ int n_channels;
++ int n_bit_depth;
++};
++
++struct ebml_content_compression {
++ uint64_t content_comp_algo;
++ struct bstr content_comp_settings;
++
++ int n_content_comp_algo;
++ int n_content_comp_settings;
++};
++
++struct ebml_content_encoding {
++ struct ebml_content_compression content_compression;
++ uint64_t content_encoding_order;
++ uint64_t content_encoding_scope;
++ uint64_t content_encoding_type;
++
++ int n_content_encoding_order;
++ int n_content_encoding_scope;
++ int n_content_encoding_type;
++ int n_content_compression;
++};
++
++struct ebml_content_encodings {
++ struct ebml_content_encoding *content_encoding;
++
++ int n_content_encoding;
++};
++
++struct ebml_track_entry {
++ struct ebml_audio audio;
++ uint64_t codec_decode_all;
++ uint64_t codec_delay;
++ char * codec_id;
++ char * codec_name;
++ struct bstr codec_private;
++ struct ebml_content_encodings content_encodings;
++ uint64_t default_duration;
++ uint64_t flag_default;
++ uint64_t flag_enabled;
++ uint64_t flag_forced;
++ uint64_t flag_lacing;
++ char * language;
++ uint64_t max_block_addition_id;
++ uint64_t max_cache;
++ uint64_t min_cache;
++ char * name;
++ uint64_t seek_pre_roll;
++ uint64_t track_number;
++ double track_timecode_scale;
++ uint64_t track_type;
++ uint64_t track_uid;
++ struct ebml_video video;
++
++ int n_track_number;
++ int n_track_uid;
++ int n_track_type;
++ int n_flag_enabled;
++ int n_flag_default;
++ int n_flag_forced;
++ int n_flag_lacing;
++ int n_min_cache;
++ int n_max_cache;
++ int n_default_duration;
++ int n_track_timecode_scale;
++ int n_max_block_addition_id;
++ int n_name;
++ int n_language;
++ int n_codec_id;
++ int n_codec_private;
++ int n_codec_name;
++ int n_codec_decode_all;
++ int n_codec_delay;
++ int n_seek_pre_roll;
++ int n_video;
++ int n_audio;
++ int n_content_encodings;
++};
++
++struct ebml_tracks {
++ struct ebml_track_entry *track_entry;
++
++ int n_track_entry;
++};
++
++struct ebml_cue_track_positions {
++ uint64_t cue_cluster_position;
++ uint64_t cue_duration;
++ uint64_t cue_relative_position;
++ uint64_t cue_track;
++
++ int n_cue_track;
++ int n_cue_cluster_position;
++ int n_cue_relative_position;
++ int n_cue_duration;
++};
++
++struct ebml_cue_point {
++ uint64_t cue_time;
++ struct ebml_cue_track_positions *cue_track_positions;
++
++ int n_cue_time;
++ int n_cue_track_positions;
++};
++
++struct ebml_cues {
++ struct ebml_cue_point *cue_point;
++
++ int n_cue_point;
++};
++
++struct ebml_attached_file {
++ struct bstr file_data;
++ char * file_description;
++ char * file_mime_type;
++ char * file_name;
++ uint64_t file_uid;
++
++ int n_file_description;
++ int n_file_name;
++ int n_file_mime_type;
++ int n_file_data;
++ int n_file_uid;
++};
++
++struct ebml_attachments {
++ struct ebml_attached_file *attached_file;
++
++ int n_attached_file;
++};
++
++struct ebml_chapter_display {
++ char * *chap_country;
++ char * *chap_language;
++ char * chap_string;
++
++ int n_chap_string;
++ int n_chap_language;
++ int n_chap_country;
++};
++
++struct ebml_chapter_atom {
++ struct ebml_chapter_display *chapter_display;
++ uint64_t chapter_flag_enabled;
++ uint64_t chapter_flag_hidden;
++ uint64_t chapter_segment_edition_uid;
++ struct bstr chapter_segment_uid;
++ uint64_t chapter_time_end;
++ uint64_t chapter_time_start;
++ uint64_t chapter_uid;
++
++ int n_chapter_uid;
++ int n_chapter_time_start;
++ int n_chapter_time_end;
++ int n_chapter_flag_hidden;
++ int n_chapter_flag_enabled;
++ int n_chapter_segment_uid;
++ int n_chapter_segment_edition_uid;
++ int n_chapter_display;
++};
++
++struct ebml_edition_entry {
++ struct ebml_chapter_atom *chapter_atom;
++ uint64_t edition_flag_default;
++ uint64_t edition_flag_hidden;
++ uint64_t edition_flag_ordered;
++ uint64_t edition_uid;
++
++ int n_edition_uid;
++ int n_edition_flag_hidden;
++ int n_edition_flag_default;
++ int n_edition_flag_ordered;
++ int n_chapter_atom;
++};
++
++struct ebml_chapters {
++ struct ebml_edition_entry *edition_entry;
++
++ int n_edition_entry;
++};
++
++struct ebml_targets {
++ uint64_t target_attachment_uid;
++ uint64_t target_chapter_uid;
++ uint64_t target_edition_uid;
++ uint64_t target_track_uid;
++ uint64_t target_type_value;
++
++ int n_target_type_value;
++ int n_target_track_uid;
++ int n_target_edition_uid;
++ int n_target_chapter_uid;
++ int n_target_attachment_uid;
++};
++
++struct ebml_simple_tag {
++ char * tag_language;
++ char * tag_name;
++ char * tag_string;
++
++ int n_tag_name;
++ int n_tag_language;
++ int n_tag_string;
++};
++
++struct ebml_tag {
++ struct ebml_simple_tag *simple_tag;
++ struct ebml_targets targets;
++
++ int n_targets;
++ int n_simple_tag;
++};
++
++struct ebml_tags {
++ struct ebml_tag *tag;
++
++ int n_tag;
++};
++
++struct ebml_segment {
++ struct ebml_attachments attachments;
++ struct ebml_chapters chapters;
++ struct ebml_cluster *cluster;
++ struct ebml_cues cues;
++ struct ebml_info *info;
++ struct ebml_seek_head *seek_head;
++ struct ebml_tags *tags;
++ struct ebml_tracks *tracks;
++
++ int n_seek_head;
++ int n_info;
++ int n_cluster;
++ int n_tracks;
++ int n_cues;
++ int n_attachments;
++ int n_chapters;
++ int n_tags;
++};
++
++extern const struct ebml_elem_desc ebml_ebml_desc;
++extern const struct ebml_elem_desc ebml_seek_desc;
++extern const struct ebml_elem_desc ebml_seek_head_desc;
++extern const struct ebml_elem_desc ebml_info_desc;
++extern const struct ebml_elem_desc ebml_block_group_desc;
++extern const struct ebml_elem_desc ebml_cluster_desc;
++extern const struct ebml_elem_desc ebml_video_desc;
++extern const struct ebml_elem_desc ebml_audio_desc;
++extern const struct ebml_elem_desc ebml_content_compression_desc;
++extern const struct ebml_elem_desc ebml_content_encoding_desc;
++extern const struct ebml_elem_desc ebml_content_encodings_desc;
++extern const struct ebml_elem_desc ebml_track_entry_desc;
++extern const struct ebml_elem_desc ebml_tracks_desc;
++extern const struct ebml_elem_desc ebml_cue_track_positions_desc;
++extern const struct ebml_elem_desc ebml_cue_point_desc;
++extern const struct ebml_elem_desc ebml_cues_desc;
++extern const struct ebml_elem_desc ebml_attached_file_desc;
++extern const struct ebml_elem_desc ebml_attachments_desc;
++extern const struct ebml_elem_desc ebml_chapter_display_desc;
++extern const struct ebml_elem_desc ebml_chapter_atom_desc;
++extern const struct ebml_elem_desc ebml_edition_entry_desc;
++extern const struct ebml_elem_desc ebml_chapters_desc;
++extern const struct ebml_elem_desc ebml_targets_desc;
++extern const struct ebml_elem_desc ebml_simple_tag_desc;
++extern const struct ebml_elem_desc ebml_tag_desc;
++extern const struct ebml_elem_desc ebml_tags_desc;
++extern const struct ebml_elem_desc ebml_segment_desc;
++
++#define MAX_EBML_SUBELEMENTS 23
+--
+2.9.0
+
diff --git a/media/mpv/patch/0003-Add-generated-man-page.patch b/media/mpv/patch/0003-Add-generated-man-page.patch
new file mode 100644
index 00000000..ebcb925d
--- /dev/null
+++ b/media/mpv/patch/0003-Add-generated-man-page.patch
@@ -0,0 +1,13870 @@
+From 0cba8fec61ccc2b2a63cdd1f3c4ecd8c46c97e41 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sat, 2 Jul 2016 21:08:15 -0700
+Subject: [PATCH] Add generated man page
+
+This requires python and rst2man to generate.
+---
+ DOCS/man/mpv.1 | 13850 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 13850 insertions(+)
+ create mode 100644 DOCS/man/mpv.1
+
+diff --git a/DOCS/man/mpv.1 b/DOCS/man/mpv.1
+new file mode 100644
+index 0000000..a6a249c
+--- /dev/null
++++ b/DOCS/man/mpv.1
+@@ -0,0 +1,13850 @@
++.\" Man page generated from reStructuredText.
++.
++.TH MPV 1 "" "" "multimedia"
++.SH NAME
++mpv \- a media player
++.
++.nr rst2man-indent-level 0
++.
++.de1 rstReportMargin
++\\$1 \\n[an-margin]
++level \\n[rst2man-indent-level]
++level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
++-
++\\n[rst2man-indent0]
++\\n[rst2man-indent1]
++\\n[rst2man-indent2]
++..
++.de1 INDENT
++.\" .rstReportMargin pre:
++. RS \\$1
++. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
++. nr rst2man-indent-level +1
++.\" .rstReportMargin post:
++..
++.de UNINDENT
++. RE
++.\" indent \\n[an-margin]
++.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
++.nr rst2man-indent-level -1
++.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
++.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
++..
++.SH SYNOPSIS
++.nf
++\fBmpv\fP [options] [file|URL|PLAYLIST|\-]
++\fBmpv\fP [options] files
++.fi
++.sp
++.SH DESCRIPTION
++.sp
++\fBmpv\fP is a media player based on MPlayer and mplayer2. It supports a wide variety of video
++file formats, audio and video codecs, and subtitle types. Special input URL
++types are available to read input from a variety of sources other than disk
++files. Depending on platform, a variety of different video and audio output
++methods are supported.
++.sp
++Usage examples to get you started quickly can be found at the end of this man
++page.
++.SH INTERACTIVE CONTROL
++.sp
++mpv has a fully configurable, command\-driven control layer which allows you
++to control mpv using keyboard, mouse, or remote control (there is no
++LIRC support \- configure remotes as input devices instead).
++.sp
++See the \fB\-\-input\-\fP options for ways to customize it.
++.sp
++The following listings are not necessarily complete. See \fBetc/input.conf\fP for
++a list of default bindings. User \fBinput.conf\fP files and Lua scripts can
++define additional key bindings.
++.SS Keyboard Control
++.INDENT 0.0
++.TP
++.B LEFT and RIGHT
++Seek backward/forward 5 seconds. Shift+arrow does a 1 second exact seek
++(see \fB\-\-hr\-seek\fP).
++.TP
++.B UP and DOWN
++Seek forward/backward 1 minute. Shift+arrow does a 5 second exact seek (see
++\fB\-\-hr\-seek\fP).
++.TP
++.B Ctrl+LEFT and Ctrl+RIGHT
++Seek to the previous/next subtitle. Subject to some restrictions and
++might not always work; see \fBsub\-seek\fP command.
++.TP
++.B [ and ]
++Decrease/increase current playback speed by 10%.
++.TP
++.B { and }
++Halve/double current playback speed.
++.TP
++.B BACKSPACE
++Reset playback speed to normal.
++.TP
++.B < and >
++Go backward/forward in the playlist.
++.TP
++.B ENTER
++Go forward in the playlist.
++.TP
++.B p / SPACE
++Pause (pressing again unpauses).
++.TP
++.B \&.
++Step forward. Pressing once will pause, every consecutive press will
++play one frame and then go into pause mode again.
++.UNINDENT
++.INDENT 0.0
++.TP
++.B ,
++Step backward. Pressing once will pause, every consecutive press will
++play one frame in reverse and then go into pause mode again.
++.TP
++.B q
++Stop playing and quit.
++.TP
++.B Q
++Like \fBq\fP, but store the current playback position. Playing the same file
++later will resume at the old playback position if possible.
++.TP
++.B / and *
++Decrease/increase volume.
++.TP
++.B 9 and 0
++Decrease/increase volume.
++.TP
++.B m
++Mute sound.
++.TP
++.B _
++Cycle through the available video tracks.
++.TP
++.B #
++Cycle through the available audio tracks.
++.TP
++.B f
++Toggle fullscreen (see also \fB\-\-fs\fP).
++.TP
++.B ESC
++Exit fullscreen mode.
++.TP
++.B T
++Toggle stay\-on\-top (see also \fB\-\-ontop\fP).
++.TP
++.B w and e
++Decrease/increase pan\-and\-scan range.
++.TP
++.B o (also P)
++Show progression bar, elapsed time and total duration on the OSD.
++.TP
++.B O
++Toggle OSD states between normal and playback time/duration.
++.TP
++.B v
++Toggle subtitle visibility.
++.TP
++.B j and J
++Cycle through the available subtitles.
++.TP
++.B x and z
++Adjust subtitle delay by +/\- 0.1 seconds.
++.TP
++.B l
++Set/clear A\-B loop points. See \fBab\-loop\fP command for details.
++.TP
++.B L
++Toggle infinite looping.
++.TP
++.B Ctrl + and Ctrl \-
++Adjust audio delay by +/\- 0.1 seconds.
++.TP
++.B u
++Switch between applying no style overrides to SSA/ASS subtitles, and
++overriding them almost completely with the normal subtitle style. See
++\fB\-\-ass\-style\-override\fP for more info.
++.TP
++.B V
++Toggle subtitle VSFilter aspect compatibility mode. See
++\fB\-\-ass\-vsfilter\-aspect\-compat\fP for more info.
++.TP
++.B r and t
++Move subtitles up/down.
++.TP
++.B s
++Take a screenshot.
++.TP
++.B S
++Take a screenshot, without subtitles. (Whether this works depends on VO
++driver support.)
++.TP
++.B Ctrl s
++Take a screenshot, as the window shows it (with subtitles, OSD, and scaled
++video).
++.TP
++.B I
++Show filename on the OSD.
++.TP
++.B PGUP and PGDWN
++Seek to the beginning of the previous/next chapter. In most cases,
++"previous" will actually go to the beginning of the current chapter; see
++\fB\-\-chapter\-seek\-threshold\fP\&.
++.TP
++.B Shift+PGUP and Shift+PGDWN
++Seek backward or forward by 10 minutes. (This used to be mapped to
++PGUP/PGDWN without Shift.)
++.TP
++.B d
++Activate/deactivate deinterlacer.
++.TP
++.B A
++Cycle aspect ratio override.
++.UNINDENT
++.sp
++(The following keys are valid only when using a video output that supports the
++corresponding adjustment, or the software equalizer (\fB\-\-vf=eq\fP).)
++.INDENT 0.0
++.TP
++.B 1 and 2
++Adjust contrast.
++.TP
++.B 3 and 4
++Adjust brightness.
++.TP
++.B 5 and 6
++Adjust gamma.
++.TP
++.B 7 and 8
++Adjust saturation.
++.TP
++.B Alt+0 (and command+0 on OSX)
++Resize video window to half its original size.
++.TP
++.B Alt+1 (and command+1 on OSX)
++Resize video window to its original size.
++.TP
++.B Alt+2 (and command+2 on OSX)
++Resize video window to double its original size.
++.TP
++.B command + f (OSX only)
++Toggle fullscreen (see also \fB\-\-fs\fP).
++.TP
++.B command + [ and command + ] (OSX only)
++Set video window alpha.
++.UNINDENT
++.sp
++(The following keys are valid if you have a keyboard with multimedia keys.)
++.INDENT 0.0
++.TP
++.B PAUSE
++Pause.
++.TP
++.B STOP
++Stop playing and quit.
++.TP
++.B PREVIOUS and NEXT
++Seek backward/forward 1 minute.
++.UNINDENT
++.sp
++(The following keys are only valid if you compiled with TV or DVB input
++support.)
++.INDENT 0.0
++.TP
++.B h and k
++Select previous/next tv\-channel.
++.TP
++.B H and K
++Select previous/next dvb\-channel.
++.UNINDENT
++.SS Mouse Control
++.INDENT 0.0
++.TP
++.B button 3 and button 4
++Seek backward/forward 1 minute.
++.TP
++.B button 5 and button 6
++Decrease/increase volume.
++.UNINDENT
++.SH USAGE
++.sp
++Every \fIflag\fP option has a \fIno\-flag\fP counterpart, e.g. the opposite of the
++\fB\-\-fs\fP option is \fB\-\-no\-fs\fP\&. \fB\-\-fs=yes\fP is same as \fB\-\-fs\fP, \fB\-\-fs=no\fP
++is the same as \fB\-\-no\-fs\fP\&.
++.sp
++If an option is marked as \fI(XXX only)\fP, it will only work in combination with
++the \fIXXX\fP option or if \fIXXX\fP is compiled in.
++.SS Escaping spaces and other special characters
++.sp
++Keep in mind that the shell will partially parse and mangle the arguments you
++pass to mpv. For example, you might need to quote or escape options and
++filenames:
++.INDENT 0.0
++.INDENT 3.5
++\fBmpv "filename with spaces.mkv" \-\-title="window title"\fP
++.UNINDENT
++.UNINDENT
++.sp
++It gets more complicated if the suboption parser is involved. The suboption
++parser puts several options into a single string, and passes them to a
++component at once, instead of using multiple options on the level of the
++command line.
++.sp
++The suboption parser can quote strings with \fB"\fP and \fB[...]\fP\&.
++Additionally, there is a special form of quoting with \fB%n%\fP described below.
++.sp
++For example, the \fBopengl\fP VO can take multiple options:
++.INDENT 0.0
++.INDENT 3.5
++\fBmpv test.mkv \-\-vo=opengl:scale=lanczos:icc\-profile=file.icc,xv\fP
++.UNINDENT
++.UNINDENT
++.sp
++This passes \fBscale=lanczos\fP and \fBicc\-profile=file.icc\fP to \fBopengl\fP,
++and also specifies \fBxv\fP as fallback VO. If the icc\-profile path contains
++spaces or characters like \fB,\fP or \fB:\fP, you need to quote them:
++.INDENT 0.0
++.INDENT 3.5
++\fBmpv \(aq\-\-vo=opengl:icc\-profile="file with spaces.icc",xv\(aq\fP
++.UNINDENT
++.UNINDENT
++.sp
++Shells may actually strip some quotes from the string passed to the commandline,
++so the example quotes the string twice, ensuring that mpv receives the \fB"\fP
++quotes.
++.sp
++The \fB[...]\fP form of quotes wraps everything between \fB[\fP and \fB]\fP\&. It\(aqs
++useful with shells that don\(aqt interpret these characters in the middle of
++an argument (like bash). These quotes are balanced (since mpv 0.9.0): the \fB[\fP
++and \fB]\fP nest, and the quote terminates on the last \fB]\fP that has no matching
++\fB[\fP within the string. (For example, \fB[a[b]c]\fP results in \fBa[b]c\fP\&.)
++.sp
++The fixed\-length quoting syntax is intended for use with external
++scripts and programs.
++.sp
++It is started with \fB%\fP and has the following format:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++%n%string_of_length_n
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.INDENT 0.0
++.INDENT 3.5
++.IP "Examples"
++.sp
++\fBmpv \-\-ao=pcm:file=%10%C:test.wav test.avi\fP
++.sp
++Or in a script:
++.sp
++\fBmpv \-\-ao=pcm:file=%\(gaexpr length "$NAME"\(ga%"$NAME" test.avi\fP
++.UNINDENT
++.UNINDENT
++.sp
++Suboptions passed to the client API are also subject to escaping. Using
++\fBmpv_set_option_string()\fP is exactly like passing \fB\-\-name=data\fP to the
++command line (but without shell processing of the string). Some options
++support passing values in a more structured way instead of flat strings, and
++can avoid the suboption parsing mess. For example, \fB\-\-vf\fP supports
++\fBMPV_FORMAT_NODE\fP, which lets you pass suboptions as a nested data structure
++of maps and arrays. (\fB\-\-vo\fP supports this in the same way, although this
++fact is undocumented.)
++.SS Paths
++.sp
++Some care must be taken when passing arbitrary paths and filenames to mpv. For
++example, paths starting with \fB\-\fP will be interpreted as options. Likewise,
++if a path contains the sequence \fB://\fP, the string before that might be
++interpreted as protocol prefix, even though \fB://\fP can be part of a legal
++UNIX path. To avoid problems with arbitrary paths, you should be sure that
++absolute paths passed to mpv start with \fB/\fP, and prefix relative paths with
++\fB\&./\fP\&.
++.sp
++Using the \fBfile://\fP pseudo\-protocol is discouraged, because it involves
++strange URL unescaping rules.
++.sp
++The name \fB\-\fP itself is interpreted as stdin, and will cause mpv to disable
++console controls. (Which makes it suitable for playing data piped to stdin.)
++.sp
++The special argument \fB\-\-\fP can be used to stop mpv from interpreting the
++following arguments as options.
++.sp
++When using the client API, you should strictly avoid using \fBmpv_command_string\fP
++for invoking the \fBloadfile\fP command, and instead prefer e.g. \fBmpv_command\fP
++to avoid the need for filename escaping.
++.sp
++For paths passed to suboptions, the situation is further complicated by the
++need to escape special characters. To work this around, the path can be
++additionally wrapped in the fixed\-length syntax, e.g. \fB%n%string_of_length_n\fP
++(see above).
++.sp
++Some mpv options interpret paths starting with \fB~\fP\&. Currently, the prefix
++\fB~~/\fP expands to the mpv configuration directory (usually \fB~/.config/mpv/\fP).
++\fB~/\fP expands to the user\(aqs home directory. (The trailing \fB/\fP is always
++required.) There are the following paths as well:
++.TS
++center;
++|l|l|.
++_
++T{
++Name
++T} T{
++Meaning
++T}
++_
++T{
++\fB~~home/\fP
++T} T{
++same as \fB~~/\fP
++T}
++_
++T{
++\fB~~global/\fP
++T} T{
++the global config path, if available (not on win32)
++T}
++_
++T{
++\fB~~osxbundle/\fP
++T} T{
++the OSX bundle resource path (OSX only)
++T}
++_
++T{
++\fB~~desktop/\fP
++T} T{
++the path to the desktop (win32, OSX)
++T}
++_
++.TE
++.SS Per\-File Options
++.sp
++When playing multiple files, any option given on the command line usually
++affects all files. Example:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv \-\-a file1.mkv \-\-b file2.mkv \-\-c
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TS
++center;
++|l|l|.
++_
++T{
++File
++T} T{
++Active options
++T}
++_
++T{
++file1.mkv
++T} T{
++\fB\-\-a \-\-b \-\-c\fP
++T}
++_
++T{
++file2.mkv
++T} T{
++\fB\-\-a \-\-b \-\-c\fP
++T}
++_
++.TE
++.sp
++(This is different from MPlayer and mplayer2.)
++.sp
++Also, if any option is changed at runtime (via input commands), they are not
++reset when a new file is played.
++.sp
++Sometimes, it is useful to change options per\-file. This can be achieved by
++adding the special per\-file markers \fB\-\-{\fP and \fB\-\-}\fP\&. (Note that you must
++escape these on some shells.) Example:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv \-\-a file1.mkv \-\-b \-\-\e{ \-\-c file2.mkv \-\-d file3.mkv \-\-e \-\-\e} file4.mkv \-\-f
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TS
++center;
++|l|l|.
++_
++T{
++File
++T} T{
++Active options
++T}
++_
++T{
++file1.mkv
++T} T{
++\fB\-\-a \-\-b \-\-f\fP
++T}
++_
++T{
++file2.mkv
++T} T{
++\fB\-\-a \-\-b \-\-f \-\-c \-\-d \-\-e\fP
++T}
++_
++T{
++file3.mkv
++T} T{
++\fB\-\-a \-\-b \-\-f \-\-c \-\-d \-\-e\fP
++T}
++_
++T{
++file4.mkv
++T} T{
++\fB\-\-a \-\-b \-\-f\fP
++T}
++_
++.TE
++.sp
++Additionally, any file\-local option changed at runtime is reset when the current
++file stops playing. If option \fB\-\-c\fP is changed during playback of
++\fBfile2.mkv\fP, it is reset when advancing to \fBfile3.mkv\fP\&. This only affects
++file\-local options. The option \fB\-\-a\fP is never reset here.
++.SS Playing DVDs
++.sp
++DVDs can be played with the \fBdvd://[title]\fP syntax. The optional
++title specifier is a number which selects between separate video
++streams on the DVD. If no title is given (\fBdvd://\fP) then the longest
++title is selected automatically by the library. This is usually what
++you want. mpv does not support DVD menus.
++.sp
++DVDs which have been copied on to a hard drive or other mounted
++filesystem (by e.g. the \fBdvdbackup\fP tool) are accommodated by
++specifying the path to the local copy: \fB\-\-dvd\-device=PATH\fP\&.
++Alternatively, running \fBmpv PATH\fP should auto\-detect a DVD directory
++tree and play the longest title.
++.sp
++\fBNOTE:\fP
++.INDENT 0.0
++.INDENT 3.5
++mpv uses a different default DVD library than MPlayer. MPlayer
++uses libdvdread by default, and mpv uses libdvdnav by default.
++Both libraries are developed in parallel, but libdvdnav is
++intended to support more sophisticated DVD features such as menus
++and multi\-angle playback. mpv uses libdvdnav for files specified
++as either \fBdvd://...\fP or \fBdvdnav://...\fP\&. To use libdvdread,
++which will produce behavior more like MPlayer, specify
++\fBdvdread://...\fP instead. Some users have experienced problems
++when using libdvdnav, in which playback gets stuck in a DVD menu
++stream. These problems are reported to go away when auto\-selecting
++the title (\fBdvd://\fP rather than \fBdvd://1\fP) or when using
++libdvdread (e.g. \fBdvdread://0\fP).
++.sp
++DVDs use image\-based subtitles. Image subtitles are implemented as
++a bitmap video stream which can be superimposed over the main
++movie. mpv\(aqs subtitle styling and positioning options and keyboard
++shortcuts generally do not work with image\-based subtitles.
++Exceptions include options like \fB\-\-stretch\-dvd\-subs\fP and
++\fB\-\-stretch\-image\-subs\-to\-screen\fP\&.
++.UNINDENT
++.UNINDENT
++.SH CONFIGURATION FILES
++.SS Location and Syntax
++.sp
++You can put all of the options in configuration files which will be read every
++time mpv is run. The system\-wide configuration file \(aqmpv.conf\(aq is in your
++configuration directory (e.g. \fB/etc/mpv\fP or \fB/usr/local/etc/mpv\fP), the
++user\-specific one is \fB~/.config/mpv/mpv.conf\fP\&. For details and platform
++specifics (in particular Windows paths) see the \fI\%FILES\fP section.
++.sp
++User\-specific options override system\-wide options and options given on the
++command line override either. The syntax of the configuration files is
++\fBoption=value\fP\&. Everything after a \fI#\fP is considered a comment. Options
++that work without values can be enabled by setting them to \fIyes\fP and disabled by
++setting them to \fIno\fP\&. Even suboptions can be specified in this way.
++.INDENT 0.0
++.INDENT 3.5
++.IP "Example configuration file"
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++# Use opengl video output by default.
++vo=opengl
++# Use quotes for text that can contain spaces:
++status\-msg="Time: ${time\-pos}"
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.SS Escaping spaces and special characters
++.sp
++This is done like with command line options. The shell is not involved here,
++but option values still need to be quoted as a whole if it contains certain
++characters like spaces. A config entry can be quoted with \fB"\fP,
++as well as with the fixed\-length syntax (\fB%n%\fP) mentioned before. This is like
++passing the exact contents of the quoted string as command line option. C\-style
++escapes are currently _not_ interpreted on this level, although some options do
++this manually. (This is a mess and should probably be changed at some point.)
++.SS Putting Command Line Options into the Configuration File
++.sp
++Almost all command line options can be put into the configuration file. Here
++is a small guide:
++.TS
++center;
++|l|l|.
++_
++T{
++Option
++T} T{
++Configuration file entry
++T}
++_
++T{
++\fB\-\-flag\fP
++T} T{
++\fBflag\fP
++T}
++_
++T{
++\fB\-opt val\fP
++T} T{
++\fBopt=val\fP
++T}
++_
++T{
++\fB\-\-opt=val\fP
++T} T{
++\fBopt=val\fP
++T}
++_
++T{
++\fB\-opt "has spaces"\fP
++T} T{
++\fBopt="has spaces"\fP
++T}
++_
++.TE
++.SS File\-specific Configuration Files
++.sp
++You can also write file\-specific configuration files. If you wish to have a
++configuration file for a file called \(aqvideo.avi\(aq, create a file named
++\(aqvideo.avi.conf\(aq with the file\-specific options in it and put it in
++\fB~/.config/mpv/\fP\&. You can also put the configuration file in the same directory
++as the file to be played. Both require you to set the \fB\-\-use\-filedir\-conf\fP
++option (either on the command line or in your global config file). If a
++file\-specific configuration file is found in the same directory, no
++file\-specific configuration is loaded from \fB~/.config/mpv\fP\&. In addition, the
++\fB\-\-use\-filedir\-conf\fP option enables directory\-specific configuration files.
++For this, mpv first tries to load a mpv.conf from the same directory
++as the file played and then tries to load any file\-specific configuration.
++.SS Profiles
++.sp
++To ease working with different configurations, profiles can be defined in the
++configuration files. A profile starts with its name in square brackets,
++e.g. \fB[my\-profile]\fP\&. All following options will be part of the profile. A
++description (shown by \fB\-\-profile=help\fP) can be defined with the
++\fBprofile\-desc\fP option. To end the profile, start another one or use the
++profile name \fBdefault\fP to continue with normal options.
++.INDENT 0.0
++.INDENT 3.5
++.IP "Example mpv config file with profiles"
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++# normal top\-level option
++fullscreen=yes
++
++# a profile that can be enabled with \-\-profile=big\-cache
++[big\-cache]
++cache=123400
++demuxer\-readahead\-secs=20
++
++[slow]
++profile\-desc="some profile name"
++vo=opengl:scale=ewa_lanczos:scale\-radius=16
++
++[fast]
++vo=vdpau
++
++# using a profile again extends it
++[slow]
++framedrop=no
++# you can also include other profiles
++profile=big\-cache
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.SS Auto profiles
++.sp
++Some profiles are loaded automatically. The following example demonstrates this:
++.INDENT 0.0
++.INDENT 3.5
++.IP "Auto profile loading"
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++[vo.vdpau]
++# Use hardware decoding
++hwdec=vdpau
++
++[protocol.dvd]
++profile\-desc="profile for dvd:// streams"
++alang=en
++
++[extension.flv]
++profile\-desc="profile for .flv files"
++vf=flip
++
++[ao.alsa]
++device=spdif
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++The profile name follows the schema \fBtype.name\fP, where type can be \fBvo\fP
++to match the value the \fB\-\-vo\fP option is set to, \fBao\fP for \fB\-\-ao\fP,
++\fBprotocol\fP for the input/output protocol in use (see \fB\-\-list\-protocols\fP),
++and \fBextension\fP for the extension of the path of the currently played file
++(\fInot\fP the file format).
++.sp
++This feature is very limited, and there are no other auto profiles.
++.SH TAKING SCREENSHOTS
++.sp
++Screenshots of the currently played file can be taken using the \(aqscreenshot\(aq
++input mode command, which is by default bound to the \fBs\fP key. Files named
++\fBmpv\-shotNNNN.jpg\fP will be saved in the working directory, using the first
++available number \- no files will be overwritten. In pseudo\-GUI mode, the
++screenshot will be saved somewhere else. See \fI\%PSEUDO GUI MODE\fP\&.
++.sp
++A screenshot will usually contain the unscaled video contents at the end of the
++video filter chain and subtitles. By default, \fBS\fP takes screenshots without
++subtitles, while \fBs\fP includes subtitles.
++.sp
++Unlike with MPlayer, the \fBscreenshot\fP video filter is not required. This
++filter was never required in mpv, and has been removed.
++.SH TERMINAL STATUS LINE
++.sp
++During playback, mpv shows the playback status on the terminal. It looks like
++something like this:
++.INDENT 0.0
++.INDENT 3.5
++\fBAV: 00:03:12 / 00:24:25 (13%) A\-V: \-0.000\fP
++.UNINDENT
++.UNINDENT
++.sp
++The status line can be overridden with the \fB\-\-term\-status\-msg\fP option.
++.sp
++The following is a list of things that can show up in the status line. Input
++properties, that can be used to get the same information manually, are also
++listed.
++.INDENT 0.0
++.IP \(bu 2
++\fBAV:\fP or \fBV:\fP (video only) or \fBA:\fP (audio only)
++.IP \(bu 2
++The current time position in \fBHH:MM:SS\fP format (\fBplayback\-time\fP property)
++.IP \(bu 2
++The total file duration (absent if unknown) (\fBlength\fP property)
++.IP \(bu 2
++Playback speed, e.g. \(ga\(ga x2.0\(ga\(ga. Only visible if the speed is not normal. This
++is the user\-requested speed, and not the actual speed (usually they should
++be the same, unless playback is too slow). (\fBspeed\fP property.)
++.IP \(bu 2
++Playback percentage, e.g. \fB(13%)\fP\&. How much of the file has been played.
++Normally calculated out of playback position and duration, but can fallback
++to other methods (like byte position) if these are not available.
++(\fBpercent\-pos\fP property.)
++.IP \(bu 2
++The audio/video sync as \fBA\-V: 0.000\fP\&. This is the difference between
++audio and video time. Normally it should be 0 or close to 0. If it\(aqs growing,
++it might indicate a playback problem. (\fBavsync\fP property.)
++.IP \(bu 2
++Total A/V sync change, e.g. \fBct: \-0.417\fP\&. Normally invisible. Can show up
++if there is audio "missing", or not enough frames can be dropped. Usually
++this will indicate a problem. (\fBtotal\-avsync\-change\fP property.)
++.IP \(bu 2
++Encoding state in \fB{...}\fP, only shown in encoding mode.
++.IP \(bu 2
++Display sync state. If display sync is active (\fBdisplay\-sync\-active\fP
++property), this shows \fBDS: 2.500/13\fP, where the first number is average
++number of vsyncs per video frame (e.g. 2.5 when playing 24Hz videos on 60Hz
++screens), which might jitter if the ratio doesn\(aqt round off, or there are
++mistimed frames (\fBvsync\-ratio\fP), and the second number of estimated number
++of vsyncs which took too long (\fBvo\-delayed\-frame\-count\fP property). The
++latter is a heuristic, as it\(aqs generally not possible to determine this with
++certainty.
++.IP \(bu 2
++Dropped frames, e.g. \fBDropped: 4\fP\&. Shows up only if the count is not 0. Can
++grow if the video framerate is higher than that of the display, or if video
++rendering is too slow. May also be incremented on "hiccups" and when the video
++frame couldn\(aqt be displayed on time. (\fBvo\-drop\-frame\-count\fP property.)
++If the decoder drops frames, the number of decoder\-dropped frames is appended
++to the display as well, e.g.: \fBDropped: 4/34\fP\&. This happens only if
++decoder frame dropping is enabled with the \fB\-\-framedrop\fP options.
++(\fBdrop\-frame\-count\fP property.)
++.IP \(bu 2
++Cache state, e.g. \fBCache: 2s+134KB\fP\&. Visible if the stream cache is enabled.
++The first value shows the amount of video buffered in the demuxer in seconds,
++the second value shows \fIadditional\fP data buffered in the stream cache in
++kilobytes. (\fBdemuxer\-cache\-duration\fP and \fBcache\-used\fP properties.)
++.UNINDENT
++.SH PROTOCOLS
++.INDENT 0.0
++.TP
++.B \fBhttp://...\fP, \fBhttps://\fP, ...
++Many network protocols are supported, but the protocol prefix must always
++be specified. mpv will never attempt to guess whether a filename is
++actually a network address. A protocol prefix is always required.
++.sp
++Note that not all prefixes are documented here. Undocumented prefixes are
++either aliases to documented protocols, or are just redirections to
++protocols implemented and documented in FFmpeg.
++.TP
++.B \fB\-\fP
++Play data from stdin.
++.TP
++.B \fBsmb://PATH\fP
++Play a path from Samba share.
++.TP
++.B \fBbd://[title][/device]\fP \fB\-\-bluray\-device=PATH\fP
++Play a Blu\-ray disc. Currently, this does not accept ISO files. Instead,
++you must mount the ISO file as filesystem, and point \fB\-\-bluray\-device\fP
++to the mounted directory directly.
++.TP
++.B \fBdvd://[title|[starttitle]\-endtitle][/device]\fP \fB\-\-dvd\-device=PATH\fP
++Play a DVD. DVD menus are not supported. If no title is given, the longest
++title is auto\-selected.
++.sp
++\fBdvdnav://\fP is an old alias for \fBdvd://\fP and does exactly the same
++thing.
++.TP
++.B \fBdvdread://...:\fP
++Play a DVD using the old libdvdread code. This is what MPlayer and older
++mpv versions use for \fBdvd://\fP\&. Use is discouraged. It\(aqs provided only
++for compatibility and for transition.
++.TP
++.B \fBtv://[channel][/input_id]\fP \fB\-\-tv\-...\fP
++Analogue TV via V4L. Also useful for webcams. (Linux only.)
++.TP
++.B \fBpvr://\fP \fB\-\-pvr\-...\fP
++PVR. (Linux only.)
++.TP
++.B \fBdvb://[cardnumber@]channel\fP \fB\-\-dvbin\-...\fP
++Digital TV via DVB. (Linux only.)
++.TP
++.B \fBmf://[filemask|@listfile]\fP \fB\-\-mf\-...\fP
++Play a series of images as video.
++.TP
++.B \fBcdda://track[\-endtrack][:speed][/device]\fP \fB\-\-cdrom\-device=PATH\fP \fB\-\-cdda\-...\fP
++Play CD.
++.TP
++.B \fBlavf://...\fP
++Access any FFmpeg/Libav libavformat protocol. Basically, this passed the
++string after the \fB//\fP directly to libavformat.
++.TP
++.B \fBav://type:options\fP
++This is intended for using libavdevice inputs. \fBtype\fP is the libavdevice
++demuxer name, and \fBoptions\fP is the (pseudo\-)filename passed to the
++demuxer.
++.sp
++For example, \fBmpv av://lavfi:mandelbrot\fP makes use of the libavfilter
++wrapper included in libavdevice, and will use the \fBmandelbrot\fP source
++filter to generate input data.
++.sp
++\fBavdevice://\fP is an alias.
++.TP
++.B \fBfile://PATH\fP
++A local path as URL. Might be useful in some special use\-cases. Note that
++\fBPATH\fP itself should start with a third \fB/\fP to make the path an
++absolute path.
++.TP
++.B \fBfd://123\fP
++Read data from the given file descriptor (for example 123). This is similar
++to piping data to stdin via \fB\-\fP, but can use an arbitrary file descriptor.
++.TP
++.B \fBedl://[edl specification as in edl\-mpv.rst]\fP
++Stitch together parts of multiple files and play them.
++.TP
++.B \fBnull://\fP
++Simulate an empty file. If opened for writing, it will discard all data.
++The \fBnull\fP demuxer will specifically pass autoprobing if this protocol
++is used (while it\(aqs not automatically invoked for empty files).
++.TP
++.B \fBmemory://data\fP
++Use the \fBdata\fP part as source data.
++.TP
++.B \fBhex://data\fP
++Like \fBmemory://\fP, but the string is interpreted as hexdump.
++.UNINDENT
++.SH PSEUDO GUI MODE
++.sp
++mpv has no official GUI, other than the OSC (\fI\%ON SCREEN CONTROLLER\fP), which
++is not a full GUI and is not meant to be. However, to compensate for the lack
++of expected GUI behavior, mpv will in some cases start with some settings
++changed to behave slightly more like a GUI mode.
++.sp
++Currently this happens only in the following cases:
++.INDENT 0.0
++.IP \(bu 2
++if started using the \fBmpv.desktop\fP file on Linux (e.g. started from menus
++or file associations provided by desktop environments)
++.IP \(bu 2
++if started from explorer.exe on Windows (technically, if it was started on
++Windows, and all of the stdout/stderr/stdin handles are unset)
++.IP \(bu 2
++manually adding \fB\-\-profile=pseudo\-gui\fP to the command line
++.UNINDENT
++.sp
++This mode implicitly adds \fB\-\-profile=pseudo\-gui\fP to the command line, with
++the \fBpseudo\-gui\fP profile being predefined with the following contents:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++[pseudo\-gui]
++terminal=no
++force\-window=yes
++idle=once
++screenshot\-directory=~~desktop/
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++This follows the mpv config file format. To customize pseudo\-GUI mode, you can
++put your own \fBpseudo\-gui\fP profile into your \fBmpv.conf\fP\&. This profile will
++enhance the default profile, rather than overwrite it.
++.sp
++The profile always overrides other settings in \fBmpv.conf\fP\&.
++.SH OPTIONS
++.SS Track Selection
++.INDENT 0.0
++.TP
++.B \fB\-\-alang=<languagecode[,languagecode,...]>\fP
++Specify a priority list of audio languages to use. Different container
++formats employ different language codes. DVDs use ISO 639\-1 two\-letter
++language codes, Matroska, MPEG\-TS and NUT use ISO 639\-2 three\-letter
++language codes, while OGM uses a free\-form identifier. See also \fB\-\-aid\fP\&.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fBmpv dvd://1 \-\-alang=hu,en\fP
++Chooses the Hungarian language track on a DVD and falls back on
++English if Hungarian is not available.
++.TP
++.B \fBmpv \-\-alang=jpn example.mkv\fP
++Plays a Matroska file in Japanese.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-slang=<languagecode[,languagecode,...]>\fP
++Specify a priority list of subtitle languages to use. Different container
++formats employ different language codes. DVDs use ISO 639\-1 two letter
++language codes, Matroska uses ISO 639\-2 three letter language codes while
++OGM uses a free\-form identifier. See also \fB\-\-sid\fP\&.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fBmpv dvd://1 \-\-slang=hu,en\fP chooses the Hungarian subtitle track on
++a DVD and falls back on English if Hungarian is not available.
++.IP \(bu 2
++\fBmpv \-\-slang=jpn example.mkv\fP plays a Matroska file with Japanese
++subtitles.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-aid=<ID|auto|no>\fP
++Select audio track. \fBauto\fP selects the default, \fBno\fP disables audio.
++See also \fB\-\-alang\fP\&. mpv normally prints available audio tracks on the
++terminal when starting playback of a file.
++.TP
++.B \fB\-\-sid=<ID|auto|no>\fP
++Display the subtitle stream specified by \fB<ID>\fP\&. \fBauto\fP selects
++the default, \fBno\fP disables subtitles.
++.sp
++See also \fB\-\-slang\fP, \fB\-\-no\-sub\fP\&.
++.TP
++.B \fB\-\-vid=<ID|auto|no>\fP
++Select video channel. \fBauto\fP selects the default, \fBno\fP disables video.
++.TP
++.B \fB\-\-ff\-aid=<ID|auto|no>\fP, \fB\-\-ff\-sid=<ID|auto|no>\fP, \fB\-\-ff\-vid=<ID|auto|no>\fP
++Select audio/subtitle/video streams by the FFmpeg stream index. The FFmpeg
++stream index is relatively arbitrary, but useful when interacting with
++other software using FFmpeg (consider \fBffprobe\fP).
++.sp
++Note that with external tracks (added with \fB\-\-sub\-file\fP and similar
++options), there will be streams with duplicate IDs. In this case, the
++first stream in order is selected.
++.TP
++.B \fB\-\-edition=<ID|auto>\fP
++(Matroska files only)
++Specify the edition (set of chapters) to use, where 0 is the first. If set
++to \fBauto\fP (the default), mpv will choose the first edition declared as a
++default, or if there is no default, the first edition defined.
++.UNINDENT
++.SS Playback Control
++.INDENT 0.0
++.TP
++.B \fB\-\-start=<relative time>\fP
++Seek to given time position.
++.sp
++The general format for absolute times is \fB[[hh:]mm:]ss[.ms]\fP\&. If the time
++is given with a prefix of \fB+\fP or \fB\-\fP, the seek is relative from the start
++or end of the file. (Since mpv 0.14, the start of the file is always
++considered 0.)
++.sp
++\fBpp%\fP seeks to percent position pp (0\-100).
++.sp
++\fB#c\fP seeks to chapter number c. (Chapters start from 1.)
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fB\-\-start=+56\fP, \fB\-\-start=+00:56\fP
++Seeks to the start time + 56 seconds.
++.TP
++.B \fB\-\-start=\-56\fP, \fB\-\-start=\-00:56\fP
++Seeks to the end time \- 56 seconds.
++.TP
++.B \fB\-\-start=01:10:00\fP
++Seeks to 1 hour 10 min.
++.TP
++.B \fB\-\-start=50%\fP
++Seeks to the middle of the file.
++.TP
++.B \fB\-\-start=30 \-\-end=40\fP
++Seeks to 30 seconds, plays 10 seconds, and exits.
++.TP
++.B \fB\-\-start=\-3:20 \-\-length=10\fP
++Seeks to 3 minutes and 20 seconds before the end of the file, plays
++10 seconds, and exits.
++.TP
++.B \fB\-\-start=\(aq#2\(aq \-\-end=\(aq#4\(aq\fP
++Plays chapters 2 and 3, and exits.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-end=<time>\fP
++Stop at given absolute time. Use \fB\-\-length\fP if the time should be relative
++to \fB\-\-start\fP\&. See \fB\-\-start\fP for valid option values and examples.
++.TP
++.B \fB\-\-length=<relative time>\fP
++Stop after a given time relative to the start time.
++See \fB\-\-start\fP for valid option values and examples.
++.TP
++.B \fB\-\-rebase\-start\-time=<yes|no>\fP
++Whether to move the file start time to \fB00:00:00\fP (default: yes). This
++is less awkward for files which start at a random timestamp, such as
++transport streams. On the other hand, if there are timestamp resets, the
++resulting behavior can be rather weird. For this reason, and in case you
++are actually interested in the real timestamps, this behavior can be
++disabled with \fBno\fP\&.
++.TP
++.B \fB\-\-speed=<0.01\-100>\fP
++Slow down or speed up playback by the factor given as parameter.
++.sp
++If \fB\-\-audio\-pitch\-correction\fP (on by default) is used, playing with a
++speed higher than normal automatically inserts the \fBscaletempo\fP audio
++filter.
++.TP
++.B \fB\-\-loop=<N|inf|force|no>\fP
++Loops playback \fBN\fP times. A value of \fB1\fP plays it one time (default),
++\fB2\fP two times, etc. \fBinf\fP means forever. \fBno\fP is the same as \fB1\fP and
++disables looping. If several files are specified on command line, the
++entire playlist is looped.
++.sp
++The \fBforce\fP mode is like \fBinf\fP, but does not skip playlist entries
++which have been marked as failing. This means the player might waste CPU
++time trying to loop a file that doesn\(aqt exist. But it might be useful for
++playing webradios under very bad network conditions.
++.TP
++.B \fB\-\-pause\fP
++Start the player in paused state.
++.TP
++.B \fB\-\-shuffle\fP
++Play files in random order.
++.TP
++.B \fB\-\-chapter=<start[\-end]>\fP
++Specify which chapter to start playing at. Optionally specify which
++chapter to end playing at.
++.sp
++See also: \fB\-\-start\fP\&.
++.TP
++.B \fB\-\-playlist\-pos=<no|index>\fP
++Set which file on the internal playlist to start playback with. The index
++is an integer, with 0 meaning the first file. The value \fBno\fP means that
++the selection of the entry to play is left to the playback resume mechanism
++(default). If an entry with the given index doesn\(aqt exist, the behavior is
++unspecified and might change in future mpv versions. The same applies if
++the playlist contains further playlists (don\(aqt expect any reasonable
++behavior). Passing a playlist file to mpv should work with this option,
++though. E.g. \fBmpv playlist.m3u \-\-playlist\-pos=123\fP will work as expected,
++as long as \fBplaylist.m3u\fP does not link to further playlists.
++.TP
++.B \fB\-\-playlist=<filename>\fP
++Play files according to a playlist file (Supports some common formats. If
++no format is detected, it will be treated as list of files, separated by
++newline characters. Note that XML playlist formats are not supported.)
++.sp
++You can play playlists directly and without this option, however, this
++option disables any security mechanisms that might be in place. You may
++also need this option to load plaintext files as playlist.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++The way mpv uses playlist files via \fB\-\-playlist\fP is not safe against
++maliciously constructed files. Such files may trigger harmful actions.
++This has been the case for all mpv and MPlayer versions, but
++unfortunately this fact was not well documented earlier, and some people
++have even misguidedly recommended use of \fB\-\-playlist\fP with untrusted
++sources. Do NOT use \fB\-\-playlist\fP with random internet sources or files
++you do not trust!
++.sp
++Playlist can contain entries using other protocols, such as local files,
++or (most severely), special protocols like \fBavdevice://\fP, which are
++inherently unsafe.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-chapter\-merge\-threshold=<number>\fP
++Threshold for merging almost consecutive ordered chapter parts in
++milliseconds (default: 100). Some Matroska files with ordered chapters
++have inaccurate chapter end timestamps, causing a small gap between the
++end of one chapter and the start of the next one when they should match.
++If the end of one playback part is less than the given threshold away from
++the start of the next one then keep playing video normally over the
++chapter change instead of doing a seek.
++.TP
++.B \fB\-\-chapter\-seek\-threshold=<seconds>\fP
++Distance in seconds from the beginning of a chapter within which a backward
++chapter seek will go to the previous chapter (default: 5.0). Past this
++threshold, a backward chapter seek will go to the beginning of the current
++chapter instead. A negative value means always go back to the previous
++chapter.
++.TP
++.B \fB\-\-hr\-seek=<no|absolute|yes>\fP
++Select when to use precise seeks that are not limited to keyframes. Such
++seeks require decoding video from the previous keyframe up to the target
++position and so can take some time depending on decoding performance. For
++some video formats, precise seeks are disabled. This option selects the
++default choice to use for seeks; it is possible to explicitly override that
++default in the definition of key bindings and in slave mode commands.
++.INDENT 7.0
++.TP
++.B no
++Never use precise seeks.
++.TP
++.B absolute
++Use precise seeks if the seek is to an absolute position in the
++file, such as a chapter seek, but not for relative seeks like
++the default behavior of arrow keys (default).
++.TP
++.B yes
++Use precise seeks whenever possible.
++.TP
++.B always
++Same as \fByes\fP (for compatibility).
++.UNINDENT
++.TP
++.B \fB\-\-hr\-seek\-demuxer\-offset=<seconds>\fP
++This option exists to work around failures to do precise seeks (as in
++\fB\-\-hr\-seek\fP) caused by bugs or limitations in the demuxers for some file
++formats. Some demuxers fail to seek to a keyframe before the given target
++position, going to a later position instead. The value of this option is
++subtracted from the time stamp given to the demuxer. Thus, if you set this
++option to 1.5 and try to do a precise seek to 60 seconds, the demuxer is
++told to seek to time 58.5, which hopefully reduces the chance that it
++erroneously goes to some time later than 60 seconds. The downside of
++setting this option is that precise seeks become slower, as video between
++the earlier demuxer position and the real target may be unnecessarily
++decoded.
++.TP
++.B \fB\-\-hr\-seek\-framedrop=<yes|no>\fP
++Allow the video decoder to drop frames during seek, if these frames are
++before the seek target. If this is enabled, precise seeking can be faster,
++but if you\(aqre using video filters which modify timestamps or add new
++frames, it can lead to precise seeking skipping the target frame. This
++e.g. can break frame backstepping when deinterlacing is enabled.
++.sp
++Default: \fByes\fP
++.TP
++.B \fB\-\-index=<mode>\fP
++Controls how to seek in files. Note that if the index is missing from a
++file, it will be built on the fly by default, so you don\(aqt need to change
++this. But it might help with some broken files.
++.INDENT 7.0
++.TP
++.B default
++use an index if the file has one, or build it if missing
++.TP
++.B recreate
++don\(aqt read or use the file\(aqs index
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This option only works if the underlying media supports seeking
++(i.e. not with stdin, pipe, etc).
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-load\-unsafe\-playlists\fP
++Load URLs from playlists which are considered unsafe (default: no). This
++includes special protocols and anything that doesn\(aqt refer to normal files.
++Local files and HTTP links on the other hand are always considered safe.
++.sp
++Note that \fB\-\-playlist\fP always loads all entries, so you use that instead
++if you really have the need for this functionality.
++.TP
++.B \fB\-\-loop\-file=<N|inf|no>\fP
++Loop a single file N times. \fBinf\fP means forever, \fBno\fP means normal
++playback. For compatibility, \fB\-\-loop\-file\fP and \fB\-\-loop\-file=yes\fP are
++also accepted, and are the same as \fB\-\-loop\-file=inf\fP\&.
++.sp
++The difference to \fB\-\-loop\fP is that this doesn\(aqt loop the playlist, just
++the file itself. If the playlist contains only a single file, the difference
++between the two option is that this option performs a seek on loop, instead
++of reloading the file.
++.TP
++.B \fB\-\-ab\-loop\-a=<time>\fP, \fB\-\-ab\-loop\-b=<time>\fP
++Set loop points. If playback passes the \fBb\fP timestamp, it will seek to
++the \fBa\fP timestamp. Seeking past the \fBb\fP point doesn\(aqt loop (this is
++intentional).
++.sp
++If both options are set to \fBno\fP, looping is disabled. Otherwise, the
++start/end of the file is used if one of the options is set to \fBno\fP\&.
++.sp
++The loop\-points can be adjusted at runtime with the corresponding
++properties. See also \fBab\-loop\fP command.
++.TP
++.B \fB\-\-ordered\-chapters\fP, \fB\-\-no\-ordered\-chapters\fP
++Enabled by default.
++Disable support for Matroska ordered chapters. mpv will not load or
++search for video segments from other files, and will also ignore any
++chapter order specified for the main file.
++.TP
++.B \fB\-\-ordered\-chapters\-files=<playlist\-file>\fP
++Loads the given file as playlist, and tries to use the files contained in
++it as reference files when opening a Matroska file that uses ordered
++chapters. This overrides the normal mechanism for loading referenced
++files by scanning the same directory the main file is located in.
++.sp
++Useful for loading ordered chapter files that are not located on the local
++filesystem, or if the referenced files are in different directories.
++.sp
++Note: a playlist can be as simple as a text file containing filenames
++separated by newlines.
++.TP
++.B \fB\-\-chapters\-file=<filename>\fP
++Load chapters from this file, instead of using the chapter metadata found
++in the main file.
++.TP
++.B \fB\-\-sstep=<sec>\fP
++Skip <sec> seconds after every frame.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Without \fB\-\-hr\-seek\fP, skipping will snap to keyframes.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-stop\-playback\-on\-init\-failure=<yes|no>\fP
++Stop playback if either audio or video fails to initialize. Currently,
++the default behavior is \fBno\fP for the command line player, but \fByes\fP
++for libmpv. With \fBno\fP, playback will continue in video\-only or audio\-only
++mode if one of them fails. This doesn\(aqt affect playback of audio\-only or
++video\-only files.
++.UNINDENT
++.SS Program Behavior
++.INDENT 0.0
++.TP
++.B \fB\-\-help\fP
++Show short summary of options.
++.TP
++.B \fB\-v\fP
++Increment verbosity level, one level for each \fB\-v\fP found on the command
++line.
++.TP
++.B \fB\-\-version, \-V\fP
++Print version string and exit.
++.TP
++.B \fB\-\-no\-config\fP
++Do not load default configuration files. This prevents loading of both the
++user\-level and system\-wide \fBmpv.conf\fP and \fBinput.conf\fP files. Other
++configuration files are blocked as well, such as resume playback files.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Files explicitly requested by command line options, like
++\fB\-\-include\fP or \fB\-\-use\-filedir\-conf\fP, will still be loaded.
++.UNINDENT
++.UNINDENT
++.sp
++See also: \fB\-\-config\-dir\fP\&.
++.TP
++.B \fB\-\-list\-options\fP
++Prints all available options.
++.TP
++.B \fB\-\-list\-properties\fP
++Print a list of the available properties.
++.TP
++.B \fB\-\-list\-protocols\fP
++Print a list of the supported protocols.
++.TP
++.B \fB\-\-log\-file=<path>\fP
++Opens the given path for writing, and print log messages to it. Existing
++files will be truncated. The log level always corresponds to \fB\-v\fP,
++regardless of terminal verbosity levels.
++.TP
++.B \fB\-\-config\-dir=<path>\fP
++Force a different configuration directory. If this is set, the given
++directory is used to load configuration files, and all other configuration
++directories are ignored. This means the global mpv configuration directory
++as well as per\-user directories are ignored, and overrides through
++environment variables (\fBMPV_HOME\fP) are also ignored.
++.sp
++Note that the \fB\-\-no\-config\fP option takes precedence over this option.
++.TP
++.B \fB\-\-save\-position\-on\-quit\fP
++Always save the current playback position on quit. When this file is
++played again later, the player will seek to the old playback position on
++start. This does not happen if playback of a file is stopped in any other
++way than quitting. For example, going to the next file in the playlist
++will not save the position, and start playback at beginning the next time
++the file is played.
++.sp
++This behavior is disabled by default, but is always available when quitting
++the player with Shift+Q.
++.TP
++.B \fB\-\-dump\-stats=<filename>\fP
++Write certain statistics to the given file. The file is truncated on
++opening. The file will contain raw samples, each with a timestamp. To
++make this file into a readable, the script \fBTOOLS/stats\-conv.py\fP can be
++used (which currently displays it as a graph).
++.sp
++This option is useful for debugging only.
++.TP
++.B \fB\-\-idle=<no|yes|once>\fP
++Makes mpv wait idly instead of quitting when there is no file to play.
++Mostly useful in slave mode, where mpv can be controlled through input
++commands.
++.sp
++\fBonce\fP will only idle at start and let the player close once the
++first playlist has finished playing back.
++.TP
++.B \fB\-\-include=<configuration\-file>\fP
++Specify configuration file to be parsed after the default ones.
++.TP
++.B \fB\-\-load\-scripts=<yes|no>\fP
++If set to \fBno\fP, don\(aqt auto\-load scripts from the \fBscripts\fP
++configuration subdirectory (usually \fB~/.config/mpv/scripts/\fP).
++(Default: \fByes\fP)
++.TP
++.B \fB\-\-script=<filename>\fP
++Load a Lua script. You can load multiple scripts by separating them with
++commas (\fB,\fP).
++.TP
++.B \fB\-\-script\-opts=key1=value1,key2=value2,...\fP
++Set options for scripts. A script can query an option by key. If an
++option is used and what semantics the option value has depends entirely on
++the loaded scripts. Values not claimed by any scripts are ignored.
++.TP
++.B \fB\-\-merge\-files\fP
++Pretend that all files passed to mpv are concatenated into a single, big
++file. This uses timeline/EDL support internally.
++.TP
++.B \fB\-\-no\-resume\-playback\fP
++Do not restore playback position from the \fBwatch_later\fP configuration
++subdirectory (usually \fB~/.config/mpv/watch_later/\fP).
++See \fBquit_watch_later\fP input command.
++.TP
++.B \fB\-\-profile=<profile1,profile2,...>\fP
++Use the given profile(s), \fB\-\-profile=help\fP displays a list of the
++defined profiles.
++.TP
++.B \fB\-\-reset\-on\-next\-file=<all|option1,option2,...>\fP
++Normally, mpv will try to keep all settings when playing the next file on
++the playlist, even if they were changed by the user during playback. (This
++behavior is the opposite of MPlayer\(aqs, which tries to reset all settings
++when starting next file.)
++.sp
++Default: Do not reset anything.
++.sp
++This can be changed with this option. It accepts a list of options, and
++mpv will reset the value of these options on playback start to the initial
++value. The initial value is either the default value, or as set by the
++config file or command line.
++.sp
++In some cases, this might not work as expected. For example, \fB\-\-volume\fP
++will only be reset if it is explicitly set in the config file or the
++command line.
++.sp
++The special name \fBall\fP resets as many options as possible.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-reset\-on\-next\-file=pause\fP
++Reset pause mode when switching to the next file.
++.IP \(bu 2
++\fB\-\-reset\-on\-next\-file=fullscreen,speed\fP
++Reset fullscreen and playback speed settings if they were changed
++during playback.
++.IP \(bu 2
++\fB\-\-reset\-on\-next\-file=all\fP
++Try to reset all settings that were changed during playback.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-write\-filename\-in\-watch\-later\-config\fP
++Prepend the watch later config files with the name of the file they refer
++to. This is simply written as comment on the top of the file.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++This option may expose privacy\-sensitive information and is thus
++disabled by default.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-ignore\-path\-in\-watch\-later\-config\fP
++Ignore path (i.e. use filename only) when using watch later feature.
++.TP
++.B \fB\-\-show\-profile=<profile>\fP
++Show the description and content of a profile.
++.TP
++.B \fB\-\-use\-filedir\-conf\fP
++Look for a file\-specific configuration file in the same directory as the
++file that is being played. See \fI\%File\-specific Configuration Files\fP\&.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++May be dangerous if playing from untrusted media.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-ytdl\fP, \fB\-\-no\-ytdl\fP
++Enable the youtube\-dl hook\-script. It will look at the input URL, and will
++play the video located on the website. This works with many streaming sites,
++not just the one that the script is named after. This requires a recent
++version of youtube\-dl to be installed on the system. (Enabled by default,
++except when the client API / libmpv is used.)
++.sp
++If the script can\(aqt do anything with an URL, it will do nothing.
++.TP
++.B \fB\-\-ytdl\-format=<best|worst|mp4|webm|...>\fP
++Video format/quality that is directly passed to youtube\-dl. The possible
++values are specific to the website and the video, for a given url the
++available formats can be found with the command
++\fByoutube\-dl \-\-list\-formats URL\fP\&. See youtube\-dl\(aqs documentation for
++available aliases.
++(Default: youtube\-dl\(aqs default, currently \fBbestvideo+bestaudio/best\fP)
++.TP
++.B \fB\-\-ytdl\-raw\-options=<key>=<value>[,<key>=<value>[,...]]\fP
++Pass arbitrary options to youtube\-dl. Parameter and argument should be
++passed as a key\-value pair. Options without argument must include \fB=\fP\&.
++.sp
++There is no sanity checking so it\(aqs possible to break things (i.e.
++passing invalid parameters to youtube\-dl).
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++\fB\-\-ytdl\-raw\-options=username=user,password=pass\fP
++\fB\-\-ytdl\-raw\-options=force\-ipv6=\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.SS Video
++.INDENT 0.0
++.TP
++.B \fB\-\-vo=<driver1[:suboption1[=value]:...],driver2,...[,]>\fP
++Specify a priority list of video output drivers to be used. For
++interactive use, one would normally specify a single one to use, but in
++configuration files, specifying a list of fallbacks may make sense. See
++\fI\%VIDEO OUTPUT DRIVERS\fP for details and descriptions of available drivers.
++.TP
++.B \fB\-\-vd=<[+|\-]family1:(*|decoder1),[+|\-]family2:(*|decoder2),...[\-]>\fP
++Specify a priority list of video decoders to be used, according to their
++family and name. See \fB\-\-ad\fP for further details. Both of these options
++use the same syntax and semantics; the only difference is that they
++operate on different codec lists.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++See \fB\-\-vd=help\fP for a full list of available decoders.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-vf=<filter1[=parameter1:parameter2:...],filter2,...>\fP
++Specify a list of video filters to apply to the video stream. See
++\fI\%VIDEO FILTERS\fP for details and descriptions of the available filters.
++The option variants \fB\-\-vf\-add\fP, \fB\-\-vf\-pre\fP, \fB\-\-vf\-del\fP and
++\fB\-\-vf\-clr\fP exist to modify a previously specified list, but you
++should not need these for typical use.
++.TP
++.B \fB\-\-no\-video\fP
++Do not play video. With some demuxers this may not work. In those cases
++you can try \fB\-\-vo=null\fP instead.
++.sp
++mpv will try to download the audio only if media is streamed with
++youtube\-dl, because it saves bandwidth. This is done by setting the ytdl_format
++to "bestaudio/best" in the ytdl_hook.lua script.
++.TP
++.B \fB\-\-untimed\fP
++Do not sleep when outputting video frames. Useful for benchmarks when used
++with \fB\-\-no\-audio.\fP
++.TP
++.B \fB\-\-framedrop=<mode>\fP
++Skip displaying some frames to maintain A/V sync on slow systems, or
++playing high framerate video on video outputs that have an upper framerate
++limit.
++.sp
++The argument selects the drop methods, and can be one of the following:
++.INDENT 7.0
++.TP
++.B <no>
++Disable any framedropping.
++.TP
++.B <vo>
++Drop late frames on video output (default). This still decodes and
++filters all frames, but doesn\(aqt render them on the VO. It tries to query
++the display FPS (X11 only, not correct on multi\-monitor systems), or
++assumes infinite display FPS if that fails. Drops are indicated in
++the terminal status line as \fBDropped:\fP field. If the decoder is too slow,
++in theory all frames would have to be dropped (because all frames are
++too late) \- to avoid this, frame dropping stops if the effective
++framerate is below 10 FPS.
++.TP
++.B <decoder>
++Old, decoder\-based framedrop mode. (This is the same as \fB\-\-framedrop=yes\fP
++in mpv 0.5.x and before.) This tells the decoder to skip frames (unless
++they are needed to decode future frames). May help with slow systems,
++but can produce unwatchable choppy output, or even freeze the display
++completely. Not recommended.
++The \fB\-\-vd\-lavc\-framedrop\fP option controls what frames to drop.
++.TP
++.B <decoder+vo>
++Enable both modes. Not recommended.
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++\fB\-\-vo=vdpau\fP has its own code for the \fBvo\fP framedrop mode. Slight
++differences to other VOs are possible.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-display\-fps=<fps>\fP
++Set the display FPS used with the \fB\-\-video\-sync=display\-*\fP modes. By
++default, a detected value is used. Keep in mind that setting an incorrect
++value (even if slightly incorrect) can ruin video playback. On multi\-monitor
++systems, there is a chance that the detected value is from the wrong
++monitor.
++.sp
++Set this option only if you have reason to believe the automatically
++determined value is wrong.
++.TP
++.B \fB\-\-hwdec=<api>\fP
++Specify the hardware video decoding API that should be used if possible.
++Whether hardware decoding is actually done depends on the video codec. If
++hardware decoding is not possible, mpv will fall back on software decoding.
++.sp
++\fB<api>\fP can be one of the following:
++.INDENT 7.0
++.TP
++.B no
++always use software decoding (default)
++.TP
++.B auto
++see below
++.TP
++.B auto\-copy
++see below
++.TP
++.B vdpau
++requires \fB\-\-vo=vdpau\fP or \fB\-\-vo=opengl\fP (Linux only)
++.TP
++.B vaapi
++requires \fB\-\-vo=opengl\fP or \fB\-\-vo=vaapi\fP (Linux only)
++.TP
++.B vaapi\-copy
++copies video back into system RAM (Linux with Intel GPUs only)
++.TP
++.B videotoolbox
++requires \fB\-\-vo=opengl\fP (OS X 10.8 and up only)
++.TP
++.B dxva2
++requires \fB\-\-vo=opengl:backend=angle\fP or
++\fB\-\-vo=opengl:backend=dxinterop\fP (Windows only)
++.TP
++.B dxva2\-copy
++copies video back to system RAM (Windows only)
++.TP
++.B d3d11va
++requires \fB\-\-vo=opengl:backend=angle\fP (Windows only)
++.TP
++.B d3d11va\-copy
++copies video back to system RAM (Windows only)
++.TP
++.B mediacodec
++copies video back to system RAM (Android only)
++.TP
++.B rpi
++requires \fB\-\-vo=rpi\fP (Raspberry Pi only \- default if available)
++.UNINDENT
++.sp
++\fBauto\fP tries to automatically enable hardware decoding using the first
++available method. This still depends what VO you are using. For example,
++if you are not using \fB\-\-vo=vdpau\fP or \fB\-\-vo=opengl\fP, vdpau decoding will
++never be enabled. Also note that if the first found method doesn\(aqt actually
++work, it will always fall back to software decoding, instead of trying the
++next method (might matter on some Linux systems).
++.sp
++\fBauto\-copy\fP selects only modes that copy the video data back to system
++memory after decoding. Currently, this selects only one of the following
++modes: \fBvaapi\-copy\fP, \fBdxva2\-copy\fP, \fBd3d11va\-copy\fP, \fBmediacodec\fP\&.
++If none of these work, hardware decoding is disabled. This mode is always
++guaranteed to incur no additional loss compared to software decoding, and
++will allow CPU processing with video filters.
++.sp
++The \fBvaapi\fP mode, if used with \fB\-\-vo=opengl\fP, requires Mesa 11 and most
++likely works with Intel GPUs only. It also requires the opengl EGL backend
++(automatically used if available). You can also try the old GLX backend by
++forcing it with \fB\-\-vo=opengl:backend=x11\fP, but the vaapi/GLX interop is
++said to be slower than \fBvaapi\-copy\fP\&.
++.sp
++Most video filters will not work with hardware decoding as they are
++primarily implemented on the CPU. Some exceptions are \fBvdpaupp\fP,
++\fBvdpaurb\fP and \fBvavpp\fP\&. See \fI\%VIDEO FILTERS\fP for more details.
++.sp
++The \fBvaapi\-copy\fP and \fBdxva2\-copy\fP modes allow you to use hardware
++decoding with any VO, backend or filter. Because these copy the decoded
++video back to system RAM, they\(aqre likely less efficient than the \fBvaapi\fP
++or \fBdxva2\fP modes respectively.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++When using this switch, hardware decoding is still only done for some
++codecs. See \fB\-\-hwdec\-codecs\fP to enable hardware decoding for more
++codecs.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Quality reduction with hardware decoding"
++.sp
++Normally, hardware decoding does not reduce video quality (at least for
++the codecs h264 and HEVC). However, due to restrictions in video output
++APIs, there can be some loss, or blatantly incorrect results.
++.sp
++In some cases, RGB conversion is forced, which means the RGB conversion
++is performed by the hardware decoding API, instead of the OpenGL code
++used by \fB\-\-vo=opengl\fP\&. This means certain obscure colorspaces may
++not display correctly, and not certain filtering (such as debanding)
++can not be applied in an ideal way.
++.sp
++\fBvdpau\fP is usually safe. If deinterlacing enabled (or the \fBvdpaupp\fP
++video filter is active in general), it forces RGB conversion. The latter
++currently does not treat certain colorspaces like BT.2020 correctly
++(which is mostly a mpv\-specific restriction). If the \fBvdpauprb\fP
++retrieves image data without RGB conversion, but does not work with
++postprocessing.
++.sp
++\fBvaapi\fP is safe if the \fBvaapi\-egl\fP backend is indicated in the logs.
++If \fBvaapi\-glx\fP is indicated, and the video colorspace is either BT.601
++or BT.709, a forced but correct RGB conversion is performed. Otherwise,
++the result will be incorrect.
++.sp
++\fBd3d11va\fP is usually safe (if used with ANGLE builds that support
++\fBEGL_KHR_stream path\fP \- otherwise, it converts to RGB), except that
++10 bit input (HEVC main 10 profiles) will be rounded down to 8 bits.
++.sp
++\fBdxva2\fP is not safe. It appears to always use BT.601 for forced RGB
++conversion, but actual behavior depends on the GPU drivers. Some drivers
++appear to convert to limited range RGB, which gives a faded appearance.
++In addition to driver\-specific behavior, global system settings might
++affect this additionally. This can give incorrect results even with
++completely ordinary video sources.
++.sp
++All other methods, in particular the copy\-back methods (like
++\fBdxva2\-copy\fP etc.) are either fully safe, or not worse than software
++decoding. In particular, \fBauto\-copy\fP will only select safe modes
++(although potentially slower than other methods).
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-hwdec\-preload=<api>\fP
++This is useful for the \fBopengl\fP and \fBopengl\-cb\fP VOs for creating the
++hardware decoding OpenGL interop context, but without actually enabling
++hardware decoding itself (like \fB\-\-hwdec\fP does).
++.sp
++If set to \fBno\fP (default), the \fB\-\-hwdec\fP option is used.
++.sp
++For \fBopengl\fP, if set, do not create the interop context on demand, but
++when the VO is created.
++.sp
++For \fBopengl\-cb\fP, if set, load the interop context as soon as the OpenGL
++context is created. Since \fBopengl\-cb\fP has no on\-demand loading, this
++allows enabling hardware decoding at runtime at all, without having
++to temporarily set the \fBhwdec\fP option just during OpenGL context
++initialization with \fBmpv_opengl_cb_init_gl()\fP\&.
++.TP
++.B \fB\-\-videotoolbox\-format=<name>\fP
++Set the internal pixel format used by \fB\-\-hwdec=videotoolbox\fP on OSX. The
++choice of the format can influence performance considerably. On the other
++hand, there doesn\(aqt appear to be a good way to detect the best format for
++the given hardware. \fBnv12\fP, the default, works better on modern hardware,
++while \fBuyvy422\fP appears to be better for old hardware. \fBrgb0\fP also
++works.
++.TP
++.B \fB\-\-panscan=<0.0\-1.0>\fP
++Enables pan\-and\-scan functionality (cropping the sides of e.g. a 16:9
++video to make it fit a 4:3 display without black bands). The range
++controls how much of the image is cropped. May not work with all video
++output drivers.
++.TP
++.B \fB\-\-video\-aspect=<ratio>\fP
++Override video aspect ratio, in case aspect information is incorrect or
++missing in the file being played. See also \fB\-\-no\-video\-aspect\fP\&.
++.sp
++Two values have special meaning:
++.INDENT 7.0
++.TP
++.B 0
++disable aspect ratio handling, pretend the video has square pixels
++.TP
++.B \-1
++use the video stream or container aspect (default)
++.UNINDENT
++.sp
++But note that handling of these special values might change in the future.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-video\-aspect=4:3\fP or \fB\-\-video\-aspect=1.3333\fP
++.IP \(bu 2
++\fB\-\-video\-aspect=16:9\fP or \fB\-\-video\-aspect=1.7777\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-no\-video\-aspect\fP
++Ignore aspect ratio information from video file and assume the video has
++square pixels. See also \fB\-\-video\-aspect\fP\&.
++.TP
++.B \fB\-\-video\-aspect\-method=<hybrid|bitstream|container>\fP
++This sets the default video aspect determination method (if the aspect is
++_not_ overridden by the user with \fB\-\-video\-aspect\fP or others).
++.INDENT 7.0
++.TP
++.B hybrid
++Prefer the container aspect ratio. If the bitstream aspect
++switches mid\-stream, switch to preferring the bitstream aspect.
++This is the default behavior in mpv and mplayer2.
++.TP
++.B container
++Strictly prefer the container aspect ratio. This is apparently
++the default behavior with VLC, at least with Matroska.
++.TP
++.B bitstream
++Strictly prefer the bitstream aspect ratio, unless the bitstream
++aspect ratio is not set. This is apparently the default behavior
++with XBMC/kodi, at least with Matroska.
++.UNINDENT
++.sp
++Normally you should not set this. Try the \fBcontainer\fP and \fBbitstream\fP
++choices if you encounter video that has the wrong aspect ratio in mpv,
++but seems to be correct in other players.
++.TP
++.B \fB\-\-video\-unscaled\fP
++Disable scaling of the video. If the window is larger than the video,
++black bars are added. Otherwise, the video is cropped. The video still
++can be influenced by the other \fB\-\-video\-...\fP options.
++.sp
++Note that the scaler algorithm may still be used, even if the video isn\(aqt
++scaled. For example, this can influence chroma conversion. The video will
++also still be scaled in one dimension if the source uses non\-square pixels
++(e.g. anamorphic widescreen DVDs).
++.sp
++This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
++.TP
++.B \fB\-\-video\-pan\-x=<value>\fP, \fB\-\-video\-pan\-y=<value>\fP
++Moves the displayed video rectangle by the given value in the X or Y
++direction. The unit is in fractions of the size of the scaled video (the
++full size, even if parts of the video are not visible due to panscan or
++other options).
++.sp
++For example, displaying a 1280x720 video fullscreen on a 1680x1050 screen
++with \fB\-\-video\-pan\-x=\-0.1\fP would move the video 168 pixels to the left
++(making 128 pixels of the source video invisible).
++.sp
++This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
++.TP
++.B \fB\-\-video\-rotate=<0\-359|no>\fP
++Rotate the video clockwise, in degrees. Currently supports 90° steps only.
++If \fBno\fP is given, the video is never rotated, even if the file has
++rotation metadata. (The rotation value is added to the rotation metadata,
++which means the value \fB0\fP would rotate the video according to the
++rotation metadata.)
++.TP
++.B \fB\-\-video\-stereo\-mode=<no|mode>\fP
++Set the stereo 3D output mode (default: \fBmono\fP). This is done by inserting
++the \fBstereo3d\fP conversion filter.
++.sp
++The pseudo\-mode \fBno\fP disables automatic conversion completely.
++.sp
++The mode \fBmono\fP is an alias to \fBml\fP, which refers to the left frame in
++2D. This is the default, which means mpv will try to show 3D movies in 2D,
++instead of the mangled 3D image not intended for consumption (such as
++showing the left and right frame side by side, etc.).
++.sp
++Use \fB\-\-video\-stereo\-mode=help\fP to list all available modes. Check with
++the \fBstereo3d\fP filter documentation to see what the names mean. Note that
++some names refer to modes not supported by \fBstereo3d\fP \- these modes can
++appear in files, but can\(aqt be handled properly by mpv.
++.TP
++.B \fB\-\-video\-zoom=<value>\fP
++Adjust the video display scale factor by the given value. The parameter is
++given log 2. For example, \fB\-\-video\-zoom=0\fP is unscaled,
++\fB\-\-video\-zoom=1\fP is twice the size, \fB\-\-video\-zoom=\-2\fP is one fourth of
++the size, and so on.
++.sp
++This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
++.TP
++.B \fB\-\-video\-align\-x=<\-1\-1>\fP, \fB\-\-video\-align\-y=<\-1\-1>\fP
++Moves the video rectangle within the black borders, which are usually added
++to pad the video to screen if video and screen aspect ratios are different.
++\fB\-\-video\-align\-y=\-1\fP would move the video to the top of the screen
++(leaving a border only on the bottom), a value of \fB0\fP centers it
++(default), and a value of \fB1\fP would put the video at the bottom of the
++screen.
++.sp
++If video and screen aspect match perfectly, these options do nothing.
++.sp
++This option is disabled if the \fB\-\-no\-keepaspect\fP option is used.
++.TP
++.B \fB\-\-correct\-pts\fP, \fB\-\-no\-correct\-pts\fP
++\fB\-\-no\-correct\-pts\fP switches mpv to a mode where video timing is
++determined using a fixed framerate value (either using the \fB\-\-fps\fP
++option, or using file information). Sometimes, files with very broken
++timestamps can be played somewhat well in this mode. Note that video
++filters, subtitle rendering and audio synchronization can be completely
++broken in this mode.
++.TP
++.B \fB\-\-fps=<float>\fP
++Override video framerate. Useful if the original value is wrong or missing.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Works in \fB\-\-no\-correct\-pts\fP mode only.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-deinterlace=<yes|no|auto>\fP
++Enable or disable interlacing (default: auto, which usually means no).
++Interlaced video shows ugly comb\-like artifacts, which are visible on
++fast movement. Enabling this typically inserts the yadif video filter in
++order to deinterlace the video, or lets the video output apply deinterlacing
++if supported.
++.sp
++This behaves exactly like the \fBdeinterlace\fP input property (usually
++mapped to \fBd\fP).
++.sp
++\fBauto\fP is a technicality. Strictly speaking, the default for this option
++is deinterlacing disabled, but the \fBauto\fP case is needed if \fByadif\fP was
++added to the filter chain manually with \fB\-\-vf\fP\&. Then the core shouldn\(aqt
++disable deinterlacing just because the \fB\-\-deinterlace\fP was not set.
++.TP
++.B \fB\-\-field\-dominance=<auto|top|bottom>\fP
++Set first field for interlaced content. Useful for deinterlacers that
++double the framerate: \fB\-\-vf=yadif=field\fP and \fB\-\-vo=vdpau:deint\fP\&.
++.INDENT 7.0
++.TP
++.B auto
++(default) If the decoder does not export the appropriate
++information, it falls back on \fBtop\fP (top field first).
++.TP
++.B top
++top field first
++.TP
++.B bottom
++bottom field first
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Setting either \fBtop\fP or \fBbottom\fP will flag all frames as interlaced.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-frames=<number>\fP
++Play/convert only first \fB<number>\fP video frames, then quit.
++.sp
++\fB\-\-frames=0\fP loads the file, but immediately quits before initializing
++playback. (Might be useful for scripts which just want to determine some
++file properties.)
++.sp
++For audio\-only playback, any value greater than 0 will quit playback
++immediately after initialization. The value 0 works as with video.
++.TP
++.B \fB\-\-video\-output\-levels=<outputlevels>\fP
++RGB color levels used with YUV to RGB conversion. Normally, output devices
++such as PC monitors use full range color levels. However, some TVs and
++video monitors expect studio RGB levels. Providing full range output to a
++device expecting studio level input results in crushed blacks and whites,
++the reverse in dim gray blacks and dim whites.
++.sp
++Not all VOs support this option. Some will silently ignore it.
++.sp
++Available color ranges are:
++.INDENT 7.0
++.TP
++.B auto
++automatic selection (equals to full range) (default)
++.TP
++.B limited
++limited range (16\-235 per component), studio levels
++.TP
++.B full
++full range (0\-255 per component), PC levels
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++It is advisable to use your graphics driver\(aqs color range option
++instead, if available.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-hwdec\-codecs=<codec1,codec2,...|all>\fP
++Allow hardware decoding for a given list of codecs only. The special value
++\fBall\fP always allows all codecs.
++.sp
++You can get the list of allowed codecs with \fBmpv \-\-vd=help\fP\&. Remove the
++prefix, e.g. instead of \fBlavc:h264\fP use \fBh264\fP\&.
++.sp
++By default, this is set to \fBh264,vc1,wmv3,hevc,mpeg2video\fP\&. Note that the
++hardware acceleration special codecs like \fBh264_vdpau\fP are not relevant
++anymore, and in fact have been removed from Libav in this form.
++.sp
++This is usually only needed with broken GPUs, where a codec is reported
++as supported, but decoding causes more problems than it solves.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBmpv \-\-hwdec=vdpau \-\-vo=vdpau \-\-hwdec\-codecs=h264,mpeg2video\fP
++Enable vdpau decoding for h264 and mpeg2 only.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-vd\-lavc\-check\-hw\-profile=<yes|no>\fP
++Check hardware decoder profile (default: yes). If \fBno\fP is set, the
++highest profile of the hardware decoder is unconditionally selected, and
++decoding is forced even if the profile of the video is higher than that.
++The result is most likely broken decoding, but may also help if the
++detected or reported profiles are somehow incorrect.
++.TP
++.B \fB\-\-vd\-lavc\-software\-fallback=<yes|no|N>\fP
++Fallback to software decoding if the hardware\-accelerated decoder fails
++(default: 3). If this is a number, then fallback will be triggered if
++N frames fail to decode in a row. 1 is equivalent to \fByes\fP\&.
++.TP
++.B \fB\-\-vd\-lavc\-bitexact\fP
++Only use bit\-exact algorithms in all decoding steps (for codec testing).
++.TP
++.B \fB\-\-vd\-lavc\-fast\fP (MPEG\-2, MPEG\-4, and H.264 only)
++Enable optimizations which do not comply with the format specification and
++potentially cause problems, like simpler dequantization, simpler motion
++compensation, assuming use of the default quantization matrix, assuming YUV
++4:2:0 and skipping a few checks to detect damaged bitstreams.
++.TP
++.B \fB\-\-vd\-lavc\-o=<key>=<value>[,<key>=<value>[,...]]\fP
++Pass AVOptions to libavcodec decoder. Note, a patch to make the \fBo=\fP
++unneeded and pass all unknown options through the AVOption system is
++welcome. A full list of AVOptions can be found in the FFmpeg manual.
++.sp
++Some options which used to be direct options can be set with this
++mechanism, like \fBbug\fP, \fBgray\fP, \fBidct\fP, \fBec\fP, \fBvismv\fP,
++\fBskip_top\fP (was \fBst\fP), \fBskip_bottom\fP (was \fBsb\fP), \fBdebug\fP\&.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++\fB\-\-vd\-lavc\-o=debug=pict\fP
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-vd\-lavc\-show\-all=<yes|no>\fP
++Show even broken/corrupt frames (default: no). If this option is set to
++no, libavcodec won\(aqt output frames that were either decoded before an
++initial keyframe was decoded, or frames that are recognized as corrupted.
++.TP
++.B \fB\-\-vd\-lavc\-skiploopfilter=<skipvalue> (H.264 only)\fP
++Skips the loop filter (AKA deblocking) during H.264 decoding. Since
++the filtered frame is supposed to be used as reference for decoding
++dependent frames, this has a worse effect on quality than not doing
++deblocking on e.g. MPEG\-2 video. But at least for high bitrate HDTV,
++this provides a big speedup with little visible quality loss.
++.sp
++\fB<skipvalue>\fP can be one of the following:
++.INDENT 7.0
++.TP
++.B none
++Never skip.
++.TP
++.B default
++Skip useless processing steps (e.g. 0 size packets in AVI).
++.TP
++.B nonref
++Skip frames that are not referenced (i.e. not used for
++decoding other frames, the error cannot "build up").
++.TP
++.B bidir
++Skip B\-Frames.
++.TP
++.B nonkey
++Skip all frames except keyframes.
++.TP
++.B all
++Skip all frames.
++.UNINDENT
++.TP
++.B \fB\-\-vd\-lavc\-skipidct=<skipvalue> (MPEG\-1/2 only)\fP
++Skips the IDCT step. This degrades quality a lot in almost all cases
++(see skiploopfilter for available skip values).
++.TP
++.B \fB\-\-vd\-lavc\-skipframe=<skipvalue>\fP
++Skips decoding of frames completely. Big speedup, but jerky motion and
++sometimes bad artifacts (see skiploopfilter for available skip values).
++.TP
++.B \fB\-\-vd\-lavc\-framedrop=<skipvalue>\fP
++Set framedropping mode used with \fB\-\-framedrop\fP (see skiploopfilter for
++available skip values).
++.TP
++.B \fB\-\-vd\-lavc\-threads=<N>\fP
++Number of threads to use for decoding. Whether threading is actually
++supported depends on codec (default: 0). 0 means autodetect number of cores
++on the machine and use that, up to the maximum of 16. You can set more than
++16 threads manually.
++.UNINDENT
++.SS Audio
++.INDENT 0.0
++.TP
++.B \fB\-\-audio\-pitch\-correction=<yes|no>\fP
++If this is enabled (default), playing with a speed different from normal
++automatically inserts the \fBscaletempo\fP audio filter. For details, see
++audio filter section.
++.TP
++.B \fB\-\-audio\-device=<name>\fP
++Use the given audio device. This consists of the audio output name, e.g.
++\fBalsa\fP, followed by \fB/\fP, followed by the audio output specific device
++name.
++.sp
++You can list audio devices with \fB\-\-audio\-device=help\fP\&. This outputs the
++device name in quotes, followed by a description. The device name is what
++you have to pass to the \fB\-\-audio\-device\fP option.
++.sp
++The default value for this option is \fBauto\fP, which tries every audio
++output in preference order with the default device.
++.sp
++Note that many AOs have a \fBdevice\fP sub\-option, which overrides the
++device selection of this option (but not the audio output selection).
++Likewise, forcing an AO with \fB\-\-ao\fP will override the audio output
++selection of \fB\-\-audio\-device\fP (but not the device selection).
++.sp
++Currently not implemented for most AOs.
++.TP
++.B \fB\-\-audio\-fallback\-to\-null=<yes|no>\fP
++If no audio device can be opened, behave as if \fB\-\-ao=null\fP was given. This
++is useful in combination with \fB\-\-audio\-device\fP: instead of causing an
++error if the selected device does not exist, the client API user (or a
++Lua script) could let playback continue normally, and check the
++\fBcurrent\-ao\fP and \fBaudio\-device\-list\fP properties to make high\-level
++decisions about how to continue.
++.TP
++.B \fB\-\-ao=<driver1[:suboption1[=value]:...],driver2,...[,]>\fP
++Specify a priority list of audio output drivers to be used. For
++interactive use one would normally specify a single one to use, but in
++configuration files specifying a list of fallbacks may make sense. See
++\fI\%AUDIO OUTPUT DRIVERS\fP for details and descriptions of available drivers.
++.TP
++.B \fB\-\-af=<filter1[=parameter1:parameter2:...],filter2,...>\fP
++Specify a list of audio filters to apply to the audio stream. See
++\fI\%AUDIO FILTERS\fP for details and descriptions of the available filters.
++The option variants \fB\-\-af\-add\fP, \fB\-\-af\-pre\fP, \fB\-\-af\-del\fP and
++\fB\-\-af\-clr\fP exist to modify a previously specified list, but you
++should not need these for typical use.
++.TP
++.B \fB\-\-audio\-spdif=<codecs>\fP
++List of codecs for which compressed audio passthrough should be used. This
++works for both classic S/PDIF and HDMI.
++.sp
++Possible codecs are \fBac3\fP, \fBdts\fP, \fBdts\-hd\fP\&. Multiple codecs can be
++specified by separating them with \fB,\fP\&. \fBdts\fP refers to low bitrate DTS
++core, while \fBdts\-hd\fP refers to DTS MA (receiver and OS support varies).
++You should only use either \fBdts\fP or \fBdts\-hd\fP (if both are specified,
++and \fBdts\fP comes first, only \fBdts\fP will be used).
++.sp
++In general, all codecs in the \fBspdif\fP family listed with \fB\-\-ad=help\fP
++are supported in theory.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++There is not much reason to use this. HDMI supports uncompressed
++multichannel PCM, and mpv supports lossless DTS\-HD decoding via
++FFmpeg\(aqs new DCA decoder (based on libdcadec).
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-ad=<[+|\-]family1:(*|decoder1),[+|\-]family2:(*|decoder2),...[\-]>\fP
++Specify a priority list of audio decoders to be used, according to their
++family and decoder name. Entries like \fBfamily:*\fP prioritize all decoders
++of the given family. When determining which decoder to use, the first
++decoder that matches the audio format is selected. If that is unavailable,
++the next decoder is used. Finally, it tries all other decoders that are not
++explicitly selected or rejected by the option.
++.sp
++\fB\-\fP at the end of the list suppresses fallback on other available
++decoders not on the \fB\-\-ad\fP list. \fB+\fP in front of an entry forces the
++decoder. Both of these should not normally be used, because they break
++normal decoder auto\-selection!
++.sp
++\fB\-\fP in front of an entry disables selection of the decoder.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fB\-\-ad=lavc:mp3float\fP
++Prefer the FFmpeg/Libav \fBmp3float\fP decoder over all other MP3
++decoders.
++.TP
++.B \fB\-\-ad=spdif:ac3,lavc:*\fP
++Always prefer spdif AC3 over FFmpeg/Libav over anything else.
++.TP
++.B \fB\-\-ad=help\fP
++List all available decoders.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++Enabling compressed audio passthrough (AC3 and DTS via SPDIF/HDMI) with
++this option is deprecated. Use \fB\-\-audio\-spdif\fP instead.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-volume=<value>\fP
++Set the startup volume. 0 means silence, 100 means no volume reduction or
++amplification. A value of \-1 (the default) will not change the volume. See
++also \fB\-\-softvol\fP\&.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This was changed after the mpv 0.9 release. Before that, 100 actually
++meant maximum volume. At the same time, the volume scale was made cubic,
++so the old values won\(aqt match up with the new ones anyway.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-audio\-delay=<sec>\fP
++Audio delay in seconds (positive or negative float value). Positive values
++delay the audio, and negative values delay the video.
++.TP
++.B \fB\-\-no\-audio\fP
++Do not play sound.
++.TP
++.B \fB\-\-mute=<auto|yes|no>\fP
++Set startup audio mute status. \fBauto\fP (default) will not change the mute
++status.
++.sp
++See also: \fB\-\-volume\fP\&.
++.TP
++.B \fB\-\-softvol=<mode>\fP
++Control whether to use the volume controls of the audio output driver or
++the internal mpv volume filter.
++.INDENT 7.0
++.TP
++.B no
++prefer audio driver controls, use the volume filter only if
++absolutely needed
++.TP
++.B yes
++always use the volume filter
++.TP
++.B auto
++prefer the volume filter if the audio driver uses the system mixer
++(default)
++.UNINDENT
++.sp
++The intention of \fBauto\fP is to avoid changing system mixer settings from
++within mpv with default settings. mpv is a video player, not a mixer panel.
++On the other hand, mixer controls are enabled for sound servers like
++PulseAudio, which provide per\-application volume.
++.TP
++.B \fB\-\-audio\-demuxer=<[+]name>\fP
++Use this audio demuxer type when using \fB\-\-audio\-file\fP\&. Use a \(aq+\(aq before
++the name to force it; this will skip some checks. Give the demuxer name as
++printed by \fB\-\-audio\-demuxer=help\fP\&.
++.TP
++.B \fB\-\-ad\-lavc\-ac3drc=<level>\fP
++Select the Dynamic Range Compression level for AC\-3 audio streams.
++\fB<level>\fP is a float value ranging from 0 to 1, where 0 means no
++compression (which is the default) and 1 means full compression (make loud
++passages more silent and vice versa). Values up to 6 are also accepted, but
++are purely experimental. This option only shows an effect if the AC\-3 stream
++contains the required range compression information.
++.sp
++The standard mandates that DRC is enabled by default, but mpv (and some
++other players) ignore this for the sake of better audio quality.
++.TP
++.B \fB\-\-ad\-lavc\-downmix=<yes|no>\fP
++Whether to request audio channel downmixing from the decoder (default: yes).
++Some decoders, like AC\-3, AAC and DTS, can remix audio on decoding. The
++requested number of output channels is set with the \fB\-\-audio\-channels\fP option.
++Useful for playing surround audio on a stereo system.
++.TP
++.B \fB\-\-ad\-lavc\-threads=<0\-16>\fP
++Number of threads to use for decoding. Whether threading is actually
++supported depends on codec. As of this writing, it\(aqs supported for some
++lossless codecs only. 0 means autodetect number of cores on the
++machine and use that, up to the maximum of 16 (default: 1).
++.TP
++.B \fB\-\-ad\-lavc\-o=<key>=<value>[,<key>=<value>[,...]]\fP
++Pass AVOptions to libavcodec decoder. Note, a patch to make the o=
++unneeded and pass all unknown options through the AVOption system is
++welcome. A full list of AVOptions can be found in the FFmpeg manual.
++.TP
++.B \fB\-\-ad\-spdif\-dtshd=<yes|no>\fP, \fB\-\-dtshd\fP, \fB\-\-no\-dtshd\fP
++If DTS is passed through, use DTS\-HD.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++This and enabling passthrough via \fB\-\-ad\fP are deprecated in favor of
++using \fB\-\-audio\-spdif=dts\-hd\fP\&.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-audio\-channels=<auto|number|layout>\fP
++Request a channel layout for audio output (default: stereo). This will ask
++the AO to open a device with the given channel layout. It\(aqs up to the AO
++to accept this layout, or to pick a fallback or to error out if the
++requested layout is not supported.
++.sp
++The \fB\-\-audio\-channels\fP option either takes a channel number or an explicit
++channel layout. Channel numbers refer to default layouts, e.g. 2 channels
++refer to stereo, 6 refers to 5.1.
++.sp
++See \fB\-\-audio\-channels=help\fP output for defined default layouts. This also
++lists speaker names, which can be used to express arbitrary channel
++layouts (e.g. \fBfl\-fr\-lfe\fP is 2.1).
++.sp
++\fB\-\-audio\-channels=auto\fP tries to play audio using the input file\(aqs
++channel layout. There is no guarantee that the audio API handles this
++correctly. See the HDMI warning below.
++(\fBempty\fP is an accepted obsolete alias for \fBauto\fP\&.)
++.sp
++This will also request the channel layout from the decoder. If the decoder
++does not support the layout, it will fall back to its native channel layout.
++(You can use \fB\-\-ad\-lavc\-downmix=no\fP to make the decoder always output
++its native layout.) Note that only some decoders support remixing audio.
++Some that do include AC\-3, AAC or DTS audio.
++.sp
++If the channel layout of the media file (i.e. the decoder) and the AO\(aqs
++channel layout don\(aqt match, mpv will attempt to insert a conversion filter.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++Using \fBauto\fP can cause issues when using audio over HDMI. The OS will
++typically report all channel layouts that _can_ go over HDMI, even if
++the receiver does not support them. If a receiver gets an unsupported
++channel layout, random things can happen, such as dropping the
++additional channels, or adding noise.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-audio\-normalize\-downmix=<yes|no>\fP
++Enable/disable normalization if surround audio is downmixed to stereo
++(default: no). If this is disabled, downmix can cause clipping. If it\(aqs
++enabled, the output might be too silent. It depends on the source audio.
++.sp
++Technically, this changes the \fBnormalize\fP suboption of the
++\fBlavrresample\fP audio filter, which performs the downmixing.
++.sp
++If downmix happens outside of mpv for some reason, this has no effect.
++.TP
++.B \fB\-\-audio\-display=<no|attachment>\fP
++Setting this option to \fBattachment\fP (default) will display image
++attachments (e.g. album cover art) when playing audio files. It will
++display the first image found, and additional images are available as
++video tracks.
++.sp
++Setting this option to \fBno\fP disables display of video entirely when
++playing audio files.
++.sp
++This option has no influence on files with normal video tracks.
++.TP
++.B \fB\-\-audio\-file=<filename>\fP
++Play audio from an external file while viewing a video. Each use of this
++option will add a new audio track. The details are similar to how
++\fB\-\-sub\-file\fP works.
++.TP
++.B \fB\-\-audio\-format=<format>\fP
++Select the sample format used for output from the audio filter layer to
++the sound card. The values that \fB<format>\fP can adopt are listed below in
++the description of the \fBformat\fP audio filter.
++.TP
++.B \fB\-\-audio\-samplerate=<Hz>\fP
++Select the output sample rate to be used (of course sound cards have
++limits on this). If the sample frequency selected is different from that
++of the current media, the lavrresample audio filter will be inserted into
++the audio filter layer to compensate for the difference.
++.TP
++.B \fB\-\-gapless\-audio=<no|yes|weak>\fP
++Try to play consecutive audio files with no silence or disruption at the
++point of file change. Default: \fBweak\fP\&.
++.INDENT 7.0
++.TP
++.B no
++Disable gapless audio.
++.TP
++.B yes
++The audio device is opened using parameters chosen for the first
++file played and is then kept open for gapless playback. This
++means that if the first file for example has a low sample rate, then
++the following files may get resampled to the same low sample rate,
++resulting in reduced sound quality. If you play files with different
++parameters, consider using options such as \fB\-\-audio\-samplerate\fP
++and \fB\-\-audio\-format\fP to explicitly select what the shared output
++format will be.
++.TP
++.B weak
++Normally, the audio device is kept open (using the format it was
++first initialized with). If the audio format the decoder output
++changes, the audio device is closed and reopened. This means that
++you will normally get gapless audio with files that were encoded
++using the same settings, but might not be gapless in other cases.
++(Unlike with \fByes\fP, you don\(aqt have to worry about corner cases
++like the first file setting a very low quality output format, and
++ruining the playback of higher quality files that follow.)
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This feature is implemented in a simple manner and relies on audio
++output device buffering to continue playback while moving from one file
++to another. If playback of the new file starts slowly, for example
++because it is played from a remote network location or because you have
++specified cache settings that require time for the initial cache fill,
++then the buffered audio may run out before playback of the new file
++can start.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-initial\-audio\-sync\fP, \fB\-\-no\-initial\-audio\-sync\fP
++When starting a video file or after events such as seeking, mpv will by
++default modify the audio stream to make it start from the same timestamp
++as video, by either inserting silence at the start or cutting away the
++first samples. Disabling this option makes the player behave like older
++mpv versions did: video and audio are both started immediately even if
++their start timestamps differ, and then video timing is gradually adjusted
++if necessary to reach correct synchronization later.
++.TP
++.B \fB\-\-softvol\-max=<100.0\-1000.0>\fP
++Set the maximum amplification level in percent (default: 130). A value of
++130 will allow you to adjust the volume up to about double the normal level.
++.TP
++.B \fB\-\-audio\-file\-auto=<no|exact|fuzzy|all>\fP, \fB\-\-no\-audio\-file\-auto\fP
++Load additional audio files matching the video filename. The parameter
++specifies how external audio files are matched. \fBexact\fP is enabled by
++default.
++.INDENT 7.0
++.TP
++.B no
++Don\(aqt automatically load external audio files.
++.TP
++.B exact
++Load the media filename with audio file extension (default).
++.TP
++.B fuzzy
++Load all audio files containing media filename.
++.TP
++.B all
++Load all aufio files in the current and \fB\-\-audio\-file\-paths\fP
++directories.
++.UNINDENT
++.TP
++.B \fB\-\-audio\-file\-paths=<path1:path2:...>\fP
++Equivalent to \fB\-\-sub\-paths\fP option, but for auto\-loaded audio files.
++.TP
++.B \fB\-\-audio\-client\-name=<name>\fP
++The application name the player reports to the audio API. Can be useful
++if you want to force a different audio profile (e.g. with PulseAudio),
++or to set your own application name when using libmpv.
++.TP
++.B \fB\-\-volume\-restore\-data=<string>\fP
++Used internally for use by playback resume (e.g. with \fBquit_watch_later\fP).
++Restoring value has to be done carefully, because different AOs as well as
++softvol can have different value ranges, and we don\(aqt want to restore
++volume if setting the volume changes it system wide. The normal options
++(like \fB\-\-volume\fP) would always set the volume. This option was added for
++restoring volume in a safer way (by storing the method used to set the
++volume), and is not generally useful. Its semantics are considered private
++to mpv.
++.sp
++Do not use.
++.TP
++.B \fB\-\-audio\-buffer=<seconds>\fP
++Set the audio output minimum buffer. The audio device might actually create
++a larger buffer if it pleases. If the device creates a smaller buffer,
++additional audio is buffered in an additional software buffer.
++.sp
++Making this larger will make soft\-volume and other filters react slower,
++introduce additional issues on playback speed change, and block the
++player on audio format changes. A smaller buffer might lead to audio
++dropouts.
++.sp
++This option should be used for testing only. If a non\-default value helps
++significantly, the mpv developers should be contacted.
++.sp
++Default: 0.2 (200 ms).
++.UNINDENT
++.SS Subtitles
++.sp
++\fBNOTE:\fP
++.INDENT 0.0
++.INDENT 3.5
++Changing styling and position does not work with all subtitles. Image\-based
++subtitles (DVD, Bluray/PGS, DVB) can not changed for fundamental reasons.
++Subtitles in ASS format are normally not changed intentionally, but
++overriding them can be controlled with \fB\-\-ass\-style\-override\fP\&.
++.UNINDENT
++.UNINDENT
++.INDENT 0.0
++.TP
++.B \fB\-\-no\-sub\fP
++Do not select any subtitle when the file is loaded.
++.TP
++.B \fB\-\-sub\-demuxer=<[+]name>\fP
++Force subtitle demuxer type for \fB\-\-sub\-file\fP\&. Give the demuxer name as
++printed by \fB\-\-sub\-demuxer=help\fP\&.
++.TP
++.B \fB\-\-sub\-delay=<sec>\fP
++Delays subtitles by \fB<sec>\fP seconds. Can be negative.
++.TP
++.B \fB\-\-sub\-file=subtitlefile\fP
++Add a subtitle file to the list of external subtitles.
++.sp
++If you use \fB\-\-sub\-file\fP only once, this subtitle file is displayed by
++default.
++.sp
++If \fB\-\-sub\-file\fP is used multiple times, the subtitle to use can be
++switched at runtime by cycling subtitle tracks. It\(aqs possible to show
++two subtitles at once: use \fB\-\-sid\fP to select the first subtitle index,
++and \fB\-\-secondary\-sid\fP to select the second index. (The index is printed
++on the terminal output after the \fB\-\-sid=\fP in the list of streams.)
++.TP
++.B \fB\-\-secondary\-sid=<ID|auto|no>\fP
++Select a secondary subtitle stream. This is similar to \fB\-\-sid\fP\&. If a
++secondary subtitle is selected, it will be rendered as toptitle (i.e. on
++the top of the screen) alongside the normal subtitle, and provides a way
++to render two subtitles at once.
++.sp
++There are some caveats associated with this feature. For example, bitmap
++subtitles will always be rendered in their usual position, so selecting a
++bitmap subtitle as secondary subtitle will result in overlapping subtitles.
++Secondary subtitles are never shown on the terminal if video is disabled.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Styling and interpretation of any formatting tags is disabled for the
++secondary subtitle. Internally, the same mechanism as \fB\-\-no\-sub\-ass\fP
++is used to strip the styling.
++.UNINDENT
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++If the main subtitle stream contains formatting tags which display the
++subtitle at the top of the screen, it will overlap with the secondary
++subtitle. To prevent this, you could use \fB\-\-no\-sub\-ass\fP to disable
++styling in the main subtitle stream.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-sub\-scale=<0\-100>\fP
++Factor for the text subtitle font size (default: 1).
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This affects ASS subtitles as well, and may lead to incorrect subtitle
++rendering. Use with care, or use \fB\-\-sub\-text\-font\-size\fP instead.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-sub\-scale\-by\-window=<yes|no>\fP
++Whether to scale subtitles with the window size (default: yes). If this is
++disabled, changing the window size won\(aqt change the subtitle font size.
++.sp
++Like \fB\-\-sub\-scale\fP, this can break ASS subtitles.
++.TP
++.B \fB\-\-sub\-scale\-with\-window=<yes|no>\fP
++Make the subtitle font size relative to the window, instead of the video.
++This is useful if you always want the same font size, even if the video
++doesn\(aqt covert the window fully, e.g. because screen aspect and window
++aspect mismatch (and the player adds black bars).
++.sp
++Default: yes.
++.sp
++This option is misnamed. The difference to the confusingly similar sounding
++option \fB\-\-sub\-scale\-by\-window\fP is that \fB\-\-sub\-scale\-with\-window\fP still
++scales with the approximate window size, while the other option disables
++this scaling.
++.sp
++Affects plain text subtitles only (or ASS if \fB\-\-ass\-style\-override\fP is
++set high enough).
++.TP
++.B \fB\-\-ass\-scale\-with\-window=<yes|no>\fP
++Like \fB\-\-sub\-scale\-with\-window\fP, but affects subtitles in ASS format only.
++Like \fB\-\-sub\-scale\fP, this can break ASS subtitles.
++.sp
++Default: no.
++.TP
++.B \fB\-\-embeddedfonts\fP, \fB\-\-no\-embeddedfonts\fP
++Use fonts embedded in Matroska container files and ASS scripts (default:
++enabled). These fonts can be used for SSA/ASS subtitle rendering.
++.TP
++.B \fB\-\-sub\-pos=<0\-100>\fP
++Specify the position of subtitles on the screen. The value is the vertical
++position of the subtitle in % of the screen height.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This affects ASS subtitles as well, and may lead to incorrect subtitle
++rendering. Use with care, or use \fB\-\-sub\-text\-margin\-y\fP instead.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-sub\-speed=<0.1\-10.0>\fP
++Multiply the subtitle event timestamps with the given value. Can be used
++to fix the playback speed for frame\-based subtitle formats. Affects text
++subtitles only.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++\fI\-\-sub\-speed=25/23.976\(ga\fP plays frame based subtitles which have been
++loaded assuming a framerate of 23.976 at 25 FPS.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-ass\-force\-style=<[Style.]Param=Value[,...]>\fP
++Override some style or script info parameters.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-ass\-force\-style=FontName=Arial,Default.Bold=1\fP
++.IP \(bu 2
++\fB\-\-ass\-force\-style=PlayResY=768\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Using this option may lead to incorrect subtitle rendering.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-ass\-hinting=<none|light|normal|native>\fP
++Set font hinting type. <type> can be:
++.INDENT 7.0
++.TP
++.B none
++no hinting (default)
++.TP
++.B light
++FreeType autohinter, light mode
++.TP
++.B normal
++FreeType autohinter, normal mode
++.TP
++.B native
++font native hinter
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++Enabling hinting can lead to mispositioned text (in situations it\(aqs
++supposed to match up video background), or reduce the smoothness
++of animations with some badly authored ASS scripts. It is recommended
++to not use this option, unless really needed.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-ass\-line\-spacing=<value>\fP
++Set line spacing value for SSA/ASS renderer.
++.TP
++.B \fB\-\-ass\-shaper=<simple|complex>\fP
++Set the text layout engine used by libass.
++.INDENT 7.0
++.TP
++.B simple
++uses Fribidi only, fast, doesn\(aqt render some languages correctly
++.TP
++.B complex
++uses HarfBuzz, slower, wider language support
++.UNINDENT
++.sp
++\fBcomplex\fP is the default. If libass hasn\(aqt been compiled against HarfBuzz,
++libass silently reverts to \fBsimple\fP\&.
++.TP
++.B \fB\-\-ass\-styles=<filename>\fP
++Load all SSA/ASS styles found in the specified file and use them for
++rendering text subtitles. The syntax of the file is exactly like the \fB[V4
++Styles]\fP / \fB[V4+ Styles]\fP section of SSA/ASS.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Using this option may lead to incorrect subtitle rendering.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-ass\-style\-override=<yes|no|force|signfs|strip>\fP
++Control whether user style overrides should be applied.
++.INDENT 7.0
++.TP
++.B yes
++Apply all the \fB\-\-ass\-*\fP style override options. Changing the default
++for any of these options can lead to incorrect subtitle rendering
++(default).
++.TP
++.B signfs
++like \fByes\fP, but apply \fB\-\-sub\-scale\fP only to signs
++.TP
++.B no
++Render subtitles as forced by subtitle scripts.
++.TP
++.B force
++Try to force the font style as defined by the \fB\-\-sub\-text\-*\fP
++options. Can break rendering easily.
++.TP
++.B strip
++Radically strip all ASS tags and styles from the subtitle. This
++is equivalent to the old \fB\-\-no\-ass\fP / \fB\-\-no\-sub\-ass\fP options.
++.UNINDENT
++.TP
++.B \fB\-\-ass\-force\-margins\fP
++Enables placing toptitles and subtitles in black borders when they are
++available, if the subtitles are in the ASS format.
++.sp
++Default: no.
++.TP
++.B \fB\-\-sub\-use\-margins\fP
++Enables placing toptitles and subtitles in black borders when they are
++available, if the subtitles are in a plain text format (or ASS if
++\fB\-\-ass\-style\-override\fP is set high enough).
++.sp
++Default: yes.
++.sp
++Renamed from \fB\-\-ass\-use\-margins\fP\&. To place ASS subtitles in the borders
++too (like the old option did), also add \fB\-\-ass\-force\-margins\fP\&.
++.TP
++.B \fB\-\-ass\-vsfilter\-aspect\-compat=<yes|no>\fP
++Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility
++with traditional VSFilter behavior. This switch has no effect when the
++video is stored with square pixels.
++.sp
++The renderer historically most commonly used for the SSA/ASS subtitle
++formats, VSFilter, had questionable behavior that resulted in subtitles
++being stretched too if the video was stored in anamorphic format that
++required scaling for display. This behavior is usually undesirable and
++newer VSFilter versions may behave differently. However, many existing
++scripts compensate for the stretching by modifying things in the opposite
++direction. Thus, if such scripts are displayed "correctly", they will not
++appear as intended. This switch enables emulation of the old VSFilter
++behavior (undesirable but expected by many existing scripts).
++.sp
++Enabled by default.
++.TP
++.B \fB\-\-ass\-vsfilter\-blur\-compat=<yes|no>\fP
++Scale \fB\eblur\fP tags by video resolution instead of script resolution
++(enabled by default). This is bug in VSFilter, which according to some,
++can\(aqt be fixed anymore in the name of compatibility.
++.sp
++Note that this uses the actual video resolution for calculating the
++offset scale factor, not what the video filter chain or the video output
++use.
++.TP
++.B \fB\-\-ass\-vsfilter\-color\-compat=<basic|full|force\-601|no>\fP
++Mangle colors like (xy\-)vsfilter do (default: basic). Historically, VSFilter
++was not color space aware. This was no problem as long as the color space
++used for SD video (BT.601) was used. But when everything switched to HD
++(BT.709), VSFilter was still converting RGB colors to BT.601, rendered
++them into the video frame, and handled the frame to the video output, which
++would use BT.709 for conversion to RGB. The result were mangled subtitle
++colors. Later on, bad hacks were added on top of the ASS format to control
++how colors are to be mangled.
++.INDENT 7.0
++.TP
++.B basic
++Handle only BT.601\->BT.709 mangling, if the subtitles seem to
++indicate that this is required (default).
++.TP
++.B full
++Handle the full \fBYCbCr Matrix\fP header with all video color spaces
++supported by libass and mpv. This might lead to bad breakages in
++corner cases and is not strictly needed for compatibility
++(hopefully), which is why this is not default.
++.TP
++.B force\-601
++Force BT.601\->BT.709 mangling, regardless of subtitle headers
++or video color space.
++.TP
++.B no
++Disable color mangling completely. All colors are RGB.
++.UNINDENT
++.sp
++Choosing anything other than \fBno\fP will make the subtitle color depend on
++the video color space, and it\(aqs for example in theory not possible to reuse
++a subtitle script with another video file. The \fB\-\-ass\-style\-override\fP
++option doesn\(aqt affect how this option is interpreted.
++.TP
++.B \fB\-\-stretch\-dvd\-subs=<yes|no>\fP
++Stretch DVD subtitles when playing anamorphic videos for better looking
++fonts on badly mastered DVDs. This switch has no effect when the
++video is stored with square pixels \- which for DVD input cannot be the case
++though.
++.sp
++Many studios tend to use bitmap fonts designed for square pixels when
++authoring DVDs, causing the fonts to look stretched on playback on DVD
++players. This option fixes them, however at the price of possibly
++misaligning some subtitles (e.g. sign translations).
++.sp
++Disabled by default.
++.TP
++.B \fB\-\-stretch\-image\-subs\-to\-screen=<yes|no>\fP
++Stretch DVD and other image subtitles to the screen, ignoring the video
++margins. This has a similar effect as \fB\-\-sub\-use\-margins\fP for text
++subtitles, except that the text itself will be stretched, not only just
++repositioned. (At least in general it is unavoidable, as an image bitmap
++can in theory consist of a single bitmap covering the whole screen, and
++the player won\(aqt know where exactly the text parts are located.)
++.sp
++This option does not display subtitles correctly. Use with care.
++.sp
++Disabled by default.
++.TP
++.B \fB\-\-sub\-ass\fP, \fB\-\-no\-sub\-ass\fP
++Render ASS subtitles natively (enabled by default).
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This has been deprecated by \fB\-\-ass\-style\-override=strip\fP\&. You also
++may need \fB\-\-embeddedfonts=no\fP to get the same behavior. Also,
++using \fB\-\-ass\-style\-override=force\fP should give better results
++without breaking subtitles too much.
++.UNINDENT
++.UNINDENT
++.sp
++If \fB\-\-no\-sub\-ass\fP is specified, all tags and style declarations are
++stripped and ignored on display. The subtitle renderer uses the font style
++as specified by the \fB\-\-sub\-text\-\fP options instead.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Using \fB\-\-no\-sub\-ass\fP may lead to incorrect or completely broken
++rendering of ASS/SSA subtitles. It can sometimes be useful to forcibly
++override the styling of ASS subtitles, but should be avoided in general.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-sub\-auto=<no|exact|fuzzy|all>\fP, \fB\-\-no\-sub\-auto\fP
++Load additional subtitle files matching the video filename. The parameter
++specifies how external subtitle files are matched. \fBexact\fP is enabled by
++default.
++.INDENT 7.0
++.TP
++.B no
++Don\(aqt automatically load external subtitle files.
++.TP
++.B exact
++Load the media filename with subtitle file extension (default).
++.TP
++.B fuzzy
++Load all subs containing media filename.
++.TP
++.B all
++Load all subs in the current and \fB\-\-sub\-paths\fP directories.
++.UNINDENT
++.TP
++.B \fB\-\-sub\-codepage=<codepage>\fP
++If your system supports \fBiconv(3)\fP, you can use this option to specify
++the subtitle codepage. By default, uchardet will be used to guess the
++charset. If mpv is not compiled with uchardet, enca will be used.
++If mpv is compiled with neither uchardet nor enca, \fBUTF\-8:UTF\-8\-BROKEN\fP
++is the default, which means it will try to use UTF\-8, otherwise the
++\fBUTF\-8\-BROKEN\fP pseudo codepage (see below).
++.sp
++The default value for this option is \fBauto\fP, whose actual effect depends
++on whether ENCA is compiled.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++If you force the charset, even subtitles that are known to be
++UTF\-8 will be recoded, which is perhaps not what you expect. Prefix
++codepages with \fButf8:\fP if you want the codepage to be used only if the
++input is not valid UTF\-8.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-sub\-codepage=utf8:latin2\fP Use Latin 2 if input is not UTF\-8.
++.IP \(bu 2
++\fB\-\-sub\-codepage=cp1250\fP Always force recoding to cp1250.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++The pseudo codepage \fBUTF\-8\-BROKEN\fP is used internally. When it
++is the codepage, subtitles are interpreted as UTF\-8 with "Latin 1" as
++fallback for bytes which are not valid UTF\-8 sequences. iconv is
++never involved in this mode.
++.sp
++If the player was compiled with ENCA support, you can control it with the
++following syntax:
++.sp
++\fB\-\-sub\-codepage=enca:<language>:<fallback codepage>\fP
++.sp
++Language is specified using a two letter code to help ENCA detect
++the codepage automatically. If an invalid language code is
++entered, mpv will complain and list valid languages. (Note
++however that this list will only be printed when the conversion code is actually
++called, for example when loading an external subtitle). The
++fallback codepage is used if autodetection fails. If no fallback
++is specified, \fBUTF\-8\-BROKEN\fP is used.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-sub\-codepage=enca:pl:cp1250\fP guess the encoding, assuming the subtitles
++are Polish, fall back on cp1250
++.IP \(bu 2
++\fB\-\-sub\-codepage=enca:pl\fP guess the encoding for Polish, fall back on UTF\-8.
++.IP \(bu 2
++\fB\-\-sub\-codepage=enca\fP try universal detection, fall back on UTF\-8.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++If the player was compiled with libguess support, you can use it with:
++.sp
++\fB\-\-sub\-codepage=guess:<language>:<fallback codepage>\fP
++.sp
++libguess always needs a language. There is no universal detection
++mode. Use \fB\-\-sub\-codepage=guess:help\fP to get a list of
++languages subject to the same caveat as with ENCA above.
++.sp
++If the player was compiled with uchardet support you can use it with:
++.sp
++\fB\-\-sub\-codepage=uchardet\fP
++.sp
++This mode doesn\(aqt take language or fallback codepage.
++.TP
++.B \fB\-\-sub\-fix\-timing\fP, \fB\-\-no\-sub\-fix\-timing\fP
++By default, subtitle timing is adjusted to remove minor gaps or overlaps
++between subtitles (if the difference is smaller than 210 ms, the gap or
++overlap is removed).
++.TP
++.B \fB\-\-sub\-forced\-only\fP
++Display only forced subtitles for the DVD subtitle stream selected by e.g.
++\fB\-\-slang\fP\&.
++.TP
++.B \fB\-\-sub\-fps=<rate>\fP
++Specify the framerate of the subtitle file (default: video fps). Affects
++text subtitles only.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++\fB<rate>\fP > video fps speeds the subtitles up for frame\-based
++subtitle files and slows them down for time\-based ones.
++.UNINDENT
++.UNINDENT
++.sp
++See also: \fB\-\-sub\-speed\fP\&.
++.TP
++.B \fB\-\-sub\-gauss=<0.0\-3.0>\fP
++Apply Gaussian blur to image subtitles (default: 0). This can help to make
++pixelated DVD/Vobsubs look nicer. A value other than 0 also switches to
++software subtitle scaling. Might be slow.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Never applied to text subtitles.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-sub\-gray\fP
++Convert image subtitles to grayscale. Can help to make yellow DVD/Vobsubs
++look nicer.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Never applied to text subtitles.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-sub\-paths=<path1:path2:...>\fP
++Specify extra directories to search for subtitles matching the video.
++Multiple directories can be separated by ":" (";" on Windows).
++Paths can be relative or absolute. Relative paths are interpreted relative
++to video file directory.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++Assuming that \fB/path/to/video/video.avi\fP is played and
++\fB\-\-sub\-paths=sub:subtitles:/tmp/subs\fP is specified, mpv searches for
++subtitle files in these directories:
++.INDENT 0.0
++.IP \(bu 2
++\fB/path/to/video/\fP
++.IP \(bu 2
++\fB/path/to/video/sub/\fP
++.IP \(bu 2
++\fB/path/to/video/subtitles/\fP
++.IP \(bu 2
++\fB/tmp/subs/\fP
++.IP \(bu 2
++the \fBsub\fP configuration subdirectory (usually \fB~/.config/mpv/sub/\fP)
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-sub\-visibility\fP, \fB\-\-no\-sub\-visibility\fP
++Can be used to disable display of subtitles, but still select and decode
++them.
++.TP
++.B \fB\-\-sub\-clear\-on\-seek\fP
++(Obscure, rarely useful.) Can be used to play broken mkv files with
++duplicate ReadOrder fields. ReadOrder is the first field in a
++Matroska\-style ASS subtitle packets. It should be unique, and libass
++uses it for fast elimination of duplicates. This option disables caching
++of subtitles across seeks, so after a seek libass can\(aqt eliminate subtitle
++packets with the same ReadOrder as earlier packets.
++.UNINDENT
++.SS Window
++.INDENT 0.0
++.TP
++.B \fB\-\-title=<string>\fP
++Set the window title. This is used for the video window, and if possible,
++also sets the audio stream title.
++.sp
++Properties are expanded. (See \fI\%Property Expansion\fP\&.)
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++There is a danger of this causing significant CPU usage, depending on
++the properties used. Changing the window title is often a slow
++operation, and if the title changes every frame, playback can be ruined.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-screen=<default|0\-32>\fP
++In multi\-monitor configurations (i.e. a single desktop that spans across
++multiple displays), this option tells mpv which screen to display the
++video on.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Note (X11)"
++.sp
++This option does not work properly with all window managers. In these
++cases, you can try to use \fB\-\-geometry\fP to position the window
++explicitly. It\(aqs also possible that the window manager provides native
++features to control which screens application windows should use.
++.UNINDENT
++.UNINDENT
++.sp
++See also \fB\-\-fs\-screen\fP\&.
++.TP
++.B \fB\-\-fullscreen\fP, \fB\-\-fs\fP
++Fullscreen playback.
++.TP
++.B \fB\-\-fs\-screen=<all|current|0\-32>\fP
++In multi\-monitor configurations (i.e. a single desktop that spans across
++multiple displays), this option tells mpv which screen to go fullscreen to.
++If \fBdefault\fP is provided mpv will fallback on using the behavior
++depending on what the user provided with the \fBscreen\fP option.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Note (X11)"
++.sp
++This option does works properly only with window managers which
++understand the EWMH \fB_NET_WM_FULLSCREEN_MONITORS\fP hint.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Note (OS X)"
++.sp
++\fBall\fP does not work on OS X and will behave like \fBcurrent\fP\&.
++.UNINDENT
++.UNINDENT
++.sp
++See also \fB\-\-screen\fP\&.
++.UNINDENT
++.sp
++\fB\-\-fs\-black\-out\-screens\fP
++.INDENT 0.0
++.INDENT 3.5
++OS X only. Black out other displays when going fullscreen.
++.UNINDENT
++.UNINDENT
++.INDENT 0.0
++.TP
++.B \fB\-\-keep\-open=<yes|no|always>\fP
++Do not terminate when playing or seeking beyond the end of the file, and
++there is not next file to be played (and \fB\-\-loop\fP is not used).
++Instead, pause the player. When trying to seek beyond end of the file, the
++player will attempt to seek to the last frame.
++.sp
++The following arguments can be given:
++.INDENT 7.0
++.TP
++.B no
++If the current file ends, go to the next file or terminate.
++(Default.)
++.TP
++.B yes
++Don\(aqt terminate if the current file is the last playlist entry.
++Equivalent to \fB\-\-keep\-open\fP without arguments.
++.TP
++.B always
++Like \fByes\fP, but also applies to files before the last playlist
++entry. This means playback will never automatically advance to
++the next file.
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This option is not respected when using \fB\-\-frames\fP\&. Explicitly
++skipping to the next file if the binding uses \fBforce\fP will terminate
++playback as well.
++.sp
++Also, if errors or unusual circumstances happen, the player can quit
++anyway.
++.UNINDENT
++.UNINDENT
++.sp
++Since mpv 0.6.0, this doesn\(aqt pause if there is a next file in the playlist,
++or the playlist is looped. Approximately, this will pause when the player
++would normally exit, but in practice there are corner cases in which this
++is not the case (e.g. \fBmpv \-\-keep\-open file.mkv /dev/null\fP will play
++file.mkv normally, then fail to open \fB/dev/null\fP, then exit). (In
++mpv 0.8.0, \fBalways\fP was introduced, which restores the old behavior.)
++.TP
++.B \fB\-\-force\-window=<yes|no|immediate>\fP
++Create a video output window even if there is no video. This can be useful
++when pretending that mpv is a GUI application. Currently, the window
++always has the size 640x480, and is subject to \fB\-\-geometry\fP,
++\fB\-\-autofit\fP, and similar options.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++The window is created only after initialization (to make sure default
++window placement still works if the video size is different from the
++\fB\-\-force\-window\fP default window size). This can be a problem if
++initialization doesn\(aqt work perfectly, such as when opening URLs with
++bad network connection, or opening broken video files. The \fBimmediate\fP
++mode can be used to create the window always on program start, but this
++may cause other issues.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-taskbar\-progress\fP, \fB\-\-no\-taskbar\-progress\fP
++(Windows only)
++Enable/disable playback progress rendering in taskbar (Windows 7 and above).
++.sp
++Enabled by default.
++.TP
++.B \fB\-\-ontop\fP
++Makes the player window stay on top of other windows.
++.sp
++On Windows, if combined with fullscreen mode, this causes mpv to be
++treated as exclusive fullscreen window that bypasses the Desktop Window
++Manager.
++.TP
++.B \fB\-\-border\fP, \fB\-\-no\-border\fP
++Play video with window border and decorations. Since this is on by
++default, use \fB\-\-no\-border\fP to disable the standard window decorations.
++.TP
++.B \fB\-\-fit\-border\fP, \fB\-\-no\-fit\-border\fP
++(Windows only) Fit the whole window with border and decorations on the
++screen. Since this is on by default, use \fB\-\-no\-fit\-border\fP to make mpv
++try to only fit client area with video on the screen. This behavior only
++applied to window/video with size exceeding size of the screen.
++.TP
++.B \fB\-\-on\-all\-workspaces\fP
++(X11 only)
++Show the video window on all virtual desktops.
++.TP
++.B \fB\-\-geometry=<[W[xH]][+\-x+\-y]>\fP, \fB\-\-geometry=<x:y>\fP
++Adjust the initial window position or size. \fBW\fP and \fBH\fP set the window
++size in pixels. \fBx\fP and \fBy\fP set the window position, measured in pixels
++from the top\-left corner of the screen to the top\-left corner of the image
++being displayed. If a percentage sign (\fB%\fP) is given after the argument,
++it turns the value into a percentage of the screen size in that direction.
++Positions are specified similar to the standard X11 \fB\-\-geometry\fP option
++format, in which e.g. +10\-50 means "place 10 pixels from the left border and
++50 pixels from the lower border" and "\-\-20+\-10" means "place 20 pixels
++beyond the right and 10 pixels beyond the top border".
++.sp
++If an external window is specified using the \fB\-\-wid\fP option, this
++option is ignored.
++.sp
++The coordinates are relative to the screen given with \fB\-\-screen\fP for the
++video output drivers that fully support \fB\-\-screen\fP\&.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Generally only supported by GUI VOs. Ignored for encoding.
++.UNINDENT
++.UNINDENT
++.\" admonition: Note (OS X)
++.\"
++.\" On Mac OS X the origin of the screen coordinate system is located on the
++.\" bottom-left corner. For instance, ``0:0`` will place the window at the
++.\" bottom-left of the screen.
++.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Note (X11)"
++.sp
++This option does not work properly with all window managers.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fB50:40\fP
++Places the window at x=50, y=40.
++.TP
++.B \fB50%:50%\fP
++Places the window in the middle of the screen.
++.TP
++.B \fB100%:100%\fP
++Places the window at the bottom right corner of the screen.
++.TP
++.B \fB50%\fP
++Sets the window width to half the screen width. Window height is set
++so that the window has the video aspect ratio.
++.TP
++.B \fB50%x50%\fP
++Forces the window width and height to half the screen width and
++height. Will show black borders to compensate for the video aspect
++ration (with most VOs and without \fB\-\-no\-keepaspect\fP).
++.TP
++.B \fB50%+10+10\fP
++Sets the window to half the screen widths, and positions it 10
++pixels below/left of the top left corner of the screen.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++See also \fB\-\-autofit\fP and \fB\-\-autofit\-larger\fP for fitting the window into
++a given size without changing aspect ratio.
++.TP
++.B \fB\-\-autofit=<[W[xH]]>\fP
++Set the initial window size to a maximum size specified by \fBWxH\fP, without
++changing the window\(aqs aspect ratio. The size is measured in pixels, or if
++a number is followed by a percentage sign (\fB%\fP), in percents of the
++screen size.
++.sp
++This option never changes the aspect ratio of the window. If the aspect
++ratio mismatches, the window\(aqs size is reduced until it fits into the
++specified size.
++.sp
++Window position is not taken into account, nor is it modified by this
++option (the window manager still may place the window differently depending
++on size). Use \fB\-\-geometry\fP to change the window position. Its effects
++are applied after this option.
++.sp
++See \fB\-\-geometry\fP for details how this is handled with multi\-monitor
++setups.
++.sp
++Use \fB\-\-autofit\-larger\fP instead if you just want to limit the maximum size
++of the window, rather than always forcing a window size.
++.sp
++Use \fB\-\-geometry\fP if you want to force both window width and height to a
++specific size.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Generally only supported by GUI VOs. Ignored for encoding.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fB70%\fP
++Make the window width 70% of the screen size, keeping aspect ratio.
++.TP
++.B \fB1000\fP
++Set the window width to 1000 pixels, keeping aspect ratio.
++.TP
++.B \fB70%x60%\fP
++Make the window as large as possible, without being wider than 70%
++of the screen width, or higher than 60% of the screen height.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-autofit\-larger=<[W[xH]]>\fP
++This option behaves exactly like \fB\-\-autofit\fP, except the window size is
++only changed if the window would be larger than the specified size.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fB90%x80%\fP
++If the video is larger than 90% of the screen width or 80% of the
++screen height, make the window smaller until either its width is 90%
++of the screen, or its height is 80% of the screen.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-autofit\-smaller=<[W[xH]]>\fP
++This option behaves exactly like \fB\-\-autofit\fP, except that it sets the
++minimum size of the window (just as \fB\-\-autofit\-larger\fP sets the maximum).
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fB500x500\fP
++Make the window at least 500 pixels wide and 500 pixels high
++(depending on the video aspect ratio, the width or height will be
++larger than 500 in order to keep the aspect ratio the same).
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-window\-scale=<factor>\fP
++Resize the video window to a multiple (or fraction) of the video size. This
++option is applied before \fB\-\-autofit\fP and other options are applied (so
++they override this option).
++.sp
++For example, \fB\-\-window\-scale=0.5\fP would show the window at half the
++video size.
++.TP
++.B \fB\-\-cursor\-autohide=<number|no|always>\fP
++Make mouse cursor automatically hide after given number of milliseconds.
++\fBno\fP will disable cursor autohide. \fBalways\fP means the cursor will stay
++hidden.
++.TP
++.B \fB\-\-cursor\-autohide\-fs\-only\fP
++If this option is given, the cursor is always visible in windowed mode. In
++fullscreen mode, the cursor is shown or hidden according to
++\fB\-\-cursor\-autohide\fP\&.
++.TP
++.B \fB\-\-no\-fixed\-vo\fP, \fB\-\-fixed\-vo\fP
++\fB\-\-no\-fixed\-vo\fP enforces closing and reopening the video window for
++multiple files (one (un)initialization for each file).
++.TP
++.B \fB\-\-force\-rgba\-osd\-rendering\fP
++Change how some video outputs render the OSD and text subtitles. This
++does not change appearance of the subtitles and only has performance
++implications. For VOs which support native ASS rendering (like \fBvdpau\fP,
++\fBopengl\fP, \fBdirect3d\fP), this can be slightly faster or slower,
++depending on GPU drivers and hardware. For other VOs, this just makes
++rendering slower.
++.TP
++.B \fB\-\-force\-window\-position\fP
++Forcefully move mpv\(aqs video output window to default location whenever
++there is a change in video parameters, video stream or file. This used to
++be the default behavior. Currently only affects X11 VOs.
++.TP
++.B \fB\-\-heartbeat\-cmd=<command>\fP
++Command that is executed every 30 seconds during playback via \fIsystem()\fP \-
++i.e. using the shell. The time between the commands can be customized with
++the \fB\-\-heartbeat\-interval\fP option. The command is not run while playback
++is paused.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++mpv uses this command without any checking. It is your responsibility to
++ensure it does not cause security problems (e.g. make sure to use full
++paths if "." is in your path like on Windows). It also only works when
++playing video (i.e. not with \fB\-\-no\-video\fP but works with
++\fB\-vo=null\fP).
++.UNINDENT
++.UNINDENT
++.sp
++This can be "misused" to disable screensavers that do not support the
++proper X API (see also \fB\-\-stop\-screensaver\fP). If you think this is too
++complicated, ask the author of the screensaver program to support the
++proper X APIs. Note that the \fB\-\-stop\-screensaver\fP does not influence the
++heartbeat code at all.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example for xscreensaver"
++.sp
++\fBmpv \-\-heartbeat\-cmd="xscreensaver\-command \-deactivate" file\fP
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example for GNOME screensaver"
++.sp
++\fBmpv \-\-heartbeat\-cmd="gnome\-screensaver\-command \-\-deactivate" file\fP
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-heartbeat\-interval=<sec>\fP
++Time between \fB\-\-heartbeat\-cmd\fP invocations in seconds (default: 30).
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This does not affect the normal screensaver operation in any way.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-no\-keepaspect\fP, \fB\-\-keepaspect\fP
++\fB\-\-no\-keepaspect\fP will always stretch the video to window size, and will
++disable the window manager hints that force the window aspect ratio.
++(Ignored in fullscreen mode.)
++.TP
++.B \fB\-\-no\-keepaspect\-window\fP, \fB\-\-keepaspect\-window\fP
++\fB\-\-keepaspect\-window\fP (the default) will lock the window size to the
++video aspect. \fB\-\-no\-keepaspect\-window\fP disables this behavior, and will
++instead add black bars if window aspect and video aspect mismatch. Whether
++this actually works depends on the VO backend.
++(Ignored in fullscreen mode.)
++.TP
++.B \fB\-\-monitoraspect=<ratio>\fP
++Set the aspect ratio of your monitor or TV screen. A value of 0 disables a
++previous setting (e.g. in the config file). Overrides the
++\fB\-\-monitorpixelaspect\fP setting if enabled.
++.sp
++See also \fB\-\-monitorpixelaspect\fP and \fB\-\-video\-aspect\fP\&.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-monitoraspect=4:3\fP or \fB\-\-monitoraspect=1.3333\fP
++.IP \(bu 2
++\fB\-\-monitoraspect=16:9\fP or \fB\-\-monitoraspect=1.7777\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-monitorpixelaspect=<ratio>\fP
++Set the aspect of a single pixel of your monitor or TV screen (default:
++1). A value of 1 means square pixels (correct for (almost?) all LCDs). See
++also \fB\-\-monitoraspect\fP and \fB\-\-video\-aspect\fP\&.
++.TP
++.B \fB\-\-stop\-screensaver\fP, \fB\-\-no\-stop\-screensaver\fP
++Turns off the screensaver (or screen blanker and similar mechanisms) at
++startup and turns it on again on exit (default: yes). The screensaver is
++always re\-enabled when the player is paused.
++.sp
++This is not supported on all video outputs or platforms. Sometimes it is
++implemented, but does not work (known to happen with GNOME). You might be
++able to work around this using \fB\-\-heartbeat\-cmd\fP instead.
++.TP
++.B \fB\-\-wid=<ID>\fP
++This tells mpv to attach to an existing window. If a VO is selected that
++supports this option, it will use that window for video output. mpv will
++scale the video to the size of this window, and will add black bars to
++compensate if the aspect ratio of the video is different.
++.sp
++On X11, the ID is interpreted as a \fBWindow\fP on X11. Unlike
++MPlayer/mplayer2, mpv always creates its own window, and sets the wid
++window as parent. The window will always be resized to cover the parent
++window fully. The value \fB0\fP is interpreted specially, and mpv will
++draw directly on the root window.
++.sp
++On win32, the ID is interpreted as \fBHWND\fP\&. Pass it as value cast to
++\fBintptr_t\fP\&. mpv will create its own window, and set the wid window as
++parent, like with X11.
++.sp
++On OSX/Cocoa, the ID is interpreted as \fBNSView*\fP\&. Pass it as value cast
++to \fBintptr_t\fP\&. mpv will create its own sub\-view. Because OSX does not
++support window embedding of foreign processes, this works only with libmpv,
++and will crash when used from the command line.
++.TP
++.B \fB\-\-no\-window\-dragging\fP
++Don\(aqt move the window when clicking on it and moving the mouse pointer.
++.TP
++.B \fB\-\-x11\-name\fP
++Set the window class name for X11\-based video output methods.
++.TP
++.B \fB\-\-x11\-netwm=<yes|no|auto>\fP
++(X11 only)
++Control the use of NetWM protocol features.
++.sp
++This may or may not help with broken window managers. This provides some
++functionality that was implemented by the now removed \fB\-\-fstype\fP option.
++Actually, it is not known to the developers to which degree this option
++was needed, so feedback is welcome.
++.sp
++Specifically, \fByes\fP will force use of NetWM fullscreen support, even if
++not advertised by the WM. This can be useful for WMs that are broken on
++purpose, like XMonad. (XMonad supposedly doesn\(aqt advertise fullscreen
++support, because Flash uses it. Apparently, applications which want to
++use fullscreen anyway are supposed to either ignore the NetWM support hints,
++or provide a workaround. Shame on XMonad for deliberately breaking X
++protocols (as if X isn\(aqt bad enough already).
++.sp
++By default, NetWM support is autodetected (\fBauto\fP).
++.sp
++This option might be removed in the future.
++.TP
++.B \fB\-\-x11\-bypass\-compositor=<yes|no|fs\-only|never>\fP
++If set to \fByes\fP, then ask the compositor to unredirect the mpv window
++(default: \fBfs\-only\fP). This uses the \fB_NET_WM_BYPASS_COMPOSITOR\fP hint.
++.sp
++\fBfs\-only\fP asks the window manager to disable the compositor only in
++fullscreen mode.
++.sp
++\fBno\fP sets \fB_NET_WM_BYPASS_COMPOSITOR\fP to 0, which is the default value
++as declared by the EWMH specification, i.e. no change is done.
++.sp
++\fBnever\fP asks the window manager to never disable the compositor.
++.UNINDENT
++.SS Disc Devices
++.INDENT 0.0
++.TP
++.B \fB\-\-cdrom\-device=<path>\fP
++Specify the CD\-ROM device (default: \fB/dev/cdrom\fP).
++.TP
++.B \fB\-\-dvd\-device=<path>\fP
++Specify the DVD device or .iso filename (default: \fB/dev/dvd\fP). You can
++also specify a directory that contains files previously copied directly
++from a DVD (with e.g. vobcopy).
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++\fBmpv dvd:// \-\-dvd\-device=/path/to/dvd/\fP
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-bluray\-device=<path>\fP
++(Blu\-ray only)
++Specify the Blu\-ray disc location. Must be a directory with Blu\-ray
++structure.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++\fBmpv bd:// \-\-bluray\-device=/path/to/bd/\fP
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-bluray\-angle=<ID>\fP
++Some Blu\-ray discs contain scenes that can be viewed from multiple angles.
++This option tells mpv which angle to use (default: 1).
++.TP
++.B \fB\-\-cdda\-...\fP
++These options can be used to tune the CD Audio reading feature of mpv.
++.TP
++.B \fB\-\-cdda\-speed=<value>\fP
++Set CD spin speed.
++.TP
++.B \fB\-\-cdda\-paranoia=<0\-2>\fP
++Set paranoia level. Values other than 0 seem to break playback of
++anything but the first track.
++.INDENT 7.0
++.TP
++.B 0
++disable checking (default)
++.TP
++.B 1
++overlap checking only
++.TP
++.B 2
++full data correction and verification
++.UNINDENT
++.TP
++.B \fB\-\-cdda\-sector\-size=<value>\fP
++Set atomic read size.
++.TP
++.B \fB\-\-cdda\-overlap=<value>\fP
++Force minimum overlap search during verification to <value> sectors.
++.TP
++.B \fB\-\-cdda\-toc\-bias\fP
++Assume that the beginning offset of track 1 as reported in the TOC
++will be addressed as LBA 0. Some discs need this for getting track
++boundaries correctly.
++.TP
++.B \fB\-\-cdda\-toc\-offset=<value>\fP
++Add \fB<value>\fP sectors to the values reported when addressing tracks.
++May be negative.
++.TP
++.B \fB\-\-cdda\-skip=<yes|no>\fP
++(Never) accept imperfect data reconstruction.
++.TP
++.B \fB\-\-cdda\-cdtext=<yes|no>\fP
++Print CD text. This is disabled by default, because it ruins performance
++with CD\-ROM drives for unknown reasons.
++.TP
++.B \fB\-\-dvd\-speed=<speed>\fP
++Try to limit DVD speed (default: 0, no change). DVD base speed is 1385
++kB/s, so an 8x drive can read at speeds up to 11080 kB/s. Slower speeds
++make the drive more quiet. For watching DVDs, 2700 kB/s should be quiet and
++fast enough. mpv resets the speed to the drive default value on close.
++Values of at least 100 mean speed in kB/s. Values less than 100 mean
++multiples of 1385 kB/s, i.e. \fB\-\-dvd\-speed=8\fP selects 11080 kB/s.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++You need write access to the DVD device to change the speed.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-dvd\-angle=<ID>\fP
++Some DVDs contain scenes that can be viewed from multiple angles.
++This option tells mpv which angle to use (default: 1).
++.UNINDENT
++.SS Equalizer
++.INDENT 0.0
++.TP
++.B \fB\-\-brightness=<\-100\-100>\fP
++Adjust the brightness of the video signal (default: 0). Not supported by
++all video output drivers.
++.TP
++.B \fB\-\-contrast=<\-100\-100>\fP
++Adjust the contrast of the video signal (default: 0). Not supported by all
++video output drivers.
++.TP
++.B \fB\-\-saturation=<\-100\-100>\fP
++Adjust the saturation of the video signal (default: 0). You can get
++grayscale output with this option. Not supported by all video output
++drivers.
++.TP
++.B \fB\-\-gamma=<\-100\-100>\fP
++Adjust the gamma of the video signal (default: 0). Not supported by all
++video output drivers.
++.TP
++.B \fB\-\-hue=<\-100\-100>\fP
++Adjust the hue of the video signal (default: 0). You can get a colored
++negative of the image with this option. Not supported by all video output
++drivers.
++.UNINDENT
++.SS Demuxer
++.INDENT 0.0
++.TP
++.B \fB\-\-demuxer=<[+]name>\fP
++Force demuxer type. Use a \(aq+\(aq before the name to force it; this will skip
++some checks. Give the demuxer name as printed by \fB\-\-demuxer=help\fP\&.
++.TP
++.B \fB\-\-demuxer\-lavf\-analyzeduration=<value>\fP
++Maximum length in seconds to analyze the stream properties.
++.TP
++.B \fB\-\-demuxer\-lavf\-probescore=<1\-100>\fP
++Minimum required libavformat probe score. Lower values will require
++less data to be loaded (makes streams start faster), but makes file
++format detection less reliable. Can be used to force auto\-detected
++libavformat demuxers, even if libavformat considers the detection not
++reliable enough. (Default: 26.)
++.TP
++.B \fB\-\-demuxer\-lavf\-allow\-mimetype=<yes|no>\fP
++Allow deriving the format from the HTTP MIME type (default: yes). Set
++this to no in case playing things from HTTP mysteriously fails, even
++though the same files work from local disk.
++.sp
++This is default in order to reduce latency when opening HTTP streams.
++.TP
++.B \fB\-\-demuxer\-lavf\-format=<name>\fP
++Force a specific libavformat demuxer.
++.TP
++.B \fB\-\-demuxer\-lavf\-hacks=<yes|no>\fP
++By default, some formats will be handled differently from other formats
++by explicitly checking for them. Most of these compensate for weird or
++imperfect behavior from libavformat demuxers. Passing \fBno\fP disables
++these. For debugging and testing only.
++.TP
++.B \fB\-\-demuxer\-lavf\-genpts\-mode=<no|lavf>\fP
++Mode for deriving missing packet PTS values from packet DTS. \fBlavf\fP
++enables libavformat\(aqs \fBgenpts\fP option. \fBno\fP disables it. This used
++to be enabled by default, but then it was deemed as not needed anymore.
++Enabling this might help with timestamp problems, or make them worse.
++.TP
++.B \fB\-\-demuxer\-lavf\-o=<key>=<value>[,<key>=<value>[,...]]\fP
++Pass AVOptions to libavformat demuxer.
++.sp
++Note, a patch to make the \fIo=\fP unneeded and pass all unknown options
++through the AVOption system is welcome. A full list of AVOptions can
++be found in the FFmpeg manual. Note that some options may conflict
++with mpv options.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++\fB\-\-demuxer\-lavf\-o=fflags=+ignidx\fP
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-demuxer\-lavf\-probesize=<value>\fP
++Maximum amount of data to probe during the detection phase. In the
++case of MPEG\-TS this value identifies the maximum number of TS packets
++to scan.
++.TP
++.B \fB\-\-demuxer\-lavf\-buffersize=<value>\fP
++Size of the stream read buffer allocated for libavformat in bytes
++(default: 32768). Lowering the size could lower latency. Note that
++libavformat might reallocate the buffer internally, or not fully use all
++of it.
++.TP
++.B \fB\-\-demuxer\-lavf\-cryptokey=<hexstring>\fP
++Encryption key the demuxer should use. This is the raw binary data of
++the key converted to a hexadecimal string.
++.TP
++.B \fB\-\-demuxer\-mkv\-subtitle\-preroll=<yes|index|no>\fP, \fB\-\-mkv\-subtitle\-preroll\fP
++Try harder to show embedded soft subtitles when seeking somewhere. Normally,
++it can happen that the subtitle at the seek target is not shown due to how
++some container file formats are designed. The subtitles appear only if
++seeking before or exactly to the position a subtitle first appears. To
++make this worse, subtitles are often timed to appear a very small amount
++before the associated video frame, so that seeking to the video frame
++typically does not demux the subtitle at that position.
++.sp
++Enabling this option makes the demuxer start reading data a bit before the
++seek target, so that subtitles appear correctly. Note that this makes
++seeking slower, and is not guaranteed to always work. It only works if the
++subtitle is close enough to the seek target.
++.sp
++Works with the internal Matroska demuxer only. Always enabled for absolute
++and hr\-seeks, and this option changes behavior with relative or imprecise
++seeks only.
++.sp
++You can use the \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs\fP option to specify
++how much data the demuxer should pre\-read at most in order to find subtitle
++packets that may overlap. Setting this to 0 will effectively disable this
++preroll mechanism. Setting a very large value can make seeking very slow,
++and an extremely large value would completely reread the entire file from
++start to seek target on every seek \- seeking can become slower towards the
++end of the file. The details are messy, and the value is actually rounded
++down to the cluster with the previous video keyframe.
++.sp
++Some files, especially files muxed with newer mkvmerge versions, have
++information embedded that can be used to determine what subtitle packets
++overlap with a seek target. In these cases, mpv will reduce the amount
++of data read to a minimum. (Although it will still read \fIall\fP data between
++the cluster that contains the first wanted subtitle packet, and the seek
++target.) If the \fBindex\fP choice (which is the default) is specified, then
++prerolling will be done only if this information is actually available. If
++this method is used, the maximum amount of data to skip can be additionally
++controlled by \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs\-index\fP (it still uses
++the value of the option without \fB\-index\fP if that is higher).
++.sp
++See also \fB\-\-hr\-seek\-demuxer\-offset\fP option. This option can achieve a
++similar effect, but only if hr\-seek is active. It works with any demuxer,
++but makes seeking much slower, as it has to decode audio and video data
++instead of just skipping over it.
++.sp
++\fB\-\-mkv\-subtitle\-preroll\fP is a deprecated alias.
++.TP
++.B \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs=<value>\fP
++See \fB\-\-demuxer\-mkv\-subtitle\-preroll\fP\&.
++.TP
++.B \fB\-\-demuxer\-mkv\-subtitle\-preroll\-secs\-index=<value>\fP
++See \fB\-\-demuxer\-mkv\-subtitle\-preroll\fP\&.
++.TP
++.B \fB\-\-demuxer\-mkv\-probe\-video\-duration=<yes|no|full>\fP
++When opening the file, seek to the end of it, and check what timestamp the
++last video packet has, and report that as file duration. This is strictly
++for compatibility with Haali only. In this mode, it\(aqs possible that opening
++will be slower (especially when playing over http), or that behavior with
++broken files is much worse. So don\(aqt use this option.
++.sp
++The \fByes\fP mode merely uses the index and reads a small number of blocks
++from the end of the file. The \fBfull\fP mode actually traverses the entire
++file and can make a reliable estimate even without an index present (such
++as partial files).
++.TP
++.B \fB\-\-demuxer\-rawaudio\-channels=<value>\fP
++Number of channels (or channel layout) if \fB\-\-demuxer=rawaudio\fP is used
++(default: stereo).
++.TP
++.B \fB\-\-demuxer\-rawaudio\-format=<value>\fP
++Sample format for \fB\-\-demuxer=rawaudio\fP (default: s16le).
++Use \fB\-\-demuxer\-rawaudio\-format=help\fP to get a list of all formats.
++.TP
++.B \fB\-\-demuxer\-rawaudio\-rate=<value>\fP
++Sample rate for \fB\-\-demuxer=rawaudio\fP (default: 44 kHz).
++.TP
++.B \fB\-\-demuxer\-rawvideo\-fps=<value>\fP
++Rate in frames per second for \fB\-\-demuxer=rawvideo\fP (default: 25.0).
++.TP
++.B \fB\-\-demuxer\-rawvideo\-w=<value>\fP, \fB\-\-demuxer\-rawvideo\-h=<value>\fP
++Image dimension in pixels for \fB\-\-demuxer=rawvideo\fP\&.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++Play a raw YUV sample:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv sample\-720x576.yuv \-\-demuxer=rawvideo \e
++\-\-demuxer\-rawvideo\-w=720 \-\-demuxer\-rawvideo\-h=576
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-demuxer\-rawvideo\-format=<value>\fP
++Color space (fourcc) in hex or string for \fB\-\-demuxer=rawvideo\fP
++(default: \fBYV12\fP).
++.TP
++.B \fB\-\-demuxer\-rawvideo\-mp\-format=<value>\fP
++Color space by internal video format for \fB\-\-demuxer=rawvideo\fP\&. Use
++\fB\-\-demuxer\-rawvideo\-mp\-format=help\fP for a list of possible formats.
++.TP
++.B \fB\-\-demuxer\-rawvideo\-codec=<value>\fP
++Set the video codec instead of selecting the rawvideo codec when using
++\fB\-\-demuxer=rawvideo\fP\&. This uses the same values as codec names in
++\fB\-\-vd\fP (but it does not accept decoder names).
++.TP
++.B \fB\-\-demuxer\-rawvideo\-size=<value>\fP
++Frame size in bytes when using \fB\-\-demuxer=rawvideo\fP\&.
++.TP
++.B \fB\-\-demuxer\-max\-packets=<packets>\fP, \fB\-\-demuxer\-max\-bytes=<bytes>\fP
++This controls how much the demuxer is allowed to buffer ahead. The demuxer
++will normally try to read ahead as much as necessary, or as much is
++requested with \fB\-\-demuxer\-readahead\-secs\fP\&. The \fB\-\-demuxer\-max\-...\fP
++options can be used to restrict the maximum readahead. This limits excessive
++readahead in case of broken files or desynced playback. The demuxer will
++stop reading additional packets as soon as one of the limits is reached.
++(The limits still can be slightly overstepped due to technical reasons.)
++.sp
++Set these limits highher if you get a packet queue overflow warning, and
++you think normal playback would be possible with a larger packet queue.
++.sp
++See \fB\-\-list\-options\fP for defaults and value range.
++.TP
++.B \fB\-\-demuxer\-thread=<yes|no>\fP
++Run the demuxer in a separate thread, and let it prefetch a certain amount
++of packets (default: yes). Having this enabled may lead to smoother
++playback, but on the other hand can add delays to seeking or track
++switching.
++.TP
++.B \fB\-\-demuxer\-readahead\-secs=<seconds>\fP
++If \fB\-\-demuxer\-thread\fP is enabled, this controls how much the demuxer
++should buffer ahead in seconds (default: 1). As long as no packet has
++a timestamp difference higher than the readahead amount relative to the
++last packet returned to the decoder, the demuxer keeps reading.
++.sp
++Note that the \fB\-\-cache\-secs\fP option will override this value if a cache
++is enabled, and the value is larger.
++.sp
++(This value tends to be fuzzy, because many file formats don\(aqt store linear
++timestamps.)
++.TP
++.B \fB\-\-force\-seekable=<yes|no>\fP
++If the player thinks that the media is not seekable (e.g. playing from a
++pipe, or it\(aqs a http stream with a server that doesn\(aqt support range
++requests), seeking will be disabled. This option can forcibly enable it.
++For seeks within the cache, there\(aqs a good chance of success.
++.UNINDENT
++.SS Input
++.INDENT 0.0
++.TP
++.B \fB\-\-native\-keyrepeat\fP
++Use system settings for keyrepeat delay and rate, instead of
++\fB\-\-input\-ar\-delay\fP and \fB\-\-input\-ar\-rate\fP\&. (Whether this applies
++depends on the VO backend and how it handles keyboard input. Does not
++apply to terminal input.)
++.TP
++.B \fB\-\-input\-ar\-delay\fP
++Delay in milliseconds before we start to autorepeat a key (0 to disable).
++.TP
++.B \fB\-\-input\-ar\-rate\fP
++Number of key presses to generate per second on autorepeat.
++.TP
++.B \fB\-\-input\-conf=<filename>\fP
++Specify input configuration file other than the default location in the mpv
++configuration directory (usually \fB~/.config/mpv/input.conf\fP).
++.TP
++.B \fB\-\-no\-input\-default\-bindings\fP
++Disable mpv default (built\-in) key bindings.
++.TP
++.B \fB\-\-input\-cmdlist\fP
++Prints all commands that can be bound to keys.
++.TP
++.B \fB\-\-input\-doubleclick\-time=<milliseconds>\fP
++Time in milliseconds to recognize two consecutive button presses as a
++double\-click (default: 300).
++.TP
++.B \fB\-\-input\-keylist\fP
++Prints all keys that can be bound to commands.
++.TP
++.B \fB\-\-input\-key\-fifo\-size=<2\-65000>\fP
++Specify the size of the FIFO that buffers key events (default: 7). If it
++is too small, some events may be lost. The main disadvantage of setting it
++to a very large value is that if you hold down a key triggering some
++particularly slow command then the player may be unresponsive while it
++processes all the queued commands.
++.TP
++.B \fB\-\-input\-test\fP
++Input test mode. Instead of executing commands on key presses, mpv
++will show the keys and the bound commands on the OSD. Has to be used
++with a dummy video, and the normal ways to quit the player will not
++work (key bindings that normally quit will be shown on OSD only, just
++like any other binding). See \fI\%INPUT.CONF\fP\&.
++.TP
++.B \fB\-\-input\-file=<filename>\fP
++Read commands from the given file. Mostly useful with a FIFO. Since
++mpv 0.7.0 also understands JSON commands (see \fI\%JSON IPC\fP), but you can\(aqt
++get replies or events. Use \fB\-\-input\-ipc\-server\fP for something
++bi\-directional. On MS Windows, JSON commands are not available.
++.sp
++This can also specify a direct file descriptor with \fBfd://N\fP (UNIX only).
++In this case, JSON replies will be written if the FD is writable.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++When the given file is a FIFO mpv opens both ends, so you can do several
++\fIecho "seek 10" > mp_pipe\fP and the pipe will stay valid.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-input\-terminal\fP, \fB\-\-no\-input\-terminal\fP
++\fB\-\-no\-input\-terminal\fP prevents the player from reading key events from
++standard input. Useful when reading data from standard input. This is
++automatically enabled when \fB\-\fP is found on the command line. There are
++situations where you have to set it manually, e.g. if you open
++\fB/dev/stdin\fP (or the equivalent on your system), use stdin in a playlist
++or intend to read from stdin later on via the loadfile or loadlist slave
++commands.
++.TP
++.B \fB\-\-input\-ipc\-server=<filename>\fP
++Enable the IPC support and create the listening socket at the given path.
++.sp
++On Linux and Unix, the given path is a regular filesystem path. On Windows,
++named pipes are used, so the path refers to the pipe namespace
++(\fB\e\e.\epipe\e<name>\fP). If the \fB\e\e.\epipe\e\fP prefix is missing, mpv will add
++it automatically before creating the pipe, so
++\fB\-\-input\-ipc\-server=/tmp/mpv\-socket\fP and
++\fB\-\-input\-ipc\-server=\e\e.\epipe\etmp\empv\-socket\fP are equivalent for IPC on
++Windows.
++.sp
++See \fI\%JSON IPC\fP for details.
++.TP
++.B \fB\-\-input\-appleremote=<yes|no>\fP
++(OS X only)
++Enable/disable Apple Remote support. Enabled by default (except for libmpv).
++.TP
++.B \fB\-\-input\-cursor\fP, \fB\-\-no\-input\-cursor\fP
++Permit mpv to receive pointer events reported by the video output
++driver. Necessary to use the OSC, or to select the buttons in DVD menus.
++Support depends on the VO in use.
++.TP
++.B \fB\-\-input\-media\-keys=<yes|no>\fP
++(OS X only)
++Enable/disable media keys support. Enabled by default (except for libmpv).
++.TP
++.B \fB\-\-input\-right\-alt\-gr\fP, \fB\-\-no\-input\-right\-alt\-gr\fP
++(Cocoa and Windows only)
++Use the right Alt key as Alt Gr to produce special characters. If disabled,
++count the right Alt as an Alt modifier key. Enabled by default.
++.TP
++.B \fB\-\-input\-vo\-keyboard=<yes|no>\fP
++Disable all keyboard input on for VOs which can\(aqt participate in proper
++keyboard input dispatching. May not affect all VOs. Generally useful for
++embedding only.
++.sp
++On X11, a sub\-window with input enabled grabs all keyboard input as long
++as it is 1. a child of a focused window, and 2. the mouse is inside of
++the sub\-window. It can steal away all keyboard input from the
++application embedding the mpv window, and on the other hand, the mpv
++window will receive no input if the mouse is outside of the mpv window,
++even though mpv has focus. Modern toolkits work around this weird X11
++behavior, but naively embedding foreign windows breaks it.
++.sp
++The only way to handle this reasonably is using the XEmbed protocol, which
++was designed to solve these problems. GTK provides \fBGtkSocket\fP, which
++supports XEmbed. Qt doesn\(aqt seem to provide anything working in newer
++versions.
++.sp
++If the embedder supports XEmbed, input should work with default settings
++and with this option disabled. Note that \fBinput\-default\-bindings\fP is
++disabled by default in libmpv as well \- it should be enabled if you want
++the mpv default key bindings.
++.sp
++(This option was renamed from \fB\-\-input\-x11\-keyboard\fP\&.)
++.TP
++.B \fB\-\-input\-app\-events=<yes|no>\fP
++(OS X only)
++Enable/disable application wide keyboard events so that keyboard shortcuts
++can be processed without a window. Enabled by default (except for libmpv).
++.UNINDENT
++.SS OSD
++.INDENT 0.0
++.TP
++.B \fB\-\-osc\fP, \fB\-\-no\-osc\fP
++Whether to load the on\-screen\-controller (default: yes).
++.TP
++.B \fB\-\-no\-osd\-bar\fP, \fB\-\-osd\-bar\fP
++Disable display of the OSD bar. This will make some things (like seeking)
++use OSD text messages instead of the bar.
++.sp
++You can configure this on a per\-command basis in input.conf using \fBosd\-\fP
++prefixes, see \fBInput command prefixes\fP\&. If you want to disable the OSD
++completely, use \fB\-\-osd\-level=0\fP\&.
++.TP
++.B \fB\-\-osd\-duration=<time>\fP
++Set the duration of the OSD messages in ms (default: 1000).
++.TP
++.B \fB\-\-osd\-font=<name>\fP, \fB\-\-sub\-text\-font=<name>\fP
++Specify font to use for OSD and for subtitles that do not themselves
++specify a particular font. The default is \fBsans\-serif\fP\&.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-osd\-font=\(aqBitstream Vera Sans\(aq\fP
++.IP \(bu 2
++\fB\-\-osd\-font=\(aqMS Comic Sans\(aq\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++The \fB\-\-sub\-text\-font\fP option (and most other \fB\-\-sub\-text\-\fP
++options) are ignored when ASS\-subtitles are rendered, unless the
++\fB\-\-no\-sub\-ass\fP option is specified.
++.sp
++This used to support fontconfig patterns. Starting with libass 0.13.0,
++this stopped working.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-osd\-font\-size=<size>\fP, \fB\-\-sub\-text\-font\-size=<size>\fP
++Specify the OSD/sub font size. The unit is the size in scaled pixels at a
++window height of 720. The actual pixel size is scaled with the window
++height: if the window height is larger or smaller than 720, the actual size
++of the text increases or decreases as well.
++.sp
++Default: 55.
++.TP
++.B \fB\-\-osd\-msg1=<string>\fP
++Show this string as message on OSD with OSD level 1 (visible by default).
++The message will be visible by default, and as long no other message
++covers it, and the OSD level isn\(aqt changed (see \fB\-\-osd\-level\fP).
++Expands properties; see \fI\%Property Expansion\fP\&.
++.TP
++.B \fB\-\-osd\-msg2=<string>\fP
++Similar as \fB\-\-osd\-msg1\fP, but for OSD level 2. If this is an empty string
++(default), then the playback time is shown.
++.TP
++.B \fB\-\-osd\-msg3=<string>\fP
++Similar as \fB\-\-osd\-msg1\fP, but for OSD level 3. If this is an empty string
++(default), then the playback time, duration, and some more information is
++shown.
++.sp
++This is also used for the \fBshow_progress\fP command (by default mapped to
++\fBP\fP), or in some non\-default cases when seeking.
++.sp
++\fB\-\-osd\-status\-msg\fP is a legacy equivalent (but with a minor difference).
++.TP
++.B \fB\-\-osd\-status\-msg=<string>\fP
++Show a custom string during playback instead of the standard status text.
++This overrides the status text used for \fB\-\-osd\-level=3\fP, when using the
++\fBshow_progress\fP command (by default mapped to \fBP\fP), or in some
++non\-default cases when seeking. Expands properties. See
++\fI\%Property Expansion\fP\&.
++.sp
++This option has been replaced with \fB\-\-osd\-msg3\fP\&. The only difference is
++that this option implicitly includes \fB${osd\-sym\-cc}\fP\&. This option is
++ignored if \fB\-\-osd\-msg3\fP is not empty.
++.TP
++.B \fB\-\-osd\-playing\-msg=<string>\fP
++Show a message on OSD when playback starts. The string is expanded for
++properties, e.g. \fB\-\-osd\-playing\-msg=\(aqfile: ${filename}\(aq\fP will show the
++message \fBfile:\fP followed by a space and the currently played filename.
++.sp
++See \fI\%Property Expansion\fP\&.
++.TP
++.B \fB\-\-osd\-bar\-align\-x=<\-1\-1>\fP
++Position of the OSD bar. \-1 is far left, 0 is centered, 1 is far right.
++Fractional values (like 0.5) are allowed.
++.TP
++.B \fB\-\-osd\-bar\-align\-y=<\-1\-1>\fP
++Position of the OSD bar. \-1 is top, 0 is centered, 1 is bottom.
++Fractional values (like 0.5) are allowed.
++.TP
++.B \fB\-\-osd\-bar\-w=<1\-100>\fP
++Width of the OSD bar, in percentage of the screen width (default: 75).
++A value of 50 means the bar is half the screen wide.
++.TP
++.B \fB\-\-osd\-bar\-h=<0.1\-50>\fP
++Height of the OSD bar, in percentage of the screen height (default: 3.125).
++.TP
++.B \fB\-\-osd\-back\-color=<color>\fP, \fB\-\-sub\-text\-back\-color=<color>\fP
++See \fB\-\-osd\-color\fP\&. Color used for OSD/sub text background.
++.TP
++.B \fB\-\-osd\-blur=<0..20.0>\fP, \fB\-\-sub\-text\-blur=<0..20.0>\fP
++Gaussian blur factor. 0 means no blur applied (default).
++.TP
++.B \fB\-\-osd\-bold=<yes|no>\fP, \fB\-\-sub\-text\-bold=<yes|no>\fP
++Format text on bold.
++.TP
++.B \fB\-\-osd\-italic=<yes|no>\fP, \fB\-\-sub\-text\-italic=<yes|no>\fP
++Format text on italic.
++.TP
++.B \fB\-\-osd\-border\-color=<color>\fP, \fB\-\-sub\-text\-border\-color=<color>\fP
++See \fB\-\-osd\-color\fP\&. Color used for the OSD/sub font border.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++ignored when \fB\-\-osd\-back\-color\fP/\fB\-\-sub\-text\-back\-color\fP is
++specified (or more exactly: when that option is not set to completely
++transparent).
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-osd\-border\-size=<size>\fP, \fB\-\-sub\-text\-border\-size=<size>\fP
++Size of the OSD/sub font border in scaled pixels (see \fB\-\-osd\-font\-size\fP
++for details). A value of 0 disables borders.
++.sp
++Default: 3.
++.TP
++.B \fB\-\-osd\-color=<color>\fP, \fB\-\-sub\-text\-color=<color>\fP
++Specify the color used for OSD/unstyled text subtitles.
++.sp
++The color is specified in the form \fBr/g/b\fP, where each color component
++is specified as number in the range 0.0 to 1.0. It\(aqs also possible to
++specify the transparency by using \fBr/g/b/a\fP, where the alpha value 0
++means fully transparent, and 1.0 means opaque. If the alpha component is
++not given, the color is 100% opaque.
++.sp
++Passing a single number to the option sets the OSD to gray, and the form
++\fBgray/a\fP lets you specify alpha additionally.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-osd\-color=1.0/0.0/0.0\fP set OSD to opaque red
++.IP \(bu 2
++\fB\-\-osd\-color=1.0/0.0/0.0/0.75\fP set OSD to opaque red with 75% alpha
++.IP \(bu 2
++\fB\-\-osd\-color=0.5/0.75\fP set OSD to 50% gray with 75% alpha
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Alternatively, the color can be specified as a RGB hex triplet in the form
++\fB#RRGGBB\fP, where each 2\-digit group expresses a color value in the
++range 0 (\fB00\fP) to 255 (\fBFF\fP). For example, \fB#FF0000\fP is red.
++This is similar to web colors. Alpha is given with \fB#AARRGGBB\fP\&.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-osd\-color=\(aq#FF0000\(aq\fP set OSD to opaque red
++.IP \(bu 2
++\fB\-\-osd\-color=\(aq#C0808080\(aq\fP set OSD to 50% gray with 75% alpha
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-osd\-fractions\fP
++Show OSD times with fractions of seconds (in millisecond precision). Useful
++to see the exact timestamp of a video frame.
++.TP
++.B \fB\-\-osd\-level=<0\-3>\fP
++Specifies which mode the OSD should start in.
++.INDENT 7.0
++.TP
++.B 0
++OSD completely disabled (subtitles only)
++.TP
++.B 1
++enabled (shows up only on user interaction)
++.TP
++.B 2
++enabled + current time visible by default
++.TP
++.B 3
++enabled + \fB\-\-osd\-status\-msg\fP (current time and status by default)
++.UNINDENT
++.TP
++.B \fB\-\-osd\-margin\-x=<size>, \-\-sub\-text\-margin\-x=<size>\fP
++Left and right screen margin for the OSD/subs in scaled pixels (see
++\fB\-\-osd\-font\-size\fP for details).
++.sp
++This option specifies the distance of the OSD to the left, as well as at
++which distance from the right border long OSD text will be broken.
++.sp
++Default: 25.
++.TP
++.B \fB\-\-osd\-margin\-y=<size>, \-\-sub\-text\-margin\-y=<size>\fP
++Top and bottom screen margin for the OSD/subs in scaled pixels (see
++\fB\-\-osd\-font\-size\fP for details).
++.sp
++This option specifies the vertical margins of the OSD. This is also used
++for unstyled text subtitles. If you just want to raise the vertical
++subtitle position, use \fB\-\-sub\-pos\fP\&.
++.sp
++Default: 22.
++.TP
++.B \fB\-\-osd\-align\-x=<left|center|right>\fP, \fB\-\-sub\-text\-align\-x=...\fP
++Control to which corner of the screen OSD or text subtitles should be
++aligned to (default: \fBcenter\fP for subs, \fBleft\fP for OSD).
++.sp
++Never applied to ASS subtitles, except in \fB\-\-no\-sub\-ass\fP mode. Likewise,
++this does not apply to image subtitles.
++.TP
++.B \fB\-\-osd\-align\-y=<top|center|bottom>\fP \fB\-\-sub\-text\-align\-y=...\fP
++Vertical position (default: \fBbottom\fP for subs, \fBtop\fP for OSD).
++Details see \fB\-\-osd\-align\-x\fP\&.
++.TP
++.B \fB\-\-osd\-scale=<factor>\fP
++OSD font size multiplier, multiplied with \fB\-\-osd\-font\-size\fP value.
++.TP
++.B \fB\-\-osd\-scale\-by\-window=<yes|no>\fP
++Whether to scale the OSD with the window size (default: yes). If this is
++disabled, \fB\-\-osd\-font\-size\fP and other OSD options that use scaled pixels
++are always in actual pixels. The effect is that changing the window size
++won\(aqt change the OSD font size.
++.TP
++.B \fB\-\-osd\-shadow\-color=<color>, \-\-sub\-text\-shadow\-color=<color>\fP
++See \fB\-\-osd\-color\fP\&. Color used for OSD/sub text shadow.
++.TP
++.B \fB\-\-osd\-shadow\-offset=<size>, \-\-sub\-text\-shadow\-offset=<size>\fP
++Displacement of the OSD/sub text shadow in scaled pixels (see
++\fB\-\-osd\-font\-size\fP for details). A value of 0 disables shadows.
++.sp
++Default: 0.
++.TP
++.B \fB\-\-osd\-spacing=<size>, \-\-sub\-text\-spacing=<size>\fP
++Horizontal OSD/sub font spacing in scaled pixels (see \fB\-\-osd\-font\-size\fP
++for details). This value is added to the normal letter spacing. Negative
++values are allowed.
++.sp
++Default: 0.
++.UNINDENT
++.SS Screenshot
++.INDENT 0.0
++.TP
++.B \fB\-\-screenshot\-format=<type>\fP
++Set the image file type used for saving screenshots.
++.sp
++Available choices:
++.INDENT 7.0
++.TP
++.B png
++PNG
++.TP
++.B ppm
++PPM
++.TP
++.B pgm
++PGM
++.TP
++.B pgmyuv
++PGM with YV12 pixel format
++.TP
++.B tga
++TARGA
++.TP
++.B jpg
++JPEG (default)
++.TP
++.B jpeg
++JPEG (same as jpg, but with .jpeg file ending)
++.UNINDENT
++.TP
++.B \fB\-\-screenshot\-tag\-colorspace=<yes|no>\fP
++Tag screenshots with the appropriate colorspace.
++.sp
++Note that not all formats are supported.
++.sp
++Default: \fBno\fP\&.
++.TP
++.B \fB\-\-screenshot\-high\-bit\-depth=<yes|no>\fP
++If possible, write screenshots with a bit depth similar to the source
++video (default: yes). This is interesting in particular for PNG, as this
++sometimes triggers writing 16 bit PNGs with huge file sizes.
++.TP
++.B \fB\-\-screenshot\-template=<template>\fP
++Specify the filename template used to save screenshots. The template
++specifies the filename without file extension, and can contain format
++specifiers, which will be substituted when taking a screenshot.
++By default, the template is \fBmpv\-shot%n\fP, which results in filenames like
++\fBmpv\-shot0012.png\fP for example.
++.sp
++The template can start with a relative or absolute path, in order to
++specify a directory location where screenshots should be saved.
++.sp
++If the final screenshot filename points to an already existing file, the
++file will not be overwritten. The screenshot will either not be saved, or if
++the template contains \fB%n\fP, saved using different, newly generated
++filename.
++.sp
++Allowed format specifiers:
++.INDENT 7.0
++.TP
++.B \fB%[#][0X]n\fP
++A sequence number, padded with zeros to length X (default: 04). E.g.
++passing the format \fB%04n\fP will yield \fB0012\fP on the 12th screenshot.
++The number is incremented every time a screenshot is taken or if the
++file already exists. The length \fBX\fP must be in the range 0\-9. With
++the optional # sign, mpv will use the lowest available number. For
++example, if you take three screenshots\-\-0001, 0002, 0003\-\-and delete
++the first two, the next two screenshots will not be 0004 and 0005, but
++0001 and 0002 again.
++.TP
++.B \fB%f\fP
++Filename of the currently played video.
++.TP
++.B \fB%F\fP
++Same as \fB%f\fP, but strip the file extension, including the dot.
++.TP
++.B \fB%x\fP
++Directory path of the currently played video. If the video is not on
++the filesystem (but e.g. \fBhttp://\fP), this expand to an empty string.
++.TP
++.B \fB%X{fallback}\fP
++Same as \fB%x\fP, but if the video file is not on the filesystem, return
++the fallback string inside the \fB{...}\fP\&.
++.TP
++.B \fB%p\fP
++Current playback time, in the same format as used in the OSD. The
++result is a string of the form "HH:MM:SS". For example, if the video is
++at the time position 5 minutes and 34 seconds, \fB%p\fP will be replaced
++with "00:05:34".
++.TP
++.B \fB%P\fP
++Similar to \fB%p\fP, but extended with the playback time in milliseconds.
++It is formatted as "HH:MM:SS.mmm", with "mmm" being the millisecond
++part of the playback time.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This is a simple way for getting unique per\-frame timestamps. (Frame
++numbers would be more intuitive, but are not easily implementable
++because container formats usually use time stamps for identifying
++frames.)
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB%wX\fP
++Specify the current playback time using the format string \fBX\fP\&.
++\fB%p\fP is like \fB%wH:%wM:%wS\fP, and \fB%P\fP is like \fB%wH:%wM:%wS.%wT\fP\&.
++.INDENT 7.0
++.TP
++.B Valid format specifiers:
++.INDENT 7.0
++.TP
++.B \fB%wH\fP
++hour (padded with 0 to two digits)
++.TP
++.B \fB%wh\fP
++hour (not padded)
++.TP
++.B \fB%wM\fP
++minutes (00\-59)
++.TP
++.B \fB%wm\fP
++total minutes (includes hours, unlike \fB%wM\fP)
++.TP
++.B \fB%wS\fP
++seconds (00\-59)
++.TP
++.B \fB%ws\fP
++total seconds (includes hours and minutes)
++.TP
++.B \fB%wf\fP
++like \fB%ws\fP, but as float
++.TP
++.B \fB%wT\fP
++milliseconds (000\-999)
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB%tX\fP
++Specify the current local date/time using the format \fBX\fP\&. This format
++specifier uses the UNIX \fBstrftime()\fP function internally, and inserts
++the result of passing "%X" to \fBstrftime\fP\&. For example, \fB%tm\fP will
++insert the number of the current month as number. You have to use
++multiple \fB%tX\fP specifiers to build a full date/time string.
++.TP
++.B \fB%{prop[:fallback text]}\fP
++Insert the value of the slave property \(aqprop\(aq. E.g. \fB%{filename}\fP is
++the same as \fB%f\fP\&. If the property does not exist or is not available,
++an error text is inserted, unless a fallback is specified.
++.TP
++.B \fB%%\fP
++Replaced with the \fB%\fP character itself.
++.UNINDENT
++.TP
++.B \fB\-\-screenshot\-directory=<path>\fP
++Store screenshots in this directory. This path is joined with the filename
++generated by \fB\-\-screenshot\-template\fP\&. If the template filename is already
++absolute, the directory is ignored.
++.sp
++If the directory does not exist, it is created on the first screenshot. If
++it is not a directory, an error is generated when trying to write a
++screenshot.
++.sp
++This option is not set by default, and thus will write screenshots to the
++directory from which mpv was started. In pseudo\-gui mode
++(see \fI\%PSEUDO GUI MODE\fP), this is set to the desktop.
++.TP
++.B \fB\-\-screenshot\-jpeg\-quality=<0\-100>\fP
++Set the JPEG quality level. Higher means better quality. The default is 90.
++.TP
++.B \fB\-\-screenshot\-jpeg\-source\-chroma=<yes|no>\fP
++Write JPEG files with the same chroma subsampling as the video
++(default: yes). If disabled, the libjpeg default is used.
++.TP
++.B \fB\-\-screenshot\-png\-compression=<0\-9>\fP
++Set the PNG compression level. Higher means better compression. This will
++affect the file size of the written screenshot file and the time it takes
++to write a screenshot. Too high compression might occupy enough CPU time to
++interrupt playback. The default is 7.
++.TP
++.B \fB\-\-screenshot\-png\-filter=<0\-5>\fP
++Set the filter applied prior to PNG compression. 0 is none, 1 is "sub", 2 is
++"up", 3 is "average", 4 is "Paeth", and 5 is "mixed". This affects the level
++of compression that can be achieved. For most images, "mixed" achieves the
++best compression ratio, hence it is the default.
++.UNINDENT
++.SS Software Scaler
++.INDENT 0.0
++.TP
++.B \fB\-\-sws\-scaler=<name>\fP
++Specify the software scaler algorithm to be used with \fB\-\-vf=scale\fP\&. This
++also affects video output drivers which lack hardware acceleration,
++e.g. \fBx11\fP\&. See also \fB\-\-vf=scale\fP\&.
++.sp
++To get a list of available scalers, run \fB\-\-sws\-scaler=help\fP\&.
++.sp
++Default: \fBbicubic\fP\&.
++.TP
++.B \fB\-\-sws\-lgb=<0\-100>\fP
++Software scaler Gaussian blur filter (luma). See \fB\-\-sws\-scaler\fP\&.
++.TP
++.B \fB\-\-sws\-cgb=<0\-100>\fP
++Software scaler Gaussian blur filter (chroma). See \fB\-\-sws\-scaler\fP\&.
++.TP
++.B \fB\-\-sws\-ls=<\-100\-100>\fP
++Software scaler sharpen filter (luma). See \fB\-\-sws\-scaler\fP\&.
++.TP
++.B \fB\-\-sws\-cs=<\-100\-100>\fP
++Software scaler sharpen filter (chroma). See \fB\-\-sws\-scaler\fP\&.
++.TP
++.B \fB\-\-sws\-chs=<h>\fP
++Software scaler chroma horizontal shifting. See \fB\-\-sws\-scaler\fP\&.
++.TP
++.B \fB\-\-sws\-cvs=<v>\fP
++Software scaler chroma vertical shifting. See \fB\-\-sws\-scaler\fP\&.
++.UNINDENT
++.SS Terminal
++.INDENT 0.0
++.TP
++.B \fB\-\-quiet\fP
++Make console output less verbose; in particular, prevents the status line
++(i.e. AV: 3.4 (00:00:03.37) / 5320.6 ...) from being displayed.
++Particularly useful on slow terminals or broken ones which do not properly
++handle carriage return (i.e. \fB\er\fP).
++.sp
++See also: \fB\-\-really\-quiet\fP and \fB\-\-msg\-level\fP\&.
++.TP
++.B \fB\-\-really\-quiet\fP
++Display even less output and status messages than with \fB\-\-quiet\fP\&.
++.TP
++.B \fB\-\-no\-terminal\fP, \fB\-\-terminal\fP
++Disable any use of the terminal and stdin/stdout/stderr. This completely
++silences any message output.
++.sp
++Unlike \fB\-\-really\-quiet\fP, this disables input and terminal initialization
++as well.
++.TP
++.B \fB\-\-no\-msg\-color\fP
++Disable colorful console output on terminals.
++.TP
++.B \fB\-\-msg\-level=<module1=level1,module2=level2,...>\fP
++Control verbosity directly for each module. The \fBall\fP module changes the
++verbosity of all the modules not explicitly specified on the command line.
++.sp
++Run mpv with \fB\-\-msg\-level=all=trace\fP to see all messages mpv outputs. You
++can use the module names printed in the output (prefixed to each line in
++\fB[...]\fP) to limit the output to interesting modules.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Some messages are printed before the command line is parsed and are
++therefore not affected by \fB\-\-msg\-level\fP\&. To control these messages,
++you have to use the \fBMPV_VERBOSE\fP environment variable; see
++\fI\%ENVIRONMENT VARIABLES\fP for details.
++.UNINDENT
++.UNINDENT
++.sp
++Available levels:
++.INDENT 7.0
++.INDENT 3.5
++.INDENT 0.0
++.TP
++.B no
++complete silence
++.TP
++.B fatal
++fatal messages only
++.TP
++.B error
++error messages
++.TP
++.B warn
++warning messages
++.TP
++.B info
++informational messages
++.TP
++.B status
++status messages (default)
++.TP
++.B v
++verbose messages
++.TP
++.B debug
++debug messages
++.TP
++.B trace
++very noisy debug messages
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv \-\-msg\-level=ao/sndio=no
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Completely silences the output of ao_sndio, which uses the log
++prefix \fB[ao/sndio]\fP\&.
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv \-\-msg\-level=all=warn,ao/alsa=error
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Only show warnings or worse, and let the ao_alsa output show errors
++only.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-term\-osd, \-\-no\-term\-osd\fP, \fB\-\-term\-osd=force\fP
++Display OSD messages on the console when no video output is available.
++Enabled by default.
++.sp
++\fBforce\fP enables terminal OSD even if a video window is created.
++.TP
++.B \fB\-\-term\-osd\-bar\fP, \fB\-\-no\-term\-osd\-bar\fP
++Enable printing a progress bar under the status line on the terminal.
++(Disabled by default.)
++.TP
++.B \fB\-\-term\-osd\-bar\-chars=<string>\fP
++Customize the \fB\-\-term\-osd\-bar\fP feature. The string is expected to
++consist of 5 characters (start, left space, position indicator,
++right space, end). You can use Unicode characters, but note that double\-
++width characters will not be treated correctly.
++.sp
++Default: \fB[\-+\-]\fP\&.
++.TP
++.B \fB\-\-term\-playing\-msg=<string>\fP
++Print out a string after starting playback. The string is expanded for
++properties, e.g. \fB\-\-term\-playing\-msg=\(aqfile: ${filename}\(aq\fP will print the string
++\fBfile:\fP followed by a space and the currently played filename.
++.sp
++See \fI\%Property Expansion\fP\&.
++.TP
++.B \fB\-\-term\-status\-msg=<string>\fP
++Print out a custom string during playback instead of the standard status
++line. Expands properties. See \fI\%Property Expansion\fP\&.
++.TP
++.B \fB\-\-msg\-module\fP
++Prepend module name to each console message.
++.TP
++.B \fB\-\-msg\-time\fP
++Prepend timing information to each console message.
++.UNINDENT
++.SS TV
++.INDENT 0.0
++.TP
++.B \fB\-\-tv\-...\fP
++These options tune various properties of the TV capture module. For
++watching TV with mpv, use \fBtv://\fP or \fBtv://<channel_number>\fP or
++even \fBtv://<channel_name>\fP (see option \fBtv\-channels\fP for \fBchannel_name\fP
++below) as a media URL. You can also use \fBtv:///<input_id>\fP to start
++watching a video from a composite or S\-Video input (see option \fBinput\fP for
++details).
++.TP
++.B \fB\-\-tv\-device=<value>\fP
++Specify TV device (default: \fB/dev/video0\fP).
++.TP
++.B \fB\-\-tv\-channel=<value>\fP
++Set tuner to <value> channel.
++.TP
++.B \fB\-\-no\-tv\-audio\fP
++no sound
++.TP
++.B \fB\-\-tv\-automute=<0\-255> (v4l and v4l2 only)\fP
++If signal strength reported by device is less than this value, audio
++and video will be muted. In most cases automute=100 will be enough.
++Default is 0 (automute disabled).
++.TP
++.B \fB\-\-tv\-driver=<value>\fP
++See \fB\-\-tv=driver=help\fP for a list of compiled\-in TV input drivers.
++available: dummy, v4l2 (default: autodetect)
++.TP
++.B \fB\-\-tv\-input=<value>\fP
++Specify input (default: 0 (TV), see console output for available
++inputs).
++.TP
++.B \fB\-\-tv\-freq=<value>\fP
++Specify the frequency to set the tuner to (e.g. 511.250). Not
++compatible with the channels parameter.
++.TP
++.B \fB\-\-tv\-outfmt=<value>\fP
++Specify the output format of the tuner with a preset value supported
++by the V4L driver (YV12, UYVY, YUY2, I420) or an arbitrary format given
++as hex value.
++.TP
++.B \fB\-\-tv\-width=<value>\fP
++output window width
++.TP
++.B \fB\-\-tv\-height=<value>\fP
++output window height
++.TP
++.B \fB\-\-tv\-fps=<value>\fP
++framerate at which to capture video (frames per second)
++.TP
++.B \fB\-\-tv\-buffersize=<value>\fP
++maximum size of the capture buffer in megabytes (default: dynamical)
++.TP
++.B \fB\-\-tv\-norm=<value>\fP
++See the console output for a list of all available norms.
++.sp
++See also: \fB\-\-tv\-normid\fP\&.
++.TP
++.B \fB\-\-tv\-normid=<value> (v4l2 only)\fP
++Sets the TV norm to the given numeric ID. The TV norm depends on the
++capture card. See the console output for a list of available TV norms.
++.TP
++.B \fB\-\-tv\-chanlist=<value>\fP
++available: argentina, australia, china\-bcast, europe\-east,
++europe\-west, france, ireland, italy, japan\-bcast, japan\-cable,
++newzealand, russia, southafrica, us\-bcast, us\-cable, us\-cable\-hrc
++.TP
++.B \fB\-\-tv\-channels=<chan>\-<name>[=<norm>],<chan>\-<name>[=<norm>],...\fP
++Set names for channels.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++If <chan> is an integer greater than 1000, it will be treated as
++frequency (in kHz) rather than channel name from frequency table.
++Use _ for spaces in names (or play with quoting ;\-) ). The channel
++names will then be written using OSD, and the slave commands
++\fBtv_step_channel\fP, \fBtv_set_channel\fP and \fBtv_last_channel\fP
++will be usable for a remote control. Not compatible with
++the \fBfrequency\fP parameter.
++.UNINDENT
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++The channel number will then be the position in the \(aqchannels\(aq
++list, beginning with 1.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.sp
++\fBtv://1\fP, \fBtv://TV1\fP, \fBtv_set_channel 1\fP,
++\fBtv_set_channel TV1\fP
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-tv\-[brightness|contrast|hue|saturation]=<\-100\-100>\fP
++Set the image equalizer on the card.
++.TP
++.B \fB\-\-tv\-audiorate=<value>\fP
++Set input audio sample rate.
++.TP
++.B \fB\-\-tv\-forceaudio\fP
++Capture audio even if there are no audio sources reported by v4l.
++.TP
++.B \fB\-\-tv\-alsa\fP
++Capture from ALSA.
++.TP
++.B \fB\-\-tv\-amode=<0\-3>\fP
++Choose an audio mode:
++.INDENT 7.0
++.TP
++.B 0
++mono
++.TP
++.B 1
++stereo
++.TP
++.B 2
++language 1
++.TP
++.B 3
++language 2
++.UNINDENT
++.TP
++.B \fB\-\-tv\-forcechan=<1\-2>\fP
++By default, the count of recorded audio channels is determined
++automatically by querying the audio mode from the TV card. This option
++allows forcing stereo/mono recording regardless of the amode option
++and the values returned by v4l. This can be used for troubleshooting
++when the TV card is unable to report the current audio mode.
++.TP
++.B \fB\-\-tv\-adevice=<value>\fP
++Set an audio device. <value> should be \fB/dev/xxx\fP for OSS and a
++hardware ID for ALSA. You must replace any \(aq:\(aq by a \(aq.\(aq in the
++hardware ID for ALSA.
++.TP
++.B \fB\-\-tv\-audioid=<value>\fP
++Choose an audio output of the capture card, if it has more than one.
++.TP
++.B \fB\-\-tv\-[volume|bass|treble|balance]=<0\-100>\fP
++These options set parameters of the mixer on the video capture card.
++They will have no effect, if your card does not have one. For v4l2 50
++maps to the default value of the control, as reported by the driver.
++.TP
++.B \fB\-\-tv\-gain=<0\-100>\fP
++Set gain control for video devices (usually webcams) to the desired
++value and switch off automatic control. A value of 0 enables automatic
++control. If this option is omitted, gain control will not be modified.
++.TP
++.B \fB\-\-tv\-immediatemode=<bool>\fP
++A value of 0 means capture and buffer audio and video together. A
++value of 1 (default) means to do video capture only and let the audio
++go through a loopback cable from the TV card to the sound card.
++.TP
++.B \fB\-\-tv\-mjpeg\fP
++Use hardware MJPEG compression (if the card supports it). When using
++this option, you do not need to specify the width and height of the
++output window, because mpv will determine it automatically from
++the decimation value (see below).
++.TP
++.B \fB\-\-tv\-decimation=<1|2|4>\fP
++choose the size of the picture that will be compressed by hardware
++MJPEG compression:
++.INDENT 7.0
++.TP
++.B 1
++full size
++.INDENT 7.0
++.IP \(bu 2
++704x576 PAL
++.IP \(bu 2
++704x480 NTSC
++.UNINDENT
++.TP
++.B 2
++medium size
++.INDENT 7.0
++.IP \(bu 2
++352x288 PAL
++.IP \(bu 2
++352x240 NTSC
++.UNINDENT
++.TP
++.B 4
++small size
++.INDENT 7.0
++.IP \(bu 2
++176x144 PAL
++.IP \(bu 2
++176x120 NTSC
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-tv\-quality=<0\-100>\fP
++Choose the quality of the JPEG compression (< 60 recommended for full
++size).
++.TP
++.B \fB\-\-tv\-scan\-autostart\fP
++Begin channel scanning immediately after startup (default: disabled).
++.TP
++.B \fB\-\-tv\-scan\-period=<0.1\-2.0>\fP
++Specify delay in seconds before switching to next channel (default:
++0.5). Lower values will cause faster scanning, but can detect inactive
++TV channels as active.
++.TP
++.B \fB\-\-tv\-scan\-threshold=<1\-100>\fP
++Threshold value for the signal strength (in percent), as reported by
++the device (default: 50). A signal strength higher than this value will
++indicate that the currently scanning channel is active.
++.UNINDENT
++.SS Cache
++.INDENT 0.0
++.TP
++.B \fB\-\-cache=<kBytes|yes|no|auto>\fP
++Set the size of the cache in kilobytes, disable it with \fBno\fP, or
++automatically enable it if needed with \fBauto\fP (default: \fBauto\fP).
++With \fBauto\fP, the cache will usually be enabled for network streams,
++using the size set by \fB\-\-cache\-default\fP\&. With \fByes\fP, the cache will
++always be enabled with the size set by \fB\-\-cache\-default\fP (unless the
++stream can not be cached, or \fB\-\-cache\-default\fP disables caching).
++.sp
++May be useful when playing files from slow media, but can also have
++negative effects, especially with file formats that require a lot of
++seeking, such as MP4.
++.sp
++Note that half the cache size will be used to allow fast seeking back. This
++is also the reason why a full cache is usually not reported as 100% full.
++The cache fill display does not include the part of the cache reserved for
++seeking back. The actual maximum percentage will usually be the ratio
++between readahead and backbuffer sizes.
++.TP
++.B \fB\-\-cache\-default=<kBytes|no>\fP
++Set the size of the cache in kilobytes (default: 75000 KB). Using \fBno\fP
++will not automatically enable the cache e.g. when playing from a network
++stream. Note that using \fB\-\-cache\fP will always override this option.
++.TP
++.B \fB\-\-cache\-initial=<kBytes>\fP
++Playback will start when the cache has been filled up with this many
++kilobytes of data (default: 0).
++.TP
++.B \fB\-\-cache\-seek\-min=<kBytes>\fP
++If a seek is to be made to a position within \fB<kBytes>\fP of the cache
++size from the current position, mpv will wait for the cache to be
++filled to this position rather than performing a stream seek (default:
++500).
++.sp
++This matters for small forward seeks. With slow streams (especially HTTP
++streams) there is a tradeoff between skipping the data between current
++position and seek destination, or performing an actual seek. Depending
++on the situation, either of these might be slower than the other method.
++This option allows control over this.
++.TP
++.B \fB\-\-cache\-backbuffer=<kBytes>\fP
++Size of the cache back buffer (default: 75000 KB). This will add to the total
++cache size, and reserved the amount for seeking back. The reserved amount
++will not be used for readahead, and instead preserves already read data to
++enable fast seeking back.
++.TP
++.B \fB\-\-cache\-file=<TMP|path>\fP
++Create a cache file on the filesystem.
++.sp
++There are two ways of using this:
++.INDENT 7.0
++.IP 1. 3
++Passing a path (a filename). The file will always be overwritten. When
++the general cache is enabled, this file cache will be used to store
++whatever is read from the source stream.
++.sp
++This will always overwrite the cache file, and you can\(aqt use an existing
++cache file to resume playback of a stream. (Technically, mpv wouldn\(aqt
++even know which blocks in the file are valid and which not.)
++.sp
++The resulting file will not necessarily contain all data of the source
++stream. For example, if you seek, the parts that were skipped over are
++never read and consequently are not written to the cache. The skipped over
++parts are filled with zeros. This means that the cache file doesn\(aqt
++necessarily correspond to a full download of the source stream.
++.sp
++Both of these issues could be improved if there is any user interest.
++.sp
++\fBWARNING:\fP
++.INDENT 3.0
++.INDENT 3.5
++Causes random corruption when used with ordered chapters or
++with \fB\-\-audio\-file\fP\&.
++.UNINDENT
++.UNINDENT
++.IP 2. 3
++Passing the string \fBTMP\fP\&. This will not be interpreted as filename.
++Instead, an invisible temporary file is created. It depends on your
++C library where this file is created (usually \fB/tmp/\fP), and whether
++filename is visible (the \fBtmpfile()\fP function is used). On some
++systems, automatic deletion of the cache file might not be guaranteed.
++.sp
++If you want to use a file cache, this mode is recommended, because it
++doesn\(aqt break ordered chapters or \fB\-\-audio\-file\fP\&. These modes open
++multiple cache streams, and using the same file for them obviously
++clashes.
++.UNINDENT
++.sp
++See also: \fB\-\-cache\-file\-size\fP\&.
++.TP
++.B \fB\-\-cache\-file\-size=<kBytes>\fP
++Maximum size of the file created with \fB\-\-cache\-file\fP\&. For read accesses
++above this size, the cache is simply not used.
++.sp
++Keep in mind that some use\-cases, like playing ordered chapters with cache
++enabled, will actually create multiple cache files, each of which will
++use up to this much disk space.
++.sp
++(Default: 1048576, 1 GB.)
++.TP
++.B \fB\-\-no\-cache\fP
++Turn off input stream caching. See \fB\-\-cache\fP\&.
++.TP
++.B \fB\-\-cache\-secs=<seconds>\fP
++How many seconds of audio/video to prefetch if the cache is active. This
++overrides the \fB\-\-demuxer\-readahead\-secs\fP option if and only if the cache
++is enabled and the value is larger. (Default: 10.)
++.TP
++.B \fB\-\-cache\-pause\fP, \fB\-\-no\-cache\-pause\fP
++Whether the player should automatically pause when the cache runs low,
++and unpause once more data is available ("buffering").
++.UNINDENT
++.SS Network
++.INDENT 0.0
++.TP
++.B \fB\-\-user\-agent=<string>\fP
++Use \fB<string>\fP as user agent for HTTP streaming.
++.TP
++.B \fB\-\-cookies\fP, \fB\-\-no\-cookies\fP
++Support cookies when making HTTP requests. Disabled by default.
++.TP
++.B \fB\-\-cookies\-file=<filename>\fP
++Read HTTP cookies from <filename>. The file is assumed to be in Netscape
++format.
++.TP
++.B \fB\-\-http\-header\-fields=<field1,field2>\fP
++Set custom HTTP fields when accessing HTTP stream.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv \-\-http\-header\-fields=\(aqField1: value1\(aq,\(aqField2: value2\(aq \e
++http://localhost:1234
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Will generate HTTP request:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++GET / HTTP/1.0
++Host: localhost:1234
++User\-Agent: MPlayer
++Icy\-MetaData: 1
++Field1: value1
++Field2: value2
++Connection: close
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-tls\-ca\-file=<filename>\fP
++Certificate authority database file for use with TLS. (Silently fails with
++older FFmpeg or Libav versions.)
++.TP
++.B \fB\-\-tls\-verify\fP
++Verify peer certificates when using TLS (e.g. with \fBhttps://...\fP).
++(Silently fails with older FFmpeg or Libav versions.)
++.TP
++.B \fB\-\-tls\-cert\-file\fP
++A file containing a certificate to use in the handshake with the
++peer.
++.TP
++.B \fB\-\-tls\-key\-file\fP
++A file containing the private key for the certificate.
++.TP
++.B \fB\-\-referrer=<string>\fP
++Specify a referrer path or URL for HTTP requests.
++.TP
++.B \fB\-\-network\-timeout=<seconds>\fP
++Specify the network timeout in seconds. This affects at least HTTP. The
++special value 0 (default) uses the FFmpeg/Libav defaults. If a protocol
++is used which does not support timeouts, this option is silently ignored.
++.TP
++.B \fB\-\-rtsp\-transport=<lavf|udp|tcp|http>\fP
++Select RTSP transport method (default: tcp). This selects the underlying
++network transport when playing \fBrtsp://...\fP URLs. The value \fBlavf\fP
++leaves the decision to libavformat.
++.TP
++.B \fB\-\-hls\-bitrate=<no|min|max|<rate>>\fP
++If HLS streams are played, this option controls what streams are selected
++by default. The option allows the following parameters:
++.INDENT 7.0
++.TP
++.B no
++Don\(aqt do anything special. Typically, this will simply pick the
++first audio/video streams it can find.
++.TP
++.B min
++Pick the streams with the lowest bitrate.
++.TP
++.B max
++Same, but highest bitrate. (Default.)
++.UNINDENT
++.sp
++Additionally, if the option is a number, the stream with the highest rate
++equal or below the option value is selected.
++.sp
++The bitrate as used is sent by the server, and there\(aqs no guarantee it\(aqs
++actually meaningful.
++.UNINDENT
++.SS DVB
++.INDENT 0.0
++.TP
++.B \fB\-\-dvbin\-card=<1\-4>\fP
++Specifies using card number 1\-4 (default: 1).
++.TP
++.B \fB\-\-dvbin\-file=<filename>\fP
++Instructs mpv to read the channels list from \fB<filename>\fP\&. The default is
++in the mpv configuration directory (usually \fB~/.config/mpv\fP) with the
++filename \fBchannels.conf.{sat,ter,cbl,atsc}\fP (based on your card type) or
++\fBchannels.conf\fP as a last resort.
++For DVB\-S/2 cards, a VDR 1.7.x format channel list is recommended
++as it allows tuning to DVB\-S2 channels, enabling subtitles and
++decoding the PMT (which largely improves the demuxing).
++Classic mplayer format channel lists are still supported (without
++these improvements), and for other card types, only limited VDR
++format channel list support is implemented (patches welcome).
++For channels with dynamic PID switching or incomplete
++\fBchannels.conf\fP, \fB\-\-dvbin\-full\-transponder\fP or the magic PID
++\fB8192\fP are recommended.
++.TP
++.B \fB\-\-dvbin\-timeout=<1\-30>\fP
++Maximum number of seconds to wait when trying to tune a frequency before
++giving up (default: 30).
++.TP
++.B \fB\-\-dvbin\-full\-transponder=<yes|no>\fP
++Apply no filters on program PIDs, only tune to frequency and pass full
++transponder to demuxer.
++The player frontend selects the streams from the full TS in this case,
++so the program which is shown initially may not match the chosen channel.
++Switching between the programs is possible by cycling the \fBprogram\fP
++property.
++This is useful to record multiple programs on a single transponder,
++or to work around issues in the \fBchannels.conf\fP\&.
++It is also recommended to use this for channels which switch PIDs
++on\-the\-fly, e.g. for regional news.
++.sp
++Default: \fBno\fP
++.UNINDENT
++.SS Miscellaneous
++.INDENT 0.0
++.TP
++.B \fB\-\-display\-tags=tag1,tags2,...\fP
++Set the list of tags that should be displayed on the terminal. Tags that
++are in the list, but are not present in the played file, will not be shown.
++If a value ends with \fB*\fP, all tags are matched by prefix (though there
++is no general globbing). Just passing \fB*\fP essentially filtering.
++.sp
++The default includes a common list of tags, call mpv with \fB\-\-list\-options\fP
++to see it.
++.TP
++.B \fB\-\-mc=<seconds/frame>\fP
++Maximum A\-V sync correction per frame (in seconds)
++.TP
++.B \fB\-\-autosync=<factor>\fP
++Gradually adjusts the A/V sync based on audio delay measurements.
++Specifying \fB\-\-autosync=0\fP, the default, will cause frame timing to be
++based entirely on audio delay measurements. Specifying \fB\-\-autosync=1\fP
++will do the same, but will subtly change the A/V correction algorithm. An
++uneven video framerate in a video which plays fine with \fB\-\-no\-audio\fP can
++often be helped by setting this to an integer value greater than 1. The
++higher the value, the closer the timing will be to \fB\-\-no\-audio\fP\&. Try
++\fB\-\-autosync=30\fP to smooth out problems with sound drivers which do not
++implement a perfect audio delay measurement. With this value, if large A/V
++sync offsets occur, they will only take about 1 or 2 seconds to settle
++out. This delay in reaction time to sudden A/V offsets should be the only
++side effect of turning this option on, for all sound drivers.
++.TP
++.B \fB\-\-video\-sync=<audio|...>\fP
++How the player synchronizes audio and video.
++.sp
++The modes starting with \fBdisplay\-\fP try to output video frames completely
++synchronously to the display, using the detected display vertical refresh
++rate as a hint how fast frames will be displayed on average. These modes
++change video speed slightly to match the display. See \fB\-\-video\-sync\-...\fP
++options for fine tuning. The robustness of this mode is further reduced by
++making a some idealized assumptions, which may not always apply in reality.
++Behavior can depend on the VO and the system\(aqs video and audio drivers.
++Media files must use constant framerate. Section\-wise VFR might work as well
++with some container formats (but not e.g. mkv). If the sync code detects
++severe A/V desync, or the framerate cannot be detected, the player
++automatically reverts to \fBaudio\fP mode for some time or permanently.
++.sp
++The modes with \fBdesync\fP in their names do not attempt to keep audio/video
++in sync. They will slowly (or quickly) desync, until e.g. the next seek
++happens. These modes are meant for testing, not serious use.
++.INDENT 7.0
++.TP
++.B audio
++Time video frames to audio. This is the most robust
++mode, because the player doesn\(aqt have to assume anything
++about how the display behaves. The disadvantage is that
++it can lead to occasional frame drops or repeats. If
++audio is disabled, this uses the system clock. This is
++the default mode.
++.TP
++.B display\-resample
++Resample audio to match the video. This mode will also
++try to adjust audio speed to compensate for other drift.
++(This means it will play the audio at a different speed
++every once in a while to reduce the A/V difference.)
++.TP
++.B display\-resample\-vdrop
++Resample audio to match the video. Drop video
++frames to compensate for drift.
++.TP
++.B display\-resample\-desync
++Like the previous mode, but no A/V compensation.
++.TP
++.B display\-vdrop
++Drop or repeat video frames to compensate desyncing
++video. (Although it should have the same effects as
++\fBaudio\fP, the implementation is very different.)
++.TP
++.B display\-adrop
++Drop or repeat audio data to compensate desyncing
++video. See \fB\-\-video\-sync\-adrop\-size\fP\&. This mode will
++cause severe audio artifacts if the real monitor
++refresh rate is too different from the reported or
++forced rate.
++.TP
++.B display\-desync
++Sync video to display, and let audio play on its own.
++.TP
++.B desync
++Sync video according to system clock, and let audio play
++on its own.
++.UNINDENT
++.TP
++.B \fB\-\-video\-sync\-max\-video\-change=<value>\fP
++Maximum speed difference in percent that is applied to video with
++\fB\-\-video\-sync=display\-...\fP (default: 1). Display sync mode will be
++disabled if the monitor and video refresh way do not match within the
++given range. It tries multiples as well: playing 30 fps video on a 60 Hz
++screen will duplicate every second frame. Playing 24 fps video on a 60 Hz
++screen will play video in a 2\-3\-2\-3\-... pattern.
++.sp
++The default settings are not loose enough to speed up 23.976 fps video to
++25 fps. We consider the pitch change too extreme to allow this behavior
++by default. Set this option to a value of \fB5\fP to enable it.
++.sp
++Note that in the \fB\-\-video\-sync=display\-resample\fP mode, audio speed will
++additionally be changed by a small amount if necessary for A/V sync. See
++\fB\-\-video\-sync\-max\-audio\-change\fP\&.
++.TP
++.B \fB\-\-video\-sync\-max\-audio\-change=<value>\fP
++Maximum \fIadditional\fP speed difference in percent that is applied to audio
++with \fB\-\-video\-sync=display\-...\fP (default: 0.125). Normally, the player
++play the audio at the speed of the video. But if the difference between
++audio and video position is too high, e.g. due to drift or other timing
++errors, it will attempt to speed up or slow down audio by this additional
++factor. Too low values could lead to video frame dropping or repeating if
++the A/V desync cannot be compensated, too high values could lead to chaotic
++frame dropping due to the audio "overshooting" and skipping multiple video
++frames before the sync logic can react.
++.TP
++.B \fB\-\-video\-sync\-adrop\-size=<value>\fP
++For the \fB\-\-video\-sync=display\-adrop\fP mode. This mode duplicates/drops
++audio data to keep audio in sync with video. To avoid audio artifacts on
++jitter (which would add/remove samples all the time), this is done in
++relatively large, fixed units, controlled by this option. The unit is
++seconds.
++.TP
++.B \fB\-\-mf\-fps=<value>\fP
++Framerate used when decoding from multiple PNG or JPEG files with \fBmf://\fP
++(default: 1).
++.TP
++.B \fB\-\-mf\-type=<value>\fP
++Input file type for \fBmf://\fP (available: jpeg, png, tga, sgi). By default,
++this is guessed from the file extension.
++.TP
++.B \fB\-\-stream\-capture=<filename>\fP
++Allows capturing the primary stream (not additional audio tracks or other
++kind of streams) into the given file. Capturing can also be started and
++stopped by changing the filename with the \fBstream\-capture\fP slave property.
++Generally this will not produce usable results for anything else than MPEG
++or raw streams, unless capturing includes the file headers and is not
++interrupted. Note that, due to cache latencies, captured data may begin and
++end somewhat delayed compared to what you see displayed.
++.sp
++The destination file is always appended. (Before mpv 0.8.0, the file was
++overwritten.)
++.TP
++.B \fB\-\-stream\-dump=<filename>\fP
++Same as \fB\-\-stream\-capture\fP, but do not start playback. Instead, the entire
++file is dumped.
++.TP
++.B \fB\-\-stream\-lavf\-o=opt1=value1,opt2=value2,...\fP
++Set AVOptions on streams opened with libavformat. Unknown or misspelled
++options are silently ignored. (They are mentioned in the terminal output
++in verbose mode, i.e. \fB\-\-v\fP\&. In general we can\(aqt print errors, because
++other options such as e.g. user agent are not available with all protocols,
++and printing errors for unknown options would end up being too noisy.)
++.TP
++.B \fB\-\-vo\-mmcss\-profile=<name>\fP
++(Windows only.)
++Set the MMCSS profile for the video renderer thread (default: \fBPlayback\fP).
++.TP
++.B \fB\-\-priority=<prio>\fP
++(Windows only.)
++Set process priority for mpv according to the predefined priorities
++available under Windows.
++.sp
++Possible values of \fB<prio>\fP:
++idle|belownormal|normal|abovenormal|high|realtime
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++Using realtime priority can cause system lockup.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB\-\-force\-media\-title=<string>\fP
++Force the contents of the \fBmedia\-title\fP property to this value. Useful
++for scripts which want to set a title, without overriding the user\(aqs
++setting in \fB\-\-title\fP\&.
++.TP
++.B \fB\-\-external\-file=<filename>\fP
++Add all tracks from the given file. Unlike \fB\-\-sub\-file\fP and
++\fB\-\-audio\-file\fP, this includes all tracks, and does not cause default
++stream selection over the "proper" file.
++.TP
++.B \fB\-\-lavfi\-complex=<string>\fP
++Set a "complex" libavfilter filter, which means a single filter graph can
++take input from multiple source audio and video tracks. The graph can result
++in a single audio or video output (or both).
++.sp
++Currently, the filter graph labels are used to select the participating
++input tracks and audio/video output. The following rules apply:
++.INDENT 7.0
++.IP \(bu 2
++A label of the form \fBaidN\fP selects audio track N as input (e.g.
++\fBaid1\fP).
++.IP \(bu 2
++A label of the form \fBvidN\fP selects video track N as input.
++.IP \(bu 2
++A label named \fBao\fP will be connected to the audio output.
++.IP \(bu 2
++A label named \fBvo\fP will be connected to the video output.
++.UNINDENT
++.sp
++Each label can be used only once. If you want to use e.g. an audio stream
++for multiple filters, you need to use the \fBasplit\fP filter. Multiple
++video or audio outputs are not possible, but you can use filters to merge
++them into one.
++.sp
++The complex filter can not be changed yet during playback. It\(aqs also not
++possible to change the tracks connected to the filter at runtime. Other
++tracks, as long as they\(aqre not connected to the filter, and the
++corresponding output is not connected to the filter, can still be freely
++changed.
++.sp
++Note that the normal filter chains (\fB\-\-af\fP, \fB\-\-vf\fP) are applied between
++the complex graphs (e.g. \fBao\fP label) and the actual output.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-lavfi\-complex=\(aq[aid1] asplit [ao] [t] ; [t] aphasemeter [vo]\(aq\fP
++Play audio track 1, and visualize it as video using the \fBaphasemeter\fP
++filter.
++.IP \(bu 2
++\fB\-\-lavfi\-complex=\(aq[aid1] [aid2] amix [ao]\(aq\fP
++Play audio track 1 and 2 at the same time.
++.IP \(bu 2
++\fB\-\-lavfi\-complex=\(aq[vid1] [vid2] vstack [vo]\(aq\fP
++Stack video track 1 and 2 and play them at the same time. Note that
++both tracks need to have the same width, or filter initialization
++will fail (you can add \fBscale\fP filters before the \fBvstack\fP filter
++to fix the size).
++.IP \(bu 2
++\fB\-\-lavfi\-complex=\(aq[aid1] asplit [ao] [t] ; [t] aphasemeter [t2] ; [vid1] [t2] overlay [vo]\(aq\fP
++Play audio track 1, and overlay its visualization over video track 1.
++.IP \(bu 2
++\fB\-\-lavfi\-complex=\(aq[aid1] asplit [t1] [ao] ; [t1] showvolume [t2] ; [vid1] [t2] overlay [vo]\(aq\fP
++Play audio track 1, and overlay the measured volume for each speaker
++over video track 1.
++.IP \(bu 2
++\fBnull:// \-\-lavfi\-complex=\(aqlife [vo]\(aq\fP
++Conways\(aq Life Game.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++See the FFmpeg libavfilter documentation for details on the available
++filters.
++.UNINDENT
++.SH AUDIO OUTPUT DRIVERS
++.sp
++Audio output drivers are interfaces to different audio output facilities. The
++syntax is:
++.INDENT 0.0
++.TP
++.B \fB\-\-ao=<driver1[:suboption1[=value]:...],driver2,...[,]>\fP
++Specify a priority list of audio output drivers to be used.
++.UNINDENT
++.sp
++If the list has a trailing \(aq,\(aq, mpv will fall back on drivers not contained
++in the list. Suboptions are optional and can mostly be omitted.
++.sp
++You can also set defaults for each driver. The defaults are applied before the
++normal driver parameters.
++.INDENT 0.0
++.TP
++.B \fB\-\-ao\-defaults=<driver1[:parameter1:parameter2:...],driver2,...>\fP
++Set defaults for each driver.
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 0.0
++.INDENT 3.5
++See \fB\-\-ao=help\fP for a list of compiled\-in audio output drivers. The
++driver \fB\-\-ao=alsa\fP is preferred. \fB\-\-ao=pulse\fP is preferred on systems
++where PulseAudio is used. On BSD systems, \fB\-\-ao=oss\fP or \fB\-\-ao=sndio\fP
++may work (the latter being experimental).
++.UNINDENT
++.UNINDENT
++.INDENT 0.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-ao=alsa,oss,\fP Try the ALSA driver, then the OSS driver, then others.
++.IP \(bu 2
++\fB\-\-ao=alsa:resample=yes:device=[plughw:0,3]\fP Lets ALSA resample and
++sets the device\-name as first card, fourth device.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Available audio output drivers are:
++.INDENT 0.0
++.TP
++.B \fBalsa\fP (Linux only)
++ALSA audio output driver
++.INDENT 7.0
++.TP
++.B \fBdevice=<device>\fP
++Sets the device name. For ac3 output via S/PDIF, use an "iec958" or
++"spdif" device, unless you really know how to set it correctly.
++.TP
++.B \fBresample=yes\fP
++Enable ALSA resampling plugin. (This is disabled by default, because
++some drivers report incorrect audio delay in some cases.)
++.TP
++.B \fBmixer\-device=<device>\fP
++Set the mixer device used with \fB\-\-no\-softvol\fP (default: \fBdefault\fP).
++.TP
++.B \fBmixer\-name=<name>\fP
++Set the name of the mixer element (default: \fBMaster\fP). This is for
++example \fBPCM\fP or \fBMaster\fP\&.
++.TP
++.B \fBmixer\-index=<number>\fP
++Set the index of the mixer channel (default: 0). Consider the output of
++"\fBamixer scontrols\fP", then the index is the number that follows the
++name of the element.
++.TP
++.B \fBnon\-interleaved\fP
++Allow output of non\-interleaved formats (if the audio decoder uses
++this format). Currently disabled by default, because some popular
++ALSA plugins are utterly broken with non\-interleaved formats.
++.TP
++.B \fBignore\-chmap\fP
++Don\(aqt read or set the channel map of the ALSA device \- only request the
++required number of channels, and then pass the audio as\-is to it. This
++option most likely should not be used. It can be useful for debugging,
++or for static setups with a specially engineered ALSA configuration (in
++this case you should always force the same layout with \fB\-\-audio\-channels\fP,
++or it will work only for files which use the layout implicit to your
++ALSA device).
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++MPlayer and mplayer2 required you to replace any \(aq,\(aq with \(aq.\(aq and
++any \(aq:\(aq with \(aq=\(aq in the ALSA device name. mpv does not do this anymore.
++Instead, quote the device name:
++.INDENT 0.0
++.INDENT 3.5
++\fB\-\-ao=alsa:device=[plug:surround50]\fP
++.UNINDENT
++.UNINDENT
++.sp
++Note that the \fB[\fP and \fB]\fP simply quote the device name. With some
++shells (like zsh), you have to quote the option string to prevent the
++shell from interpreting the brackets instead of passing them to mpv.
++.sp
++Actually, you should use the \fB\-\-audio\-device\fP option, instead of
++setting the device directly.
++.UNINDENT
++.UNINDENT
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++Handling of multichannel/surround audio changed in mpv 0.8.0 from the
++behavior in MPlayer/mplayer2 and older versions of mpv.
++.sp
++The old behavior is that the player always downmixed to stereo by
++default. The \fB\-\-audio\-channels\fP (or \fB\-\-channels\fP before that) option
++had to be set to get multichannel audio. Then playing stereo would
++use the \fBdefault\fP device (which typically allows multiple programs
++to play audio at the same time via dmix), while playing anything with
++more channels would open one of the hardware devices, e.g. via the
++\fBsurround51\fP alias (typically with exclusive access). Whether the
++player would use exclusive access or not would depend on the file
++being played.
++.sp
++The new behavior since mpv 0.8.0 always enables multichannel audio,
++i.e. \fB\-\-audio\-channels=auto\fP is the default. However, since ALSA
++provides no good way to play multichannel audio in a non\-exclusive
++way (without blocking other applications from using audio), the player
++is restricted to the capabilities of the \fBdefault\fP device by default,
++which means it supports only stereo and mono (at least with current
++typical ALSA configurations). But if a hardware device is selected,
++then multichannel audio will typically work.
++.sp
++The short story is: if you want multichannel audio with ALSA, use
++\fB\-\-audio\-device\fP to select the device (use \fB\-\-audio\-device=help\fP
++to get a list of all devices and their mpv name).
++.sp
++You can also try \fI\%using the upmix plugin\fP\&.
++This setup enables multichannel audio on the \fBdefault\fP device
++with automatic upmixing with shared access, so playing stereo
++and multichannel audio at the same time will work as expected.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBoss\fP
++OSS audio output driver
++.INDENT 7.0
++.TP
++.B \fB<dsp\-device>\fP
++Sets the audio output device (default: \fB/dev/dsp\fP).
++.TP
++.B \fB<mixer\-device>\fP
++Sets the audio mixer device (default: \fB/dev/mixer\fP).
++.TP
++.B \fB<mixer\-channel>\fP
++Sets the audio mixer channel (default: \fBpcm\fP). Other valid values
++include \fBvol, pcm, line\fP\&. For a complete list of options look for
++\fBSOUND_DEVICE_NAMES\fP in \fB/usr/include/linux/soundcard.h\fP\&.
++.UNINDENT
++.TP
++.B \fBjack\fP
++JACK (Jack Audio Connection Kit) audio output driver
++.INDENT 7.0
++.TP
++.B \fBport=<name>\fP
++Connects to the ports with the given name (default: physical ports).
++.TP
++.B \fBname=<client>\fP
++Client name that is passed to JACK (default: \fBmpv\fP). Useful
++if you want to have certain connections established automatically.
++.TP
++.B \fB(no\-)autostart\fP
++Automatically start jackd if necessary (default: disabled). Note that
++this tends to be unreliable and will flood stdout with server messages.
++.TP
++.B \fB(no\-)connect\fP
++Automatically create connections to output ports (default: enabled).
++When enabled, the maximum number of output channels will be limited to
++the number of available output ports.
++.TP
++.B \fBstd\-channel\-layout=waveext|any\fP
++Select the standard channel layout (default: waveext). JACK itself has no
++notion of channel layouts (i.e. assigning which speaker a given
++channel is supposed to map to) \- it just takes whatever the application
++outputs, and reroutes it to whatever the user defines. This means the
++user and the application are in charge of dealing with the channel
++layout. \fBwaveext\fP uses WAVE_FORMAT_EXTENSIBLE order, which, even
++though it was defined by Microsoft, is the standard on many systems.
++The value \fBany\fP makes JACK accept whatever comes from the audio
++filter chain, regardless of channel layout and without reordering. This
++mode is probably not very useful, other than for debugging or when used
++with fixed setups.
++.UNINDENT
++.TP
++.B \fBcoreaudio\fP (Mac OS X only)
++Native Mac OS X audio output driver using AudioUnits and the CoreAudio
++sound server.
++.sp
++Automatically redirects to \fBcoreaudio_exclusive\fP when playing compressed
++formats.
++.INDENT 7.0
++.TP
++.B \fBchange\-physical\-format=<yes|no>\fP
++Change the physical format to one similar to the requested audio format
++(default: no). This has the advantage that multichannel audio output
++will actually work. The disadvantage is that it will change the
++system\-wide audio settings. This is equivalent to changing the \fBFormat\fP
++setting in the \fBAudio Devices\fP dialog in the \fBAudio MIDI Setup\fP
++utility. Note that this does not affect the selected speaker setup.
++.TP
++.B \fBexclusive\fP
++Use exclusive mode access. This merely redirects to
++\fBcoreaudio_exclusive\fP, but should be preferred over using that AO
++directly.
++.UNINDENT
++.TP
++.B \fBcoreaudio_exclusive\fP (Mac OS X only)
++Native Mac OS X audio output driver using direct device access and
++exclusive mode (bypasses the sound server).
++.TP
++.B \fBopenal\fP
++Experimental OpenAL audio output driver
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is not very useful. Playing multi\-channel audio with
++it is slow.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBpulse\fP
++PulseAudio audio output driver
++.INDENT 7.0
++.TP
++.B \fB[<host>][:<output sink>]\fP
++Specify the host and optionally output sink to use. An empty <host>
++string uses a local connection, "localhost" uses network transfer
++(most likely not what you want).
++.TP
++.B \fBbuffer=<1\-2000|native>\fP
++Set the audio buffer size in milliseconds. A higher value buffers
++more data, and has a lower probability of buffer underruns. A smaller
++value makes the audio stream react faster, e.g. to playback speed
++changes. Default: 250.
++.TP
++.B \fBlatency\-hacks=<yes|no>\fP
++Enable hacks to workaround PulseAudio timing bugs (default: no). If
++enabled, mpv will do elaborate latency calculations on its own. If
++disabled, it will use PulseAudio automatically updated timing
++information. Disabling this might help with e.g. networked audio or
++some plugins, while enabling it might help in some unknown situations
++(it used to be required to get good behavior on old PulseAudio versions).
++.sp
++If you have stuttering video when using pulse, try to enable this
++option. (Or try to update PulseAudio.)
++.UNINDENT
++.TP
++.B \fBsdl\fP
++SDL 1.2+ audio output driver. Should work on any platform supported by SDL
++1.2, but may require the \fBSDL_AUDIODRIVER\fP environment variable to be set
++appropriately for your system.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is for compatibility with extremely foreign
++environments, such as systems where none of the other drivers
++are available.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBbuflen=<length>\fP
++Sets the audio buffer length in seconds. Is used only as a hint by the
++sound system. Playing a file with \fB\-v\fP will show the requested and
++obtained exact buffer size. A value of 0 selects the sound system
++default.
++.TP
++.B \fBbufcnt=<count>\fP
++Sets the number of extra audio buffers in mpv. Usually needs not be
++changed.
++.UNINDENT
++.TP
++.B \fBnull\fP
++Produces no audio output but maintains video playback speed. Use
++\fB\-\-ao=null:untimed\fP for benchmarking.
++.INDENT 7.0
++.TP
++.B \fBuntimed\fP
++Do not simulate timing of a perfect audio device. This means audio
++decoding will go as fast as possible, instead of timing it to the
++system clock.
++.TP
++.B \fBbuffer\fP
++Simulated buffer length in seconds.
++.TP
++.B \fBoutburst\fP
++Simulated chunk size in samples.
++.TP
++.B \fBspeed\fP
++Simulated audio playback speed as a multiplier. Usually, a real audio
++device will not go exactly as fast as the system clock. It will deviate
++just a little, and this option helps to simulate this.
++.TP
++.B \fBlatency\fP
++Simulated device latency. This is additional to EOF.
++.TP
++.B \fBbroken\-eof\fP
++Simulate broken audio drivers, which always add the fixed device
++latency to the reported audio playback position.
++.TP
++.B \fBbroken\-delay\fP
++Simulate broken audio drivers, which don\(aqt report latency correctly.
++.TP
++.B \fBchannel\-layouts\fP
++If not empty, this is a \fB,\fP separated list of channel layouts the
++AO allows. This can be used to test channel layout selection.
++.UNINDENT
++.TP
++.B \fBpcm\fP
++Raw PCM/WAVE file writer audio output
++.INDENT 7.0
++.TP
++.B \fB(no\-)waveheader\fP
++Include or do not include the WAVE header (default: included). When
++not included, raw PCM will be generated.
++.TP
++.B \fBfile=<filename>\fP
++Write the sound to \fB<filename>\fP instead of the default
++\fBaudiodump.wav\fP\&. If \fBno\-waveheader\fP is specified, the default is
++\fBaudiodump.pcm\fP\&.
++.TP
++.B \fB(no\-)append\fP
++Append to the file, instead of overwriting it. Always use this with the
++\fBno\-waveheader\fP option \- with \fBwaveheader\fP it\(aqs broken, because
++it will write a WAVE header every time the file is opened.
++.UNINDENT
++.TP
++.B \fBrsound\fP
++Audio output to an RSound daemon
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Completely useless, unless you intend to run RSound. Not to be
++confused with RoarAudio, which is something completely
++different.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBhost=<name/path>\fP
++Set the address of the server (default: localhost). Can be either a
++network hostname for TCP connections or a Unix domain socket path
++starting with \(aq/\(aq.
++.TP
++.B \fBport=<number>\fP
++Set the TCP port used for connecting to the server (default: 12345).
++Not used if connecting to a Unix domain socket.
++.UNINDENT
++.TP
++.B \fBsndio\fP
++Audio output to the OpenBSD sndio sound system
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Experimental. There are known bugs and issues.
++.UNINDENT
++.UNINDENT
++.sp
++(Note: only supports mono, stereo, 4.0, 5.1 and 7.1 channel
++layouts.)
++.INDENT 7.0
++.TP
++.B \fBdevice=<device>\fP
++sndio device to use (default: \fB$AUDIODEVICE\fP, resp. \fBsnd0\fP).
++.UNINDENT
++.TP
++.B \fBwasapi\fP
++Audio output to the Windows Audio Session API.
++.INDENT 7.0
++.TP
++.B \fBexclusive\fP
++Requests exclusive, direct hardware access. By definition prevents
++sound playback of any other program until mpv exits.
++.TP
++.B \fBdevice=<id>\fP
++Uses the requested endpoint instead of the system\(aqs default audio
++endpoint. Both an ordinal number (0,1,2,...) and the GUID
++String are valid; the GUID string is guaranteed to not change
++unless the driver is uninstalled.
++.sp
++Also supports searching active devices by human\-readable name. If more
++than one device matches the name, refuses loading it.
++.sp
++This option is mostly deprecated in favour of the more general
++\fB\-\-audio\-device\fP option. That said, \fB\-\-audio\-device=help\fP will give
++a list of valid device GUIDs (prefixed with \fBwasapi/\fP), as well as
++their human readable names, which should work here.
++.UNINDENT
++.UNINDENT
++.SH VIDEO OUTPUT DRIVERS
++.sp
++Video output drivers are interfaces to different video output facilities. The
++syntax is:
++.INDENT 0.0
++.TP
++.B \fB\-\-vo=<driver1[:suboption1[=value]:...],driver2,...[,]>\fP
++Specify a priority list of video output drivers to be used.
++.UNINDENT
++.sp
++If the list has a trailing \(aq,\(aq, mpv will fall back on drivers not contained
++in the list. Suboptions are optional and can mostly be omitted.
++.sp
++You can also set defaults for each driver. The defaults are applied before the
++normal driver parameters.
++.INDENT 0.0
++.TP
++.B \fB\-\-vo\-defaults=<driver1[:parameter1:parameter2:...],driver2,...>\fP
++Set defaults for each driver.
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 0.0
++.INDENT 3.5
++See \fB\-\-vo=help\fP for a list of compiled\-in video output drivers.
++.sp
++The recommended output driver is \fB\-\-vo=opengl\-hq\fP\&. All other drivers are
++for compatibility or special purposes. By default, \fB\-\-vo=opengl\fP is used,
++but if that appears not to work, it fallback to other drivers (in the same
++order as listed by \fB\-\-vo=help\fP).
++.UNINDENT
++.UNINDENT
++.sp
++Available video output drivers are:
++.INDENT 0.0
++.TP
++.B \fBxv\fP (X11 only)
++Uses the XVideo extension to enable hardware\-accelerated display. This is
++the most compatible VO on X, but may be low\-quality, and has issues with
++OSD and subtitle display.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is for compatibility with old systems.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBadaptor=<number>\fP
++Select a specific XVideo adapter (check xvinfo results).
++.TP
++.B \fBport=<number>\fP
++Select a specific XVideo port.
++.TP
++.B \fBck=<cur|use|set>\fP
++Select the source from which the color key is taken (default: cur).
++.INDENT 7.0
++.TP
++.B cur
++The default takes the color key currently set in Xv.
++.TP
++.B use
++Use but do not set the color key from mpv (use the \fB\-\-colorkey\fP
++option to change it).
++.TP
++.B set
++Same as use but also sets the supplied color key.
++.UNINDENT
++.TP
++.B \fBck\-method=<man|bg|auto>\fP
++Sets the color key drawing method (default: man).
++.INDENT 7.0
++.TP
++.B man
++Draw the color key manually (reduces flicker in some cases).
++.TP
++.B bg
++Set the color key as window background.
++.TP
++.B auto
++Let Xv draw the color key.
++.UNINDENT
++.TP
++.B \fBcolorkey=<number>\fP
++Changes the color key to an RGB value of your choice. \fB0x000000\fP is
++black and \fB0xffffff\fP is white.
++.TP
++.B \fBno\-colorkey\fP
++Disables color\-keying.
++.TP
++.B \fBbuffers=<number>\fP
++Number of image buffers to use for the internal ringbuffer (default: 2).
++Increasing this will use more memory, but might help with the X server
++not responding quickly enough if video FPS is close to or higher than
++the display refresh rate.
++.UNINDENT
++.TP
++.B \fBx11\fP (X11 only)
++Shared memory video output driver without hardware acceleration that works
++whenever X11 is present.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This is a fallback only, and should not be normally used.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBvdpau\fP (X11 only)
++Uses the VDPAU interface to display and optionally also decode video.
++Hardware decoding is used with \fB\-\-hwdec=vdpau\fP\&.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++Earlier versions of mpv (and MPlayer, mplayer2) provided sub\-options
++to tune vdpau post\-processing, like \fBdeint\fP, \fBsharpen\fP, \fBdenoise\fP,
++\fBchroma\-deint\fP, \fBpullup\fP, \fBhqscaling\fP\&. These sub\-options are
++deprecated, and you should use the \fBvdpaupp\fP video filter instead.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBsharpen=<\-1\-1>\fP
++(Deprecated. See note about \fBvdpaupp\fP\&.)
++.sp
++For positive values, apply a sharpening algorithm to the video, for
++negative values a blurring algorithm (default: 0).
++.TP
++.B \fBdenoise=<0\-1>\fP
++(Deprecated. See note about \fBvdpaupp\fP\&.)
++.sp
++Apply a noise reduction algorithm to the video (default: 0; no noise
++reduction).
++.TP
++.B \fBdeint=<\-4\-4>\fP
++(Deprecated. See note about \fBvdpaupp\fP\&.)
++.sp
++Select deinterlacing mode (default: 0). In older versions (as well as
++MPlayer/mplayer2) you could use this option to enable deinterlacing.
++This doesn\(aqt work anymore, and deinterlacing is enabled with either
++the \fBd\fP key (by default mapped to the command \fBcycle deinterlace\fP),
++or the \fB\-\-deinterlace\fP option. Also, to select the default deint mode,
++you should use something like \fB\-\-vf\-defaults=vdpaupp:deint\-mode=temporal\fP
++instead of this sub\-option.
++.INDENT 7.0
++.TP
++.B 0
++Pick the \fBvdpaupp\fP video filter default, which corresponds to 3.
++.TP
++.B 1
++Show only first field.
++.TP
++.B 2
++Bob deinterlacing.
++.TP
++.B 3
++Motion\-adaptive temporal deinterlacing. May lead to A/V desync
++with slow video hardware and/or high resolution.
++.TP
++.B 4
++Motion\-adaptive temporal deinterlacing with edge\-guided spatial
++interpolation. Needs fast video hardware.
++.UNINDENT
++.TP
++.B \fBchroma\-deint\fP
++(Deprecated. See note about \fBvdpaupp\fP\&.)
++.sp
++Makes temporal deinterlacers operate both on luma and chroma (default).
++Use no\-chroma\-deint to solely use luma and speed up advanced
++deinterlacing. Useful with slow video memory.
++.TP
++.B \fBpullup\fP
++(Deprecated. See note about \fBvdpaupp\fP\&.)
++.sp
++Try to apply inverse telecine, needs motion adaptive temporal
++deinterlacing.
++.TP
++.B \fBhqscaling=<0\-9>\fP
++(Deprecated. See note about \fBvdpaupp\fP\&.)
++.INDENT 7.0
++.TP
++.B 0
++Use default VDPAU scaling (default).
++.TP
++.B 1\-9
++Apply high quality VDPAU scaling (needs capable hardware).
++.UNINDENT
++.TP
++.B \fBfps=<number>\fP
++Override autodetected display refresh rate value (the value is needed
++for framedrop to allow video playback rates higher than display
++refresh rate, and for vsync\-aware frame timing adjustments). Default 0
++means use autodetected value. A positive value is interpreted as a
++refresh rate in Hz and overrides the autodetected value. A negative
++value disables all timing adjustment and framedrop logic.
++.TP
++.B \fBcomposite\-detect\fP
++NVIDIA\(aqs current VDPAU implementation behaves somewhat differently
++under a compositing window manager and does not give accurate frame
++timing information. With this option enabled, the player tries to
++detect whether a compositing window manager is active. If one is
++detected, the player disables timing adjustments as if the user had
++specified \fBfps=\-1\fP (as they would be based on incorrect input). This
++means timing is somewhat less accurate than without compositing, but
++with the composited mode behavior of the NVIDIA driver, there is no
++hard playback speed limit even without the disabled logic. Enabled by
++default, use \fBno\-composite\-detect\fP to disable.
++.TP
++.B \fBqueuetime_windowed=<number>\fP and \fBqueuetime_fs=<number>\fP
++Use VDPAU\(aqs presentation queue functionality to queue future video
++frame changes at most this many milliseconds in advance (default: 50).
++See below for additional information.
++.TP
++.B \fBoutput_surfaces=<2\-15>\fP
++Allocate this many output surfaces to display video frames (default:
++3). See below for additional information.
++.TP
++.B \fBcolorkey=<#RRGGBB|#AARRGGBB>\fP
++Set the VDPAU presentation queue background color, which in practice
++is the colorkey used if VDPAU operates in overlay mode (default:
++\fB#020507\fP, some shade of black). If the alpha component of this value
++is 0, the default VDPAU colorkey will be used instead (which is usually
++green).
++.TP
++.B \fBforce\-yuv\fP
++Never accept RGBA input. This means mpv will insert a filter to convert
++to a YUV format before the VO. Sometimes useful to force availability
++of certain YUV\-only features, like video equalizer or deinterlacing.
++.UNINDENT
++.sp
++Using the VDPAU frame queuing functionality controlled by the queuetime
++options makes mpv\(aqs frame flip timing less sensitive to system CPU load and
++allows mpv to start decoding the next frame(s) slightly earlier, which can
++reduce jitter caused by individual slow\-to\-decode frames. However, the
++NVIDIA graphics drivers can make other window behavior such as window moves
++choppy if VDPAU is using the blit queue (mainly happens if you have the
++composite extension enabled) and this feature is active. If this happens on
++your system and it bothers you then you can set the queuetime value to 0 to
++disable this feature. The settings to use in windowed and fullscreen mode
++are separate because there should be no reason to disable this for
++fullscreen mode (as the driver issue should not affect the video itself).
++.sp
++You can queue more frames ahead by increasing the queuetime values and the
++\fBoutput_surfaces\fP count (to ensure enough surfaces to buffer video for a
++certain time ahead you need at least as many surfaces as the video has
++frames during that time, plus two). This could help make video smoother in
++some cases. The main downsides are increased video RAM requirements for
++the surfaces and laggier display response to user commands (display
++changes only become visible some time after they\(aqre queued). The graphics
++driver implementation may also have limits on the length of maximum
++queuing time or number of queued surfaces that work well or at all.
++.TP
++.B \fBdirect3d_shaders\fP (Windows only)
++Video output driver that uses the Direct3D interface.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is for compatibility with systems that don\(aqt provide
++proper OpenGL drivers.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBprefer\-stretchrect\fP
++Use \fBIDirect3DDevice9::StretchRect\fP over other methods if possible.
++.TP
++.B \fBdisable\-stretchrect\fP
++Never render the video using \fBIDirect3DDevice9::StretchRect\fP\&.
++.TP
++.B \fBdisable\-textures\fP
++Never render the video using D3D texture rendering. Rendering with
++textures + shader will still be allowed. Add \fBdisable\-shaders\fP to
++completely disable video rendering with textures.
++.TP
++.B \fBdisable\-shaders\fP
++Never use shaders when rendering video.
++.TP
++.B \fBonly\-8bit\fP
++Never render YUV video with more than 8 bits per component.
++Using this flag will force software conversion to 8\-bit.
++.TP
++.B \fBdisable\-texture\-align\fP
++Normally texture sizes are always aligned to 16. With this option
++enabled, the video texture will always have exactly the same size as
++the video itself.
++.UNINDENT
++.sp
++Debug options. These might be incorrect, might be removed in the future,
++might crash, might cause slow downs, etc. Contact the developers if you
++actually need any of these for performance or proper operation.
++.INDENT 7.0
++.TP
++.B \fBforce\-power\-of\-2\fP
++Always force textures to power of 2, even if the device reports
++non\-power\-of\-2 texture sizes as supported.
++.TP
++.B \fBtexture\-memory=<mode>\fP
++Only affects operation with shaders/texturing enabled, and (E)OSD.
++Possible values:
++.INDENT 7.0
++.TP
++.B \fBdefault\fP (default)
++Use \fBD3DPOOL_DEFAULT\fP, with a \fBD3DPOOL_SYSTEMMEM\fP texture for
++locking. If the driver supports \fBD3DDEVCAPS_TEXTURESYSTEMMEMORY\fP,
++\fBD3DPOOL_SYSTEMMEM\fP is used directly.
++.TP
++.B \fBdefault\-pool\fP
++Use \fBD3DPOOL_DEFAULT\fP\&. (Like \fBdefault\fP, but never use a
++shadow\-texture.)
++.TP
++.B \fBdefault\-pool\-shadow\fP
++Use \fBD3DPOOL_DEFAULT\fP, with a \fBD3DPOOL_SYSTEMMEM\fP texture for
++locking. (Like \fBdefault\fP, but always force the shadow\-texture.)
++.TP
++.B \fBmanaged\fP
++Use \fBD3DPOOL_MANAGED\fP\&.
++.TP
++.B \fBscratch\fP
++Use \fBD3DPOOL_SCRATCH\fP, with a \fBD3DPOOL_SYSTEMMEM\fP texture for
++locking.
++.UNINDENT
++.TP
++.B \fBswap\-discard\fP
++Use \fBD3DSWAPEFFECT_DISCARD\fP, which might be faster.
++Might be slower too, as it must(?) clear every frame.
++.TP
++.B \fBexact\-backbuffer\fP
++Always resize the backbuffer to window size.
++.UNINDENT
++.TP
++.B \fBdirect3d\fP (Windows only)
++Same as \fBdirect3d_shaders\fP, but with the options \fBdisable\-textures\fP
++and \fBdisable\-shaders\fP forced.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is for compatibility with old systems.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBopengl\fP
++OpenGL video output driver. It supports extended scaling methods, dithering
++and color management.
++.sp
++By default, it tries to use fast and fail\-safe settings. Use the alias
++\fBopengl\-hq\fP to use this driver with defaults set to high quality
++rendering.
++.sp
++Requires at least OpenGL 2.1.
++.sp
++Some features are available with OpenGL 3 capable graphics drivers only
++(or if the necessary extensions are available).
++.sp
++OpenGL ES 2.0 and 3.0 are supported as well.
++.sp
++Hardware decoding over OpenGL\-interop is supported to some degree. Note
++that in this mode, some corner case might not be gracefully handled, and
++color space conversion and chroma upsampling is generally in the hand of
++the hardware decoder APIs.
++.sp
++\fBopengl\fP makes use of FBOs by default. Sometimes you can achieve better
++quality or performance by changing the \fBfbo\-format\fP suboption to
++\fBrgb16f\fP, \fBrgb32f\fP or \fBrgb\fP\&. Known problems include Mesa/Intel not
++accepting \fBrgb16\fP, Mesa sometimes not being compiled with float texture
++support, and some OS X setups being very slow with \fBrgb16\fP but fast
++with \fBrgb32f\fP\&. If you have problems, you can also try passing the
++\fBdumb\-mode=yes\fP sub\-option.
++.INDENT 7.0
++.TP
++.B \fBdumb\-mode=<yes|no>\fP
++This mode is extremely restricted, and will disable most extended
++OpenGL features. This includes high quality scalers and custom
++shaders!
++.sp
++It is intended for hardware that does not support FBOs (including GLES,
++which supports it insufficiently), or to get some more performance out
++of bad or old hardware.
++.sp
++This mode is forced automatically if needed, and this option is mostly
++useful for debugging. It\(aqs also enabled automatically if nothing uses
++features which require FBOs.
++.sp
++This option might be silently removed in the future.
++.UNINDENT
++.sp
++\fBscale=<filter>\fP
++.INDENT 7.0
++.INDENT 3.5
++.INDENT 0.0
++.TP
++.B \fBbilinear\fP
++Bilinear hardware texture filtering (fastest, very low quality).
++This is the default for compatibility reasons.
++.TP
++.B \fBspline36\fP
++Mid quality and speed. This is the default when using \fBopengl\-hq\fP\&.
++.TP
++.B \fBlanczos\fP
++Lanczos scaling. Provides mid quality and speed. Generally worse
++than \fBspline36\fP, but it results in a slightly sharper image
++which is good for some content types. The number of taps can be
++controlled with \fBscale\-radius\fP, but is best left unchanged.
++.sp
++This filter corresponds to the old \fBlanczos3\fP alias if the default
++radius is used, while \fBlanczos2\fP corresponds to a radius of 2.
++.sp
++(This filter is an alias for \fBsinc\fP\-windowed \fBsinc\fP)
++.TP
++.B \fBewa_lanczos\fP
++Elliptic weighted average Lanczos scaling. Also known as Jinc.
++Relatively slow, but very good quality. The radius can be
++controlled with \fBscale\-radius\fP\&. Increasing the radius makes the
++filter sharper but adds more ringing.
++.sp
++(This filter is an alias for \fBjinc\fP\-windowed \fBjinc\fP)
++.TP
++.B \fBewa_lanczossharp\fP
++A slightly sharpened version of ewa_lanczos, preconfigured to use
++an ideal radius and parameter. If your hardware can run it, this is
++probably what you should use by default.
++.TP
++.B \fBmitchell\fP
++Mitchell\-Netravali. The \fBB\fP and \fBC\fP parameters can be set with
++\fBscale\-param1\fP and \fBscale\-param2\fP\&. This filter is very good at
++downscaling (see \fBdscale\fP).
++.TP
++.B \fBoversample\fP
++A version of nearest neighbour that (naively) oversamples pixels,
++so that pixels overlapping edges get linearly interpolated instead
++of rounded. This essentially removes the small imperfections and
++judder artifacts caused by nearest\-neighbour interpolation, in
++exchange for adding some blur. This filter is good at temporal
++interpolation, and also known as "smoothmotion" (see \fBtscale\fP).
++.TP
++.B \fBcustom\fP
++A user\-defined custom shader (see \fBscale\-shader\fP).
++.UNINDENT
++.sp
++There are some more filters, but most are not as useful. For a complete
++list, pass \fBhelp\fP as value, e.g.:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv \-\-vo=opengl:scale=help
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBscale\-param1=<value>\fP, \fBscale\-param2=<value>\fP
++Set filter parameters. Ignored if the filter is not tunable.
++Currently, this affects the following filter parameters:
++.INDENT 7.0
++.TP
++.B bcspline
++Spline parameters (\fBB\fP and \fBC\fP). Defaults to 0.5 for both.
++.TP
++.B gaussian
++Scale parameter (\fBt\fP). Increasing this makes the result blurrier.
++Defaults to 1.
++.TP
++.B oversample
++Minimum distance to an edge before interpolation is used. Setting
++this to 0 will always interpolate edges, whereas setting it to 0.5
++will never interpolate, thus behaving as if the regular nearest
++neighbour algorithm was used. Defaults to 0.0.
++.UNINDENT
++.TP
++.B \fBscale\-blur=<value>\fP
++Kernel scaling factor (also known as a blur factor). Decreasing this
++makes the result sharper, increasing it makes it blurrier (default 0).
++If set to 0, the kernel\(aqs preferred blur factor is used. Note that
++setting this too low (eg. 0.5) leads to bad results. It\(aqs generally
++recommended to stick to values between 0.8 and 1.2.
++.TP
++.B \fBscale\-radius=<value>\fP
++Set radius for filters listed below, must be a float number between 0.5
++and 16.0. Defaults to the filter\(aqs preferred radius if not specified.
++.INDENT 7.0
++.INDENT 3.5
++\fBsinc\fP and derivatives, \fBjinc\fP and derivatives, \fBgaussian\fP, \fBbox\fP and \fBtriangle\fP
++.UNINDENT
++.UNINDENT
++.sp
++Note that depending on filter implementation details and video scaling
++ratio, the radius that actually being used might be different
++(most likely being increased a bit).
++.TP
++.B \fBscale\-antiring=<value>\fP
++Set the antiringing strength. This tries to eliminate ringing, but can
++introduce other artifacts in the process. Must be a float number
++between 0.0 and 1.0. The default value of 0.0 disables antiringing
++entirely.
++.sp
++Note that this doesn\(aqt affect the special filters \fBbilinear\fP and
++\fBbicubic_fast\fP\&.
++.TP
++.B \fBscale\-window=<window>\fP
++(Advanced users only) Choose a custom windowing function for the kernel.
++Defaults to the filter\(aqs preferred window if unset. Use
++\fBscale\-window=help\fP to get a list of supported windowing functions.
++.TP
++.B \fBscale\-wparam=<window>\fP
++(Advanced users only) Configure the parameter for the window function
++given by \fBscale\-window\fP\&. Ignored if the window is not tunable.
++Currently, this affects the following window parameters:
++.INDENT 7.0
++.TP
++.B kaiser
++Window parameter (alpha). Defaults to 6.33.
++.TP
++.B blackman
++Window parameter (alpha). Defaults to 0.16.
++.TP
++.B gaussian
++Scale parameter (t). Increasing this makes the window wider.
++Defaults to 1.
++.UNINDENT
++.TP
++.B \fBscaler\-lut\-size=<4..10>\fP
++Set the size of the lookup texture for scaler kernels (default: 6).
++The actual size of the texture is \fB2^N\fP for an option value of \fBN\fP\&.
++So the lookup texture with the default setting uses 64 samples.
++.sp
++All weights are bilinearly interpolated from those samples, so
++increasing the size of lookup table might improve the accuracy of
++scaler.
++.TP
++.B \fBscaler\-resizes\-only\fP
++Disable the scaler if the video image is not resized. In that case,
++\fBbilinear\fP is used instead whatever is set with \fBscale\fP\&. Bilinear
++will reproduce the source image perfectly if no scaling is performed.
++Enabled by default. Note that this option never affects \fBcscale\fP\&.
++.TP
++.B \fBpbo\fP
++Enable use of PBOs. On some drivers this can be faster, especially if
++the source video size is huge (e.g. so called "4K" video). On other
++drivers it might be slower or cause latency issues.
++.sp
++In theory, this can sometimes lead to sporadic and temporary image
++corruption (because reupload is not retried when it fails).
++.TP
++.B \fBdither\-depth=<N|no|auto>\fP
++Set dither target depth to N. Default: no.
++.INDENT 7.0
++.TP
++.B no
++Disable any dithering done by mpv.
++.TP
++.B auto
++Automatic selection. If output bit depth cannot be detected,
++8 bits per component are assumed.
++.TP
++.B 8
++Dither to 8 bit output.
++.UNINDENT
++.sp
++Note that the depth of the connected video display device can not be
++detected. Often, LCD panels will do dithering on their own, which
++conflicts with \fBopengl\fP\(aqs dithering and leads to ugly output.
++.TP
++.B \fBdither\-size\-fruit=<2\-8>\fP
++Set the size of the dither matrix (default: 6). The actual size of
++the matrix is \fB(2^N) x (2^N)\fP for an option value of \fBN\fP, so a
++value of 6 gives a size of 64x64. The matrix is generated at startup
++time, and a large matrix can take rather long to compute (seconds).
++.sp
++Used in \fBdither=fruit\fP mode only.
++.TP
++.B \fBdither=<fruit|ordered|no>\fP
++Select dithering algorithm (default: fruit). (Normally, the
++\fBdither\-depth\fP option controls whether dithering is enabled.)
++.TP
++.B \fBtemporal\-dither\fP
++Enable temporal dithering. (Only active if dithering is enabled in
++general.) This changes between 8 different dithering patterns on each
++frame by changing the orientation of the tiled dithering matrix.
++Unfortunately, this can lead to flicker on LCD displays, since these
++have a high reaction time.
++.TP
++.B \fBtemporal\-dither\-period=<1\-128>\fP
++Determines how often the dithering pattern is updated when
++\fBtemporal\-dither\fP is in use. 1 (the default) will update on every
++video frame, 2 on every other frame, etc.
++.TP
++.B \fBdebug\fP
++Check for OpenGL errors, i.e. call \fBglGetError()\fP\&. Also, request a
++debug OpenGL context (which does nothing with current graphics drivers
++as of this writing).
++.TP
++.B \fBinterpolation\fP
++Reduce stuttering caused by mismatches in the video fps and display
++refresh rate (also known as judder).
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++This requires setting the \fB\-\-video\-sync\fP option to one
++of the \fBdisplay\-\fP modes, or it will be silently disabled.
++This was not required before mpv 0.14.0.
++.UNINDENT
++.UNINDENT
++.sp
++This essentially attempts to interpolate the missing frames by
++convoluting the video along the temporal axis. The filter used can be
++controlled using the \fBtscale\fP setting.
++.sp
++Note that this relies on vsync to work, see \fBswapinterval\fP for more
++information.
++.TP
++.B \fBswapinterval=<n>\fP
++Interval in displayed frames between two buffer swaps.
++1 is equivalent to enable VSYNC, 0 to disable VSYNC. Defaults to 1 if
++not specified.
++.sp
++Note that this depends on proper OpenGL vsync support. On some platforms
++and drivers, this only works reliably when in fullscreen mode. It may
++also require driver\-specific hacks if using multiple monitors, to
++ensure mpv syncs to the right one. Compositing window managers can
++also lead to bad results, as can missing or incorrect display FPS
++information (see \fB\-\-display\-fps\fP).
++.TP
++.B \fBdscale=<filter>\fP
++Like \fBscale\fP, but apply these filters on downscaling instead. If this
++option is unset, the filter implied by \fBscale\fP will be applied.
++.TP
++.B \fBcscale=<filter>\fP
++As \fBscale\fP, but for interpolating chroma information. If the image
++is not subsampled, this option is ignored entirely.
++.TP
++.B \fBtscale=<filter>\fP
++The filter used for interpolating the temporal axis (frames). This is
++only used if \fBinterpolation\fP is enabled. The only valid choices
++for \fBtscale\fP are separable convolution filters (use \fBtscale=help\fP
++to get a list). The default is \fBmitchell\fP\&.
++.sp
++Note that the maximum supported filter radius is currently 3, due to
++limitations in the number of video textures that can be loaded
++simultaneously.
++.TP
++.B \fBtscale\-clamp\fP
++Clamp the \fBtscale\fP filter kernel\(aqs value range to [0\-1]. This reduces
++excessive ringing artifacts in the temporal domain (which typically
++manifest themselves as short flashes or fringes of black, mostly
++around moving edges) in exchange for potentially adding more blur.
++.TP
++.B \fBinterpolation\-threshold=<0..1,\-1>\fP
++Threshold below which frame ratio interpolation gets disabled (default:
++\fB0.0001\fP). This is calculated as \fBabs(disphz/vfps \- 1) < threshold\fP,
++where \fBvfps\fP is the speed\-adjusted display FPS, and \fBdisphz\fP the
++display refresh rate.
++.sp
++The default is intended to almost always enable interpolation if the
++playback rate is even slightly different from the display refresh rate.
++But note that if you use e.g. \fB\-\-video\-sync=display\-vdrop\fP, small
++deviations in the rate can disable interpolation and introduce a
++discontinuity every other minute.
++.sp
++Set this to \fB\-1\fP to disable this logic.
++.TP
++.B \fBdscale\-radius\fP, \fBcscale\-radius\fP, \fBtscale\-radius\fP, etc.
++Set filter parameters for \fBdscale\fP, \fBcscale\fP and \fBtscale\fP,
++respectively.
++.sp
++See the corresponding options for \fBscale\fP\&.
++.TP
++.B \fBlinear\-scaling\fP
++Scale in linear light. It should only be used with a \fBfbo\-format\fP
++that has at least 16 bit precision.
++.TP
++.B \fBcorrect\-downscaling\fP
++When using convolution based filters, extend the filter size
++when downscaling. Increases quality, but reduces performance while
++downscaling.
++.sp
++This will perform slightly sub\-optimally for anamorphic video (but still
++better than without it) since it will extend the size to match only the
++milder of the scale factors between the axes.
++.TP
++.B \fBpre\-shaders=<files>\fP, \fBpost\-shaders=<files>\fP, \fBscale\-shader=<file>\fP
++Custom GLSL fragment shaders.
++.INDENT 7.0
++.TP
++.B pre\-shaders (list)
++These get applied after conversion to RGB and before linearization
++and upscaling. Operates on non\-linear RGB (same as input). This is
++the best place to put things like sharpen filters.
++.TP
++.B scale\-shader
++This gets used instead of scale/cscale when those options are set
++to \fBcustom\fP\&. The colorspace it operates on depends on the values
++of \fBlinear\-scaling\fP and \fBsigmoid\-upscaling\fP, so no assumptions
++should be made here.
++.TP
++.B post\-shaders (list)
++These get applied after upscaling and subtitle blending (when
++\fBblend\-subtitles\fP is enabled), but before color management.
++Operates on linear RGB if \fBlinear\-scaling\fP is in effect,
++otherwise non\-linear RGB. This is the best place for colorspace
++transformations (eg. saturation mapping).
++.UNINDENT
++.sp
++These files must define a function with the following signature:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++vec4 sample_pixel(sampler2D tex, vec2 pos, vec2 tex_size)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++(If there is no string \fBsample_pixel\fP in the shader script, it will
++use \fBsample\fP instead. This is a compatibility hack for older shader
++scripts, and is deprecated.)
++.sp
++The meanings of the parameters are as follows:
++.INDENT 7.0
++.TP
++.B sampler2D tex
++The source texture for the shader.
++.TP
++.B vec2 pos
++The position to be sampled, in coordinate space [0\-1].
++.TP
++.B vec2 tex_size
++The size of the texture, in pixels. This may differ from image_size,
++eg. for subsampled content or for post\-shaders.
++.UNINDENT
++.sp
++In addition to these parameters, the following uniforms are also
++globally available:
++.INDENT 7.0
++.TP
++.B float random
++A random number in the range [0\-1], different per frame.
++.TP
++.B int frame
++A simple count of frames rendered, increases by one per frame and
++never resets (regardless of seeks).
++.TP
++.B vec2 image_size
++The size in pixels of the input image.
++.UNINDENT
++.sp
++For example, a shader that inverts the colors could look like this:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++vec4 sample(sampler2D tex, vec2 pos, vec2 tex_size)
++{
++ vec4 color = texture(tex, pos);
++ return vec4(1.0 \- color.rgb, color.a);
++}
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBuser\-shaders=<files>\fP
++Custom GLSL hooks. These are similar to \fBpost\-shaders\fP etc., but more
++flexible: They can be injected at almost arbitrary points in the
++rendering pipeline, and access all previous intermediate textures.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++The syntax is not stable yet and may change any time.
++.UNINDENT
++.UNINDENT
++.sp
++The general syntax of a user shader looks like this:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++//!METADATA ARGS...
++//!METADATA ARGS...
++
++vec4 hook() {
++ ...
++ return something;
++}
++
++//!METADATA ARGS...
++//!METADATA ARGS...
++
++\&...
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Each block of metadata, along with the non\-metadata lines after it,
++defines a single pass. Each pass can set the following metadata:
++.INDENT 7.0
++.TP
++.B HOOK <name> (required)
++The texture which to hook into. May occur multiple times within a
++metadata block, up to a predetermined limit. See below for a list
++of hookable textures.
++.TP
++.B BIND <name>
++Loads a texture and makes it available to the pass, and sets up
++macros to enable accessing it. See below for a list of set macros.
++By default, no textures are bound. The special name HOOKED can be
++used to refer to the texture that triggered this pass.
++.TP
++.B SAVE <name>
++Gives the name of the texture to save the result of this pass
++into. By default, this is set to the special name HOOKED which has
++the effect of overwriting the hooked texture.
++.TP
++.B WIDTH <szexpr>, HEIGHT <szexpr>
++Specifies the size of the resulting texture for this pass.
++\fBszexpr\fP refers to an expression in RPN (reverse polish
++notation), using the operators + \- * / > < !, floating point
++literals, and references to sizes of existing texture and OUTPUT
++(such as MAIN.width or CHROMA.height). By default, these are set to
++HOOKED.w and HOOKED.h, respectively.
++.TP
++.B WHEN <szexpr>
++Specifies a condition that needs to be true (non\-zero) for the
++shader stage to be evaluated. If it fails, it will silently be
++omitted. (Note that a shader stage like this which has a dependency
++on an optional hook point can still cause that hook point to be
++saved, which has some minor overhead)
++.TP
++.B OFFSET ox oy
++Indicates a pixel shift (offset) introduced by this pass. These
++pixel offsets will be accumulated and corrected during the
++next scaling pass (\fBcscale\fP or \fBscale\fP). The default values
++are 0 0 which correspond to no shift. Note that offsets are ignored
++when not overwriting the hooked texture.
++.TP
++.B COMPONENTS n
++Specifies how many components of this pass\(aqs output are relevant
++and should be stored in the texture, up to 4 (rgba). By default,
++this value is equal to the number of components in HOOKED.
++.UNINDENT
++.sp
++Each bound texture (via \fBBIND\fP) will make available the following
++definitions to that shader pass, where NAME is the name of the bound
++texture:
++.INDENT 7.0
++.TP
++.B vec4 NAME_tex(vec2 pos)
++The sampling function to use to access the texture at a certain
++spot (in texture coordinate space, range [0,1]). This takes care
++of any necessary normalization conversions.
++.TP
++.B vec4 NAME_texOff(vec2 offset)
++Sample the texture at a certain offset in pixels. This works like
++NAME_tex but additionally takes care of necessary rotations, so
++that sampling at e.g. vec2(\-1,0) is always one pixel to the left.
++.TP
++.B vec2 NAME_pos
++The local texture coordinate of that texture, range [0,1].
++.TP
++.B vec2 NAME_size
++The (rotated) size in pixels of the texture.
++.TP
++.B mat2 NAME_rot
++The rotation matrix associated with this texture. (Rotates
++pixel space to texture coordinates)
++.TP
++.B vec2 NAME_pt
++The (unrotated) size of a single pixel, range [0,1].
++.TP
++.B sampler NAME_raw
++The raw bound texture itself. The use of this should be
++avoided unless absolutely necessary.
++.UNINDENT
++.sp
++In addition, the global uniforms described in \fBpost\-shaders\fP are
++also available.
++.sp
++Internally, vo_opengl may generate any number of the following
++textures. Whenever a texture is rendered and saved by vo_opengl, all of
++the passes that have hooked into it will run, in the order they were
++added by the user. This is a list of the legal hook points:
++.INDENT 7.0
++.TP
++.B RGB, LUMA, CHROMA, ALPHA, XYZ (resizable)
++Source planes (raw). Which of these fire depends on the image
++format of the source.
++.TP
++.B CHROMA_SCALED, ALPHA_SCALED (fixed)
++Source planes (upscaled). These only fire on subsampled content.
++.TP
++.B NATIVE (resizable)
++The combined image, in the source colorspace, before conversion
++to RGB.
++.TP
++.B MAINPRESUB (resizable)
++The image, after conversion to RGB, but before
++\fBblend\-subtitles=video\fP is applied.
++.TP
++.B MAIN (resizable)
++The main image, after conversion to RGB but before upscaling.
++.TP
++.B LINEAR (fixed)
++Linear light image, before scaling. This only fires when
++\fBlinear\-scaling\fP is in effect.
++.TP
++.B SIGMOID (fixed)
++Sigmoidized light, before scaling. This only fires when
++\fBsigmoid\-upscaling\fP is in effect.
++.TP
++.B PREKERNEL (fixed)
++The image immediately before the scaler kernel runs.
++.TP
++.B POSTKERNEL (fixed)
++The image immediately after the scaler kernel runs.
++.TP
++.B SCALED (fixed)
++The final upscaled image, before color management.
++.TP
++.B OUTPUT (fixed)
++The final output image, after color management but before
++dithering and drawing to screen.
++.UNINDENT
++.sp
++Only the textures labelled with \fBresizable\fP may be transformed by the
++pass. When overwriting a texture marked \fBfixed\fP, the WIDTH, HEIGHT
++and OFFSET must be left at their default values.
++.TP
++.B \fBdeband\fP
++Enable the debanding algorithm. This greatly reduces the amount of
++visible banding, blocking and other quantization artifacts, at the
++expensive of very slightly blurring some of the finest details. In
++practice, it\(aqs virtually always an improvement \- the only reason to
++disable it would be for performance.
++.TP
++.B \fBdeband\-iterations=<1..16>\fP
++The number of debanding steps to perform per sample. Each step reduces
++a bit more banding, but takes time to compute. Note that the strength
++of each step falls off very quickly, so high numbers (>4) are
++practically useless. (Default 1)
++.TP
++.B \fBdeband\-threshold=<0..4096>\fP
++The debanding filter\(aqs cut\-off threshold. Higher numbers increase the
++debanding strength dramatically but progressively diminish image
++details. (Default 64)
++.TP
++.B \fBdeband\-range=<1..64>\fP
++The debanding filter\(aqs initial radius. The radius increases linearly
++for each iteration. A higher radius will find more gradients, but
++a lower radius will smooth more aggressively. (Default 16)
++.sp
++If you increase the \fBdeband\-iterations\fP, you should probably
++decrease this to compensate.
++.TP
++.B \fBdeband\-grain=<0..4096>\fP
++Add some extra noise to the image. This significantly helps cover up
++remaining quantization artifacts. Higher numbers add more noise.
++(Default 48)
++.TP
++.B \fBsigmoid\-upscaling\fP
++When upscaling, use a sigmoidal color transform to avoid emphasizing
++ringing artifacts. This also implies \fBlinear\-scaling\fP\&.
++.TP
++.B \fBsigmoid\-center\fP
++The center of the sigmoid curve used for \fBsigmoid\-upscaling\fP, must
++be a float between 0.0 and 1.0. Defaults to 0.75 if not specified.
++.TP
++.B \fBsigmoid\-slope\fP
++The slope of the sigmoid curve used for \fBsigmoid\-upscaling\fP, must
++be a float between 1.0 and 20.0. Defaults to 6.5 if not specified.
++.TP
++.B \fBsharpen=<value>\fP
++If set to a value other than 0, enable an unsharp masking filter.
++Positive values will sharpen the image (but add more ringing and
++aliasing). Negative values will blur the image. If your GPU is powerful
++enough, consider alternatives like the \fBewa_lanczossharp\fP scale
++filter, or the \fBscale\-blur\fP sub\-option.
++.sp
++(This feature is the replacement for the old \fBsharpen3\fP and
++\fBsharpen5\fP scalers.)
++.TP
++.B \fBglfinish\fP
++Call \fBglFinish()\fP before and after swapping buffers (default: disabled).
++Slower, but might improve results when doing framedropping.
++Can completely ruin performance. The details depend entirely on the
++OpenGL driver.
++.TP
++.B \fBwaitvsync\fP
++Call \fBglXWaitVideoSyncSGI\fP after each buffer swap (default: disabled).
++This may or may not help with video timing accuracy and frame drop. It\(aqs
++possible that this makes video output slower, or has no effect at all.
++.sp
++X11/GLX only.
++.TP
++.B \fBvsync\-fences=<N>\fP
++Synchronize the CPU to the Nth past frame using the \fBGL_ARB_sync\fP
++extension. A value of 0 disables this behavior (default). A value of
++1 means it will synchronize to the current frame after rendering it.
++Like \fBglfinish\fP and \fBwaitvsync\fP, this can lower or ruin performance.
++Its advantage is that it can span multiple frames, and effectively limit
++the number of frames the GPU queues ahead (which also has an influence
++on vsync).
++.TP
++.B \fBdwmflush=<no|windowed|yes|auto>\fP
++Calls \fBDwmFlush\fP after swapping buffers on Windows (default: auto).
++It also sets \fBSwapInterval(0)\fP to ignore the OpenGL timing. Values
++are: no (disabled), windowed (only in windowed mode), yes (also in
++full screen).
++.sp
++The value \fBauto\fP will try to determine whether the compositor is
++active, and calls \fBDwmFlush\fP only if it seems to be.
++.sp
++This may help to get more consistent frame intervals, especially with
++high\-fps clips \- which might also reduce dropped frames. Typically, a
++value of \fBwindowed\fP should be enough, since full screen may bypass the
++DWM.
++.sp
++Windows only.
++.TP
++.B \fBsw\fP
++Continue even if a software renderer is detected.
++.TP
++.B \fBbackend=<sys>\fP
++The value \fBauto\fP (the default) selects the windowing backend. You
++can also pass \fBhelp\fP to get a complete list of compiled in backends
++(sorted by autoprobe order).
++.INDENT 7.0
++.TP
++.B auto
++auto\-select (default)
++.TP
++.B cocoa
++Cocoa/OS X
++.TP
++.B win
++Win32/WGL
++.TP
++.B angle
++Direct3D11 through the OpenGL ES translation layer ANGLE. This
++supports almost everything the \fBwin\fP backend does (if the ANGLE
++build is new enough).
++.TP
++.B dxinterop (experimental)
++Win32, using WGL for rendering and Direct3D 9Ex for presentation.
++Works on Nvidia and AMD. Newer Intel chips with the latest drivers
++may also work.
++.TP
++.B x11
++X11/GLX
++.TP
++.B wayland
++Wayland/EGL
++.TP
++.B drm\-egl
++DRM/EGL
++.TP
++.B x11egl
++X11/EGL
++.UNINDENT
++.TP
++.B \fBes=<mode>\fP
++Select whether to use GLES:
++.INDENT 7.0
++.TP
++.B yes
++Try to prefer ES over Desktop GL
++.TP
++.B no
++Try to prefer desktop GL over ES
++.TP
++.B auto
++Use the default for each backend (default)
++.UNINDENT
++.TP
++.B \fBfbo\-format=<fmt>\fP
++Selects the internal format of textures used for FBOs. The format can
++influence performance and quality of the video output.
++\fBfmt\fP can be one of: rgb8, rgb10, rgb10_a2, rgb16, rgb16f,
++rgb32f, rgba12, rgba16, rgba16f, rgba32f.
++Default: \fBauto\fP, which maps to rgba16 on desktop GL, and rgba16f or
++rgb10_a2 on GLES (e.g. ANGLE), unless GL_EXT_texture_norm16 is
++available.
++.TP
++.B \fBgamma=<0.1..2.0>\fP
++Set a gamma value (default: 1.0). If gamma is adjusted in other ways
++(like with the \fB\-\-gamma\fP option or key bindings and the \fBgamma\fP
++property), the value is multiplied with the other gamma value.
++.sp
++Recommended values based on the environmental brightness:
++.INDENT 7.0
++.TP
++.B 1.0
++Brightly illuminated (default)
++.TP
++.B 0.9
++Slightly dim
++.TP
++.B 0.8
++Pitch black room
++.UNINDENT
++.sp
++NOTE: Typical movie content (Blu\-ray etc.) already contains a gamma
++drop of about 0.8, so specifying it here as well will result in even
++even darker image than intended!
++.TP
++.B \fBgamma\-auto\fP
++Automatically corrects the gamma value depending on ambient lighting
++conditions (adding a gamma boost for dark rooms).
++.sp
++With ambient illuminance of 64lux, mpv will pick the 1.0 gamma value
++(no boost), and slightly increase the boost up until 0.8 for 16lux.
++.sp
++NOTE: Only implemented on OS X.
++.TP
++.B \fBtarget\-prim=<value>\fP
++Specifies the primaries of the display. Video colors will be adapted to
++this colorspace when ICC color management is not being used. Valid
++values are:
++.INDENT 7.0
++.TP
++.B auto
++Disable any adaptation (default)
++.TP
++.B bt.470m
++ITU\-R BT.470 M
++.TP
++.B bt.601\-525
++ITU\-R BT.601 (525\-line SD systems, eg. NTSC), SMPTE 170M/240M
++.TP
++.B bt.601\-625
++ITU\-R BT.601 (625\-line SD systems, eg. PAL/SECAM), ITU\-R BT.470 B/G
++.TP
++.B bt.709
++ITU\-R BT.709 (HD), IEC 61966\-2\-4 (sRGB), SMPTE RP177 Annex B
++.TP
++.B bt.2020
++ITU\-R BT.2020 (UHD)
++.TP
++.B apple
++Apple RGB
++.TP
++.B adobe
++Adobe RGB (1998)
++.TP
++.B prophoto
++ProPhoto RGB (ROMM)
++.TP
++.B cie1931
++CIE 1931 RGB (not to be confused with CIE XYZ)
++.TP
++.B dci\-p3
++DCI\-P3 (Digital Cinema Colorspace), SMPTE RP431\-2
++.UNINDENT
++.TP
++.B \fBtarget\-trc=<value>\fP
++Specifies the transfer characteristics (gamma) of the display. Video
++colors will be adjusted to this curve when ICC color management is
++not being used. Valid values are:
++.INDENT 7.0
++.TP
++.B auto
++Disable any adaptation (default)
++.TP
++.B bt.1886
++ITU\-R BT.1886 curve (assuming infinite contrast)
++.TP
++.B srgb
++IEC 61966\-2\-4 (sRGB)
++.TP
++.B linear
++Linear light output
++.TP
++.B gamma1.8
++Pure power curve (gamma 1.8), also used for Apple RGB
++.TP
++.B gamma2.2
++Pure power curve (gamma 2.2)
++.TP
++.B gamma2.8
++Pure power curve (gamma 2.8), also used for BT.470\-BG
++.TP
++.B prophoto
++ProPhoto RGB (ROMM)
++.TP
++.B st2084
++SMPTE ST2084 (HDR) curve, PQ OETF
++.UNINDENT
++.TP
++.B \fBtarget\-brightness=<1..100000>\fP
++Specifies the display\(aqs approximate brightness in cd/m^2. When playing
++HDR content on a SDR display (or SDR content on an HDR display), video
++colors will be tone mapped to this target brightness using the
++algorithm specified by \fBhdr\-tone\-mapping\fP\&. The default of 250 cd/m^2
++corresponds to a typical consumer display.
++.TP
++.B \fBhdr\-tone\-mapping=<value>\fP
++Specifies the algorithm used for tone\-mapping HDR images onto the
++target display. Valid values are:
++.INDENT 7.0
++.TP
++.B clip
++Hard\-clip any out\-of\-range values.
++.TP
++.B reinhard
++Reinhard tone mapping algorithm. Very simple continuous curve.
++Preserves dynamic range and peak but uses nonlinear contrast.
++.TP
++.B hable
++Similar to \fBreinhard\fP but preserves dark contrast better
++(slightly sigmoidal). Developed by John Hable for use in video
++games. (default)
++.TP
++.B gamma
++Fits a logarithmic transfer between the tone curves.
++.TP
++.B linear
++Linearly stretches the entire reference gamut to (a linear multiple
++of) the display.
++.UNINDENT
++.TP
++.B \fBtone\-mapping\-param=<value>\fP
++Set tone mapping parameters. Ignored if the tone mapping algorithm is
++not tunable. This affects the following tone mapping algorithms:
++.INDENT 7.0
++.TP
++.B reinhard
++Specifies the local contrast coefficient at the display peak.
++Defaults to 0.5, which means that in\-gamut values will be about
++half as bright as when clipping.
++.TP
++.B gamma
++Specifies the exponent of the function. Defaults to 1.8.
++.TP
++.B linear
++Specifies the scale factor to use while stretching. Defaults to
++1.0.
++.UNINDENT
++.TP
++.B \fBicc\-profile=<file>\fP
++Load an ICC profile and use it to transform video RGB to screen output.
++Needs LittleCMS 2 support compiled in. This option overrides the
++\fBtarget\-prim\fP, \fBtarget\-trc\fP and \fBicc\-profile\-auto\fP options.
++.TP
++.B \fBicc\-profile\-auto\fP
++Automatically select the ICC display profile currently specified by
++the display settings of the operating system.
++.sp
++NOTE: On Windows, the default profile must be an ICC profile. WCS
++profiles are not supported.
++.TP
++.B \fBicc\-cache\-dir=<dirname>\fP
++Store and load the 3D LUTs created from the ICC profile in this directory.
++This can be used to speed up loading, since LittleCMS 2 can take a while
++to create a 3D LUT. Note that these files contain uncompressed LUTs.
++Their size depends on the \fB3dlut\-size\fP, and can be very big.
++.sp
++NOTE: This is not cleaned automatically, so old, unused cache files
++may stick around indefinitely.
++.TP
++.B \fBicc\-intent=<value>\fP
++Specifies the ICC intent used for the color transformation (when using
++\fBicc\-profile\fP).
++.INDENT 7.0
++.TP
++.B 0
++perceptual
++.TP
++.B 1
++relative colorimetric (default)
++.TP
++.B 2
++saturation
++.TP
++.B 3
++absolute colorimetric
++.UNINDENT
++.TP
++.B \fB3dlut\-size=<r>x<g>x<b>\fP
++Size of the 3D LUT generated from the ICC profile in each dimension.
++Default is 128x256x64.
++Sizes must be a power of two, and 512 at most.
++.TP
++.B \fBicc\-contrast=<0\-100000>\fP
++Specifies an upper limit on the target device\(aqs contrast ratio.
++This is detected automatically from the profile if possible, but for
++some profiles it might be missing, causing the contrast to be assumed
++as infinite. As a result, video may appear darker than intended. This
++only affects BT.1886 content. The default of 0 means no limit.
++.TP
++.B \fBblend\-subtitles=<yes|video|no>\fP
++Blend subtitles directly onto upscaled video frames, before
++interpolation and/or color management (default: no). Enabling this
++causes subtitles to be affected by \fBicc\-profile\fP, \fBtarget\-prim\fP,
++\fBtarget\-trc\fP, \fBinterpolation\fP, \fBgamma\fP and \fBpost\-shader\fP\&. It
++also increases subtitle performance when using \fBinterpolation\fP\&.
++.sp
++The downside of enabling this is that it restricts subtitles to the
++visible portion of the video, so you can\(aqt have subtitles exist in the
++black margins below a video (for example).
++.sp
++If \fBvideo\fP is selected, the behavior is similar to \fByes\fP, but subs
++are drawn at the video\(aqs native resolution, and scaled along with the
++video.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++This changes the way subtitle colors are handled. Normally,
++subtitle colors are assumed to be in sRGB and color managed
++as such. Enabling this makes them treated as being in the
++video\(aqs color space instead. This is good if you want
++things like softsubbed ASS signs to match the video colors,
++but may cause SRT subtitles or similar to look slightly off.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBalpha=<blend\-tiles|blend|yes|no>\fP
++Decides what to do if the input has an alpha component.
++.INDENT 7.0
++.TP
++.B blend\-tiles
++Blend the frame against a 16x16 gray/white tiles background (default).
++.TP
++.B blend
++Blend the frame against a black background.
++.TP
++.B yes
++Try to create a framebuffer with alpha component. This only makes sense
++if the video contains alpha information (which is extremely rare). May
++not be supported on all platforms. If alpha framebuffers are
++unavailable, it silently falls back on a normal framebuffer. Note
++that if you set the \fBfbo\-format\fP option to a non\-default value,
++a format with alpha must be specified, or this won\(aqt work.
++.TP
++.B no
++Ignore alpha component.
++.UNINDENT
++.TP
++.B \fBrectangle\-textures\fP
++Force use of rectangle textures (default: no). Normally this shouldn\(aqt
++have any advantages over normal textures. Note that hardware decoding
++overrides this flag.
++.TP
++.B \fBbackground=<color>\fP
++Color used to draw parts of the mpv window not covered by video.
++See \fB\-\-osd\-color\fP option how colors are defined.
++.UNINDENT
++.TP
++.B \fBopengl\-hq\fP
++Same as \fBopengl\fP, but with default settings for high quality rendering.
++.sp
++This is equivalent to:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++\-\-vo=opengl:scale=spline36:cscale=spline36:dscale=mitchell:dither\-depth=auto:correct\-downscaling:sigmoid\-upscaling:deband:es=no
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Note that some cheaper LCDs do dithering that gravely interferes with
++\fBopengl\fP\(aqs dithering. Disabling dithering with \fBdither\-depth=no\fP helps.
++.TP
++.B \fBsdl\fP
++SDL 2.0+ Render video output driver, depending on system with or without
++hardware acceleration. Should work on all platforms supported by SDL 2.0.
++For tuning, refer to your copy of the file \fBSDL_hints.h\fP\&.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is for compatibility with systems that don\(aqt provide
++proper graphics drivers, or which support GLES only.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBsw\fP
++Continue even if a software renderer is detected.
++.TP
++.B \fBswitch\-mode\fP
++Instruct SDL to switch the monitor video mode when going fullscreen.
++.UNINDENT
++.TP
++.B \fBvaapi\fP
++Intel VA API video output driver with support for hardware decoding. Note
++that there is absolutely no reason to use this, other than wanting to use
++hardware decoding to save power on laptops, or possibly preventing video
++tearing with some setups.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is for compatibility with crappy systems. You can
++use vaapi hardware decoding with \fB\-\-vo=opengl\fP too.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBscaling=<algorithm>\fP
++.INDENT 7.0
++.TP
++.B default
++Driver default (mpv default as well).
++.TP
++.B fast
++Fast, but low quality.
++.TP
++.B hq
++Unspecified driver dependent high\-quality scaling, slow.
++.TP
++.B nla
++\fBnon\-linear anamorphic scaling\fP
++.UNINDENT
++.TP
++.B \fBdeint\-mode=<mode>\fP
++Select deinterlacing algorithm. Note that by default deinterlacing is
++initially always off, and needs to be enabled with the \fBd\fP key
++(default key binding for \fBcycle deinterlace\fP).
++.sp
++This option doesn\(aqt apply if libva supports video post processing (vpp).
++In this case, the default for \fBdeint\-mode\fP is \fBno\fP, and enabling
++deinterlacing via user interaction using the methods mentioned above
++actually inserts the \fBvavpp\fP video filter. If vpp is not actually
++supported with the libva backend in use, you can use this option to
++forcibly enable VO based deinterlacing.
++.INDENT 7.0
++.TP
++.B no
++Don\(aqt allow deinterlacing (default for newer libva).
++.TP
++.B first\-field
++Show only first field (going by \fB\-\-field\-dominance\fP).
++.TP
++.B bob
++bob deinterlacing (default for older libva).
++.UNINDENT
++.TP
++.B \fBscaled\-osd=<yes|no>\fP
++If enabled, then the OSD is rendered at video resolution and scaled to
++display resolution. By default, this is disabled, and the OSD is
++rendered at display resolution if the driver supports it.
++.UNINDENT
++.TP
++.B \fBnull\fP
++Produces no video output. Useful for benchmarking.
++.sp
++Usually, it\(aqs better to disable video with \fB\-\-no\-video\fP instead.
++.INDENT 7.0
++.TP
++.B \fBfps=<value>\fP
++Simulate display FPS. This artificially limits how many frames the
++VO accepts per second.
++.UNINDENT
++.TP
++.B \fBcaca\fP
++Color ASCII art video output driver that works on a text console.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is a joke.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBimage\fP
++Output each frame into an image file in the current directory. Each file
++takes the frame number padded with leading zeros as name.
++.INDENT 7.0
++.TP
++.B \fBformat=<format>\fP
++Select the image file format.
++.INDENT 7.0
++.TP
++.B jpg
++JPEG files, extension .jpg. (Default.)
++.TP
++.B jpeg
++JPEG files, extension .jpeg.
++.TP
++.B png
++PNG files.
++.TP
++.B ppm
++Portable bitmap format.
++.TP
++.B pgm
++Portable graymap format.
++.TP
++.B pgmyuv
++Portable graymap format, using the YV12 pixel format.
++.TP
++.B tga
++Truevision TGA.
++.UNINDENT
++.TP
++.B \fBpng\-compression=<0\-9>\fP
++PNG compression factor (speed vs. file size tradeoff) (default: 7)
++.TP
++.B \fBpng\-filter=<0\-5>\fP
++Filter applied prior to PNG compression (0 = none; 1 = sub; 2 = up;
++3 = average; 4 = Paeth; 5 = mixed) (default: 5)
++.TP
++.B \fBjpeg\-quality=<0\-100>\fP
++JPEG quality factor (default: 90)
++.TP
++.B \fB(no\-)jpeg\-progressive\fP
++Specify standard or progressive JPEG (default: no).
++.TP
++.B \fB(no\-)jpeg\-baseline\fP
++Specify use of JPEG baseline or not (default: yes).
++.TP
++.B \fBjpeg\-optimize=<0\-100>\fP
++JPEG optimization factor (default: 100)
++.TP
++.B \fBjpeg\-smooth=<0\-100>\fP
++smooth factor (default: 0)
++.TP
++.B \fBjpeg\-dpi=<1\->\fP
++JPEG DPI (default: 72)
++.TP
++.B \fBoutdir=<dirname>\fP
++Specify the directory to save the image files to (default: \fB\&./\fP).
++.UNINDENT
++.TP
++.B \fBwayland\fP (Wayland only)
++Wayland shared memory video output as fallback for \fBopengl\fP\&.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This driver is for compatibility with systems that don\(aqt provide
++working OpenGL drivers.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBalpha\fP
++Use a buffer format that supports videos and images with alpha
++information
++.TP
++.B \fBrgb565\fP
++Use RGB565 as buffer format. This format is implemented on most
++platforms, especially on embedded where it is far more efficient then
++RGB8888.
++.TP
++.B \fBtriple\-buffering\fP
++Use 3 buffers instead of 2. This can lead to more fluid playback, but
++uses more memory.
++.UNINDENT
++.TP
++.B \fBopengl\-cb\fP
++For use with libmpv direct OpenGL embedding; useless in any other contexts.
++(See \fB<mpv/opengl_cb.h>\fP\&.)
++.sp
++This also supports many of the suboptions the \fBopengl\fP VO has. Run
++\fBmpv \-\-vo=opengl\-cb:help\fP for a list.
++.sp
++This also supports the \fBvo_cmdline\fP command.
++.TP
++.B \fBrpi\fP (Raspberry Pi)
++Native video output on the Raspberry Pi using the MMAL API.
++.INDENT 7.0
++.TP
++.B \fBdisplay=<number>\fP
++Select the display number on which the video overlay should be shown
++(default: 0).
++.TP
++.B \fBlayer=<number>\fP
++Select the dispmanx layer on which the video overlay should be shown
++(default: \-10). Note that mpv will also use the 2 layers above the
++selected layer, to handle the window background and OSD. Actual video
++rendering will happen on the layer above the selected layer.
++.TP
++.B \fBbackground=<yes|no>\fP
++Whether to render a black background behind the video (default: no).
++Normally it\(aqs better to kill the console framebuffer instead, which
++gives better performance.
++.TP
++.B \fBosd=<yes|no>\fP
++Enabled by default. If disabled with \fBno\fP, no OSD layer is created.
++This also means there will be no subtitles rendered.
++.UNINDENT
++.TP
++.B \fBdrm\fP (Direct Rendering Manager)
++Video output driver using Kernel Mode Setting / Direct Rendering Manager.
++Should be used when one doesn\(aqt want to install full\-blown graphical
++environment (e.g. no X). Does not support hardware acceleration (if you
++need this, check the \fBdrm\-egl\fP backend for \fBopengl\fP VO).
++.INDENT 7.0
++.TP
++.B \fBconnector=<number>\fP
++Select the connector to use (usually this is a monitor.) If set to \-1,
++mpv renders the output on the first available connector. (default: \-1)
++.TP
++.B \fBdevpath=<filename>\fP
++Path to graphic card device.
++(default: /dev/dri/card0)
++.TP
++.B \fBmode=<number>\fP
++Mode ID to use (resolution, bit depth and frame rate).
++(default: 0)
++.UNINDENT
++.UNINDENT
++.SH AUDIO FILTERS
++.sp
++Audio filters allow you to modify the audio stream and its properties. The
++syntax is:
++.INDENT 0.0
++.TP
++.B \fB\-\-af=<filter1[=parameter1:parameter2:...],filter2,...>\fP
++Setup a chain of audio filters.
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 0.0
++.INDENT 3.5
++To get a full list of available audio filters, see \fB\-\-af=help\fP\&.
++.sp
++Also, keep in mind that most actual filters are available via the \fBlavfi\fP
++wrapper, which gives you access to most of libavfilter\(aqs filters. This
++includes all filters that have been ported from MPlayer to libavfilter.
++.UNINDENT
++.UNINDENT
++.sp
++You can also set defaults for each filter. The defaults are applied before the
++normal filter parameters.
++.INDENT 0.0
++.TP
++.B \fB\-\-af\-defaults=<filter1[=parameter1:parameter2:...],filter2,...>\fP
++Set defaults for each filter.
++.UNINDENT
++.sp
++Audio filters are managed in lists. There are a few commands to manage the
++filter list:
++.INDENT 0.0
++.TP
++.B \fB\-\-af\-add=<filter1[,filter2,...]>\fP
++Appends the filters given as arguments to the filter list.
++.TP
++.B \fB\-\-af\-pre=<filter1[,filter2,...]>\fP
++Prepends the filters given as arguments to the filter list.
++.TP
++.B \fB\-\-af\-del=<index1[,index2,...]>\fP
++Deletes the filters at the given indexes. Index numbers start at 0,
++negative numbers address the end of the list (\-1 is the last).
++.TP
++.B \fB\-\-af\-clr\fP
++Completely empties the filter list.
++.UNINDENT
++.sp
++Available filters are:
++.INDENT 0.0
++.TP
++.B \fBlavrresample[=option1:option2:...]\fP
++This filter uses libavresample (or libswresample, depending on the build)
++to change sample rate, sample format, or channel layout of the audio stream.
++This filter is automatically enabled if the audio output does not support
++the audio configuration of the file being played.
++.sp
++It supports only the following sample formats: u8, s16, s32, float.
++.INDENT 7.0
++.TP
++.B \fBfilter\-size=<length>\fP
++Length of the filter with respect to the lower sampling rate. (default:
++16)
++.TP
++.B \fBphase\-shift=<count>\fP
++Log2 of the number of polyphase entries. (..., 10\->1024, 11\->2048,
++12\->4096, ...) (default: 10\->1024)
++.TP
++.B \fBcutoff=<cutoff>\fP
++Cutoff frequency (0.0\-1.0), default set depending upon filter length.
++.TP
++.B \fBlinear\fP
++If set then filters will be linearly interpolated between polyphase
++entries. (default: no)
++.TP
++.B \fBno\-detach\fP
++Do not detach if input and output audio format/rate/channels match.
++(If you just want to set defaults for this filter that will be used
++even by automatically inserted lavrresample instances, you should
++prefer setting them with \fB\-\-af\-defaults=lavrresample:...\fP\&.)
++.TP
++.B \fBnormalize=<yes|no|auto>\fP
++Whether to normalize when remixing channel layouts (default: auto).
++\fBauto\fP uses the value set by \fB\-\-audio\-normalize\-downmix\fP\&.
++.TP
++.B \fBo=<string>\fP
++Set AVOptions on the SwrContext or AVAudioResampleContext. These should
++be documented by FFmpeg or Libav.
++.UNINDENT
++.TP
++.B \fBlavcac3enc[=options]\fP
++Encode multi\-channel audio to AC\-3 at runtime using libavcodec. Supports
++16\-bit native\-endian input format, maximum 6 channels. The output is
++big\-endian when outputting a raw AC\-3 stream, native\-endian when
++outputting to S/PDIF. If the input sample rate is not 48 kHz, 44.1 kHz or
++32 kHz, it will be resampled to 48 kHz.
++.INDENT 7.0
++.TP
++.B \fBtospdif=<yes|no>\fP
++Output raw AC\-3 stream if \fBno\fP, output to S/PDIF for
++pass\-through if \fByes\fP (default).
++.TP
++.B \fBbitrate=<rate>\fP
++The bitrate use for the AC\-3 stream. Set it to 384 to get 384 kbps.
++.sp
++The default is 640. Some receivers might not be able to handle this.
++.sp
++Valid values: 32, 40, 48, 56, 64, 80, 96, 112, 128,
++160, 192, 224, 256, 320, 384, 448, 512, 576, 640.
++.sp
++The special value \fBauto\fP selects a default bitrate based on the
++input channel number:
++.INDENT 7.0
++.TP
++.B 1ch
++96
++.TP
++.B 2ch
++192
++.TP
++.B 3ch
++224
++.TP
++.B 4ch
++384
++.TP
++.B 5ch
++448
++.TP
++.B 6ch
++448
++.UNINDENT
++.TP
++.B \fBminch=<n>\fP
++If the input channel number is less than \fB<minch>\fP, the filter will
++detach itself (default: 3).
++.TP
++.B \fBencoder=<name>\fP
++Select the libavcodec encoder used. Currently, this should be an AC\-3
++encoder, and using another codec will fail horribly.
++.UNINDENT
++.TP
++.B \fBequalizer=g1:g2:g3:...:g10\fP
++10 octave band graphic equalizer, implemented using 10 IIR band\-pass
++filters. This means that it works regardless of what type of audio is
++being played back. The center frequencies for the 10 bands are:
++.TS
++center;
++|l|l|.
++_
++T{
++No.
++T} T{
++frequency
++T}
++_
++T{
++0
++T} T{
++31.25 Hz
++T}
++_
++T{
++1
++T} T{
++62.50 Hz
++T}
++_
++T{
++2
++T} T{
++125.00 Hz
++T}
++_
++T{
++3
++T} T{
++250.00 Hz
++T}
++_
++T{
++4
++T} T{
++500.00 Hz
++T}
++_
++T{
++5
++T} T{
++1.00 kHz
++T}
++_
++T{
++6
++T} T{
++2.00 kHz
++T}
++_
++T{
++7
++T} T{
++4.00 kHz
++T}
++_
++T{
++8
++T} T{
++8.00 kHz
++T}
++_
++T{
++9
++T} T{
++16.00 kHz
++T}
++_
++.TE
++.sp
++If the sample rate of the sound being played is lower than the center
++frequency for a frequency band, then that band will be disabled. A known
++bug with this filter is that the characteristics for the uppermost band
++are not completely symmetric if the sample rate is close to the center
++frequency of that band. This problem can be worked around by upsampling
++the sound using a resampling filter before it reaches this filter.
++.INDENT 7.0
++.TP
++.B \fB<g1>:<g2>:<g3>:...:<g10>\fP
++floating point numbers representing the gain in dB for each frequency
++band (\-12\-12)
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBmpv \-\-af=equalizer=11:11:10:5:0:\-12:0:5:12:12 media.avi\fP
++Would amplify the sound in the upper and lower frequency region
++while canceling it almost completely around 1 kHz.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBchannels=nch[:routes]\fP
++Can be used for adding, removing, routing and copying audio channels. If
++only \fB<nch>\fP is given, the default routing is used. It works as follows:
++If the number of output channels is greater than the number of input
++channels, empty channels are inserted (except when mixing from mono to
++stereo; then the mono channel is duplicated). If the number of output
++channels is less than the number of input channels, the exceeding
++channels are truncated.
++.INDENT 7.0
++.TP
++.B \fB<nch>\fP
++number of output channels (1\-8)
++.TP
++.B \fB<routes>\fP
++List of \fB,\fP separated routes, in the form \fBfrom1\-to1,from2\-to2,...\fP\&.
++Each pair defines where to route each channel. There can be at most
++8 routes. Without this argument, the default routing is used. Since
++\fB,\fP is also used to separate filters, you must quote this argument
++with \fB[...]\fP or similar.
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fBmpv \-\-af=channels=4:[0\-1,1\-0,2\-2,3\-3] media.avi\fP
++Would change the number of channels to 4 and set up 4 routes that
++swap channel 0 and channel 1 and leave channel 2 and 3 intact.
++Observe that if media containing two channels were played back,
++channels 2 and 3 would contain silence but 0 and 1 would still be
++swapped.
++.TP
++.B \fBmpv \-\-af=channels=6:[0\-0,0\-1,0\-2,0\-3] media.avi\fP
++Would change the number of channels to 6 and set up 4 routes that
++copy channel 0 to channels 0 to 3. Channel 4 and 5 will contain
++silence.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++You should probably not use this filter. If you want to change the
++output channel layout, try the \fBformat\fP filter, which can make mpv
++automatically up\- and downmix standard channel layouts.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBformat=format:srate:channels:out\-format:out\-srate:out\-channels\fP
++Does not do any format conversion itself. Rather, it may cause the
++filter system to insert necessary conversion filters before or after this
++filter if needed. It is primarily useful for controlling the audio format
++going into other filters. To specify the format for audio output, see
++\fB\-\-audio\-format\fP, \fB\-\-audio\-samplerate\fP, and \fB\-\-audio\-channels\fP\&. This
++filter is able to force a particular format, whereas \fB\-\-audio\-*\fP
++may be overridden by the ao based on output compatibility.
++.sp
++All parameters are optional. The first 3 parameters restrict what the filter
++accepts as input. They will therefore cause conversion filters to be
++inserted before this one. The \fBout\-\fP parameters tell the filters or audio
++outputs following this filter how to interpret the data without actually
++doing a conversion. Setting these will probably just break things unless you
++really know you want this for some reason, such as testing or dealing with
++broken media.
++.INDENT 7.0
++.TP
++.B \fB<format>\fP
++Force conversion to this format. Use \fB\-\-af=format=format=help\fP to get
++a list of valid formats.
++.TP
++.B \fB<srate>\fP
++Force conversion to a specific sample rate. The rate is an integer,
++48000 for example.
++.TP
++.B \fB<channels>\fP
++Force mixing to a specific channel layout. See \fB\-\-audio\-channels\fP option
++for possible values.
++.UNINDENT
++.sp
++\fB<out\-format>\fP
++.sp
++\fB<out\-srate>\fP
++.sp
++\fB<out\-channels>\fP
++.sp
++\fINOTE\fP: this filter used to be named \fBforce\fP\&. The old \fBformat\fP filter
++used to do conversion itself, unlike this one which lets the filter system
++handle the conversion.
++.TP
++.B \fBvolume[=<volumedb>[:...]]\fP
++Implements software volume control. Use this filter with caution since it
++can reduce the signal to noise ratio of the sound. In most cases it is
++best to use the \fIMaster\fP volume control of your sound card or the volume
++knob on your amplifier.
++.sp
++\fINOTE\fP: This filter is not reentrant and can therefore only be enabled
++once for every audio stream.
++.INDENT 7.0
++.TP
++.B \fB<volumedb>\fP
++Sets the desired gain in dB for all channels in the stream from \-200 dB
++to +60 dB, where \-200 dB mutes the sound completely and +60 dB equals a
++gain of 1000 (default: 0).
++.TP
++.B \fBreplaygain\-track\fP
++Adjust volume gain according to the track\-gain replaygain value stored
++in the file metadata.
++.TP
++.B \fBreplaygain\-album\fP
++Like replaygain\-track, but using the album\-gain value instead.
++.TP
++.B \fBreplaygain\-preamp\fP
++Pre\-amplification gain in dB to apply to the selected replaygain gain
++(default: 0).
++.TP
++.B \fBreplaygain\-clip=yes|no\fP
++Prevent clipping caused by replaygain by automatically lowering the
++gain (default). Use \fBreplaygain\-clip=no\fP to disable this.
++.TP
++.B \fBreplaygain\-fallback\fP
++Gain in dB to apply if the file has no replay gain tags. This option
++is always applied if the replaygain logic is somehow inactive. If this
++is applied, no other replaygain options are applied.
++.TP
++.B \fBsoftclip\fP
++Turns soft clipping on. Soft\-clipping can make the
++sound more smooth if very high volume levels are used. Enable this
++option if the dynamic range of the loudspeakers is very low.
++.sp
++\fIWARNING\fP: This feature creates distortion and should be considered a
++last resort.
++.TP
++.B \fBs16\fP
++Force S16 sample format if set. Lower quality, but might be faster
++in some situations.
++.TP
++.B \fBdetach\fP
++Remove the filter if the volume is not changed at audio filter config
++time. Useful with replaygain: if the current file has no replaygain
++tags, then the filter will be removed if this option is enabled.
++(If \fB\-\-softvol=yes\fP is used and the player volume controls are used
++during playback, a different volume filter will be inserted.)
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBmpv \-\-af=volume=10.1 media.avi\fP
++Would amplify the sound by 10.1 dB and hard\-clip if the sound level
++is too high.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBpan=n:[<matrix>]\fP
++Mixes channels arbitrarily. Basically a combination of the volume and the
++channels filter that can be used to down\-mix many channels to only a few,
++e.g. stereo to mono, or vary the "width" of the center speaker in a
++surround sound system. This filter is hard to use, and will require some
++tinkering before the desired result is obtained. The number of options for
++this filter depends on the number of output channels. An example how to
++downmix a six\-channel file to two channels with this filter can be found
++in the examples section near the end.
++.INDENT 7.0
++.TP
++.B \fB<n>\fP
++Number of output channels (1\-8).
++.TP
++.B \fB<matrix>\fP
++A list of values \fB[L00,L01,L02,...,L10,L11,L12,...,Ln0,Ln1,Ln2,...]\fP,
++where each element \fBLij\fP means how much of input channel i is mixed
++into output channel j (range 0\-1). So in principle you first have n
++numbers saying what to do with the first input channel, then n numbers
++that act on the second input channel etc. If you do not specify any
++numbers for some input channels, 0 is assumed.
++Note that the values are separated by \fB,\fP, which is already used
++by the option parser to separate filters. This is why you must quote
++the value list with \fB[...]\fP or similar.
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fBmpv \-\-af=pan=1:[0.5,0.5] media.avi\fP
++Would downmix from stereo to mono.
++.TP
++.B \fBmpv \-\-af=pan=3:[1,0,0.5,0,1,0.5] media.avi\fP
++Would give 3 channel output leaving channels 0 and 1 intact, and mix
++channels 0 and 1 into output channel 2 (which could be sent to a
++subwoofer for example).
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++If you just want to force remixing to a certain output channel layout,
++it is easier to use the \fBformat\fP filter. For example,
++\fBmpv \(aq\-\-af=format=channels=5.1\(aq \(aq\-\-audio\-channels=5.1\(aq\fP would always force
++remixing audio to 5.1 and output it like this.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBdelay[=[ch1,ch2,...]]\fP
++Delays the sound to the loudspeakers such that the sound from the
++different channels arrives at the listening position simultaneously. It is
++only useful if you have more than 2 loudspeakers.
++.INDENT 7.0
++.TP
++.B \fB[ch1,ch2,...]\fP
++The delay in ms that should be imposed on each channel (floating point
++number between 0 and 1000).
++.UNINDENT
++.sp
++To calculate the required delay for the different channels, do as follows:
++.INDENT 7.0
++.IP 1. 3
++Measure the distance to the loudspeakers in meters in relation to your
++listening position, giving you the distances s1 to s5 (for a 5.1
++system). There is no point in compensating for the subwoofer (you will
++not hear the difference anyway).
++.IP 2. 3
++Subtract the distances s1 to s5 from the maximum distance, i.e.
++\fBs[i] = max(s) \- s[i]; i = 1...5\fP\&.
++.IP 3. 3
++Calculate the required delays in ms as \fBd[i] = 1000*s[i]/342; i =
++1...5\fP\&.
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBmpv \-\-af=delay=[10.5,10.5,0,0,7,0] media.avi\fP
++Would delay front left and right by 10.5 ms, the two rear channels
++and the subwoofer by 0 ms and the center channel by 7 ms.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBdrc[=method:target]\fP
++Applies dynamic range compression. This maximizes the volume by compressing
++the audio signal\(aqs dynamic range. (Formerly called \fBvolnorm\fP\&.)
++.INDENT 7.0
++.TP
++.B \fB<method>\fP
++Sets the used method.
++.INDENT 7.0
++.TP
++.B 1
++Use a single sample to smooth the variations via the standard
++weighted mean over past samples (default).
++.TP
++.B 2
++Use several samples to smooth the variations via the standard
++weighted mean over past samples.
++.UNINDENT
++.TP
++.B \fB<target>\fP
++Sets the target amplitude as a fraction of the maximum for the sample
++type (default: 0.25).
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This filter can cause distortion with audio signals that have a very
++large dynamic range.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBscaletempo[=option1:option2:...]\fP
++Scales audio tempo without altering pitch, optionally synced to playback
++speed (default).
++.sp
++This works by playing \(aqstride\(aq ms of audio at normal speed then consuming
++\(aqstride*scale\(aq ms of input audio. It pieces the strides together by
++blending \(aqoverlap\(aq% of stride with audio following the previous stride. It
++optionally performs a short statistical analysis on the next \(aqsearch\(aq ms
++of audio to determine the best overlap position.
++.INDENT 7.0
++.TP
++.B \fBscale=<amount>\fP
++Nominal amount to scale tempo. Scales this amount in addition to
++speed. (default: 1.0)
++.TP
++.B \fBstride=<amount>\fP
++Length in milliseconds to output each stride. Too high of a value will
++cause noticeable skips at high scale amounts and an echo at low scale
++amounts. Very low values will alter pitch. Increasing improves
++performance. (default: 60)
++.TP
++.B \fBoverlap=<percent>\fP
++Percentage of stride to overlap. Decreasing improves performance.
++(default: .20)
++.TP
++.B \fBsearch=<amount>\fP
++Length in milliseconds to search for best overlap position. Decreasing
++improves performance greatly. On slow systems, you will probably want
++to set this very low. (default: 14)
++.TP
++.B \fBspeed=<tempo|pitch|both|none>\fP
++Set response to speed change.
++.INDENT 7.0
++.TP
++.B tempo
++Scale tempo in sync with speed (default).
++.TP
++.B pitch
++Reverses effect of filter. Scales pitch without altering tempo.
++Add this to your \fBinput.conf\fP to step by musical semi\-tones:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++[ multiply speed 0.9438743126816935
++] multiply speed 1.059463094352953
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++Loses sync with video.
++.UNINDENT
++.UNINDENT
++.TP
++.B both
++Scale both tempo and pitch.
++.TP
++.B none
++Ignore speed changes.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fBmpv \-\-af=scaletempo \-\-speed=1.2 media.ogg\fP
++Would play media at 1.2x normal speed, with audio at normal
++pitch. Changing playback speed would change audio tempo to match.
++.TP
++.B \fBmpv \-\-af=scaletempo=scale=1.2:speed=none \-\-speed=1.2 media.ogg\fP
++Would play media at 1.2x normal speed, with audio at normal
++pitch, but changing playback speed would have no effect on audio
++tempo.
++.TP
++.B \fBmpv \-\-af=scaletempo=stride=30:overlap=.50:search=10 media.ogg\fP
++Would tweak the quality and performance parameters.
++.TP
++.B \fBmpv \-\-af=format=float,scaletempo media.ogg\fP
++Would make scaletempo use float code. Maybe faster on some
++platforms.
++.TP
++.B \fBmpv \-\-af=scaletempo=scale=1.2:speed=pitch audio.ogg\fP
++Would play media at 1.2x normal speed, with audio at normal pitch.
++Changing playback speed would change pitch, leaving audio tempo at
++1.2x.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBrubberband\fP
++High quality pitch correction with librubberband. This can be used in place
++of \fBscaletempo\fP, and will be used to adjust audio pitch when playing
++at speed different from normal.
++.sp
++This filter has a number of sub\-options. You can list them with
++\fBmpv \-\-af=rubberband=help\fP\&. This will also show the default values
++for each option. The options are not documented here, because they are
++merely passed to librubberband. Look at the librubberband documentation
++to learn what each option does:
++\fI\%http://breakfastquay.com/rubberband/code\-doc/classRubberBand_1_1RubberBandStretcher.html\fP
++(The mapping of the mpv rubberband filter sub\-option names and values to
++those of librubberband follows a simple pattern: \fB"Option" + Name + Value\fP\&.)
++.TP
++.B \fBlavfi=graph\fP
++Filter audio using FFmpeg\(aqs libavfilter.
++.INDENT 7.0
++.TP
++.B \fB<graph>\fP
++Libavfilter graph. See \fBlavfi\fP video filter for details \- the graph
++syntax is the same.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++Don\(aqt forget to quote libavfilter graphs as described in the lavfi
++video filter section.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBo=<string>\fP
++AVOptions.
++.UNINDENT
++.UNINDENT
++.SH VIDEO FILTERS
++.sp
++Video filters allow you to modify the video stream and its properties. The
++syntax is:
++.INDENT 0.0
++.TP
++.B \fB\-\-vf=<filter1[=parameter1:parameter2:...],filter2,...>\fP
++Setup a chain of video filters.
++.UNINDENT
++.sp
++You can also set defaults for each filter. The defaults are applied before the
++normal filter parameters.
++.INDENT 0.0
++.TP
++.B \fB\-\-vf\-defaults=<filter1[=parameter1:parameter2:...],filter2,...>\fP
++Set defaults for each filter.
++.UNINDENT
++.sp
++\fBNOTE:\fP
++.INDENT 0.0
++.INDENT 3.5
++To get a full list of available video filters, see \fB\-\-vf=help\fP\&.
++.sp
++Also, keep in mind that most actual filters are available via the \fBlavfi\fP
++wrapper, which gives you access to most of libavfilter\(aqs filters. This
++includes all filters that have been ported from MPlayer to libavfilter.
++.UNINDENT
++.UNINDENT
++.sp
++Video filters are managed in lists. There are a few commands to manage the
++filter list.
++.INDENT 0.0
++.TP
++.B \fB\-\-vf\-add=<filter1[,filter2,...]>\fP
++Appends the filters given as arguments to the filter list.
++.TP
++.B \fB\-\-vf\-pre=<filter1[,filter2,...]>\fP
++Prepends the filters given as arguments to the filter list.
++.TP
++.B \fB\-\-vf\-del=<index1[,index2,...]>\fP
++Deletes the filters at the given indexes. Index numbers start at 0,
++negative numbers address the end of the list (\-1 is the last).
++.TP
++.B \fB\-\-vf\-clr\fP
++Completely empties the filter list.
++.UNINDENT
++.sp
++With filters that support it, you can access parameters by their name.
++.INDENT 0.0
++.TP
++.B \fB\-\-vf=<filter>=help\fP
++Prints the parameter names and parameter value ranges for a particular
++filter.
++.TP
++.B \fB\-\-vf=<filter=named_parameter1=value1[:named_parameter2=value2:...]>\fP
++Sets a named parameter to the given value. Use on and off or yes and no to
++set flag parameters.
++.UNINDENT
++.sp
++Available filters are:
++.INDENT 0.0
++.TP
++.B \fBcrop[=w:h:x:y]\fP
++Crops the given part of the image and discards the rest. Useful to remove
++black bands from widescreen videos.
++.INDENT 7.0
++.TP
++.B \fB<w>,<h>\fP
++Cropped width and height, defaults to original width and height.
++.TP
++.B \fB<x>,<y>\fP
++Position of the cropped picture, defaults to center.
++.UNINDENT
++.TP
++.B \fBexpand[=w:h:x:y:aspect:round]\fP
++Expands (not scales) video resolution to the given value and places the
++unscaled original at coordinates x, y.
++.INDENT 7.0
++.TP
++.B \fB<w>,<h>\fP
++Expanded width,height (default: original width,height). Negative
++values for w and h are treated as offsets to the original size.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBexpand=0:\-50:0:0\fP
++Adds a 50 pixel border to the bottom of the picture.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB<x>,<y>\fP
++position of original image on the expanded image (default: center)
++.TP
++.B \fB<aspect>\fP
++Expands to fit an aspect instead of a resolution (default: 0).
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBexpand=800::::4/3\fP
++Expands to 800x600, unless the source is higher resolution, in
++which case it expands to fill a 4/3 aspect.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB<round>\fP
++Rounds up to make both width and height divisible by <r> (default: 1).
++.UNINDENT
++.TP
++.B \fBflip\fP
++Flips the image upside down.
++.TP
++.B \fBmirror\fP
++Mirrors the image on the Y axis.
++.TP
++.B \fBrotate[=0|90|180|270]\fP
++Rotates the image by a multiple of 90 degrees clock\-wise.
++.TP
++.B \fBscale[=w:h:param:param2:chr\-drop:noup:arnd\fP
++Scales the image with the software scaler (slow) and performs a YUV<\->RGB
++color space conversion (see also \fB\-\-sws\fP).
++.sp
++All parameters are optional.
++.INDENT 7.0
++.TP
++.B \fB<w>:<h>\fP
++scaled width/height (default: original width/height)
++.INDENT 7.0
++.TP
++.B 0
++scaled d_width/d_height
++.TP
++.B \-1
++original width/height
++.TP
++.B \-2
++Calculate w/h using the other dimension and the prescaled
++aspect ratio.
++.TP
++.B \-3
++Calculate w/h using the other dimension and the original
++aspect ratio.
++.TP
++.B \-(n+8)
++Like \-n above, but rounding the dimension to the closest
++multiple of 16.
++.UNINDENT
++.TP
++.B \fB<param>[:<param2>]\fP (see also \fB\-\-sws\fP)
++Set some scaling parameters depending on the type of scaler selected
++with \fB\-\-sws\fP:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++\-\-sws=2 (bicubic): B (blurring) and C (ringing)
++ 0.00:0.60 default
++ 0.00:0.75 VirtualDub\(aqs "precise bicubic"
++ 0.00:0.50 Catmull\-Rom spline
++ 0.33:0.33 Mitchell\-Netravali spline
++ 1.00:0.00 cubic B\-spline
++
++\-\-sws=7 (Gaussian): sharpness (0 (soft) \- 100 (sharp))
++
++\-\-sws=9 (Lanczos): filter length (1\-10)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB<chr\-drop>\fP
++chroma skipping
++.INDENT 7.0
++.TP
++.B 0
++Use all available input lines for chroma (default).
++.TP
++.B 1
++Use only every 2. input line for chroma.
++.TP
++.B 2
++Use only every 4. input line for chroma.
++.TP
++.B 3
++Use only every 8. input line for chroma.
++.UNINDENT
++.TP
++.B \fB<noup>\fP
++Disallow upscaling past the original dimensions.
++.INDENT 7.0
++.TP
++.B 0
++Allow upscaling (default).
++.TP
++.B 1
++Disallow upscaling if one dimension exceeds its original value.
++.TP
++.B 2
++Disallow upscaling if both dimensions exceed their original values.
++.UNINDENT
++.TP
++.B \fB<arnd>\fP
++Accurate rounding for the vertical scaler, which may be faster or
++slower than the default rounding.
++.INDENT 7.0
++.TP
++.B no
++Disable accurate rounding (default).
++.TP
++.B yes
++Enable accurate rounding.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBdsize[=w:h:aspect\-method:r:aspect]\fP
++Changes the intended display aspect at an arbitrary point in the
++filter chain. Aspect can be given as a fraction (4/3) or floating point
++number (1.33). Note that this filter does \fInot\fP do any scaling itself; it
++just affects what later scalers (software or hardware) will do when
++auto\-scaling to the correct aspect.
++.INDENT 7.0
++.TP
++.B \fB<w>,<h>\fP
++New aspect ratio given by a display width and height. Unlike older mpv
++versions or MPlayer, this does not set the display size.
++.sp
++Can also be these special values:
++.INDENT 7.0
++.TP
++.B 0
++original display width and height
++.TP
++.B \-1
++original video width and height (default)
++.TP
++.B \-2
++Calculate w/h using the other dimension and the original display
++aspect ratio.
++.TP
++.B \-3
++Calculate w/h using the other dimension and the original video
++aspect ratio.
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBdsize=800:\-2\fP
++Specifies a display resolution of 800x600 for a 4/3 aspect
++video, or 800x450 for a 16/9 aspect video.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB<aspect\-method>\fP
++Modifies width and height according to original aspect ratios.
++.INDENT 7.0
++.TP
++.B \-1
++Ignore original aspect ratio (default).
++.TP
++.B 0
++Keep display aspect ratio by using \fB<w>\fP and \fB<h>\fP as maximum
++resolution.
++.TP
++.B 1
++Keep display aspect ratio by using \fB<w>\fP and \fB<h>\fP as minimum
++resolution.
++.TP
++.B 2
++Keep video aspect ratio by using \fB<w>\fP and \fB<h>\fP as maximum
++resolution.
++.TP
++.B 3
++Keep video aspect ratio by using \fB<w>\fP and \fB<h>\fP as minimum
++resolution.
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fBdsize=800:600:0\fP
++Specifies a display resolution of at most 800x600, or smaller,
++in order to keep aspect.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB<r>\fP
++Rounds up to make both width and height divisible by \fB<r>\fP
++(default: 1).
++.TP
++.B \fB<aspect>\fP
++Force an aspect ratio.
++.UNINDENT
++.TP
++.B \fBformat=fmt=<value>:colormatrix=<value>:...\fP
++Restricts the color space for the next filter without doing any conversion.
++Use together with the scale filter for a real conversion.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++For a list of available formats, see \fBformat=fmt=help\fP\&.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fB<fmt>\fP
++Format name, e.g. rgb15, bgr24, 420p, etc. (default: don\(aqt change).
++.TP
++.B \fB<outfmt>\fP
++Format name that should be substituted for the output. If they do not
++have the same bytes per pixel and chroma subsamplimg, it will fail.
++.TP
++.B \fB<colormatrix>\fP
++Controls the YUV to RGB color space conversion when playing video. There
++are various standards. Normally, BT.601 should be used for SD video, and
++BT.709 for HD video. (This is done by default.) Using incorrect color space
++results in slightly under or over saturated and shifted colors.
++.sp
++These options are not always supported. Different video outputs provide
++varying degrees of support. The \fBopengl\fP and \fBvdpau\fP video output
++drivers usually offer full support. The \fBxv\fP output can set the color
++space if the system video driver supports it, but not input and output
++levels. The \fBscale\fP video filter can configure color space and input
++levels, but only if the output format is RGB (if the video output driver
++supports RGB output, you can force this with \fB\-vf scale,format=rgba\fP).
++.sp
++If this option is set to \fBauto\fP (which is the default), the video\(aqs
++color space flag will be used. If that flag is unset, the color space
++will be selected automatically. This is done using a simple heuristic that
++attempts to distinguish SD and HD video. If the video is larger than
++1279x576 pixels, BT.709 (HD) will be used; otherwise BT.601 (SD) is
++selected.
++.sp
++Available color spaces are:
++.INDENT 7.0
++.TP
++.B auto
++automatic selection (default)
++.TP
++.B bt.601
++ITU\-R BT.601 (SD)
++.TP
++.B bt.709
++ITU\-R BT.709 (HD)
++.TP
++.B bt.2020\-ncl
++ITU\-R BT.2020 non\-constant luminance system
++.TP
++.B bt.2020\-cl
++ITU\-R BT.2020 constant luminance system
++.TP
++.B smpte\-240m
++SMPTE\-240M
++.UNINDENT
++.TP
++.B \fB<colorlevels>\fP
++YUV color levels used with YUV to RGB conversion. This option is only
++necessary when playing broken files which do not follow standard color
++levels or which are flagged wrong. If the video does not specify its
++color range, it is assumed to be limited range.
++.sp
++The same limitations as with \fB<colormatrix>\fP apply.
++.sp
++Available color ranges are:
++.INDENT 7.0
++.TP
++.B auto
++automatic selection (normally limited range) (default)
++.TP
++.B limited
++limited range (16\-235 for luma, 16\-240 for chroma)
++.TP
++.B full
++full range (0\-255 for both luma and chroma)
++.UNINDENT
++.TP
++.B \fB<primaries>\fP
++RGB primaries the source file was encoded with. Normally this should be set
++in the file header, but when playing broken or mistagged files this can be
++used to override the setting.
++.sp
++This option only affects video output drivers that perform color
++management, for example \fBopengl\fP with the \fBtarget\-prim\fP or
++\fBicc\-profile\fP suboptions set.
++.sp
++If this option is set to \fBauto\fP (which is the default), the video\(aqs
++primaries flag will be used. If that flag is unset, the color space will
++be selected automatically, using the following heuristics: If the
++\fB<colormatrix>\fP is set or determined as BT.2020 or BT.709, the
++corresponding primaries are used. Otherwise, if the video height is
++exactly 576 (PAL), BT.601\-625 is used. If it\(aqs exactly 480 or 486 (NTSC),
++BT.601\-525 is used. If the video resolution is anything else, BT.709 is
++used.
++.sp
++Available primaries are:
++.INDENT 7.0
++.TP
++.B auto
++automatic selection (default)
++.TP
++.B bt.601\-525
++ITU\-R BT.601 (SD) 525\-line systems (NTSC, SMPTE\-C)
++.TP
++.B bt.601\-625
++ITU\-R BT.601 (SD) 625\-line systems (PAL, SECAM)
++.TP
++.B bt.709
++ITU\-R BT.709 (HD) (same primaries as sRGB)
++.TP
++.B bt.2020
++ITU\-R BT.2020 (UHD)
++.TP
++.B apple
++Apple RGB
++.TP
++.B adobe
++Adobe RGB (1998)
++.TP
++.B prophoto
++ProPhoto RGB (ROMM)
++.TP
++.B cie1931
++CIE 1931 RGB
++.UNINDENT
++.TP
++.B \fB<gamma>\fP
++Gamma function the source file was encoded with. Normally this should be set
++in the file header, but when playing broken or mistagged files this can be
++used to override the setting.
++.sp
++This option only affects video output drivers that perform color management.
++.sp
++If this option is set to \fBauto\fP (which is the default), the gamma will
++be set to BT.1886 for YCbCr content, sRGB for RGB content and Linear for
++XYZ content.
++.sp
++Available gamma functions are:
++.INDENT 7.0
++.TP
++.B auto
++automatic selection (default)
++.TP
++.B bt.1886
++ITU\-R BT.1886 (EOTF corresponding to BT.601/BT.709/BT.2020)
++.TP
++.B srgb
++IEC 61966\-2\-4 (sRGB)
++.TP
++.B linear
++Linear light
++.TP
++.B gamma1.8
++Pure power curve (gamma 1.8)
++.TP
++.B gamma2.2
++Pure power curve (gamma 2.2)
++.TP
++.B gamma2.8
++Pure power curve (gamma 2.8)
++.TP
++.B prophoto
++ProPhoto RGB (ROMM) curve
++.TP
++.B st2084
++SMPTE ST2084 (HDR) curve
++.UNINDENT
++.TP
++.B \fB<peak>\fP
++Reference peak illumination for the video file. This is mostly
++interesting for HDR, but it can also be used tone map SDR content
++to a darker or brighter exposure.
++.sp
++The default of 0.0 will default to the display\(aqs reference brightness
++for SDR and the source\(aqs reference brightness for HDR.
++.TP
++.B \fB<stereo\-in>\fP
++Set the stereo mode the video is assumed to be encoded in. Takes the
++same values as the \fB\-\-video\-stereo\-mode\fP option.
++.TP
++.B \fB<stereo\-out>\fP
++Set the stereo mode the video should be displayed as. Takes the
++same values as the \fB\-\-video\-stereo\-mode\fP option.
++.TP
++.B \fB<rotate>\fP
++Set the rotation the video is assumed to be encoded with in degrees.
++The special value \fB\-1\fP uses the input format.
++.TP
++.B \fB<dw>\fP, \fB<dh>\fP
++Set the display size. Note that setting the display size such that
++the video is scaled in both directions instead of just changing the
++aspect ratio is an implementation detail, and might change later.
++.TP
++.B \fB<dar>\fP
++Set the display aspect ratio of the video frame. This is a float,
++but values such as \fB[16:9]\fP can be passed too (\fB[...]\fP for quoting
++to prevent the option parser from interpreting the \fB:\fP character).
++.UNINDENT
++.TP
++.B \fBnoformat[=fmt]\fP
++Restricts the color space for the next filter without doing any conversion.
++Unlike the format filter, this will allow any color space except the one
++you specify.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++For a list of available formats, see \fBnoformat=fmt=help\fP\&.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fB<fmt>\fP
++Format name, e.g. rgb15, bgr24, 420p, etc. (default: 420p).
++.UNINDENT
++.TP
++.B \fBlavfi=graph[:sws\-flags[:o=opts]]\fP
++Filter video using FFmpeg\(aqs libavfilter.
++.INDENT 7.0
++.TP
++.B \fB<graph>\fP
++The libavfilter graph string. The filter must have a single video input
++pad and a single video output pad.
++.sp
++See \fI\%https://ffmpeg.org/ffmpeg\-filters.html\fP for syntax and available
++filters.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++If you want to use the full filter syntax with this option, you have
++to quote the filter graph in order to prevent mpv\(aqs syntax and the
++filter graph syntax from clashing.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fB\-vf lavfi=[gradfun=20:30,vflip]\fP
++\fBgradfun\fP filter with nonsense parameters, followed by a
++\fBvflip\fP filter. (This demonstrates how libavfilter takes a
++graph and not just a single filter.) The filter graph string is
++quoted with \fB[\fP and \fB]\fP\&. This requires no additional quoting
++or escaping with some shells (like bash), while others (like
++zsh) require additional \fB"\fP quotes around the option string.
++.TP
++.B \fB\(aq\-\-vf=lavfi="gradfun=20:30,vflip"\(aq\fP
++Same as before, but uses quoting that should be safe with all
++shells. The outer \fB\(aq\fP quotes make sure that the shell does not
++remove the \fB"\fP quotes needed by mpv.
++.TP
++.B \fB\(aq\-\-vf=lavfi=graph="gradfun=radius=30:strength=20,vflip"\(aq\fP
++Same as before, but uses named parameters for everything.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fB<sws\-flags>\fP
++If libavfilter inserts filters for pixel format conversion, this
++option gives the flags which should be passed to libswscale. This
++option is numeric and takes a bit\-wise combination of \fBSWS_\fP flags.
++.sp
++See \fBhttp://git.videolan.org/?p=ffmpeg.git;a=blob;f=libswscale/swscale.h\fP\&.
++.TP
++.B \fB<o>\fP
++Set AVFilterGraph options. These should be documented by FFmpeg.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B \fB\(aq\-\-vf=lavfi=yadif:o="threads=2,thread_type=slice"\(aq\fP
++forces a specific threading configuration.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBeq[=gamma:contrast:brightness:saturation:rg:gg:bg:weight]\fP
++Software equalizer that uses lookup tables (slow), allowing gamma correction
++in addition to simple brightness and contrast adjustment. The parameters are
++given as floating point values.
++.INDENT 7.0
++.TP
++.B \fB<0.1\-10>\fP
++initial gamma value (default: 1.0)
++.TP
++.B \fB<\-2\-2>\fP
++initial contrast, where negative values result in a negative image
++(default: 1.0)
++.TP
++.B \fB<\-1\-1>\fP
++initial brightness (default: 0.0)
++.TP
++.B \fB<0\-3>\fP
++initial saturation (default: 1.0)
++.TP
++.B \fB<0.1\-10>\fP
++gamma value for the red component (default: 1.0)
++.TP
++.B \fB<0.1\-10>\fP
++gamma value for the green component (default: 1.0)
++.TP
++.B \fB<0.1\-10>\fP
++gamma value for the blue component (default: 1.0)
++.TP
++.B \fB<0\-1>\fP
++The weight parameter can be used to reduce the effect of a high gamma
++value on bright image areas, e.g. keep them from getting overamplified
++and just plain white. A value of 0.0 turns the gamma correction all
++the way down while 1.0 leaves it at its full strength (default: 1.0).
++.UNINDENT
++.TP
++.B \fBpullup[=jl:jr:jt:jb:sb:mp]\fP
++Pulldown reversal (inverse telecine) filter, capable of handling mixed
++hard\-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
++content. The \fBpullup\fP filter makes use of future context in making its
++decisions. It is stateless in the sense that it does not lock onto a pattern
++to follow, but it instead looks forward to the following fields in order to
++identify matches and rebuild progressive frames.
++.INDENT 7.0
++.TP
++.B \fBjl\fP, \fBjr\fP, \fBjt\fP, and \fBjb\fP
++These options set the amount of "junk" to ignore at the left, right,
++top, and bottom of the image, respectively. Left/right are in units of
++8 pixels, while top/bottom are in units of 2 lines. The default is 8
++pixels on each side.
++.TP
++.B \fBsb\fP (strict breaks)
++Setting this option to 1 will reduce the chances of \fBpullup\fP
++generating an occasional mismatched frame, but it may also cause an
++excessive number of frames to be dropped during high motion sequences.
++Conversely, setting it to \-1 will make \fBpullup\fP match fields more
++easily. This may help process video with slight blurring between the
++fields, but may also cause interlaced frames in the output.
++.TP
++.B \fBmp\fP (metric plane)
++This option may be set to \fBu\fP or \fBv\fP to use a chroma plane instead of the
++luma plane for doing \fBpullup\fP\(aqs computations. This may improve accuracy
++on very clean source material, but more likely will decrease accuracy,
++especially if there is chroma noise (rainbow effect) or any grayscale
++video. The main purpose of setting \fBmp\fP to a chroma plane is to reduce
++CPU load and make pullup usable in realtime on slow machines.
++.UNINDENT
++.TP
++.B \fByadif=[mode:interlaced\-only]\fP
++Yet another deinterlacing filter
++.INDENT 7.0
++.TP
++.B \fB<mode>\fP
++.INDENT 7.0
++.TP
++.B frame
++Output 1 frame for each frame.
++.TP
++.B field
++Output 1 frame for each field (default).
++.TP
++.B frame\-nospatial
++Like \fBframe\fP but skips spatial interlacing check.
++.TP
++.B field\-nospatial
++Like \fBfield\fP but skips spatial interlacing check.
++.UNINDENT
++.TP
++.B \fB<interlaced\-only>\fP
++.INDENT 7.0
++.TP
++.B no
++Deinterlace all frames.
++.TP
++.B yes
++Only deinterlace frames marked as interlaced (default).
++.UNINDENT
++.UNINDENT
++.sp
++This filter is automatically inserted when using the \fBd\fP key (or any
++other key that toggles the \fBdeinterlace\fP property or when using the
++\fB\-\-deinterlace\fP switch), assuming the video output does not have native
++deinterlacing support.
++.sp
++If you just want to set the default mode, put this filter and its options
++into \fB\-\-vf\-defaults\fP instead, and enable deinterlacing with \fBd\fP or
++\fB\-\-deinterlace\fP\&.
++.sp
++Also, note that the \fBd\fP key is stupid enough to insert a deinterlacer twice
++when inserting yadif with \fB\-\-vf\fP, so using the above methods is
++recommended.
++.TP
++.B \fBsub=[=bottom\-margin:top\-margin]\fP
++Moves subtitle rendering to an arbitrary point in the filter chain, or force
++subtitle rendering in the video filter as opposed to using video output OSD
++support.
++.INDENT 7.0
++.TP
++.B \fB<bottom\-margin>\fP
++Adds a black band at the bottom of the frame. The SSA/ASS renderer can
++place subtitles there (with \fB\-\-sub\-use\-margins\fP).
++.TP
++.B \fB<top\-margin>\fP
++Black band on the top for toptitles (with \fB\-\-sub\-use\-margins\fP).
++.UNINDENT
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fB\-\-vf=sub,eq\fP
++Moves sub rendering before the eq filter. This will put both
++subtitle colors and video under the influence of the video equalizer
++settings.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBstereo3d[=in:out]\fP
++Stereo3d converts between different stereoscopic image formats.
++.INDENT 7.0
++.TP
++.B \fB<in>\fP
++Stereoscopic image format of input. Possible values:
++.INDENT 7.0
++.TP
++.B \fBsbsl\fP or \fBside_by_side_left_first\fP
++side by side parallel (left eye left, right eye right)
++.TP
++.B \fBsbsr\fP or \fBside_by_side_right_first\fP
++side by side crosseye (right eye left, left eye right)
++.TP
++.B \fBabl\fP or \fBabove_below_left_first\fP
++above\-below (left eye above, right eye below)
++.TP
++.B \fBabr\fP or \fBabove_below_right_first\fP
++above\-below (right eye above, left eye below)
++.TP
++.B \fBab2l\fP or \fBabove_below_half_height_left_first\fP
++above\-below with half height resolution (left eye above, right eye
++below)
++.TP
++.B \fBab2r\fP or \fBabove_below_half_height_right_first\fP
++above\-below with half height resolution (right eye above, left eye
++below)
++.UNINDENT
++.TP
++.B \fB<out>\fP
++Stereoscopic image format of output. Possible values are all the input
++formats as well as:
++.INDENT 7.0
++.TP
++.B \fBarcg\fP or \fBanaglyph_red_cyan_gray\fP
++anaglyph red/cyan gray (red filter on left eye, cyan filter on
++right eye)
++.TP
++.B \fBarch\fP or \fBanaglyph_red_cyan_half_color\fP
++anaglyph red/cyan half colored (red filter on left eye, cyan filter
++on right eye)
++.TP
++.B \fBarcc\fP or \fBanaglyph_red_cyan_color\fP
++anaglyph red/cyan color (red filter on left eye, cyan filter on
++right eye)
++.TP
++.B \fBarcd\fP or \fBanaglyph_red_cyan_dubois\fP
++anaglyph red/cyan color optimized with the least\-squares
++projection of Dubois (red filter on left eye, cyan filter on right
++eye)
++.TP
++.B \fBagmg\fP or \fBanaglyph_green_magenta_gray\fP
++anaglyph green/magenta gray (green filter on left eye, magenta
++filter on right eye)
++.TP
++.B \fBagmh\fP or \fBanaglyph_green_magenta_half_color\fP
++anaglyph green/magenta half colored (green filter on left eye,
++magenta filter on right eye)
++.TP
++.B \fBagmc\fP or \fBanaglyph_green_magenta_color\fP
++anaglyph green/magenta colored (green filter on left eye, magenta
++filter on right eye)
++.TP
++.B \fBaybg\fP or \fBanaglyph_yellow_blue_gray\fP
++anaglyph yellow/blue gray (yellow filter on left eye, blue filter
++on right eye)
++.TP
++.B \fBaybh\fP or \fBanaglyph_yellow_blue_half_color\fP
++anaglyph yellow/blue half colored (yellow filter on left eye, blue
++filter on right eye)
++.TP
++.B \fBaybc\fP or \fBanaglyph_yellow_blue_color\fP
++anaglyph yellow/blue colored (yellow filter on left eye, blue
++filter on right eye)
++.TP
++.B \fBirl\fP or \fBinterleave_rows_left_first\fP
++Interleaved rows (left eye has top row, right eye starts on next
++row)
++.TP
++.B \fBirr\fP or \fBinterleave_rows_right_first\fP
++Interleaved rows (right eye has top row, left eye starts on next
++row)
++.TP
++.B \fBml\fP or \fBmono_left\fP
++mono output (left eye only)
++.TP
++.B \fBmr\fP or \fBmono_right\fP
++mono output (right eye only)
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBgradfun[=strength[:radius|:size=<size>]]\fP
++Fix the banding artifacts that are sometimes introduced into nearly flat
++regions by truncation to 8\-bit color depth. Interpolates the gradients that
++should go where the bands are, and dithers them.
++.INDENT 7.0
++.TP
++.B \fB<strength>\fP
++Maximum amount by which the filter will change any one pixel. Also the
++threshold for detecting nearly flat regions (default: 1.5).
++.TP
++.B \fB<radius>\fP
++Neighborhood to fit the gradient to. Larger radius makes for smoother
++gradients, but also prevents the filter from modifying pixels near
++detailed regions (default: disabled).
++.TP
++.B \fB<size>\fP
++size of the filter in percent of the image diagonal size. This is
++used to calculate the final radius size (default: 1).
++.UNINDENT
++.TP
++.B \fBdlopen=dll[:a0[:a1[:a2[:a3]]]]\fP
++Loads an external library to filter the image. The library interface
++is the \fBvf_dlopen\fP interface specified using \fBlibmpcodecs/vf_dlopen.h\fP\&.
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++This filter is deprecated.
++.UNINDENT
++.UNINDENT
++.INDENT 7.0
++.TP
++.B \fBdll=<library>\fP
++Specify the library to load. This may require a full file system path
++in some cases. This argument is required.
++.TP
++.B \fBa0=<string>\fP
++Specify the first parameter to pass to the library.
++.TP
++.B \fBa1=<string>\fP
++Specify the second parameter to pass to the library.
++.TP
++.B \fBa2=<string>\fP
++Specify the third parameter to pass to the library.
++.TP
++.B \fBa3=<string>\fP
++Specify the fourth parameter to pass to the library.
++.UNINDENT
++.TP
++.B \fBvapoursynth=file:buffered\-frames:concurrent\-frames\fP
++Loads a VapourSynth filter script. This is intended for streamed
++processing: mpv actually provides a source filter, instead of using a
++native VapourSynth video source. The mpv source will answer frame
++requests only within a small window of frames (the size of this window
++is controlled with the \fBbuffered\-frames\fP parameter), and requests outside
++of that will return errors. As such, you can\(aqt use the full power of
++VapourSynth, but you can use certain filters.
++.sp
++If you just want to play video generated by a VapourSynth (i.e. using
++a native VapourSynth video source), it\(aqs better to use \fBvspipe\fP and a
++FIFO to feed the video to mpv. The same applies if the filter script
++requires random frame access (see \fBbuffered\-frames\fP parameter).
++.sp
++This filter is experimental. If it turns out that it works well and is
++used, it will be ported to libavfilter. Otherwise, it will be just removed.
++.INDENT 7.0
++.TP
++.B \fBfile\fP
++Filename of the script source. Currently, this is always a python
++script. The variable \fBvideo_in\fP is set to the mpv video source,
++and it is expected that the script reads video from it. (Otherwise,
++mpv will decode no video, and the video packet queue will overflow,
++eventually leading to audio being stopped.) The script is also
++expected to pass through timestamps using the \fB_DurationNum\fP and
++\fB_DurationDen\fP frame properties.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example:"
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++import vapoursynth as vs
++core = vs.get_core()
++core.std.AddBorders(video_in, 10, 10, 20, 20).set_output()
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++\fBWARNING:\fP
++.INDENT 7.0
++.INDENT 3.5
++The script will be reloaded on every seek. This is done to reset
++the filter properly on discontinuities.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBbuffered\-frames\fP
++Maximum number of decoded video frames that should be buffered before
++the filter (default: 4). This specifies the maximum number of frames
++the script can request in reverse direction.
++E.g. if \fBbuffered\-frames=5\fP, and the script just requested frame 15,
++it can still request frame 10, but frame 9 is not available anymore.
++If it requests frame 30, mpv will decode 15 more frames, and keep only
++frames 25\-30.
++.sp
++The actual number of buffered frames also depends on the value of the
++\fBconcurrent\-frames\fP option. Currently, both option values are
++multiplied to get the final buffer size.
++.sp
++(Normally, VapourSynth source filters must provide random access, but
++mpv was made for playback, and does not provide frame\-exact random
++access. The way this video filter works is a compromise to make simple
++filters work anyway.)
++.TP
++.B \fBconcurrent\-frames\fP
++Number of frames that should be requested in parallel. The
++level of concurrency depends on the filter and how quickly mpv can
++decode video to feed the filter. This value should probably be
++proportional to the number of cores on your machine. Most time,
++making it higher than the number of cores can actually make it
++slower.
++.sp
++By default, this uses the special value \fBauto\fP, which sets the option
++to the number of detected logical CPU cores.
++.UNINDENT
++.sp
++The following variables are defined by mpv:
++.INDENT 7.0
++.TP
++.B \fBvideo_in\fP
++The mpv video source as vapoursynth clip. Note that this has no length
++set, which confuses many filters. Using \fBTrim\fP on the clip with a
++high dummy length can turn it into a finite clip.
++.TP
++.B \fBvideo_in_dw\fP, \fBvideo_in_dh\fP
++Display size of the video. Can be different from video size if the
++video does not use square pixels (e.g. DVD).
++.TP
++.B \fBcontainer_fps\fP
++FPS value as reported by file headers. This value can be wrong or
++completely broken (e.g. 0 or NaN). Even if the value is correct,
++if another filter changes the real FPS (by dropping or inserting
++frames), the value of this variable might not be useful. Note that
++the \fB\-\-fps\fP command line option overrides this value.
++.sp
++Useful for some filters which insist on having a FPS.
++.TP
++.B \fBdisplay_fps\fP
++Refresh rate of the current display. Note that this value can be 0.
++.UNINDENT
++.TP
++.B \fBvapoursynth\-lazy\fP
++The same as \fBvapoursynth\fP, but doesn\(aqt load Python scripts. Instead, a
++custom backend using Lua and the raw VapourSynth API is used. The syntax
++is completely different, and absolutely no convenience features are
++provided. There\(aqs no type checking either, and you can trigger crashes.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example:"
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++video_out = invoke("morpho", "Open", {clip = video_in})
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++The special variable \fBvideo_in\fP is the mpv video source, while the
++special variable \fBvideo_out\fP is used to read video from. The 1st argument
++is the plugin (queried with \fBgetPluginByNs\fP), the 2nd is the filter name,
++and the 3rd argument is a table with the arguments. Positional arguments
++are not supported. The types must match exactly. Since Lua is terrible and
++can\(aqt distinguish integers and floats, integer arguments must be prefixed
++with \fBi_\fP, in which case the prefix is removed and the argument is cast
++to an integer. Should the argument\(aqs name start with \fBi_\fP, you\(aqre out of
++luck.
++.sp
++Clips (VSNodeRef) are passed as light userdata, so trying to pass any
++other userdata type will result in hard crashes.
++.TP
++.B \fBvavpp\fP
++VA\-AP\-API video post processing. Works with \fB\-\-vo=vaapi\fP and \fB\-\-vo=opengl\fP
++only. Currently deinterlaces. This filter is automatically inserted if
++deinterlacing is requested (either using the \fBd\fP key, by default mapped to
++the command \fBcycle deinterlace\fP, or the \fB\-\-deinterlace\fP option).
++.INDENT 7.0
++.TP
++.B \fBdeint=<method>\fP
++Select the deinterlacing algorithm.
++.INDENT 7.0
++.TP
++.B no
++Don\(aqt perform deinterlacing.
++.TP
++.B first\-field
++Show only first field (going by \fB\-\-field\-dominance\fP).
++.TP
++.B bob
++bob deinterlacing (default).
++.TP
++.B weave, motion\-adaptive, motion\-compensated
++Advanced deinterlacing algorithms. Whether these actually work
++depends on the GPU hardware, the GPU drivers, driver bugs, and
++mpv bugs.
++.UNINDENT
++.TP
++.B \fB<interlaced\-only>\fP
++.INDENT 7.0
++.TP
++.B no
++Deinterlace all frames.
++.TP
++.B yes
++Only deinterlace frames marked as interlaced (default).
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBvdpaupp\fP
++VDPAU video post processing. Works with \fB\-\-vo=vdpau\fP and \fB\-\-vo=opengl\fP
++only. This filter is automatically inserted if deinterlacing is requested
++(either using the \fBd\fP key, by default mapped to the command
++\fBcycle deinterlace\fP, or the \fB\-\-deinterlace\fP option). When enabling
++deinterlacing, it is always preferred over software deinterlacer filters
++if the \fBvdpau\fP VO is used, and also if \fBopengl\fP is used and hardware
++decoding was activated at least once (i.e. vdpau was loaded).
++.INDENT 7.0
++.TP
++.B \fBsharpen=<\-1\-1>\fP
++For positive values, apply a sharpening algorithm to the video, for
++negative values a blurring algorithm (default: 0).
++.TP
++.B \fBdenoise=<0\-1>\fP
++Apply a noise reduction algorithm to the video (default: 0; no noise
++reduction).
++.TP
++.B \fBdeint=<yes|no>\fP
++Whether deinterlacing is enabled (default: no). If enabled, it will use
++the mode selected with \fBdeint\-mode\fP\&.
++.TP
++.B \fBdeint\-mode=<first\-field|bob|temporal|temporal\-spatial>\fP
++Select deinterlacing mode (default: temporal).
++All modes respect \fB\-\-field\-dominance\fP\&.
++.sp
++Note that there\(aqs currently a mechanism that allows the \fBvdpau\fP VO to
++change the \fBdeint\-mode\fP of auto\-inserted \fBvdpaupp\fP filters. To avoid
++confusion, it\(aqs recommended not to use the \fB\-\-vo=vdpau\fP suboptions
++related to filtering.
++.INDENT 7.0
++.TP
++.B first\-field
++Show only first field.
++.TP
++.B bob
++Bob deinterlacing.
++.TP
++.B temporal
++Motion\-adaptive temporal deinterlacing. May lead to A/V desync
++with slow video hardware and/or high resolution.
++.TP
++.B temporal\-spatial
++Motion\-adaptive temporal deinterlacing with edge\-guided spatial
++interpolation. Needs fast video hardware.
++.UNINDENT
++.TP
++.B \fBchroma\-deint\fP
++Makes temporal deinterlacers operate both on luma and chroma (default).
++Use no\-chroma\-deint to solely use luma and speed up advanced
++deinterlacing. Useful with slow video memory.
++.TP
++.B \fBpullup\fP
++Try to apply inverse telecine, needs motion adaptive temporal
++deinterlacing.
++.TP
++.B \fBinterlaced\-only=<yes|no>\fP
++If \fByes\fP (default), only deinterlace frames marked as interlaced.
++.TP
++.B \fBhqscaling=<0\-9>\fP
++.INDENT 7.0
++.TP
++.B 0
++Use default VDPAU scaling (default).
++.TP
++.B 1\-9
++Apply high quality VDPAU scaling (needs capable hardware).
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBvdpaurb\fP
++VDPAU video read back. Works with \fB\-\-vo=vdpau\fP and \fB\-\-vo=opengl\fP only.
++This filter will read back frames decoded by VDPAU so that other filters,
++which are not normally compatible with VDPAU, can be used like normal.
++This filter must be specified before \fBvdpaupp\fP in the filter chain if
++\fBvdpaupp\fP is used.
++.TP
++.B \fBd3d11vpp\fP
++Direct3D 11 video post processing. Currently requires D3D11 hardware
++decoding for use.
++.INDENT 7.0
++.TP
++.B \fBdeint=<yes|no>\fP
++Whether deinterlacing is enabled (default: no).
++.TP
++.B \fBinterlaced\-only=<yes|no>\fP
++If \fByes\fP (default), only deinterlace frames marked as interlaced.
++.UNINDENT
++.TP
++.B \fBbuffer=<num>\fP
++Buffer \fB<num>\fP frames in the filter chain. This filter is probably pretty
++useless, except for debugging. (Note that this won\(aqt help to smooth out
++latencies with decoding, because the filter will never output a frame if
++the buffer isn\(aqt full, except on EOF.)
++.UNINDENT
++.SH ENCODING
++.sp
++You can encode files from one format/codec to another using this facility.
++.INDENT 0.0
++.TP
++.B \fB\-\-o=<filename>\fP
++Enables encoding mode and specifies the output file name.
++.TP
++.B \fB\-\-of=<format>\fP
++Specifies the output format (overrides autodetection by the file name
++extension of the file specified by \fB\-o\fP). This can be a comma separated
++list of possible formats to try. See \fB\-\-of=help\fP for a full list of
++supported formats.
++.TP
++.B \fB\-\-ofopts=<options>\fP
++Specifies the output format options for libavformat.
++See \fB\-\-ofopts=help\fP for a full list of supported options.
++.sp
++Options are managed in lists. There are a few commands to manage the
++options list.
++.INDENT 7.0
++.TP
++.B \fB\-\-ofopts\-add=<options1[,options2,...]>\fP
++Appends the options given as arguments to the options list.
++.TP
++.B \fB\-\-ofopts\-pre=<options1[,options2,...]>\fP
++Prepends the options given as arguments to the options list.
++.TP
++.B \fB\-\-ofopts\-del=<index1[,index2,...]>\fP
++Deletes the options at the given indexes. Index numbers start at 0,
++negative numbers address the end of the list (\-1 is the last).
++.TP
++.B \fB\-\-ofopts\-clr\fP
++Completely empties the options list.
++.UNINDENT
++.TP
++.B \fB\-\-ofps=<float value>\fP
++Specifies the output format time base (default: 24000). Low values like 25
++limit video fps by dropping frames.
++.TP
++.B \fB\-\-oautofps\fP
++Sets the output format time base to the guessed frame rate of the input
++video (simulates MEncoder behavior, useful for AVI; may cause frame drops).
++Note that not all codecs and not all formats support VFR encoding, and some
++which do have bugs when a target bitrate is specified \- use \fB\-\-ofps\fP or
++\fB\-\-oautofps\fP to force CFR encoding in these cases.
++.TP
++.B \fB\-\-omaxfps=<float value>\fP
++Specifies the minimum distance of adjacent frames (default: 0, which means
++unset). Content of lower frame rate is not readjusted to this frame rate;
++content of higher frame rate is decimated to this frame rate.
++.TP
++.B \fB\-\-oharddup\fP
++If set, the frame rate given by \fB\-\-ofps\fP is attained not by skipping time
++codes, but by duplicating frames (constant frame rate mode).
++.TP
++.B \fB\-\-oneverdrop\fP
++If set, frames are never dropped. Instead, time codes of video are
++readjusted to always increase. This may cause AV desync, though; to work
++around this, use a high\-fps time base using \fB\-\-ofps\fP and absolutely
++avoid \fB\-\-oautofps\fP\&.
++.TP
++.B \fB\-\-oac=<codec>\fP
++Specifies the output audio codec. This can be a comma separated list of
++possible codecs to try. See \fB\-\-oac=help\fP for a full list of supported
++codecs.
++.TP
++.B \fB\-\-oaoffset=<value>\fP
++Shifts audio data by the given time (in seconds) by adding/removing
++samples at the start.
++.TP
++.B \fB\-\-oacopts=<options>\fP
++Specifies the output audio codec options for libavcodec.
++See \fB\-\-oacopts=help\fP for a full list of supported options.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.TP
++.B "\fB\-\-oac=libmp3lame \-\-oacopts=b=128000\fP"
++selects 128 kbps MP3 encoding.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Options are managed in lists. There are a few commands to manage the
++options list.
++.INDENT 7.0
++.TP
++.B \fB\-\-oacopts\-add=<options1[,options2,...]>\fP
++Appends the options given as arguments to the options list.
++.TP
++.B \fB\-\-oacopts\-pre=<options1[,options2,...]>\fP
++Prepends the options given as arguments to the options list.
++.TP
++.B \fB\-\-oacopts\-del=<index1[,index2,...]>\fP
++Deletes the options at the given indexes. Index numbers start at 0,
++negative numbers address the end of the list (\-1 is the last).
++.TP
++.B \fB\-\-oacopts\-clr\fP
++Completely empties the options list.
++.UNINDENT
++.TP
++.B \fB\-\-oafirst\fP
++Force the audio stream to become the first stream in the output.
++By default, the order is unspecified.
++.TP
++.B \fB\-\-ovc=<codec>\fP
++Specifies the output video codec. This can be a comma separated list of
++possible codecs to try. See \fB\-\-ovc=help\fP for a full list of supported
++codecs.
++.TP
++.B \fB\-\-ovoffset=<value>\fP
++Shifts video data by the given time (in seconds) by shifting the pts
++values.
++.TP
++.B \fB\-\-ovcopts <options>\fP
++Specifies the output video codec options for libavcodec.
++See \-\-ovcopts=help for a full list of supported options.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.TP
++.B \fB"\-\-ovc=mpeg4 \-\-ovcopts=qscale=5"\fP
++selects constant quantizer scale 5 for MPEG\-4 encoding.
++.TP
++.B \fB"\-\-ovc=libx264 \-\-ovcopts=crf=23"\fP
++selects VBR quality factor 23 for H.264 encoding.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Options are managed in lists. There are a few commands to manage the
++options list.
++.INDENT 7.0
++.TP
++.B \fB\-\-ovcopts\-add=<options1[,options2,...]>\fP
++Appends the options given as arguments to the options list.
++.TP
++.B \fB\-\-ovcopts\-pre=<options1[,options2,...]>\fP
++Prepends the options given as arguments to the options list.
++.TP
++.B \fB\-\-ovcopts\-del=<index1[,index2,...]>\fP
++Deletes the options at the given indexes. Index numbers start at 0,
++negative numbers address the end of the list (\-1 is the last).
++.TP
++.B \fB\-\-ovcopts\-clr\fP
++Completely empties the options list.
++.UNINDENT
++.TP
++.B \fB\-\-ovfirst\fP
++Force the video stream to become the first stream in the output.
++By default, the order is unspecified.
++.TP
++.B \fB\-\-ocopyts\fP
++Copies input pts to the output video (not supported by some output
++container formats, e.g. AVI). Discontinuities are still fixed.
++By default, audio pts are set to playback time and video pts are
++synchronized to match audio pts, as some output formats do not support
++anything else.
++.TP
++.B \fB\-\-orawts\fP
++Copies input pts to the output video (not supported by some output
++container formats, e.g. AVI). In this mode, discontinuities are not fixed
++and all pts are passed through as\-is. Never seek backwards or use multiple
++input files in this mode!
++.TP
++.B \fB\-\-no\-ometadata\fP
++Turns off copying of metadata from input files to output files when
++encoding (which is enabled by default).
++.UNINDENT
++.SH COMMAND INTERFACE
++.sp
++The mpv core can be controlled with commands and properties. A number of ways
++to interact with the player use them: key bindings (\fBinput.conf\fP), OSD
++(showing information with properties), JSON IPC, the client API (\fBlibmpv\fP),
++and the classic slave mode.
++.SS input.conf
++.sp
++The input.conf file consists of a list of key bindings, for example:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++s screenshot # take a screenshot with the s key
++LEFT seek 15 # map the left\-arrow key to seeking forward by 15 seconds
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Each line maps a key to an input command. Keys are specified with their literal
++value (upper case if combined with \fBShift\fP), or a name for special keys. For
++example, \fBa\fP maps to the \fBa\fP key without shift, and \fBA\fP maps to \fBa\fP
++with shift.
++.sp
++The file is located in the mpv configuration directory (normally at
++\fB~/.config/mpv/input.conf\fP depending on platform). The default bindings are
++defined here:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++https://github.com/mpv\-player/mpv/blob/master/etc/input.conf
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++A list of special keys can be obtained with
++.INDENT 0.0
++.INDENT 3.5
++\fBmpv \-\-input\-keylist\fP
++.UNINDENT
++.UNINDENT
++.sp
++In general, keys can be combined with \fBShift\fP, \fBCtrl\fP and \fBAlt\fP:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++ctrl+q quit
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++\fBmpv\fP can be started in input test mode, which displays key bindings and the
++commands they\(aqre bound to on the OSD, instead of executing the commands:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv \-\-input\-test \-\-force\-window \-\-idle
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++(Only closing the window will make \fBmpv\fP exit, pressing normal keys will
++merely display the binding, even if mapped to quit.)
++.SS General Input Command Syntax
++.sp
++\fB[Shift+][Ctrl+][Alt+][Meta+]<key> [{<section>}] [<prefixes>] <command> (<argument>)* [; <command>]\fP
++.sp
++Note that by default, the right Alt key can be used to create special
++characters, and thus does not register as a modifier. The option
++\fB\-\-no\-input\-right\-alt\-gr\fP changes this behavior.
++.sp
++Newlines always start a new binding. \fB#\fP starts a comment (outside of quoted
++string arguments). To bind commands to the \fB#\fP key, \fBSHARP\fP can be used.
++.sp
++\fB<key>\fP is either the literal character the key produces (ASCII or Unicode
++character), or a symbolic name (as printed by \fB\-\-input\-keylist\fP).
++.sp
++\fB<section>\fP (braced with \fB{\fP and \fB}\fP) is the input section for this
++command.
++.sp
++Arguments are separated by whitespace. This applies even to string arguments.
++For this reason, string arguments should be quoted with \fB"\fP\&. Inside quotes,
++C\-style escaping can be used.
++.sp
++You can bind multiple commands to one key. For example:
++.nf
++a show\-text "command 1" ; show\-text "command 2"
++.fi
++.sp
++.sp
++It\(aqs also possible to bind a command to a sequence of keys:
++.nf
++a\-b\-c show\-text "command run after a, b, c have been pressed"
++.fi
++.sp
++.sp
++(This is not shown in the general command syntax.)
++.sp
++If \fBa\fP or \fBa\-b\fP or \fBb\fP are already bound, this will run the first command
++that matches, and the multi\-key command will never be called. Intermediate keys
++can be remapped to \fBignore\fP in order to avoid this issue. The maximum number
++of (non\-modifier) keys for combinations is currently 4.
++.SS List of Input Commands
++.INDENT 0.0
++.TP
++.B \fBignore\fP
++Use this to "block" keys that should be unbound, and do nothing. Useful for
++disabling default bindings, without disabling all bindings with
++\fB\-\-no\-input\-default\-bindings\fP\&.
++.TP
++.B \fBseek <seconds> [relative|absolute|absolute\-percent|relative\-percent|exact|keyframes]\fP
++Change the playback position. By default, seeks by a relative amount of
++seconds.
++.sp
++The second argument consists of flags controlling the seek mode:
++.INDENT 7.0
++.TP
++.B relative (default)
++Seek relative to current position (a negative value seeks backwards).
++.TP
++.B absolute
++Seek to a given time.
++.TP
++.B absolute\-percent
++Seek to a given percent position.
++.TP
++.B relative\-percent
++Seek relative to current position in percent.
++.TP
++.B keyframes
++Always restart playback at keyframe boundaries (fast).
++.TP
++.B exact
++Always do exact/hr/precise seeks (slow).
++.UNINDENT
++.sp
++Multiple flags can be combined, e.g.: \fBabsolute+keyframes\fP\&.
++.sp
++By default, \fBkeyframes\fP is used for relative seeks, and \fBexact\fP is used
++for absolute seeks.
++.sp
++Before mpv 0.9, the \fBkeyframes\fP and \fBexact\fP flags had to be passed as
++3rd parameter (essentially using a space instead of \fB+\fP). The 3rd
++parameter is still parsed, but is considered deprecated.
++.TP
++.B \fBrevert\-seek [mode]\fP
++Undoes the \fBseek\fP command, and some other commands that seek (but not
++necessarily all of them). Calling this command once will jump to the
++playback position before the seek. Calling it a second time undoes the
++\fBrevert\-seek\fP command itself. This only works within a single file.
++.sp
++The first argument is optional, and can change the behavior:
++.INDENT 7.0
++.TP
++.B mark
++Mark the current time position. The next normal \fBrevert\-seek\fP command
++will seek back to this point, no matter how many seeks happened since
++last time.
++.UNINDENT
++.sp
++Using it without any arguments gives you the default behavior.
++.TP
++.B \fBframe\-step\fP
++Play one frame, then pause. Does nothing with audio\-only playback.
++.TP
++.B \fBframe\-back\-step\fP
++Go back by one frame, then pause. Note that this can be very slow (it tries
++to be precise, not fast), and sometimes fails to behave as expected. How
++well this works depends on whether precise seeking works correctly (e.g.
++see the \fB\-\-hr\-seek\-demuxer\-offset\fP option). Video filters or other video
++post\-processing that modifies timing of frames (e.g. deinterlacing) should
++usually work, but might make backstepping silently behave incorrectly in
++corner cases. Using \fB\-\-hr\-seek\-framedrop=no\fP should help, although it
++might make precise seeking slower.
++.sp
++This does not work with audio\-only playback.
++.TP
++.B \fBset <property> "<value>"\fP
++Set the given property to the given value.
++.TP
++.B \fBadd <property> [<value>]\fP
++Add the given value to the property. On overflow or underflow, clamp the
++property to the maximum. If \fB<value>\fP is omitted, assume \fB1\fP\&.
++.TP
++.B \fBcycle <property> [up|down]\fP
++Cycle the given property. \fBup\fP and \fBdown\fP set the cycle direction. On
++overflow, set the property back to the minimum, on underflow set it to the
++maximum. If \fBup\fP or \fBdown\fP is omitted, assume \fBup\fP\&.
++.TP
++.B \fBmultiply <property> <factor>\fP
++Multiplies the value of a property with the numeric factor.
++.TP
++.B \fBscreenshot [subtitles|video|window|\- [single|each\-frame]]\fP
++Take a screenshot.
++.sp
++First argument:
++.INDENT 7.0
++.TP
++.B <subtitles> (default)
++Save the video image, in its original resolution, and with subtitles.
++Some video outputs may still include the OSD in the output under certain
++circumstances.
++.TP
++.B <video>
++Like \fBsubtitles\fP, but typically without OSD or subtitles. The exact
++behavior depends on the selected video output.
++.TP
++.B <window>
++Save the contents of the mpv window. Typically scaled, with OSD and
++subtitles. The exact behavior depends on the selected video output, and
++if no support is available, this will act like \fBvideo\fP\&.
++.TP
++.B <each\-frame>
++Take a screenshot each frame. Issue this command again to stop taking
++screenshots. Note that you should disable frame\-dropping when using
++this mode \- or you might receive duplicate images in cases when a
++frame was dropped. This flag can be combined with the other flags,
++e.g. \fBvideo+each\-frame\fP\&.
++.UNINDENT
++.TP
++.B \fBscreenshot\-to\-file "<filename>" [subtitles|video|window]\fP
++Take a screenshot and save it to a given file. The format of the file will
++be guessed by the extension (and \fB\-\-screenshot\-format\fP is ignored \- the
++behavior when the extension is missing or unknown is arbitrary).
++.sp
++The second argument is like the first argument to \fBscreenshot\fP\&.
++.sp
++If the file already exists, it\(aqs overwritten.
++.sp
++Like all input command parameters, the filename is subject to property
++expansion as described in \fI\%Property Expansion\fP\&.
++.TP
++.B \fBplaylist\-next [weak|force]\fP
++Go to the next entry on the playlist.
++.INDENT 7.0
++.TP
++.B weak (default)
++If the last file on the playlist is currently played, do nothing.
++.TP
++.B force
++Terminate playback if there are no more files on the playlist.
++.UNINDENT
++.TP
++.B \fBplaylist\-prev [weak|force]\fP
++Go to the previous entry on the playlist.
++.INDENT 7.0
++.TP
++.B weak (default)
++If the first file on the playlist is currently played, do nothing.
++.TP
++.B force
++Terminate playback if the first file is being played.
++.UNINDENT
++.TP
++.B \fBloadfile "<file>" [replace|append|append\-play [options]]\fP
++Load the given file and play it.
++.sp
++Second argument:
++.INDENT 7.0
++.TP
++.B <replace> (default)
++Stop playback of the current file, and play the new file immediately.
++.TP
++.B <append>
++Append the file to the playlist.
++.TP
++.B <append\-play>
++Append the file, and if nothing is currently playing, start playback.
++(Always starts with the added file, even if the playlist was not empty
++before running this command.)
++.UNINDENT
++.sp
++The third argument is a list of options and values which should be set
++while the file is playing. It is of the form \fBopt1=value1,opt2=value2,..\fP\&.
++Not all options can be changed this way. Some options require a restart
++of the player.
++.TP
++.B \fBloadlist "<playlist>" [replace|append]\fP
++Load the given playlist file (like \fB\-\-playlist\fP).
++.TP
++.B \fBplaylist\-clear\fP
++Clear the playlist, except the currently played file.
++.TP
++.B \fBplaylist\-remove current|<index>\fP
++Remove the playlist entry at the given index. Index values start counting
++with 0. The special value \fBcurrent\fP removes the current entry. Note that
++removing the current entry also stops playback and starts playing the next
++entry.
++.TP
++.B \fBplaylist\-move <index1> <index2>\fP
++Move the playlist entry at index1, so that it takes the place of the
++entry index2. (Paradoxically, the moved playlist entry will not have
++the index value index2 after moving if index1 was lower than index2,
++because index2 refers to the target entry, not the index the entry
++will have after moving.)
++.TP
++.B \fBplaylist\-shuffle\fP
++Shuffle the playlist. This is similar to what is done on start if the
++\fB\-\-shuffle\fP option is used.
++.TP
++.B \fBrun "command" "arg1" "arg2" ...\fP
++Run the given command. Unlike in MPlayer/mplayer2 and earlier versions of
++mpv (0.2.x and older), this doesn\(aqt call the shell. Instead, the command
++is run directly, with each argument passed separately. Each argument is
++expanded like in \fI\%Property Expansion\fP\&. Note that there is a static limit
++of (as of this writing) 9 arguments (this limit could be raised on demand).
++.sp
++The program is run in a detached way. mpv doesn\(aqt wait until the command
++is completed, but continues playback right after spawning it.
++.sp
++To get the old behavior, use \fB/bin/sh\fP and \fB\-c\fP as the first two
++arguments.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++\fBrun "/bin/sh" "\-c" "echo ${title} > /tmp/playing"\fP
++.sp
++This is not a particularly good example, because it doesn\(aqt handle
++escaping, and a specially prepared file might allow an attacker to
++execute arbitrary shell commands. It is recommended to write a small
++shell script, and call that with \fBrun\fP\&.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBquit [<code>]\fP
++Exit the player. If an argument is given, it\(aqs used as process exit code.
++.TP
++.B \fBquit\-watch\-later [<code>]\fP
++Exit player, and store current playback position. Playing that file later
++will seek to the previous position on start. The (optional) argument is
++exactly as in the \fBquit\fP command.
++.TP
++.B \fBsub\-add "<file>" [<flags> [<title> [<lang>]]]\fP
++Load the given subtitle file. It is selected as current subtitle after
++loading.
++.sp
++The \fBflags\fP args is one of the following values:
++.sp
++<select>
++.INDENT 7.0
++.INDENT 3.5
++Select the subtitle immediately.
++.UNINDENT
++.UNINDENT
++.sp
++<auto>
++.INDENT 7.0
++.INDENT 3.5
++Don\(aqt select the subtitle. (Or in some special situations, let the
++default stream selection mechanism decide.)
++.UNINDENT
++.UNINDENT
++.sp
++<cached>
++.INDENT 7.0
++.INDENT 3.5
++Select the subtitle. If a subtitle with the same filename was already
++added, that one is selected, instead of loading a duplicate entry.
++(In this case, title/language are ignored, and if the was changed since
++it was loaded, these changes won\(aqt be reflected.)
++.UNINDENT
++.UNINDENT
++.sp
++The \fBtitle\fP argument sets the track title in the UI.
++.sp
++The \fBlang\fP argument sets the track language, and can also influence
++stream selection with \fBflags\fP set to \fBauto\fP\&.
++.TP
++.B \fBsub\-remove [<id>]\fP
++Remove the given subtitle track. If the \fBid\fP argument is missing, remove
++the current track. (Works on external subtitle files only.)
++.TP
++.B \fBsub\-reload [<id>]\fP
++Reload the given subtitle tracks. If the \fBid\fP argument is missing, reload
++the current track. (Works on external subtitle files only.)
++.sp
++This works by unloading and re\-adding the subtitle track.
++.TP
++.B \fBsub\-step <skip>\fP
++Change subtitle timing such, that the subtitle event after the next
++\fB<skip>\fP subtitle events is displayed. \fB<skip>\fP can be negative to step
++backwards.
++.TP
++.B \fBsub\-seek <skip>\fP
++Seek to the next (skip set to 1) or the previous (skip set to \-1) subtitle.
++This is similar to \fBsub\-step\fP, except that it seeks video and audio
++instead of adjusting the subtitle delay.
++.sp
++For embedded subtitles (like with Matroska), this works only with subtitle
++events that have already been displayed, or are within a short prefetch
++range.
++.TP
++.B \fBosd [<level>]\fP
++Toggle OSD level. If \fB<level>\fP is specified, set the OSD mode
++(see \fB\-\-osd\-level\fP for valid values).
++.TP
++.B \fBprint\-text "<string>"\fP
++Print text to stdout. The string can contain properties (see
++\fI\%Property Expansion\fP).
++.TP
++.B \fBshow\-text "<string>" [<duration>|\- [<level>]]\fP
++Show text on the OSD. The string can contain properties, which are expanded
++as described in \fI\%Property Expansion\fP\&. This can be used to show playback
++time, filename, and so on.
++.INDENT 7.0
++.TP
++.B <duration>
++The time in ms to show the message for. By default, it uses the same
++value as \fB\-\-osd\-duration\fP\&.
++.TP
++.B <level>
++The minimum OSD level to show the text at (see \fB\-\-osd\-level\fP).
++.UNINDENT
++.TP
++.B \fBshow\-progress\fP
++Show the progress bar, the elapsed time and the total duration of the file
++on the OSD.
++.TP
++.B \fBwrite\-watch\-later\-config\fP
++Write the resume config file that the \fBquit\-watch\-later\fP command writes,
++but continue playback normally.
++.TP
++.B \fBstop\fP
++Stop playback and clear playlist. With default settings, this is
++essentially like \fBquit\fP\&. Useful for the client API: playback can be
++stopped without terminating the player.
++.TP
++.B \fBmouse <x> <y> [<button> [single|double]]\fP
++Send a mouse event with given coordinate (\fB<x>\fP, \fB<y>\fP).
++.sp
++Second argument:
++.INDENT 7.0
++.TP
++.B <button>
++The button number of clicked mouse button. This should be one of 0\-19.
++If \fB<button>\fP is omitted, only the position will be updated.
++.UNINDENT
++.sp
++Third argument:
++.INDENT 7.0
++.TP
++.B <single> (default)
++The mouse event represents regular single click.
++.TP
++.B <double>
++The mouse event represents double\-click.
++.UNINDENT
++.TP
++.B \fBkeypress <key_name>\fP
++Send a key event through mpv\(aqs input handler, triggering whatever
++behavior is configured to that key. \fBkey_name\fP uses the \fBinput.conf\fP
++naming scheme for keys and modifiers. Useful for the client API: key events
++can be sent to libmpv to handle internally.
++.TP
++.B \fBkeydown <key_name>\fP
++Similar to \fBkeypress\fP, but sets the \fBKEYDOWN\fP flag so that if the key is
++bound to a repeatable command, it will be run repeatedly with mpv\(aqs key
++repeat timing until the \fBkeyup\fP command is called.
++.TP
++.B \fBkeyup [<key_name>]\fP
++Set the \fBKEYUP\fP flag, stopping any repeated behavior that had been
++triggered. \fBkey_name\fP is optional. If \fBkey_name\fP is not given or is an
++empty string, \fBKEYUP\fP will be set on all keys. Otherwise, \fBKEYUP\fP will
++only be set on the key specified by \fBkey_name\fP\&.
++.TP
++.B \fBaudio\-add "<file>" [<flags> [<title> [<lang>]]]\fP
++Load the given audio file. See \fBsub\-add\fP command.
++.TP
++.B \fBaudio\-remove [<id>]\fP
++Remove the given audio track. See \fBsub\-remove\fP command.
++.TP
++.B \fBaudio\-reload [<id>]\fP
++Reload the given audio tracks. See \fBsub\-reload\fP command.
++.TP
++.B \fBrescan\-external\-files [<mode>]\fP
++Rescan external files according to the current \fB\-\-sub\-auto\fP and
++\fB\-\-audio\-file\-auto\fP settings. This can be used to auto\-load external
++files \fIafter\fP the file was loaded.
++.sp
++The \fBmode\fP argument is one of the following:
++.INDENT 7.0
++.TP
++.B <reselect> (default)
++Select the default audio and subtitle streams, which typically selects
++external files with the highest preference. (The implementation is not
++perfect, and could be improved on request.)
++.TP
++.B <keep\-selection>
++Do not change current track selections.
++.UNINDENT
++.UNINDENT
++.SS Input Commands that are Possibly Subject to Change
++.INDENT 0.0
++.TP
++.B \fBaf set|add|toggle|del|clr "filter1=params,filter2,..."\fP
++Change audio filter chain. See \fBvf\fP command.
++.TP
++.B \fBvf set|add|toggle|del|clr "filter1=params,filter2,..."\fP
++Change video filter chain.
++.sp
++The first argument decides what happens:
++.INDENT 7.0
++.TP
++.B set
++Overwrite the previous filter chain with the new one.
++.TP
++.B add
++Append the new filter chain to the previous one.
++.TP
++.B toggle
++Check if the given filter (with the exact parameters) is already
++in the video chain. If yes, remove the filter. If no, add the filter.
++(If several filters are passed to the command, this is done for
++each filter.)
++.TP
++.B del
++Remove the given filters from the video chain. Unlike in the other
++cases, the second parameter is a comma separated list of filter names
++or integer indexes. \fB0\fP would denote the first filter. Negative
++indexes start from the last filter, and \fB\-1\fP denotes the last
++filter.
++.TP
++.B clr
++Remove all filters. Note that like the other sub\-commands, this does
++not control automatically inserted filters.
++.UNINDENT
++.sp
++You can assign labels to filter by prefixing them with \fB@name:\fP (where
++\fBname\fP is a user\-chosen arbitrary identifier). Labels can be used to
++refer to filters by name in all of the filter chain modification commands.
++For \fBadd\fP, using an already used label will replace the existing filter.
++.sp
++The \fBvf\fP command shows the list of requested filters on the OSD after
++changing the filter chain. This is roughly equivalent to
++\fBshow\-text ${vf}\fP\&. Note that auto\-inserted filters for format conversion
++are not shown on the list, only what was requested by the user.
++.sp
++Normally, the commands will check whether the video chain is recreated
++successfully, and will undo the operation on failure. If the command is run
++before video is configured (can happen if the command is run immediately
++after opening a file and before a video frame is decoded), this check can\(aqt
++be run. Then it can happen that creating the video chain fails.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example for input.conf"
++.INDENT 0.0
++.IP \(bu 2
++\fBa vf set flip\fP turn video upside\-down on the \fBa\fP key
++.IP \(bu 2
++\fBb vf set ""\fP remove all video filters on \fBb\fP
++.IP \(bu 2
++\fBc vf toggle lavfi=gradfun\fP toggle debanding on \fBc\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBcycle\-values ["!reverse"] <property> "<value1>" "<value2>" ...\fP
++Cycle through a list of values. Each invocation of the command will set the
++given property to the next value in the list. The command maintains an
++internal counter which value to pick next, and which is initially 0. It is
++reset to 0 once the last value is reached.
++.sp
++The internal counter is associated using the property name and the value
++list. If multiple commands (bound to different keys) use the same name
++and value list, they will share the internal counter.
++.sp
++The special argument \fB!reverse\fP can be used to cycle the value list in
++reverse. Compared with a command that just lists the value in reverse, this
++command will actually share the internal counter with the forward\-cycling
++key binding (as long as the rest of the arguments are the same).
++.sp
++Note that there is a static limit of (as of this writing) 10 arguments
++(this limit could be raised on demand).
++.TP
++.B \fBenable\-section "<section>" [flags]\fP
++Enable all key bindings in the named input section.
++.sp
++The enabled input sections form a stack. Bindings in sections on the top of
++the stack are preferred to lower sections. This command puts the section
++on top of the stack. If the section was already on the stack, it is
++implicitly removed beforehand. (A section cannot be on the stack more than
++once.)
++.sp
++The \fBflags\fP parameter can be a combination (separated by \fB+\fP) of the
++following flags:
++.INDENT 7.0
++.TP
++.B <exclusive>
++All sections enabled before the newly enabled section are disabled.
++They will be re\-enabled as soon as all exclusive sections above them
++are removed. In other words, the new section shadows all previous
++sections.
++.TP
++.B <allow\-hide\-cursor>
++This feature can\(aqt be used through the public API.
++.TP
++.B <allow\-vo\-dragging>
++Same.
++.UNINDENT
++.TP
++.B \fBdisable\-section "<section>"\fP
++Disable the named input section. Undoes \fBenable\-section\fP\&.
++.TP
++.B \fBdefine\-section "<section>" "<contents>" [default|forced]\fP
++Create a named input section, or replace the contents of an already existing
++input section. The \fBcontents\fP parameter uses the same syntax as the
++\fBinput.conf\fP file (except that using the section syntax in it is not
++allowed), including the need to separate bindings with a newline character.
++.sp
++If the \fBcontents\fP parameter is an empty string, the section is removed.
++.sp
++The section with the name \fBdefault\fP is the normal input section.
++.sp
++In general, input sections have to be enabled with the \fBenable\-section\fP
++command, or they are ignored.
++.sp
++The last parameter has the following meaning:
++.INDENT 7.0
++.TP
++.B <default> (also used if parameter omitted)
++Use a key binding defined by this section only if the user hasn\(aqt
++already bound this key to a command.
++.TP
++.B <forced>
++Always bind a key. (The input section that was made active most recently
++wins if there are ambiguities.)
++.UNINDENT
++.sp
++This command can be used to dispatch arbitrary keys to a script or a client
++API user. If the input section defines \fBscript\-binding\fP commands, it is
++also possible to get separate events on key up/down, and relatively detailed
++information about the key state. The special key name \fBunmapped\fP can be
++used to match any unmapped key.
++.TP
++.B \fBoverlay\-add <id> <x> <y> "<file>" <offset> "<fmt>" <w> <h> <stride>\fP
++Add an OSD overlay sourced from raw data. This might be useful for scripts
++and applications controlling mpv, and which want to display things on top
++of the video window.
++.sp
++Overlays are usually displayed in screen resolution, but with some VOs,
++the resolution is reduced to that of the video\(aqs. You can read the
++\fBosd\-width\fP and \fBosd\-height\fP properties. At least with \fB\-\-vo\-xv\fP and
++anamorphic video (such as DVD), \fBosd\-par\fP should be read as well, and the
++overlay should be aspect\-compensated. (Future directions: maybe mpv should
++take care of some of these things automatically, but it\(aqs hard to tell
++where to draw the line.)
++.sp
++\fBid\fP is an integer between 0 and 63 identifying the overlay element. The
++ID can be used to add multiple overlay parts, update a part by using this
++command with an already existing ID, or to remove a part with
++\fBoverlay\-remove\fP\&. Using a previously unused ID will add a new overlay,
++while reusing an ID will update it. (Future directions: there should be
++something to ensure different programs wanting to create overlays don\(aqt
++conflict with each others, should that ever be needed.)
++.sp
++\fBx\fP and \fBy\fP specify the position where the OSD should be displayed.
++.sp
++\fBfile\fP specifies the file the raw image data is read from. It can be
++either a numeric UNIX file descriptor prefixed with \fB@\fP (e.g. \fB@4\fP),
++or a filename. The file will be mapped into memory with \fBmmap()\fP\&. Some VOs
++will pass the mapped pointer directly to display APIs (e.g. opengl or
++vdpau), so no actual copying is involved. Truncating the source file while
++the overlay is active will crash the player. You shouldn\(aqt change the data
++while the overlay is active, because the data is essentially accessed at
++random points. Instead, call \fBoverlay\-add\fP again (preferably with a
++different memory region to prevent tearing).
++.sp
++It is also possible to pass a raw memory address for use as bitmap memory
++by passing a memory address as integer prefixed with an \fB&\fP character.
++Passing the wrong thing here will crash the player. This mode might be
++useful for use with libmpv. The \fBoffset\fP parameter is simply added to the
++memory address (since mpv 0.8.0, ignored before).
++.sp
++\fBoffset\fP is the byte offset of the first pixel in the source file.
++(The current implementation always mmap\(aqs the whole file from position 0 to
++the end of the image, so large offsets should be avoided. Before mpv 0.8.0,
++the offset was actually passed directly to \fBmmap\fP, but it was changed to
++make using it easier.)
++.sp
++\fBfmt\fP is a string identifying the image format. Currently, only \fBbgra\fP
++is defined. This format has 4 bytes per pixels, with 8 bits per component.
++The least significant 8 bits are blue, and the most significant 8 bits
++are alpha (in little endian, the components are B\-G\-R\-A, with B as first
++byte). This uses premultiplied alpha: every color component is already
++multiplied with the alpha component. This means the numeric value of each
++component is equal to or smaller than the alpha component. (Violating this
++rule will lead to different results with different VOs: numeric overflows
++resulting from blending broken alpha values is considered something that
++shouldn\(aqt happen, and consequently implementations don\(aqt ensure that you
++get predictable behavior in this case.)
++.sp
++\fBw\fP, \fBh\fP, and \fBstride\fP specify the size of the overlay. \fBw\fP is the
++visible width of the overlay, while \fBstride\fP gives the width in bytes in
++memory. In the simple case, and with the \fBbgra\fP format, \fBstride==4*w\fP\&.
++In general, the total amount of memory accessed is \fBstride * h\fP\&.
++(Technically, the minimum size would be \fBstride * (h \- 1) + w * 4\fP, but
++for simplicity, the player will access all \fBstride * h\fP bytes.)
++.INDENT 7.0
++.INDENT 3.5
++.IP "Warning"
++.sp
++When updating the overlay, you should prepare a second shared memory
++region (e.g. make use of the offset parameter) and add this as overlay,
++instead of reusing the same memory every time. Otherwise, you might
++get the equivalent of tearing, when your application and mpv write/read
++the buffer at the same time. Also, keep in mind that mpv might access
++an overlay\(aqs memory at random times whenever it feels the need to do
++so, for example when redrawing the screen.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBoverlay\-remove <id>\fP
++Remove an overlay added with \fBoverlay\-add\fP and the same ID. Does nothing
++if no overlay with this ID exists.
++.TP
++.B \fBscript\-message "<arg1>" "<arg2>" ...\fP
++Send a message to all clients, and pass it the following list of arguments.
++What this message means, how many arguments it takes, and what the arguments
++mean is fully up to the receiver and the sender. Every client receives the
++message, so be careful about name clashes (or use \fBscript\-message\-to\fP).
++.TP
++.B \fBscript\-message\-to "<target>" "<arg1>" "<arg2>" ...\fP
++Same as \fBscript\-message\fP, but send it only to the client named
++\fB<target>\fP\&. Each client (scripts etc.) has a unique name. For example,
++Lua scripts can get their name via \fBmp.get_script_name()\fP\&.
++.TP
++.B \fBscript\-binding "<name>"\fP
++Invoke a script\-provided key binding. This can be used to remap key
++bindings provided by external Lua scripts.
++.sp
++The argument is the name of the binding.
++.sp
++It can optionally be prefixed with the name of the script, using \fB/\fP as
++separator, e.g. \fBscript_binding scriptname/bindingname\fP\&.
++.sp
++For completeness, here is how this command works internally. The details
++could change any time. On any matching key event, \fBscript\-message\-to\fP
++or \fBscript\-message\fP is called (depending on whether the script name is
++included), with the following arguments:
++.INDENT 7.0
++.IP 1. 3
++The string \fBkey\-binding\fP\&.
++.IP 2. 3
++The name of the binding (as established above).
++.IP 3. 3
++The key state as string (see below).
++.IP 4. 3
++The key name (since mpv 0.15.0).
++.UNINDENT
++.sp
++The key state consists of 2 letters:
++.INDENT 7.0
++.IP 1. 3
++One of \fBd\fP (key was pressed down), \fBu\fP (was released), \fBr\fP (key
++is still down, and was repeated; only if key repeat is enabled for this
++binding), \fBp\fP (key was pressed; happens if up/down can\(aqt be tracked).
++.IP 2. 3
++Whether the event originates from the mouse, either \fBm\fP (mouse button)
++or \fB\-\fP (something else).
++.UNINDENT
++.TP
++.B \fBab\-loop\fP
++Cycle through A\-B loop states. The first command will set the \fBA\fP point
++(the \fBab\-loop\-a\fP property); the second the \fBB\fP point, and the third
++will clear both points.
++.TP
++.B \fBvo\-cmdline "<args>"\fP
++Reset the sub\-option of the current VO. Currently works with \fBopengl\fP
++(including \fBopengl\-hq\fP). The argument is the sub\-option string usually
++passed to the VO on the command line. Not all sub\-options can be set, but
++those which can will be reset even if they don\(aqt appear in the argument.
++This command might be changed or removed in the future.
++.TP
++.B \fBdrop\-buffers\fP
++Drop audio/video/demuxer buffers, and restart from fresh. Might help with
++unseekable streams that are going out of sync.
++This command might be changed or removed in the future.
++.TP
++.B \fBscreenshot\-raw [subtitles|video|window]\fP
++Return a screenshot in memory. This can be used only through the client
++API. The MPV_FORMAT_NODE_MAP returned by this command has the \fBw\fP, \fBh\fP,
++\fBstride\fP fields set to obvious contents. A \fBformat\fP field is set to
++\fBbgr0\fP by default. This format is organized as \fBB8G8R8X8\fP (where \fBB\fP
++is the LSB). The contents of the padding \fBX\fP is undefined. The \fBdata\fP
++field is of type MPV_FORMAT_BYTE_ARRAY with the actual image data. The image
++is freed as soon as the result node is freed.
++.TP
++.B \fBvf\-command "<label>" "<cmd>" "<args>"\fP
++Send a command to the filter with the given \fB<label>\fP\&. Use \fBall\fP to send
++it to all filters at once. The command and argument string is filter
++specific. Currently, this only works with the \fBlavfi\fP filter \- see
++the libavfilter documentation for which commands a filter supports.
++.sp
++Note that the \fB<label>\fP is a mpv filter label, not a libavfilter filter
++name.
++.TP
++.B \fBaf\-command "<label>" "<cmd>" "<args>"\fP
++Same as \fBvf\-command\fP, but for audio filters.
++.UNINDENT
++.sp
++Undocumented commands: \fBtv\-last\-channel\fP (TV/DVB only),
++\fBao\-reload\fP (experimental/internal).
++.SS Hooks
++.sp
++Hooks are synchronous events between player core and a script or similar. This
++applies to client API (including the Lua scripting interface). Normally,
++events are supposed to be asynchronous, and the hook API provides an awkward
++and obscure way to handle events that require stricter coordination. There are
++no API stability guarantees made. Not following the protocol exactly can make
++the player freeze randomly. Basically, nobody should use this API.
++.sp
++There are two special commands involved. Also, the client must listen for
++client messages (\fBMPV_EVENT_CLIENT_MESSAGE\fP in the C API).
++.INDENT 0.0
++.TP
++.B \fBhook\-add <hook\-name> <id> <priority>\fP
++Subscribe to the hook identified by the first argument (basically, the
++name of event). The \fBid\fP argument is an arbitrary integer chosen by the
++user. \fBpriority\fP is used to sort all hook handlers globally across all
++clients. Each client can register multiple hook handlers (even for the
++same hook\-name). Once the hook is registered, it cannot be unregistered.
++.sp
++When a specific event happens, all registered handlers are run serially.
++This uses a protocol every client has to follow explicitly. When a hook
++handler is run, a client message (\fBMPV_EVENT_CLIENT_MESSAGE\fP) is sent to
++the client which registered the hook. This message has the following
++arguments:
++.INDENT 7.0
++.IP 1. 3
++the string \fBhook_run\fP
++.IP 2. 3
++the \fBid\fP argument the hook was registered with as string (this can be
++used to correctly handle multiple hooks registered by the same client,
++as long as the \fBid\fP argument is unique in the client)
++.IP 3. 3
++something undefined, used by the hook mechanism to track hook execution
++(currently, it\(aqs the hook\-name, but this might change without warning)
++.UNINDENT
++.sp
++Upon receiving this message, the client can handle the event. While doing
++this, the player core will still react to requests, but playback will
++typically be stopped.
++.sp
++When the client is done, it must continue the core\(aqs hook execution by
++running the \fBhook\-ack\fP command.
++.TP
++.B \fBhook\-ack <string>\fP
++Run the next hook in the global chain of hooks. The argument is the 3rd
++argument of the client message that starts hook execution for the
++current client.
++.UNINDENT
++.sp
++The following hooks are currently defined:
++.INDENT 0.0
++.TP
++.B \fBon_load\fP
++Called when a file is to be opened, before anything is actually done.
++For example, you could read and write the \fBstream\-open\-filename\fP
++property to redirect an URL to something else (consider support for
++streaming sites which rarely give the user a direct media URL), or
++you could set per\-file options with by setting the property
++\fBfile\-local\-options/<option name>\fP\&. The player will wait until all
++hooks are run.
++.TP
++.B \fBon_preloaded\fP
++Called after a file has been opened, and before tracks are selected and
++decoders are created. This has some usefulness if an API users wants
++to select tracks manually, based on the set of available tracks. It\(aqs
++also useful to initialize \fB\-\-lavfi\-complex\fP in a specific way by API,
++without having to "probe" the available streams at first.
++.sp
++Note that this does not yet apply default track selection. Which operations
++exactly can be done and not be done, and what information is available and
++what is not yet available yet, is all subject to change.
++.TP
++.B \fBon_unload\fP
++Run before closing a file, and before actually uninitializing
++everything. It\(aqs not possible to resume playback in this state.
++.UNINDENT
++.SS Input Command Prefixes
++.sp
++These prefixes are placed between key name and the actual command. Multiple
++prefixes can be specified. They are separated by whitespace.
++.INDENT 0.0
++.TP
++.B \fBosd\-auto\fP (default)
++Use the default behavior for this command.
++.TP
++.B \fBno\-osd\fP
++Do not use any OSD for this command.
++.TP
++.B \fBosd\-bar\fP
++If possible, show a bar with this command. Seek commands will show the
++progress bar, property changing commands may show the newly set value.
++.TP
++.B \fBosd\-msg\fP
++If possible, show an OSD message with this command. Seek command show
++the current playback time, property changing commands show the newly set
++value as text.
++.TP
++.B \fBosd\-msg\-bar\fP
++Combine osd\-bar and osd\-msg.
++.TP
++.B \fBraw\fP
++Do not expand properties in string arguments. (Like \fB"${property\-name}"\fP\&.)
++.TP
++.B \fBexpand\-properties\fP (default)
++All string arguments are expanded as described in \fI\%Property Expansion\fP\&.
++.TP
++.B \fBrepeatable\fP
++For some commands, keeping a key pressed doesn\(aqt run the command repeatedly.
++This prefix forces enabling key repeat in any case.
++.UNINDENT
++.sp
++All of the osd prefixes are still overridden by the global \fB\-\-osd\-level\fP
++settings.
++.SS Input Sections
++.sp
++Input sections group a set of bindings, and enable or disable them at once.
++In \fBinput.conf\fP, each key binding is assigned to an input section, rather
++than actually having explicit text sections.
++.sp
++See also: \fBenable_section\fP and \fBdisable_section\fP commands.
++.sp
++Predefined bindings:
++.INDENT 0.0
++.TP
++.B \fBdefault\fP
++Bindings without input section are implicitly assigned to this section. It
++is enabled by default during normal playback.
++.TP
++.B \fBencode\fP
++Section which is active in encoding mode. It is enabled exclusively, so
++that bindings in the \fBdefault\fP sections are ignored.
++.UNINDENT
++.SS Properties
++.sp
++Properties are used to set mpv options during runtime, or to query arbitrary
++information. They can be manipulated with the \fBset\fP/\fBadd\fP/\fBcycle\fP
++commands, and retrieved with \fBshow\-text\fP, or anything else that uses property
++expansion. (See \fI\%Property Expansion\fP\&.)
++.sp
++The property name is annotated with RW to indicate whether the property is
++generally writable.
++.sp
++If an option is referenced, the property will normally take/return exactly the
++same values as the option. In these cases, properties are merely a way to change
++an option at runtime.
++.SS Property list
++.INDENT 0.0
++.TP
++.B \fBosd\-level\fP (RW)
++See \fB\-\-osd\-level\fP\&.
++.TP
++.B \fBosd\-scale\fP (RW)
++OSD font size multiplier, see \fB\-\-osd\-scale\fP\&.
++.TP
++.B \fBloop\fP (RW)
++See \fB\-\-loop\fP\&.
++.TP
++.B \fBloop\-file\fP (RW)
++See \fB\-\-loop\-file\fP (uses \fByes\fP/\fBno\fP).
++.TP
++.B \fBspeed\fP (RW)
++See \fB\-\-speed\fP\&.
++.TP
++.B \fBaudio\-speed\-correction\fP, \fBvideo\-speed\-correction\fP
++Factor multiplied with \fBspeed\fP at which the player attempts to play the
++file. Usually it\(aqs exactly 1. (Display sync mode will make this useful.)
++.sp
++OSD formatting will display it in the form of \fB+1.23456%\fP, with the number
++being \fB(raw \- 1) * 100\fP for the given raw property value.
++.TP
++.B \fBdisplay\-sync\-active\fP
++Return whether \fB\-\-video\-sync=display\fP is actually active.
++.TP
++.B \fBfilename\fP
++Currently played file, with path stripped. If this is an URL, try to undo
++percent encoding as well. (The result is not necessarily correct, but
++looks better for display purposes. Use the \fBpath\fP property to get an
++unmodified filename.)
++.TP
++.B \fBfile\-size\fP
++Length in bytes of the source file/stream. (This is the same as
++\fB${stream\-end}\fP\&. For ordered chapters and such, the
++size of the currently played segment is returned.)
++.TP
++.B \fBestimated\-frame\-count\fP
++Total number of frames in current file.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This is only an estimate. (It\(aqs computed from two unreliable
++quantities: fps and stream length.)
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBestimated\-frame\-number\fP
++Number of current frame in current stream.
++.sp
++\fBNOTE:\fP
++.INDENT 7.0
++.INDENT 3.5
++This is only an estimate. (It\(aqs computed from two unreliable
++quantities: fps and possibly rounded timestamps.)
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBpath\fP
++Full path of the currently played file. Usually this is exactly the same
++string you pass on the mpv command line or the \fBloadfile\fP command, even
++if it\(aqs a relative path. If you expect an absolute path, you will have to
++determine it yourself, for example by using the \fBworking\-directory\fP
++property.
++.TP
++.B \fBmedia\-title\fP
++If the currently played file has a \fBtitle\fP tag, use that.
++.sp
++Otherwise, if the media type is DVD, return the volume ID of DVD.
++.sp
++Otherwise, return the \fBfilename\fP property.
++.TP
++.B \fBfile\-format\fP
++Symbolic name of the file format. In some cases, this is a comma\-separated
++list of format names, e.g. mp4 is \fBmov,mp4,m4a,3gp,3g2,mj2\fP (the list
++may grow in the future for any format).
++.TP
++.B \fBdemuxer\fP
++Name of the current demuxer. (This is useless.)
++.TP
++.B \fBstream\-path\fP
++Filename (full path) of the stream layer filename. (This is probably
++useless. It looks like this can be different from \fBpath\fP only when
++using e.g. ordered chapters.)
++.TP
++.B \fBstream\-pos\fP
++Raw byte position in source stream. Technically, this returns the position
++of the most recent packet passed to a decoder.
++.TP
++.B \fBstream\-end\fP
++Raw end position in bytes in source stream.
++.TP
++.B \fBduration\fP
++Duration of the current file in seconds. If the duration is unknown, the
++property is unavailable. Note that the file duration is not always exactly
++known, so this is an estimate.
++.sp
++This replaces the \fBlength\fP property, which was deprecated after the
++mpv 0.9 release. (The semantics are the same.)
++.TP
++.B \fBavsync\fP
++Last A/V synchronization difference. Unavailable if audio or video is
++disabled.
++.TP
++.B \fBtotal\-avsync\-change\fP
++Total A\-V sync correction done. Unavailable if audio or video is
++disabled.
++.TP
++.B \fBdrop\-frame\-count\fP
++Video frames dropped by decoder, because video is too far behind audio (when
++using \fB\-\-framedrop=decoder\fP). Sometimes, this may be incremented in other
++situations, e.g. when video packets are damaged, or the decoder doesn\(aqt
++follow the usual rules. Unavailable if video is disabled.
++.TP
++.B \fBvo\-drop\-frame\-count\fP
++Frames dropped by VO (when using \fB\-\-framedrop=vo\fP).
++.TP
++.B \fBmistimed\-frame\-count\fP
++Number of video frames that were not timed correctly in display\-sync mode
++for the sake of keeping A/V sync. This does not include external
++circumstances, such as video rendering being too slow or the graphics
++driver somehow skipping a vsync. It does not include rounding errors either
++(which can happen especially with bad source timestamps). For example,
++using the \fBdisplay\-desync\fP mode should never change this value from 0.
++.TP
++.B \fBvsync\-ratio\fP
++For how many vsyncs a frame is displayed on average. This is available if
++display\-sync is active only. For 30 FPS video on a 60 Hz screen, this will
++be 2. This is the moving average of what actually has been scheduled, so
++24 FPS on 60 Hz will never remain exactly on 2.5, but jitter depending on
++the last frame displayed.
++.TP
++.B \fBvo\-delayed\-frame\-count\fP
++Estimated number of frames delayed due to external circumstances in
++display\-sync mode. Note that in general, mpv has to guess that this is
++happening, and the guess can be inaccurate.
++.TP
++.B \fBpercent\-pos\fP (RW)
++Position in current file (0\-100). The advantage over using this instead of
++calculating it out of other properties is that it properly falls back to
++estimating the playback position from the byte position, if the file
++duration is not known.
++.TP
++.B \fBtime\-pos\fP (RW)
++Position in current file in seconds.
++.TP
++.B \fBtime\-start\fP
++Deprecated. Always returns 0. Before mpv 0.14, this used to return the start
++time of the file (could affect e.g. transport streams). See
++\fB\-\-rebase\-start\-time\fP option.
++.TP
++.B \fBtime\-remaining\fP
++Remaining length of the file in seconds. Note that the file duration is not
++always exactly known, so this is an estimate.
++.TP
++.B \fBplaytime\-remaining\fP
++\fBtime\-remaining\fP scaled by the current \fBspeed\fP\&.
++.TP
++.B \fBplayback\-time\fP (RW)
++Position in current file in seconds. Unlike \fBtime\-pos\fP, the time is
++clamped to the range of the file. (Inaccurate file durations etc. could
++make it go out of range. Useful on attempts to seek outside of the file,
++as the seek target time is considered the current position during seeking.)
++.TP
++.B \fBchapter\fP (RW)
++Current chapter number. The number of the first chapter is 0.
++.TP
++.B \fBedition\fP (RW)
++Current MKV edition number. Setting this property to a different value will
++restart playback. The number of the first edition is 0.
++.TP
++.B \fBdisc\-titles\fP
++Number of BD/DVD titles.
++.sp
++This has a number of sub\-properties. Replace \fBN\fP with the 0\-based edition
++index.
++.INDENT 7.0
++.TP
++.B \fBdisc\-titles/count\fP
++Number of titles.
++.TP
++.B \fBdisc\-titles/id\fP
++Title ID as integer. Currently, this is the same as the title index.
++.TP
++.B \fBdisc\-titles/length\fP
++Length in seconds. Can be unavailable in a number of cases (currently
++it works for libdvdnav only).
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each edition)
++ "id" MPV_FORMAT_INT64
++ "length" MPV_FORMAT_DOUBLE
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBdisc\-title\-list\fP
++List of BD/DVD titles.
++.TP
++.B \fBdisc\-title\fP (RW)
++Current BD/DVD title number. Writing works only for \fBdvdnav://\fP and
++\fBbd://\fP (and aliases for these).
++.TP
++.B \fBchapters\fP
++Number of chapters.
++.TP
++.B \fBeditions\fP
++Number of MKV editions.
++.TP
++.B \fBedition\-list\fP
++List of editions, current entry marked. Currently, the raw property value
++is useless.
++.sp
++This has a number of sub\-properties. Replace \fBN\fP with the 0\-based edition
++index.
++.INDENT 7.0
++.TP
++.B \fBedition\-list/count\fP
++Number of editions. If there are no editions, this can be 0 or 1 (1
++if there\(aqs a useless dummy edition).
++.TP
++.B \fBedition\-list/N/id\fP
++Edition ID as integer. Use this to set the \fBedition\fP property.
++Currently, this is the same as the edition index.
++.TP
++.B \fBedition\-list/N/default\fP
++\fByes\fP if this is the default edition, \fBno\fP otherwise.
++.TP
++.B \fBedition\-list/N/title\fP
++Edition title as stored in the file. Not always available.
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each edition)
++ "id" MPV_FORMAT_INT64
++ "title" MPV_FORMAT_STRING
++ "default" MPV_FORMAT_FLAG
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBab\-loop\-a\fP, \fBab\-loop\-b\fP (RW)
++Set/get A\-B loop points. See corresponding options and \fBab\-loop\fP command
++for details.
++.TP
++.B \fBangle\fP (RW)
++Current DVD angle.
++.TP
++.B \fBmetadata\fP
++Metadata key/value pairs.
++.sp
++If the property is accessed with Lua\(aqs \fBmp.get_property_native\fP, this
++returns a table with metadata keys mapping to metadata values. If it is
++accessed with the client API, this returns a \fBMPV_FORMAT_NODE_MAP\fP,
++with tag keys mapping to tag values.
++.sp
++For OSD, it returns a formatted list. Trying to retrieve this property as
++a raw string doesn\(aqt work.
++.sp
++This has a number of sub\-properties:
++.INDENT 7.0
++.TP
++.B \fBmetadata/by\-key/<key>\fP
++Value of metadata entry \fB<key>\fP\&.
++.TP
++.B \fBmetadata/list/count\fP
++Number of metadata entries.
++.TP
++.B \fBmetadata/list/N/key\fP
++Key name of the Nth metadata entry. (The first entry is \fB0\fP).
++.TP
++.B \fBmetadata/list/N/value\fP
++Value of the Nth metadata entry.
++.TP
++.B \fBmetadata/<key>\fP
++Old version of \fBmetadata/by\-key/<key>\fP\&. Use is discouraged, because
++the metadata key string could conflict with other sub\-properties.
++.UNINDENT
++.sp
++The layout of this property might be subject to change. Suggestions are
++welcome how exactly this property should work.
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_MAP
++ (key and string value for each metadata entry)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBfiltered\-metadata\fP
++Like \fBmetadata\fP, but includes only fields listed in the \fB\-\-display\-tags\fP
++option. This is the same set of tags that is printed to the terminal.
++.TP
++.B \fBchapter\-metadata\fP
++Metadata of current chapter. Works similar to \fBmetadata\fP property. It
++also allows the same access methods (using sub\-properties).
++.sp
++Per\-chapter metadata is very rare. Usually, only the chapter name
++(\fBtitle\fP) is set.
++.sp
++For accessing other information, like chapter start, see the
++\fBchapter\-list\fP property.
++.TP
++.B \fBvf\-metadata/<filter\-label>\fP
++Metadata added by video filters. Accessed by the filter label,
++which, if not explicitly specified using the \fB@filter\-label:\fP syntax,
++will be \fB<filter\-name>NN\fP\&.
++.sp
++Works similar to \fBmetadata\fP property. It allows the same access
++methods (using sub\-properties).
++.sp
++An example of this kind of metadata are the cropping parameters
++added by \fB\-\-vf=lavfi=cropdetect\fP\&.
++.TP
++.B \fBaf\-metadata/<filter\-label>\fP
++Equivalent to \fBvf\-metadata/<filter\-label>\fP, but for audio filters.
++.TP
++.B \fBpause\fP (RW)
++Pause status. This is usually \fByes\fP or \fBno\fP\&. See \fB\-\-pause\fP\&.
++.TP
++.B \fBidle\fP
++Return \fByes\fP if no file is loaded, but the player is staying around
++because of the \fB\-\-idle\fP option.
++.TP
++.B \fBcore\-idle\fP
++Return \fByes\fP if the playback core is paused, otherwise \fBno\fP\&. This can
++be different \fBpause\fP in special situations, such as when the player
++pauses itself due to low network cache.
++.sp
++This also returns \fByes\fP if playback is restarting or if nothing is
++playing at all. In other words, it\(aqs only \fBno\fP if there\(aqs actually
++video playing. (Behavior since mpv 0.7.0.)
++.TP
++.B \fBcache\fP
++Network cache fill state (0\-100.0).
++.TP
++.B \fBcache\-size\fP (RW)
++Network cache size in KB. This is similar to \fB\-\-cache\fP\&. This allows
++setting the cache size at runtime. Currently, it\(aqs not possible to enable
++or disable the cache at runtime using this property, just to resize an
++existing cache.
++.sp
++This does not include the backbuffer size (changed after mpv 0.10.0).
++.sp
++Note that this tries to keep the cache contents as far as possible. To make
++this easier, the cache resizing code will allocate the new cache while the
++old cache is still allocated.
++.sp
++Don\(aqt use this when playing DVD or Blu\-ray.
++.TP
++.B \fBcache\-free\fP (R)
++Total free cache size in KB.
++.TP
++.B \fBcache\-used\fP (R)
++Total used cache size in KB.
++.TP
++.B \fBcache\-speed\fP (R)
++Current I/O read speed between the cache and the lower layer (like network).
++This gives the number bytes per seconds over a 1 second window (using
++the type \fBMPV_FORMAT_INT64\fP for the client API).
++.TP
++.B \fBcache\-idle\fP (R)
++Returns \fByes\fP if the cache is idle, which means the cache is filled as
++much as possible, and is currently not reading more data.
++.TP
++.B \fBdemuxer\-cache\-duration\fP
++Approximate duration of video buffered in the demuxer, in seconds. The
++guess is very unreliable, and often the property will not be available
++at all, even if data is buffered.
++.TP
++.B \fBdemuxer\-cache\-time\fP
++Approximate time of video buffered in the demuxer, in seconds. Same as
++\fBdemuxer\-cache\-duration\fP but returns the last timestamp of buffered
++data in demuxer.
++.TP
++.B \fBdemuxer\-cache\-idle\fP
++Returns \fByes\fP if the demuxer is idle, which means the demuxer cache is
++filled to the requested amount, and is currently not reading more data.
++.TP
++.B \fBpaused\-for\-cache\fP
++Returns \fByes\fP when playback is paused because of waiting for the cache.
++.TP
++.B \fBcache\-buffering\-state\fP
++Return the percentage (0\-100) of the cache fill status until the player
++will unpause (related to \fBpaused\-for\-cache\fP).
++.TP
++.B \fBeof\-reached\fP
++Returns \fByes\fP if end of playback was reached, \fBno\fP otherwise. Note
++that this is usually interesting only if \fB\-\-keep\-open\fP is enabled,
++since otherwise the player will immediately play the next file (or exit
++or enter idle mode), and in these cases the \fBeof\-reached\fP property will
++logically be cleared immediately after it\(aqs set.
++.TP
++.B \fBseeking\fP
++Returns \fByes\fP if the player is currently seeking, or otherwise trying
++to restart playback. (It\(aqs possible that it returns \fByes\fP while a file
++is loaded, or when switching ordered chapter segments. This is because
++the same underlying code is used for seeking and resyncing.)
++.TP
++.B \fBhr\-seek\fP (RW)
++See \fB\-\-hr\-seek\fP\&.
++.TP
++.B \fBmixer\-active\fP
++Return \fByes\fP if the audio mixer is active, \fBno\fP otherwise. This has
++implications for \fB\-\-softvol=no\fP mode: if the mixer is inactive, changing
++\fBvolume\fP doesn\(aqt actually change anything on the system mixer. If the
++\fB\-\-volume\fP or \fB\-\-mute\fP option are used, these might not be applied
++properly until the mixer becomes active either. (The options, if set, will
++just overwrite the mixer state at audio initialization.)
++.sp
++While the behavior with \fBmixer\-active==yes\fP is relatively well\-defined,
++the \fBno\fP case will provide possibly wrong or insignificant values.
++.sp
++Note that an active mixer does not necessarily imply active audio output,
++although this is implied in the current implementation.
++.TP
++.B \fBvolume\fP (RW)
++Current volume (see \fB\-\-volume\fP for details). Also see \fBmixer\-active\fP
++property.
++.TP
++.B \fBvolume\-max\fP
++Current maximum value the volume property can be set to. (This may depend
++on the \fB\-\-softvol\-max\fP option.)
++.TP
++.B \fBmute\fP (RW)
++Current mute status (\fByes\fP/\fBno\fP). Also see \fBmixer\-active\fP property.
++.TP
++.B \fBaudio\-delay\fP (RW)
++See \fB\-\-audio\-delay\fP\&.
++.TP
++.B \fBaudio\-codec\fP
++Audio codec selected for decoding.
++.TP
++.B \fBaudio\-codec\-name\fP
++Audio codec.
++.TP
++.B \fBaudio\-params\fP
++Audio format as output by the audio decoder.
++This has a number of sub\-properties:
++.INDENT 7.0
++.TP
++.B \fBaudio\-params/format\fP
++The sample format as string. This uses the same names as used in other
++places of mpv.
++.TP
++.B \fBaudio\-params/samplerate\fP
++Samplerate.
++.TP
++.B \fBaudio\-params/channels\fP
++The channel layout as a string. This is similar to what the
++\fB\-\-audio\-channels\fP accepts.
++.TP
++.B \fBaudio\-params/hr\-channels\fP
++As \fBchannels\fP, but instead of the possibly cryptic actual layout
++sent to the audio device, return a hopefully more human readable form.
++(Usually only \fBaudio\-out\-params/hr\-channels\fP makes sense.)
++.TP
++.B \fBaudio\-params/channel\-count\fP
++Number of audio channels. This is redundant to the \fBchannels\fP field
++described above.
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_MAP
++ "format" MPV_FORMAT_STRING
++ "samplerate" MPV_FORMAT_INT64
++ "channels" MPV_FORMAT_STRING
++ "channel\-count" MPV_FORMAT_INT64
++ "hr\-channels" MPV_FORMAT_STRING
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBaudio\-out\-params\fP
++Same as \fBaudio\-params\fP, but the format of the data written to the audio
++API.
++.TP
++.B \fBaid\fP (RW)
++Current audio track (similar to \fB\-\-aid\fP).
++.TP
++.B \fBaudio\fP (RW)
++Alias for \fBaid\fP\&.
++.TP
++.B \fBbalance\fP (RW)
++Audio channel balance. (The implementation of this feature is rather odd.
++It doesn\(aqt change the volumes of each channel, but instead sets up a pan
++matrix to mix the left and right channels.)
++.TP
++.B \fBfullscreen\fP (RW)
++See \fB\-\-fullscreen\fP\&.
++.TP
++.B \fBdeinterlace\fP (RW)
++See \fB\-\-deinterlace\fP\&.
++.TP
++.B \fBfield\-dominance\fP (RW)
++See \fB\-\-field\-dominance\fP
++.TP
++.B \fBcolormatrix\fP (R)
++Redirects to \fBvideo\-params/colormatrix\fP\&. This parameter (as well as
++similar ones) can be overridden with the \fBformat\fP video filter.
++.TP
++.B \fBcolormatrix\-input\-range\fP (R)
++See \fBcolormatrix\fP\&.
++.TP
++.B \fBvideo\-output\-levels\fP (RW)
++See \fB\-\-video\-output\-levels\fP,
++.TP
++.B \fBcolormatrix\-primaries\fP (R)
++See \fBcolormatrix\fP\&.
++.TP
++.B \fBtaskbar\-progress\fP (RW)
++See \fB\-\-taskbar\-progress\fP\&.
++.TP
++.B \fBontop\fP (RW)
++See \fB\-\-ontop\fP\&.
++.TP
++.B \fBborder\fP (RW)
++See \fB\-\-border\fP\&.
++.TP
++.B \fBon\-all\-workspaces\fP (RW)
++See \fB\-\-on\-all\-workspaces\fP\&. Unsetting may not work on all WMs.
++.TP
++.B \fBframedrop\fP (RW)
++See \fB\-\-framedrop\fP\&.
++.TP
++.B \fBgamma\fP (RW)
++See \fB\-\-gamma\fP\&.
++.TP
++.B \fBbrightness\fP (RW)
++See \fB\-\-brightness\fP\&.
++.TP
++.B \fBcontrast\fP (RW)
++See \fB\-\-contrast\fP\&.
++.TP
++.B \fBsaturation\fP (RW)
++See \fB\-\-saturation\fP\&.
++.TP
++.B \fBhue\fP (RW)
++See \fB\-\-hue\fP\&.
++.TP
++.B \fBhwdec\fP (RW)
++Reflects the \fB\-\-hwdec\fP option.
++.sp
++Writing to it may change the currently used hardware decoder, if possible.
++(Internally, the player may reinitialize the decoder, and will perform a
++seek to refresh the video properly.) You can watch the other hwdec
++properties to see whether this was successful.
++.sp
++Unlike in mpv 0.9.x and before, this does not return the currently active
++hardware decoder. Since mpv 0.17.1, \fBhwdec\-current\fP is available for
++this purpose.
++.TP
++.B \fBhwdec\-current\fP
++Return the current hardware decoding in use. If decoding is active, return
++one of the values used by the \fBhwdec\fP option/property. \fBno\fP indicates
++software decoding. If no decoder is loaded, the property is unavailable.
++.TP
++.B \fBhwdec\-interop\fP
++This returns the currently loaded hardware decoding/output interop driver.
++This is known only once the VO has opened (and possibly later). With some
++VOs (like \fBopengl\fP), this might be never known in advance, but only when
++the decoder attempted to create the hw decoder successfully. (Using
++\fB\-\-hwdec\-preload\fP can load it eagerly.) If there are multiple drivers
++loaded, they will be separated by \fB,\fP\&.
++.sp
++If no VO is active or no interop driver is known, this property is
++unavailable.
++.sp
++This does not necessarily use the same values as \fBhwdec\fP\&. There can be
++multiple interop drivers for the same hardware decoder, depending on
++platform and VO.
++.TP
++.B \fBhwdec\-active\fP
++Deprecated. To be removed in mpv 0.19.0. Use \fBhwdec\-current\fP instead.
++.sp
++Return \fByes\fP or \fBno\fP, depending on whether any type of hardware decoding
++is actually in use.
++.TP
++.B \fBhwdec\-detected\fP
++Deprecated. To be removed in mpv 0.19.0.
++.sp
++If hardware decoding is active, this returns the hardware decoder in use.
++Otherwise, it returns either \fBno\fP, or if applicable, the currently loaded
++hardware decoding API. This is known only once the VO has opened (and
++possibly later). With some VOs (like \fBopengl\fP), this is never known in
++advance, but only when the decoder attempted to create the hw decoder
++successfully. Also, hw decoders with \fB\-copy\fP suffix will return \fBno\fP
++while no video is being decoded. All this reflects how detecting hw decoders
++are detected and used internally in mpv.
++.TP
++.B \fBpanscan\fP (RW)
++See \fB\-\-panscan\fP\&.
++.TP
++.B \fBvideo\-format\fP
++Video format as string.
++.TP
++.B \fBvideo\-codec\fP
++Video codec selected for decoding.
++.TP
++.B \fBwidth\fP, \fBheight\fP
++Video size. This uses the size of the video as decoded, or if no video
++frame has been decoded yet, the (possibly incorrect) container indicated
++size.
++.TP
++.B \fBvideo\-params\fP
++Video parameters, as output by the decoder (with overrides like aspect
++etc. applied). This has a number of sub\-properties:
++.INDENT 7.0
++.TP
++.B \fBvideo\-params/pixelformat\fP
++The pixel format as string. This uses the same names as used in other
++places of mpv.
++.TP
++.B \fBvideo\-params/average\-bpp\fP
++Average bits\-per\-pixel as integer. Subsampled planar formats use a
++different resolution, which is the reason this value can sometimes be
++odd or confusing. Can be unavailable with some formats.
++.TP
++.B \fBvideo\-params/plane\-depth\fP
++Bit depth for each color component as integer. This is only exposed
++for planar or single\-component formats, and is unavailable for other
++formats.
++.TP
++.B \fBvideo\-params/w\fP, \fBvideo\-params/h\fP
++Video size as integers, with no aspect correction applied.
++.TP
++.B \fBvideo\-params/dw\fP, \fBvideo\-params/dh\fP
++Video size as integers, scaled for correct aspect ratio.
++.TP
++.B \fBvideo\-params/aspect\fP
++Display aspect ratio as float.
++.TP
++.B \fBvideo\-params/par\fP
++Pixel aspect ratio.
++.TP
++.B \fBvideo\-params/colormatrix\fP
++The colormatrix in use as string. (Exact values subject to change.)
++.TP
++.B \fBvideo\-params/colorlevels\fP
++The colorlevels as string. (Exact values subject to change.)
++.TP
++.B \fBvideo\-params/primaries\fP
++The primaries in use as string. (Exact values subject to change.)
++.TP
++.B \fBvideo\-params/gamma\fP
++The gamma function in use as string. (Exact values subject to change.)
++.TP
++.B \fBvideo\-params/chroma\-location\fP
++Chroma location as string. (Exact values subject to change.)
++.TP
++.B \fBvideo\-params/rotate\fP
++Intended display rotation in degrees (clockwise).
++.TP
++.B \fBvideo\-params/stereo\-in\fP
++Source file stereo 3D mode. (See \fB\-\-video\-stereo\-mode\fP option.)
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_MAP
++ "pixelformat" MPV_FORMAT_STRING
++ "w" MPV_FORMAT_INT64
++ "h" MPV_FORMAT_INT64
++ "dw" MPV_FORMAT_INT64
++ "dh" MPV_FORMAT_INT64
++ "aspect" MPV_FORMAT_DOUBLE
++ "par" MPV_FORMAT_DOUBLE
++ "colormatrix" MPV_FORMAT_STRING
++ "colorlevels" MPV_FORMAT_STRING
++ "primaries" MPV_FORMAT_STRING
++ "chroma\-location" MPV_FORMAT_STRING
++ "rotate" MPV_FORMAT_INT64
++ "stereo\-in" MPV_FORMAT_STRING
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBdwidth\fP, \fBdheight\fP
++Video display size. This is the video size after filters and aspect scaling
++have been applied. The actual video window size can still be different
++from this, e.g. if the user resized the video window manually.
++.sp
++These have the same values as \fBvideo\-out\-params/dw\fP and
++\fBvideo\-out\-params/dh\fP\&.
++.TP
++.B \fBvideo\-out\-params\fP
++Same as \fBvideo\-params\fP, but after video filters have been applied. If
++there are no video filters in use, this will contain the same values as
++\fBvideo\-params\fP\&. Note that this is still not necessarily what the video
++window uses, since the user can change the window size, and all real VOs
++do their own scaling independently from the filter chain.
++.sp
++Has the same sub\-properties as \fBvideo\-params\fP\&.
++.TP
++.B \fBvideo\-frame\-info\fP
++Approximate information of the current frame. Note that if any of these
++are used on OSD, the information might be off by a few frames due to OSD
++redrawing and frame display being somewhat disconnected, and you might
++have to pause and force a redraw.
++.sp
++Sub\-properties:
++.sp
++\fBvideo\-frame\-info/picture\-type\fP
++\fBvideo\-frame\-info/interlaced\fP
++\fBvideo\-frame\-info/tff\fP
++\fBvideo\-frame\-info/repeat\fP
++.TP
++.B \fBfps\fP
++Container FPS. This can easily contain bogus values. For videos that use
++modern container formats or video codecs, this will often be incorrect.
++.TP
++.B \fBestimated\-vf\-fps\fP
++Estimated/measured FPS of the video filter chain output. (If no filters
++are used, this corresponds to decoder output.) This uses the average of
++the 10 past frame durations to calculate the FPS. It will be inaccurate
++if frame\-dropping is involved (such as when framedrop is explicitly
++enabled, or after precise seeking). Files with imprecise timestamps (such
++as Matroska) might lead to unstable results.
++.TP
++.B \fBwindow\-scale\fP (RW)
++Window size multiplier. Setting this will resize the video window to the
++values contained in \fBdwidth\fP and \fBdheight\fP multiplied with the value
++set with this property. Setting \fB1\fP will resize to original video size
++(or to be exact, the size the video filters output). \fB2\fP will set the
++double size, \fB0.5\fP halves the size.
++.TP
++.B \fBwindow\-minimized\fP
++Return whether the video window is minimized or not.
++.TP
++.B \fBdisplay\-names\fP
++Names of the displays that the mpv window covers. On X11, these
++are the xrandr names (LVDS1, HDMI1, DP1, VGA1, etc.).
++.TP
++.B \fBdisplay\-fps\fP (RW)
++The refresh rate of the current display. Currently, this is the lowest FPS
++of any display covered by the video, as retrieved by the underlying system
++APIs (e.g. xrandr on X11). It is not the measured FPS. It\(aqs not necessarily
++available on all platforms. Note that any of the listed facts may change
++any time without a warning.
++.TP
++.B \fBestimated\-display\-fps\fP
++Only available if display\-sync mode (as selected by \fB\-\-video\-sync\fP) is
++active. Returns the actual rate at which display refreshes seem to occur,
++measured by system time.
++.TP
++.B \fBvsync\-jitter\fP
++Estimated deviation factor of the vsync duration.
++.TP
++.B \fBvideo\-aspect\fP (RW)
++Video aspect, see \fB\-\-video\-aspect\fP\&.
++.TP
++.B \fBosd\-width\fP, \fBosd\-height\fP
++Last known OSD width (can be 0). This is needed if you want to use the
++\fBoverlay_add\fP command. It gives you the actual OSD size, which can be
++different from the window size in some cases.
++.TP
++.B \fBosd\-par\fP
++Last known OSD display pixel aspect (can be 0).
++.TP
++.B \fBvid\fP (RW)
++Current video track (similar to \fB\-\-vid\fP).
++.TP
++.B \fBvideo\fP (RW)
++Alias for \fBvid\fP\&.
++.TP
++.B \fBvideo\-align\-x\fP, \fBvideo\-align\-y\fP (RW)
++See \fB\-\-video\-align\-x\fP and \fB\-\-video\-align\-y\fP\&.
++.TP
++.B \fBvideo\-pan\-x\fP, \fBvideo\-pan\-y\fP (RW)
++See \fB\-\-video\-pan\-x\fP and \fB\-\-video\-pan\-y\fP\&.
++.TP
++.B \fBvideo\-zoom\fP (RW)
++See \fB\-\-video\-zoom\fP\&.
++.TP
++.B \fBvideo\-unscaled\fP (W)
++See \fB\-\-video\-unscaled\fP\&.
++.TP
++.B \fBprogram\fP (W)
++Switch TS program (write\-only).
++.TP
++.B \fBdvb\-channel\fP (W)
++Pair of integers: card,channel of current DVB stream.
++Can be switched to switch to another channel on the same card.
++.TP
++.B \fBdvb\-channel\-name\fP (RW)
++Name of current DVB program.
++On write, a channel\-switch to the named channel on the same
++card is performed. Can also be used for channel switching.
++.TP
++.B \fBsid\fP (RW)
++Current subtitle track (similar to \fB\-\-sid\fP).
++.TP
++.B \fBsecondary\-sid\fP (RW)
++Secondary subtitle track (see \fB\-\-secondary\-sid\fP).
++.TP
++.B \fBsub\fP (RW)
++Alias for \fBsid\fP\&.
++.TP
++.B \fBsub\-delay\fP (RW)
++See \fB\-\-sub\-delay\fP\&.
++.TP
++.B \fBsub\-pos\fP (RW)
++See \fB\-\-sub\-pos\fP\&.
++.TP
++.B \fBsub\-visibility\fP (RW)
++See \fB\-\-sub\-visibility\fP\&.
++.TP
++.B \fBsub\-forced\-only\fP (RW)
++See \fB\-\-sub\-forced\-only\fP\&.
++.TP
++.B \fBsub\-scale\fP (RW)
++Subtitle font size multiplier.
++.TP
++.B \fBass\-force\-margins\fP (RW)
++See \fB\-\-ass\-force\-margins\fP\&.
++.TP
++.B \fBsub\-use\-margins\fP (RW)
++See \fB\-\-sub\-use\-margins\fP\&.
++.TP
++.B \fBass\-vsfilter\-aspect\-compat\fP (RW)
++See \fB\-\-ass\-vsfilter\-aspect\-compat\fP\&.
++.TP
++.B \fBass\-style\-override\fP (RW)
++See \fB\-\-ass\-style\-override\fP\&.
++.TP
++.B \fBstream\-capture\fP (RW)
++A filename, see \fB\-\-stream\-capture\fP\&. Setting this will start capture using
++the given filename. Setting it to an empty string will stop it.
++.TP
++.B \fBtv\-brightness\fP, \fBtv\-contrast\fP, \fBtv\-saturation\fP, \fBtv\-hue\fP (RW)
++TV stuff.
++.TP
++.B \fBplaylist\-pos\fP (RW)
++Current position on playlist. The first entry is on position 0. Writing
++to the property will restart playback at the written entry.
++.TP
++.B \fBplaylist\-pos\-1\fP (RW)
++Same as \fBplaylist\-pos\fP, but 1\-based.
++.TP
++.B \fBplaylist\-count\fP
++Number of total playlist entries.
++.TP
++.B \fBplaylist\fP
++Playlist, current entry marked. Currently, the raw property value is
++useless.
++.sp
++This has a number of sub\-properties. Replace \fBN\fP with the 0\-based playlist
++entry index.
++.INDENT 7.0
++.TP
++.B \fBplaylist/count\fP
++Number of playlist entries (same as \fBplaylist\-count\fP).
++.TP
++.B \fBplaylist/N/filename\fP
++Filename of the Nth entry.
++.TP
++.B \fBplaylist/N/current\fP, \fBplaylist/N/playing\fP
++\fByes\fP if this entry is currently playing (or being loaded).
++Unavailable or \fBno\fP otherwise. When changing files, \fBcurrent\fP and
++\fBplaying\fP can be different, because the currently playing file hasn\(aqt
++been unloaded yet; in this case, \fBcurrent\fP refers to the new
++selection. (Since mpv 0.7.0.)
++.TP
++.B \fBplaylist/N/title\fP
++Name of the Nth entry. Only available if the playlist file contains
++such fields, and only if mpv\(aqs parser supports it for the given
++playlist format.
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each playlist entry)
++ "filename" MPV_FORMAT_STRING
++ "current" MPV_FORMAT_FLAG (might be missing; since mpv 0.7.0)
++ "playing" MPV_FORMAT_FLAG (same)
++ "title" MPV_FORMAT_STRING (optional)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBtrack\-list\fP
++List of audio/video/sub tracks, current entry marked. Currently, the raw
++property value is useless.
++.sp
++This has a number of sub\-properties. Replace \fBN\fP with the 0\-based track
++index.
++.INDENT 7.0
++.TP
++.B \fBtrack\-list/count\fP
++Total number of tracks.
++.TP
++.B \fBtrack\-list/N/id\fP
++The ID as it\(aqs used for \fB\-sid\fP/\fB\-\-aid\fP/\fB\-\-vid\fP\&. This is unique
++within tracks of the same type (sub/audio/video), but otherwise not.
++.TP
++.B \fBtrack\-list/N/type\fP
++String describing the media type. One of \fBaudio\fP, \fBvideo\fP, \fBsub\fP\&.
++.TP
++.B \fBtrack\-list/N/src\-id\fP
++Track ID as used in the source file. Not always available.
++.TP
++.B \fBtrack\-list/N/title\fP
++Track title as it is stored in the file. Not always available.
++.TP
++.B \fBtrack\-list/N/lang\fP
++Track language as identified by the file. Not always available.
++.TP
++.B \fBtrack\-list/N/albumart\fP
++\fByes\fP if this is a video track that consists of a single picture,
++\fBno\fP or unavailable otherwise. This is used for video tracks that are
++really attached pictures in audio files.
++.TP
++.B \fBtrack\-list/N/default\fP
++\fByes\fP if the track has the default flag set in the file, \fBno\fP
++otherwise.
++.TP
++.B \fBtrack\-list/N/forced\fP
++\fByes\fP if the track has the forced flag set in the file, \fBno\fP
++otherwise.
++.TP
++.B \fBtrack\-list/N/codec\fP
++The codec name used by this track, for example \fBh264\fP\&. Unavailable
++in some rare cases.
++.TP
++.B \fBtrack\-list/N/external\fP
++\fByes\fP if the track is an external file, \fBno\fP otherwise. This is
++set for separate subtitle files.
++.TP
++.B \fBtrack\-list/N/external\-filename\fP
++The filename if the track is from an external file, unavailable
++otherwise.
++.TP
++.B \fBtrack\-list/N/selected\fP
++\fByes\fP if the track is currently decoded, \fBno\fP otherwise.
++.TP
++.B \fBtrack\-list/N/ff\-index\fP
++The stream index as usually used by the FFmpeg utilities. Note that
++this can be potentially wrong if a demuxer other than libavformat
++(\fB\-\-demuxer=lavf\fP) is used. For mkv files, the index will usually
++match even if the default (builtin) demuxer is used, but there is
++no hard guarantee.
++.TP
++.B \fBtrack\-list/N/decoder\-desc\fP
++If this track is being decoded, the human\-readable decoder name,
++.TP
++.B \fBtrack\-list/N/demux\-w\fP, \fBtrack\-list/N/demux\-h\fP
++Video size hint as indicated by the container. (Not always accurate.)
++.TP
++.B \fBtrack\-list/N/demux\-channel\-count\fP
++Number of audio channels as indicated by the container. (Not always
++accurate \- in particular, the track could be decoded as a different
++number of channels.)
++.TP
++.B \fBtrack\-list/N/demux\-channels\fP
++Channel layout as indicated by the container. (Not always accurate.)
++.TP
++.B \fBtrack\-list/N/demux\-samplerate\fP
++Audio sample rate as indicated by the container. (Not always accurate.)
++.TP
++.B \fBtrack\-list/N/demux\-fps\fP
++Video FPS as indicated by the container. (Not always accurate.)
++.TP
++.B \fBtrack\-list/N/audio\-channels\fP (deprecated)
++Deprecated alias for \fBtrack\-list/N/demux\-channel\-count\fP\&.
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each track)
++ "id" MPV_FORMAT_INT64
++ "type" MPV_FORMAT_STRING
++ "src\-id" MPV_FORMAT_INT64
++ "title" MPV_FORMAT_STRING
++ "lang" MPV_FORMAT_STRING
++ "albumart" MPV_FORMAT_FLAG
++ "default" MPV_FORMAT_FLAG
++ "forced" MPV_FORMAT_FLAG
++ "selected" MPV_FORMAT_FLAG
++ "external" MPV_FORMAT_FLAG
++ "external\-filename" MPV_FORMAT_STRING
++ "codec" MPV_FORMAT_STRING
++ "ff\-index" MPV_FORMAT_INT64
++ "decoder\-desc" MPV_FORMAT_STRING
++ "demux\-w" MPV_FORMAT_INT64
++ "demux\-h" MPV_FORMAT_INT64
++ "demux\-channel\-count" MPV_FORMAT_INT64
++ "demux\-channels" MPV_FORMAT_STRING
++ "demux\-samplerate" MPV_FORMAT_INT64
++ "demux\-fps" MPV_FORMAT_DOUBLE
++ "audio\-channels" MPV_FORMAT_INT64
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBchapter\-list\fP
++List of chapters, current entry marked. Currently, the raw property value
++is useless.
++.sp
++This has a number of sub\-properties. Replace \fBN\fP with the 0\-based chapter
++index.
++.INDENT 7.0
++.TP
++.B \fBchapter\-list/count\fP
++Number of chapters.
++.TP
++.B \fBchapter\-list/N/title\fP
++Chapter title as stored in the file. Not always available.
++.TP
++.B \fBchapter\-list/N/time\fP
++Chapter start time in seconds as float.
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each chapter)
++ "title" MPV_FORMAT_STRING
++ "time" MPV_FORMAT_DOUBLE
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBaf\fP (RW)
++See \fB\-\-af\fP and the \fBaf\fP command.
++.TP
++.B \fBvf\fP (RW)
++See \fB\-\-vf\fP and the \fBvf\fP command.
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each filter entry)
++ "name" MPV_FORMAT_STRING
++ "label" MPV_FORMAT_STRING [optional]
++ "params" MPV_FORMAT_NODE_MAP [optional]
++ "key" MPV_FORMAT_STRING
++ "value" MPV_FORMAT_STRING
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++It\(aqs also possible to write the property using this format.
++.TP
++.B \fBvideo\-rotate\fP (RW)
++See \fB\-\-video\-rotate\fP option.
++.TP
++.B \fBvideo\-stereo\-mode\fP (RW)
++See \fB\-\-video\-stereo\-mode\fP option.
++.TP
++.B \fBseekable\fP
++Return whether it\(aqs generally possible to seek in the current file.
++.TP
++.B \fBpartially\-seekable\fP
++Return \fByes\fP if the current file is considered seekable, but only because
++the cache is active. This means small relative seeks may be fine, but larger
++seeks may fail anyway. Whether a seek will succeed or not is generally not
++known in advance.
++.sp
++If this property returns true, \fBseekable\fP will also return true.
++.TP
++.B \fBplayback\-abort\fP
++Return whether playback is stopped or is to be stopped. (Useful in obscure
++situations like during \fBon_load\fP hook processing, when the user can
++stop playback, but the script has to explicitly end processing.)
++.TP
++.B \fBcursor\-autohide\fP (RW)
++See \fB\-\-cursor\-autohide\fP\&. Setting this to a new value will always update
++the cursor, and reset the internal timer.
++.TP
++.B \fBosd\-sym\-cc\fP
++Inserts the current OSD symbol as opaque OSD control code (cc). This makes
++sense only with the \fBshow\-text\fP command or options which set OSD messages.
++The control code is implementation specific and is useless for anything else.
++.TP
++.B \fBosd\-ass\-cc\fP
++\fB${osd\-ass\-cc/0}\fP disables escaping ASS sequences of text in OSD,
++\fB${osd\-ass\-cc/1}\fP enables it again. By default, ASS sequences are
++escaped to avoid accidental formatting, and this property can disable
++this behavior. Note that the properties return an opaque OSD control
++code, which only makes sense for the \fBshow\-text\fP command or options
++which set OSD messages.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.INDENT 0.0
++.IP \(bu 2
++\fB\-\-osd\-status\-msg=\(aqThis is ${osd\-ass\-cc/0}{\e\eb1}bold text\(aq\fP
++.IP \(bu 2
++\fBshow\-text "This is ${osd\-ass\-cc/0}{\eb1}bold text"\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Any ASS override tags as understood by libass can be used.
++.sp
++Note that you need to escape the \fB\e\fP character, because the string is
++processed for C escape sequences before passing it to the OSD code.
++.sp
++A list of tags can be found here: \fI\%http://docs.aegisub.org/latest/ASS_Tags/\fP
++.TP
++.B \fBvo\-configured\fP
++Return whether the VO is configured right now. Usually this corresponds to
++whether the video window is visible. If the \fB\-\-force\-window\fP option is
++used, this is usually always returns \fByes\fP\&.
++.TP
++.B \fBvo\-performance\fP
++Some video output performance metrics. Not implemented by all VOs. This has
++a number of sup\-properties, of the form \fBvo\-performance/<metric>\-<value>\fP,
++all of them in milliseconds.
++.sp
++\fB<metric>\fP refers to one of:
++.INDENT 7.0
++.TP
++.B \fBupload\fP
++Time needed to make the frame available to the GPU (if necessary).
++.TP
++.B \fBrender\fP
++Time needed to perform all necessary video postprocessing and rendering
++passes (if necessary).
++.TP
++.B \fBpresent\fP
++Time needed to present a rendered frame on\-screen.
++.UNINDENT
++.sp
++When a step is unnecessary or skipped, it will have the value 0.
++.sp
++\fB<value>\fP refers to one of:
++.INDENT 7.0
++.TP
++.B \fBlast\fP
++Last measured value.
++.TP
++.B \fBavg\fP
++Average over a fixed number of past samples. (The exact timeframe
++varies, but it should generally be a handful of seconds)
++.TP
++.B \fBpeak\fP
++The peak (highest value) within this averaging range.
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_MAP
++ "<metric>\-<value>" MPV_FORMAT_INT64
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++(One entry for each \fB<metric>\fP and \fB<value>\fP combination)
++.TP
++.B \fBvideo\-bitrate\fP, \fBaudio\-bitrate\fP, \fBsub\-bitrate\fP
++Bitrate values calculated on the packet level. This works by dividing the
++bit size of all packets between two keyframes by their presentation
++timestamp distance. (This uses the timestamps are stored in the file, so
++e.g. playback speed does not influence the returned values.) In particular,
++the video bitrate will update only per keyframe, and show the "past"
++bitrate. To make the property more UI friendly, updates to these properties
++are throttled in a certain way.
++.sp
++The unit is bits per second. OSD formatting turns these values in kilobits
++(or megabits, if appropriate), which can be prevented by using the
++raw property value, e.g. with \fB${=video\-bitrate}\fP\&.
++.sp
++Note that the accuracy of these properties is influenced by a few factors.
++If the underlying demuxer rewrites the packets on demuxing (done for some
++file formats), the bitrate might be slightly off. If timestamps are bad
++or jittery (like in Matroska), even constant bitrate streams might show
++fluctuating bitrate.
++.sp
++How exactly these values are calculated might change in the future.
++.sp
++In earlier versions of mpv, these properties returned a static (but bad)
++guess using a completely different method.
++.TP
++.B \fBpacket\-video\-bitrate\fP, \fBpacket\-audio\-bitrate\fP, \fBpacket\-sub\-bitrate\fP
++Old and deprecated properties for \fBvideo\-bitrate\fP, \fBaudio\-bitrate\fP,
++\fBsub\-bitrate\fP\&. They behave exactly the same, but return a value in
++kilobits. Also, they don\(aqt have any OSD formatting, though the same can be
++achieved with e.g. \fB${=video\-bitrate}\fP\&.
++.sp
++These properties shouldn\(aqt be used anymore.
++.TP
++.B \fBaudio\-device\-list\fP
++Return the list of discovered audio devices. This is mostly for use with
++the client API, and reflects what \fB\-\-audio\-device=help\fP with the command
++line player returns.
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each device entry)
++ "name" MPV_FORMAT_STRING
++ "description" MPV_FORMAT_STRING
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++The \fBname\fP is what is to be passed to the \fB\-\-audio\-device\fP option (and
++often a rather cryptic audio API\-specific ID), while \fBdescription\fP is
++human readable free form text. The description is an empty string if none
++was received.
++.sp
++The special entry with the name set to \fBauto\fP selects the default audio
++output driver and the default device.
++.sp
++The property can be watched with the property observation mechanism in
++the client API and in Lua scripts. (Technically, change notification is
++enabled the first time this property is read.)
++.TP
++.B \fBaudio\-device\fP (RW)
++Set the audio device. This directly reads/writes the \fB\-\-audio\-device\fP
++option, but on write accesses, the audio output will be scheduled for
++reloading.
++.sp
++Writing this property while no audio output is active will not automatically
++enable audio. (This is also true in the case when audio was disabled due to
++reinitialization failure after a previous write access to \fBaudio\-device\fP\&.)
++.sp
++This property also doesn\(aqt tell you which audio device is actually in use.
++.sp
++How these details are handled may change in the future.
++.TP
++.B \fBcurrent\-vo\fP
++Current video output driver (name as used with \fB\-\-vo\fP).
++.TP
++.B \fBcurrent\-ao\fP
++Current audio output driver (name as used with \fB\-\-ao\fP).
++.TP
++.B \fBaudio\-out\-detected\-device\fP
++Return the audio device selected by the AO driver (only implemented for
++some drivers: currently only \fBcoreaudio\fP).
++.TP
++.B \fBworking\-directory\fP
++Return the working directory of the mpv process. Can be useful for JSON IPC
++users, because the command line player usually works with relative paths.
++.TP
++.B \fBprotocol\-list\fP
++List of protocol prefixes potentially recognized by the player. They are
++returned without trailing \fB://\fP suffix (which is still always required).
++In some cases, the protocol will not actually be supported (consider
++\fBhttps\fP if ffmpeg is not compiled with TLS support).
++.TP
++.B \fBdecoder\-list\fP
++List of decoders supported. This lists decoders which can be passed to
++\fB\-\-vd\fP and \fB\-\-ad\fP\&.
++.INDENT 7.0
++.TP
++.B \fBfamily\fP
++Decoder driver. Usually \fBlavc\fP for libavcodec.
++.TP
++.B \fBcodec\fP
++Canonical codec name, which identifies the format the decoder can
++handle.
++.TP
++.B \fBdriver\fP
++The name of the decoder itself. Often, this is the same as \fBcodec\fP\&.
++Sometimes it can be different. It is used to distinguish multiple
++decoders for the same codec.
++.TP
++.B \fBdescription\fP
++Human readable description of the decoder and codec.
++.UNINDENT
++.sp
++When querying the property with the client API using \fBMPV_FORMAT_NODE\fP,
++or with Lua \fBmp.get_property_native\fP, this will return a mpv_node with
++the following contents:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++MPV_FORMAT_NODE_ARRAY
++ MPV_FORMAT_NODE_MAP (for each decoder entry)
++ "family" MPV_FORMAT_STRING
++ "codec" MPV_FORMAT_STRING
++ "driver" MPV_FORMAT_STRING
++ "description" MPV_FORMAT_STRING
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBencoder\-list\fP
++List of libavcodec encoders. This has the same format as \fBdecoder\-list\fP\&.
++The encoder names (\fBdriver\fP entries) can be passed to \fB\-\-ovc\fP and
++\fB\-\-oac\fP (without the \fBlavc:\fP prefix required by \fB\-\-vd\fP and \fB\-\-ad\fP).
++.TP
++.B \fBmpv\-version\fP
++Return the mpv version/copyright string. Depending on how the binary was
++built, it might contain either a release version, or just a git hash.
++.TP
++.B \fBmpv\-configuration\fP
++Return the configuration arguments which were passed to the build system
++(typically the way \fB\&./waf configure ...\fP was invoked).
++.TP
++.B \fBffmpeg\-version\fP
++Return the contents of the \fBav_version_info()\fP API call. This is a string
++which identifies the build in some way, either through a release version
++number, or a git hash. This applies to Libav as well (the property is
++still named the same.) This property is unavailable if mpv is linked against
++older FFmpeg and Libav versions.
++.TP
++.B \fBoptions/<name>\fP (RW)
++Read\-only access to value of option \fB\-\-<name>\fP\&. Most options can be
++changed at runtime by writing to this property. Note that many options
++require reloading the file for changes to take effect. If there is an
++equivalent property, prefer setting the property instead.
++.TP
++.B \fBfile\-local\-options/<name>\fP
++Similar to \fBoptions/<name>\fP, but when setting an option through this
++property, the option is reset to its old value once the current file has
++stopped playing. Trying to write an option while no file is playing (or
++is being loaded) results in an error.
++.sp
++(Note that if an option is marked as file\-local, even \fBoptions/\fP will
++access the local value, and the \fBold\fP value, which will be restored on
++end of playback, can not be read or written until end of playback.)
++.TP
++.B \fBoption\-info/<name>\fP
++Additional per\-option information.
++.sp
++This has a number of sub\-properties. Replace \fB<name>\fP with the name of
++a top\-level option. No guarantee of stability is given to any of these
++sub\-properties \- they may change radically in the feature.
++.INDENT 7.0
++.TP
++.B \fBoption\-info/<name>/name\fP
++Returns the name of the option.
++.TP
++.B \fBoption\-info/<name>/type\fP
++Return the name of the option type, like \fBString\fP or \fBInteger\fP\&.
++For many complex types, this isn\(aqt very accurate.
++.TP
++.B \fBoption\-info/<name>/set\-from\-commandline\fP
++Return \fByes\fP if the option was set from the mpv command line,
++\fBno\fP otherwise. What this is set to if the option is e.g. changed
++at runtime is left undefined (meaning it could change in the future).
++.TP
++.B \fBoption\-info/<name>/set\-locally\fP
++Return \fByes\fP if the option was set per\-file. This is the case with
++automatically loaded profiles, file\-dir configs, and other cases. It
++means the option value will be restored to the value before playback
++start when playback ends.
++.TP
++.B \fBoption\-info/<name>/default\-value\fP
++The default value of the option. May not always be available.
++.TP
++.B \fBoption\-info/<name>/min\fP, \fBoption\-info/<name>/max\fP
++Integer minimum and maximum values allowed for the option. Only
++available if the options are numeric, and the minimum/maximum has been
++set internally. It\(aqs also possible that only one of these is set.
++.TP
++.B \fBoption\-info/<name>/choices\fP
++If the option is a choice option, the possible choices. Choices that
++are integers may or may not be included (they can be implied by \fBmin\fP
++and \fBmax\fP). Note that options which behave like choice options, but
++are not actual choice options internally, may not have this info
++available.
++.UNINDENT
++.TP
++.B \fBproperty\-list\fP
++Return the list of top\-level properties.
++.UNINDENT
++.SS Property Expansion
++.sp
++All string arguments to input commands as well as certain options (like
++\fB\-\-term\-playing\-msg\fP) are subject to property expansion. Note that property
++expansion does not work in places where e.g. numeric parameters are expected.
++(For example, the \fBadd\fP command does not do property expansion. The \fBset\fP
++command is an exception and not a general rule.)
++.INDENT 0.0
++.INDENT 3.5
++.IP "Example for input.conf"
++.INDENT 0.0
++.TP
++.B \fBi show\-text "Filename: ${filename}"\fP
++shows the filename of the current file when pressing the \fBi\fP key
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Within \fBinput.conf\fP, property expansion can be inhibited by putting the
++\fBraw\fP prefix in front of commands.
++.sp
++The following expansions are supported:
++.INDENT 0.0
++.TP
++.B \fB${NAME}\fP
++Expands to the value of the property \fBNAME\fP\&. If retrieving the property
++fails, expand to an error string. (Use \fB${NAME:}\fP with a trailing
++\fB:\fP to expand to an empty string instead.)
++If \fBNAME\fP is prefixed with \fB=\fP, expand to the raw value of the property
++(see section below).
++.TP
++.B \fB${NAME:STR}\fP
++Expands to the value of the property \fBNAME\fP, or \fBSTR\fP if the
++property cannot be retrieved. \fBSTR\fP is expanded recursively.
++.TP
++.B \fB${?NAME:STR}\fP
++Expands to \fBSTR\fP (recursively) if the property \fBNAME\fP is available.
++.TP
++.B \fB${!NAME:STR}\fP
++Expands to \fBSTR\fP (recursively) if the property \fBNAME\fP cannot be
++retrieved.
++.TP
++.B \fB${?NAME==VALUE:STR}\fP
++Expands to \fBSTR\fP (recursively) if the property \fBNAME\fP expands to a
++string equal to \fBVALUE\fP\&. You can prefix \fBNAME\fP with \fB=\fP in order to
++compare the raw value of a property (see section below). If the property
++is unavailable, or other errors happen when retrieving it, the value is
++never considered equal.
++Note that \fBVALUE\fP can\(aqt contain any of the characters \fB:\fP or \fB}\fP\&.
++Also, it is possible that escaping with \fB"\fP or \fB%\fP might be added in
++the future, should the need arise.
++.TP
++.B \fB${!NAME==VALUE:STR}\fP
++Same as with the \fB?\fP variant, but \fBSTR\fP is expanded if the value is
++not equal. (Using the same semantics as with \fB?\fP\&.)
++.TP
++.B \fB$$\fP
++Expands to \fB$\fP\&.
++.TP
++.B \fB$}\fP
++Expands to \fB}\fP\&. (To produce this character inside recursive
++expansion.)
++.TP
++.B \fB$>\fP
++Disable property expansion and special handling of \fB$\fP for the rest
++of the string.
++.UNINDENT
++.sp
++In places where property expansion is allowed, C\-style escapes are often
++accepted as well. Example:
++.INDENT 0.0
++.INDENT 3.5
++.INDENT 0.0
++.IP \(bu 2
++\fB\en\fP becomes a newline character
++.IP \(bu 2
++\fB\e\e\fP expands to \fB\e\fP
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.SS Raw and Formatted Properties
++.sp
++Normally, properties are formatted as human\-readable text, meant to be
++displayed on OSD or on the terminal. It is possible to retrieve an unformatted
++(raw) value from a property by prefixing its name with \fB=\fP\&. These raw values
++can be parsed by other programs and follow the same conventions as the options
++associated with the properties.
++.INDENT 0.0
++.INDENT 3.5
++.IP "Examples"
++.INDENT 0.0
++.IP \(bu 2
++\fB${time\-pos}\fP expands to \fB00:14:23\fP (if playback position is at 14
++minutes 23 seconds)
++.IP \(bu 2
++\fB${=time\-pos}\fP expands to \fB863.4\fP (same time, plus 400 milliseconds \-
++milliseconds are normally not shown in the formatted case)
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Sometimes, the difference in amount of information carried by raw and formatted
++property values can be rather big. In some cases, raw values have more
++information, like higher precision than seconds with \fBtime\-pos\fP\&. Sometimes
++it is the other way around, e.g. \fBaid\fP shows track title and language in the
++formatted case, but only the track number if it is raw.
++.SH ON SCREEN CONTROLLER
++.sp
++The On Screen Controller (short: OSC) is a minimal GUI integrated with mpv to
++offer basic mouse\-controllability. It is intended to make interaction easier
++for new users and to enable precise and direct seeking.
++.sp
++The OSC is enabled by default if mpv was compiled with Lua support. It can be
++disabled entirely using the \fB\-\-osc=no\fP option.
++.SS Using the OSC
++.sp
++By default, the OSC will show up whenever the mouse is moved inside the
++player window and will hide if the mouse is not moved outside the OSC for
++0.5 seconds or if the mouse leaves the window.
++.SS The Interface
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
+++\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
++| playlist prev | title | playlist next |
+++\-\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-+\-\-+\-\-\-\-\-\-+\-+\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+
++| audio | skip | seek | | seek | skip | full |
+++\-\-\-\-\-\-\-+ back | back | play | frwd | frwd | screen |
++| sub | | | | | | |
+++\-\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-+\-\-\-\-\-\-\-\-+
++| seekbar |
+++\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
++| time passed | cache status | time remaining |
+++\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.INDENT 0.0
++.TP
++.B playlist prev
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++play previous file in playlist
++T}
++_
++T{
++shift+L\-click
++T} T{
++show playlist
++T}
++_
++.TE
++.TP
++.B title
++.nf
++Displays current media\-title or filename
++.fi
++.sp
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++show playlist position and length and full title
++T}
++_
++T{
++right\-click
++T} T{
++show filename
++T}
++_
++.TE
++.TP
++.B playlist next
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++play next file in playlist
++T}
++_
++T{
++shift+L\-click
++T} T{
++show playlist
++T}
++_
++.TE
++.TP
++.B audio and sub
++.nf
++Displays selected track and amount of available tracks
++.fi
++.sp
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++cycle audio/sub tracks forward
++T}
++_
++T{
++right\-click
++T} T{
++cycle audio/sub tracks backwards
++T}
++_
++T{
++shift+L\-click
++T} T{
++show available audio/sub tracks
++T}
++_
++.TE
++.TP
++.B skip back
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++go to beginning of chapter / previous chapter
++T}
++_
++T{
++shift+L\-click
++T} T{
++show chapters
++T}
++_
++.TE
++.TP
++.B seek back
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++skip back 5 seconds
++T}
++_
++T{
++right\-click
++T} T{
++skip back 30 seconds
++T}
++_
++T{
++shift\-L\-click
++T} T{
++skip back 1 frame
++T}
++_
++.TE
++.TP
++.B play
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++toggle play/pause
++T}
++_
++.TE
++.TP
++.B seek frwd
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++skip forward 10 seconds
++T}
++_
++T{
++right\-click
++T} T{
++skip forward 60 seconds
++T}
++_
++T{
++shift\-L\-click
++T} T{
++skip forward 1 frame
++T}
++_
++.TE
++.TP
++.B skip frwd
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++go to next chapter
++T}
++_
++T{
++shift+L\-click
++T} T{
++show chapters
++T}
++_
++.TE
++.TP
++.B fullscreen
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++toggle fullscreen
++T}
++_
++.TE
++.TP
++.B seekbar
++.nf
++Indicates current playback position and position of chapters
++.fi
++.sp
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++seek to position
++T}
++_
++.TE
++.TP
++.B time passed
++.nf
++Shows current playback position timestamp
++.fi
++.sp
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++toggle displaying timecodes with milliseconds
++T}
++_
++.TE
++.TP
++.B cache status
++.nf
++Shows current cache fill status (only visible when below 45%)
++.fi
++.sp
++.TP
++.B time remaining
++.nf
++Shows remaining playback time timestamp
++.fi
++.sp
++.TS
++center;
++|l|l|.
++_
++T{
++left\-click
++T} T{
++toggle between total and remaining time
++T}
++_
++.TE
++.UNINDENT
++.SS Key Bindings
++.sp
++These key bindings are active by default if nothing else is already bound to
++these keys. In case of collision, the function needs to be bound to a
++different key. See the \fI\%Script Commands\fP section.
++.TS
++center;
++|l|l|.
++_
++T{
++del
++T} T{
++Cycles visibility between never / auto (mouse\-move) / always
++T}
++_
++.TE
++.SS Configuration
++.sp
++The OSC offers limited configuration through a config file
++\fBlua\-settings/osc.conf\fP placed in mpv\(aqs user dir and through the
++\fB\-\-script\-opts\fP command\-line option. Options provided through the command\-line
++will override those from the config file.
++.SS Config Syntax
++.sp
++The config file must exactly follow the following syntax:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++# this is a comment
++optionA=value1
++optionB=value2
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++\fB#\fP can only be used at the beginning of a line and there may be no
++spaces around the \fB=\fP or anywhere else.
++.SS Command\-line Syntax
++.sp
++To avoid collisions with other scripts, all options need to be prefixed with
++\fBosc\-\fP\&.
++.sp
++Example:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++\-\-script\-opts=osc\-optionA=value1,osc\-optionB=value2
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.SS Configurable Options
++.INDENT 0.0
++.TP
++.B \fBshowwindowed\fP
++.nf
++Default: yes
++Enable the OSC when windowed
++.fi
++.sp
++.TP
++.B \fBshowfullscreen\fP
++.nf
++Default: yes
++Enable the OSC when fullscreen
++.fi
++.sp
++.TP
++.B \fBscalewindowed\fP
++.nf
++Default: 1.0
++Scale factor of the OSC when windowed
++.fi
++.sp
++.TP
++.B \fBscalefullscreen\fP
++.nf
++Default: 1.0
++Scale factor of the OSC when fullscreen
++.fi
++.sp
++.TP
++.B \fBscaleforcedwindow\fP
++.nf
++Default: 2.0
++Scale factor of the OSC when rendered on a forced (dummy) window
++.fi
++.sp
++.TP
++.B \fBvidscale\fP
++.nf
++Default: yes
++Scale the OSC with the video
++\fBno\fP tries to keep the OSC size constant as much as the window size allows
++.fi
++.sp
++.TP
++.B \fBvalign\fP
++.nf
++Default: 0.8
++Vertical alignment, \-1 (top) to 1 (bottom)
++.fi
++.sp
++.TP
++.B \fBhalign\fP
++.nf
++Default: 0.0
++Horizontal alignment, \-1 (left) to 1 (right)
++.fi
++.sp
++.TP
++.B \fBboxalpha\fP
++.nf
++Default: 80
++Alpha of the background box, 0 (opaque) to 255 (fully transparent)
++.fi
++.sp
++.TP
++.B \fBhidetimeout\fP
++.nf
++Default: 500
++Duration in ms until the OSC hides if no mouse movement, must not be
++negative
++.fi
++.sp
++.TP
++.B \fBfadeduration\fP
++.nf
++Default: 200
++Duration of fade out in ms, 0 = no fade
++.fi
++.sp
++.TP
++.B \fBdeadzonesize\fP
++.nf
++Default: 0
++Size of the deadzone. The deadzone is an area that makes the mouse act
++like leaving the window. Movement there won\(aqt make the OSC show up and
++it will hide immediately if the mouse enters it. The deadzone starts
++at the window border opposite to the OSC and the size controls how much
++of the window it will span. Values between 0 and 1.
++.fi
++.sp
++.TP
++.B \fBminmousemove\fP
++.nf
++Default: 3
++Minimum amount of pixels the mouse has to move between ticks to make
++the OSC show up
++.fi
++.sp
++.TP
++.B \fBlayout\fP
++.nf
++Default: box
++The layout for the OSC. Currently available are: box, slimbox,
++bottombar and topbar.
++.fi
++.sp
++.TP
++.B \fBseekbarstyle\fP
++.nf
++Default: slider
++Sets the style of the seekbar, slider (diamond marker) or bar (fill)
++.fi
++.sp
++.TP
++.B \fBtimetotal\fP
++.nf
++Default: no
++Show total time instead of time remaining
++.fi
++.sp
++.TP
++.B \fBtimems\fP
++.nf
++Default: no
++Display timecodes with milliseconds
++.fi
++.sp
++.TP
++.B \fBvisibility\fP
++.nf
++Default: auto (auto hide/show on mouse move)
++Also supports \fBnever\fP and \fBalways\fP
++.fi
++.sp
++.UNINDENT
++.SS Script Commands
++.sp
++The OSC script listens to certain script commands. These commands can bound
++in \fBinput.conf\fP, or sent by other scripts.
++.INDENT 0.0
++.TP
++.B \fBosc\-message\fP
++Show a message on screen using the OSC. First argument is the message,
++second the duration in seconds.
++.TP
++.B \fBosc\-visibility\fP
++Controls visibility mode \fBnever\fP / \fBauto\fP (on mouse move) / \fBalways\fP
++and also \fBcycle\fP to cycle between the modes
++.UNINDENT
++.sp
++Example
++.sp
++You could put this into \fBinput.conf\fP to hide the OSC with the \fBa\fP key and
++to set auto mode (the default) with \fBb\fP:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++a script\-message osc\-visibility never
++b script\-message osc\-visibility auto
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.SH LUA SCRIPTING
++.sp
++mpv can load Lua scripts. Scripts passed to the \fB\-\-script\fP option, or found in
++the \fBscripts\fP subdirectory of the mpv configuration directory (usually
++\fB~/.config/mpv/scripts/\fP) will be loaded on program start. mpv also appends the
++\fBscripts\fP subdirectory to the end of Lua\(aqs path so you can import scripts from
++there too. Since it\(aqs added to the end, don\(aqt name scripts you want to import
++the same as Lua libraries because they will be overshadowed by them.
++.sp
++mpv provides the built\-in module \fBmp\fP, which contains functions to send
++commands to the mpv core and to retrieve information about playback state, user
++settings, file information, and so on.
++.sp
++These scripts can be used to control mpv in a similar way to slave mode.
++Technically, the Lua code uses the client API internally.
++.SS Example
++.sp
++A script which leaves fullscreen mode when the player is paused:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++function on_pause_change(name, value)
++ if value == true then
++ mp.set_property("fullscreen", "no")
++ end
++end
++mp.observe_property("pause", "bool", on_pause_change)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.SS Details on the script initialization and lifecycle
++.sp
++Your script will be loaded by the player at program start from the \fBscripts\fP
++configuration subdirectory, or from a path specified with the \fB\-\-script\fP
++option. Some scripts are loaded internally (like \fB\-\-osc\fP). Each script runs in
++its own thread. Your script is first run "as is", and once that is done, the event loop
++is entered. This event loop will dispatch events received by mpv and call your
++own event handlers which you have registered with \fBmp.register_event\fP, or
++timers added with \fBmp.add_timeout\fP or similar.
++.sp
++When the player quits, all scripts will be asked to terminate. This happens via
++a \fBshutdown\fP event, which by default will make the event loop return. If your
++script got into an endless loop, mpv will probably behave fine during playback
++(unless the player is suspended, see \fBmp.suspend\fP), but it won\(aqt terminate
++when quitting, because it\(aqs waiting on your script.
++.sp
++Internally, the C code will call the Lua function \fBmp_event_loop\fP after
++loading a Lua script. This function is normally defined by the default prelude
++loaded before your script (see \fBplayer/lua/defaults.lua\fP in the mpv sources).
++The event loop will wait for events and dispatch events registered with
++\fBmp.register_event\fP\&. It will also handle timers added with \fBmp.add_timeout\fP
++and similar (by waiting with a timeout).
++.sp
++Since mpv 0.6.0, the player will wait until the script is fully loaded before
++continuing normal operation. The player considers a script as fully loaded as
++soon as it starts waiting for mpv events (or it exits). In practice this means
++the player will more or less hang until the script returns from the main chunk
++(and \fBmp_event_loop\fP is called), or the script calls \fBmp_event_loop\fP or
++\fBmp.dispatch_events\fP directly. This is done to make it possible for a script
++to fully setup event handlers etc. before playback actually starts. In older
++mpv versions, this happened asynchronously.
++.SS mp functions
++.sp
++The \fBmp\fP module is preloaded, although it can be loaded manually with
++\fBrequire \(aqmp\(aq\fP\&. It provides the core client API.
++.INDENT 0.0
++.TP
++.B \fBmp.command(string)\fP
++Run the given command. This is similar to the commands used in input.conf.
++See \fI\%List of Input Commands\fP\&.
++.sp
++By default, this will show something on the OSD (depending on the command),
++as if it was used in \fBinput.conf\fP\&. See \fI\%Input Command Prefixes\fP how
++to influence OSD usage per command.
++.sp
++Returns \fBtrue\fP on success, or \fBnil, error\fP on error.
++.TP
++.B \fBmp.commandv(arg1, arg2, ...)\fP
++Similar to \fBmp.command\fP, but pass each command argument as separate
++parameter. This has the advantage that you don\(aqt have to care about
++quoting and escaping in some cases.
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mp.command("loadfile " .. filename .. " append")
++mp.commandv("loadfile", filename, "append")
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++These two commands are equivalent, except that the first version breaks
++if the filename contains spaces or certain special characters.
++.sp
++Note that properties are \fInot\fP expanded. You can use either \fBmp.command\fP,
++the \fBexpand\-properties\fP prefix, or the \fBmp.get_property\fP family of
++functions.
++.sp
++Unlike \fBmp.command\fP, this will not use OSD by default either (except
++for some OSD\-specific commands).
++.TP
++.B \fBmp.command_native(table [,def])\fP
++Similar to \fBmp.commandv\fP, but pass the argument list as table. This has
++the advantage that in at least some cases, arguments can be passed as
++native types.
++.sp
++Returns a result table on success (usually empty), or \fBdef, error\fP on
++error. \fBdef\fP is the second parameter provided to the function, and is
++nil if it\(aqs missing.
++.TP
++.B \fBmp.get_property(name [,def])\fP
++Return the value of the given property as string. These are the same
++properties as used in input.conf. See \fI\%Properties\fP for a list of
++properties. The returned string is formatted similar to \fB${=name}\fP
++(see \fI\%Property Expansion\fP).
++.sp
++Returns the string on success, or \fBdef, error\fP on error. \fBdef\fP is the
++second parameter provided to the function, and is nil if it\(aqs missing.
++.TP
++.B \fBmp.get_property_osd(name [,def])\fP
++Similar to \fBmp.get_property\fP, but return the property value formatted for
++OSD. This is the same string as printed with \fB${name}\fP when used in
++input.conf.
++.sp
++Returns the string on success, or \fBdef, error\fP on error. \fBdef\fP is the
++second parameter provided to the function, and is an empty string if it\(aqs
++missing. Unlike \fBget_property()\fP, assigning the return value to a variable
++will always result in a string.
++.TP
++.B \fBmp.get_property_bool(name [,def])\fP
++Similar to \fBmp.get_property\fP, but return the property value as Boolean.
++.sp
++Returns a Boolean on success, or \fBdef, error\fP on error.
++.TP
++.B \fBmp.get_property_number(name [,def])\fP
++Similar to \fBmp.get_property\fP, but return the property value as number.
++.sp
++Note that while Lua does not distinguish between integers and floats,
++mpv internals do. This function simply request a double float from mpv,
++and mpv will usually convert integer property values to float.
++.sp
++Returns a number on success, or \fBdef, error\fP on error.
++.TP
++.B \fBmp.get_property_native(name [,def])\fP
++Similar to \fBmp.get_property\fP, but return the property value using the best
++Lua type for the property. Most time, this will return a string, Boolean,
++or number. Some properties (for example \fBchapter\-list\fP) are returned as
++tables.
++.sp
++Returns a value on success, or \fBdef, error\fP on error. Note that \fBnil\fP
++might be a possible, valid value too in some corner cases.
++.TP
++.B \fBmp.set_property(name, value)\fP
++Set the given property to the given string value. See \fBmp.get_property\fP
++and \fI\%Properties\fP for more information about properties.
++.sp
++Returns true on success, or \fBnil, error\fP on error.
++.TP
++.B \fBmp.set_property_bool(name, value)\fP
++Similar to \fBmp.set_property\fP, but set the given property to the given
++Boolean value.
++.TP
++.B \fBmp.set_property_number(name, value)\fP
++Similar to \fBmp.set_property\fP, but set the given property to the given
++numeric value.
++.sp
++Note that while Lua does not distinguish between integers and floats,
++mpv internals do. This function will test whether the number can be
++represented as integer, and if so, it will pass an integer value to mpv,
++otherwise a double float.
++.TP
++.B \fBmp.set_property_native(name, value)\fP
++Similar to \fBmp.set_property\fP, but set the given property using its native
++type.
++.sp
++Since there are several data types which can not represented natively in
++Lua, this might not always work as expected. For example, while the Lua
++wrapper can do some guesswork to decide whether a Lua table is an array
++or a map, this would fail with empty tables. Also, there are not many
++properties for which it makes sense to use this, instead of
++\fBset_property\fP, \fBset_property_bool\fP, \fBset_property_number\fP\&.
++For these reasons, this function should probably be avoided for now, except
++for properties that use tables natively.
++.TP
++.B \fBmp.get_time()\fP
++Return the current mpv internal time in seconds as a number. This is
++basically the system time, with an arbitrary offset.
++.TP
++.B \fBmp.add_key_binding(key, name|fn [,fn [,flags]])\fP
++Register callback to be run on a key binding. The binding will be mapped to
++the given \fBkey\fP, which is a string describing the physical key. This uses
++the same key names as in input.conf, and also allows combinations
++(e.g. \fBctrl+a\fP). If the key is empty or \fBnil\fP, no physical key is
++registered, but the user still can create own bindings (see below).
++.sp
++After calling this function, key presses will cause the function \fBfn\fP to
++be called (unless the user remapped the key with another binding).
++.sp
++The \fBname\fP argument should be a short symbolic string. It allows the user
++to remap the key binding via input.conf using the \fBscript\-message\fP
++command, and the name of the key binding (see below for
++an example). The name should be unique across other bindings in the same
++script \- if not, the previous binding with the same name will be
++overwritten. You can omit the name, in which case a random name is generated
++internally.
++.sp
++The last argument is used for optional flags. This is a table, which can
++have the following entries:
++.INDENT 7.0
++.INDENT 3.5
++.INDENT 0.0
++.TP
++.B \fBrepeatable\fP
++If set to \fBtrue\fP, enables key repeat for this specific binding.
++.TP
++.B \fBcomplex\fP
++If set to \fBtrue\fP, then \fBfn\fP is called on both key up and down
++events (as well as key repeat, if enabled), with the first
++argument being a table. This table has an \fBevent\fP entry, which
++is set to one of the strings \fBdown\fP, \fBrepeat\fP, \fBup\fP or
++\fBpress\fP (the latter if key up/down can\(aqt be tracked). It further
++has an \fBis_mouse\fP entry, which tells whether the event was caused
++by a mouse button.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Internally, key bindings are dispatched via the \fBscript\-message\-to\fP or
++\fBscript\-binding\fP input commands and \fBmp.register_script_message\fP\&.
++.sp
++Trying to map multiple commands to a key will essentially prefer a random
++binding, while the other bindings are not called. It is guaranteed that
++user defined bindings in the central input.conf are preferred over bindings
++added with this function (but see \fBmp.add_forced_key_binding\fP).
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++function something_handler()
++ print("the key was pressed")
++end
++mp.add_key_binding("x", "something", something_handler)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++This will print the message \fBthe key was pressed\fP when \fBx\fP was pressed.
++.sp
++The user can remap these key bindings. Then the user has to put the
++following into his input.conf to remap the command to the \fBy\fP key:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++y script\-binding something
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++This will print the message when the key \fBy\fP is pressed. (\fBx\fP will
++still work, unless the user remaps it.)
++.sp
++You can also explicitly send a message to a named script only. Assume the
++above script was using the filename \fBfooscript.lua\fP:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++y script\-binding fooscript/something
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBmp.add_forced_key_binding(...)\fP
++This works almost the same as \fBmp.add_key_binding\fP, but registers the
++key binding in a way that will overwrite the user\(aqs custom bindings in his
++input.conf. (\fBmp.add_key_binding\fP overwrites default key bindings only,
++but not those by the user\(aqs input.conf.)
++.TP
++.B \fBmp.remove_key_binding(name)\fP
++Remove a key binding added with \fBmp.add_key_binding\fP or
++\fBmp.add_forced_key_binding\fP\&. Use the same name as you used when adding
++the bindings. It\(aqs not possible to remove bindings for which you omitted
++the name.
++.TP
++.B \fBmp.register_event(name, fn)\fP
++Call a specific function when an event happens. The event name is a string,
++and the function fn is a Lua function value.
++.sp
++Some events have associated data. This is put into a Lua table and passed
++as argument to fn. The Lua table by default contains a \fBname\fP field,
++which is a string containing the event name. If the event has an error
++associated, the \fBerror\fP field is set to a string describing the error,
++on success it\(aqs not set.
++.sp
++If multiple functions are registered for the same event, they are run in
++registration order, which the first registered function running before all
++the other ones.
++.sp
++Returns true if such an event exists, false otherwise.
++.sp
++See \fI\%Events\fP and \fI\%List of events\fP for details.
++.TP
++.B \fBmp.unregister_event(fn)\fP
++Undo \fBmp.register_event(..., fn)\fP\&. This removes all event handlers that
++are equal to the \fBfn\fP parameter. This uses normal Lua \fB==\fP comparison,
++so be careful when dealing with closures.
++.TP
++.B \fBmp.observe_property(name, type, fn)\fP
++Watch a property for changes. If the property \fBname\fP is changed, then
++the function \fBfn(name)\fP will be called. \fBtype\fP can be \fBnil\fP, or be
++set to one of \fBnone\fP, \fBnative\fP, \fBbool\fP, \fBstring\fP, or \fBnumber\fP\&.
++\fBnone\fP is the same as \fBnil\fP\&. For all other values, the new value of
++the property will be passed as second argument to \fBfn\fP, using
++\fBmp.get_property_<type>\fP to retrieve it. This means if \fBtype\fP is for
++example \fBstring\fP, \fBfn\fP is roughly called as in
++\fBfn(name, mp.get_property_string(name))\fP\&.
++.sp
++If possible, change events are coalesced. If a property is changed a bunch
++of times in a row, only the last change triggers the change function. (The
++exact behavior depends on timing and other things.)
++.sp
++In some cases the function is not called even if the property changes.
++Whether this can happen depends on the property.
++.sp
++If the \fBtype\fP is \fBnone\fP or \fBnil\fP, sporadic property change events are
++possible. This means the change function \fBfn\fP can be called even if the
++property doesn\(aqt actually change.
++.TP
++.B \fBmp.unobserve_property(fn)\fP
++Undo \fBmp.observe_property(..., fn)\fP\&. This removes all property handlers
++that are equal to the \fBfn\fP parameter. This uses normal Lua \fB==\fP
++comparison, so be careful when dealing with closures.
++.TP
++.B \fBmp.add_timeout(seconds, fn)\fP
++Call the given function fn when the given number of seconds has elapsed.
++Note that the number of seconds can be fractional. For now, the timer\(aqs
++resolution may be as low as 50 ms, although this will be improved in the
++future.
++.sp
++This is a one\-shot timer: it will be removed when it\(aqs fired.
++.sp
++Returns a timer object. See \fBmp.add_periodic_timer\fP for details.
++.TP
++.B \fBmp.add_periodic_timer(seconds, fn)\fP
++Call the given function periodically. This is like \fBmp.add_timeout\fP, but
++the timer is re\-added after the function fn is run.
++.INDENT 7.0
++.TP
++.B Returns a timer object. The timer object provides the following methods:
++.INDENT 7.0
++.TP
++.B \fBstop()\fP
++Disable the timer. Does nothing if the timer is already disabled.
++This will remember the current elapsed time when stopping, so that
++\fBresume()\fP essentially unpauses the timer.
++.TP
++.B \fBkill()\fP
++Disable the timer. Resets the elapsed time. \fBresume()\fP will
++restart the timer.
++.TP
++.B \fBresume()\fP
++Restart the timer. If the timer was disabled with \fBstop()\fP, this
++will resume at the time it was stopped. If the timer was disabled
++with \fBkill()\fP, or if it\(aqs a previously fired one\-shot timer (added
++with \fBadd_timeout()\fP), this starts the timer from the beginning,
++using the initially configured timeout.
++.TP
++.B \fBis_enabled()\fP
++Whether the timer is currently enabled or was previously disabled
++(e.g. by \fBstop()\fP or \fBkill()\fP).
++.TP
++.B \fBtimeout\fP (RW)
++This field contains the current timeout period. This value is not
++updated as time progresses. It\(aqs only used to calculate when the
++timer should fire next when the timer expires.
++.sp
++If you write this, you can call \fBt:kill() ; t:resume()\fP to reset
++the current timeout to the new one. (\fBt:stop()\fP won\(aqt use the
++new timeout.)
++.TP
++.B \fBoneshot\fP (RW)
++Whether the timer is periodic (\fBfalse\fP) or fires just once
++(\fBtrue\fP). This value is used when the timer expires (but before
++the timer callback function fn is run).
++.UNINDENT
++.UNINDENT
++.sp
++Note that these are method, and you have to call them using \fB:\fP instead
++of \fB\&.\fP (Refer to \fI\%http://www.lua.org/manual/5.2/manual.html#3.4.9\fP .)
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++seconds = 0
++timer = mp.add_periodic_timer(1, function()
++ print("called every second")
++ # stop it after 10 seconds
++ seconds = seconds + 1
++ if seconds >= 10 then
++ timer:kill()
++ end
++end)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBmp.get_opt(key)\fP
++Return a setting from the \fB\-\-script\-opts\fP option. It\(aqs up to the user and
++the script how this mechanism is used. Currently, all scripts can access
++this equally, so you should be careful about collisions.
++.TP
++.B \fBmp.get_script_name()\fP
++Return the name of the current script. The name is usually made of the
++filename of the script, with directory and file extension removed. If
++there are several scripts which would have the same name, it\(aqs made unique
++by appending a number.
++.INDENT 7.0
++.INDENT 3.5
++.IP "Example"
++.sp
++The script \fB/path/to/fooscript.lua\fP becomes \fBfooscript\fP\&.
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBmp.osd_message(text [,duration])\fP
++Show an OSD message on the screen. \fBduration\fP is in seconds, and is
++optional (uses \fB\-\-osd\-duration\fP by default).
++.UNINDENT
++.SS Advanced mp functions
++.sp
++These also live in the \fBmp\fP module, but are documented separately as they
++are useful only in special situations.
++.INDENT 0.0
++.TP
++.B \fBmp.suspend()\fP
++Suspend the mpv main loop. There is a long\-winded explanation of this in
++the C API function \fBmpv_suspend()\fP\&. In short, this prevents the player
++from displaying the next video frame, so that you don\(aqt get blocked when
++trying to access the player.
++.sp
++Before mpv 0.17.0, this was automatically called by the event handler.
++.TP
++.B \fBmp.resume()\fP
++Undo one \fBmp.suspend()\fP call. \fBmp.suspend()\fP increments an internal
++counter, and \fBmp.resume()\fP decrements it. When 0 is reached, the player
++is actually resumed.
++.TP
++.B \fBmp.resume_all()\fP
++This resets the internal suspend counter and resumes the player. (It\(aqs
++like calling \fBmp.resume()\fP until the player is actually resumed.)
++.TP
++.B \fBmp.get_wakeup_pipe()\fP
++Calls \fBmpv_get_wakeup_pipe()\fP and returns the read end of the wakeup
++pipe. (See \fBclient.h\fP for details.)
++.TP
++.B \fBmp.get_next_timeout()\fP
++Return the relative time in seconds when the next timer (\fBmp.add_timeout\fP
++and similar) expires. If there is no timer, return \fBnil\fP\&.
++.TP
++.B \fBmp.dispatch_events([allow_wait])\fP
++This can be used to run custom event loops. If you want to have direct
++control what the Lua script does (instead of being called by the default
++event loop), you can set the global variable \fBmp_event_loop\fP to your
++own function running the event loop. From your event loop, you should call
++\fBmp.dispatch_events()\fP to dequeue and dispatch mpv events.
++.sp
++If the \fBallow_wait\fP parameter is set to \fBtrue\fP, the function will block
++until the next event is received or the next timer expires. Otherwise (and
++this is the default behavior), it returns as soon as the event loop is
++emptied. It\(aqs strongly recommended to use \fBmp.get_next_timeout()\fP and
++\fBmp.get_wakeup_pipe()\fP if you\(aqre interested in properly working
++notification of new events and working timers.
++.TP
++.B \fBmp.enable_messages(level)\fP
++Set the minimum log level of which mpv message output to receive. These
++messages are normally printed to the terminal. By calling this function,
++you can set the minimum log level of messages which should be received with
++the \fBlog\-message\fP event. See the description of this event for details.
++The level is a string, see \fBmsg.log\fP for allowed log levels.
++.TP
++.B \fBmp.register_script_message(name, fn)\fP
++This is a helper to dispatch \fBscript\-message\fP or \fBscript\-message\-to\fP
++invocations to Lua functions. \fBfn\fP is called if \fBscript\-message\fP or
++\fBscript\-message\-to\fP (with this script as destination) is run
++with \fBname\fP as first parameter. The other parameters are passed to \fBfn\fP\&.
++If a message with the given name is already registered, it\(aqs overwritten.
++.sp
++Used by \fBmp.add_key_binding\fP, so be careful about name collisions.
++.TP
++.B \fBmp.unregister_script_message(name)\fP
++Undo a previous registration with \fBmp.register_script_message\fP\&. Does
++nothing if the \fBname\fP wasn\(aqt registered.
++.UNINDENT
++.SS mp.msg functions
++.sp
++This module allows outputting messages to the terminal, and can be loaded
++with \fBrequire \(aqmp.msg\(aq\fP\&.
++.INDENT 0.0
++.TP
++.B \fBmsg.log(level, ...)\fP
++The level parameter is the message priority. It\(aqs a string and one of
++\fBfatal\fP, \fBerror\fP, \fBwarn\fP, \fBinfo\fP, \fBv\fP, \fBdebug\fP\&. The user\(aqs
++settings will determine which of these messages will be visible. Normally,
++all messages are visible, except \fBv\fP and \fBdebug\fP\&.
++.sp
++The parameters after that are all converted to strings. Spaces are inserted
++to separate multiple parameters.
++.sp
++You don\(aqt need to add newlines.
++.TP
++.B \fBmsg.fatal(...)\fP, \fBmsg.error(...)\fP, \fBmsg.warn(...)\fP, \fBmsg.info(...)\fP, \fBmsg.verbose(...)\fP, \fBmsg.debug(...)\fP
++All of these are shortcuts and equivalent to the corresponding
++\fBmsg.log(level, ...)\fP call.
++.UNINDENT
++.SS mp.options functions
++.sp
++mpv comes with a built\-in module to manage options from config\-files and the
++command\-line. All you have to do is to supply a table with default options to
++the read_options function. The function will overwrite the default values
++with values found in the config\-file and the command\-line (in that order).
++.INDENT 0.0
++.TP
++.B \fBoptions.read_options(table [, identifier])\fP
++A \fBtable\fP with key\-value pairs. The type of the default values is
++important for converting the values read from the config file or
++command\-line back. Do not use \fBnil\fP as a default value!
++.sp
++The \fBidentifier\fP is used to identify the config\-file and the command\-line
++options. These needs to unique to avoid collisions with other scripts.
++Defaults to \fBmp.get_script_name()\fP\&.
++.UNINDENT
++.sp
++Example implementation:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++require \(aqmp.options\(aq
++local options = {
++ optionA = "defaultvalueA",
++ optionB = \-0.5,
++ optionC = true,
++}
++read_options(options, "myscript")
++print(options.optionA)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++The config file will be stored in \fBlua\-settings/identifier.conf\fP in mpv\(aqs user
++folder. Comment lines can be started with # and stray spaces are not removed.
++Boolean values will be represented with yes/no.
++.sp
++Example config:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++# comment
++optionA=Hello World
++optionB=9999
++optionC=no
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Command\-line options are read from the \fB\-\-script\-opts\fP parameter. To avoid
++collisions, all keys have to be prefixed with \fBidentifier\-\fP\&.
++.sp
++Example command\-line:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++\-\-script\-opts=myscript\-optionA=TEST,myscript\-optionB=0,myscript\-optionC=yes
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.SS mp.utils options
++.sp
++This built\-in module provides generic helper functions for Lua, and have
++strictly speaking nothing to do with mpv or video/audio playback. They are
++provided for convenience. Most compensate for Lua\(aqs scarce standard library.
++.sp
++Be warned that any of these functions might disappear any time. They are not
++strictly part of the guaranteed API.
++.INDENT 0.0
++.TP
++.B \fButils.getcwd()\fP
++Returns the directory that mpv was launched from. On error, \fBnil, error\fP
++is returned.
++.TP
++.B \fButils.readdir(path [, filter])\fP
++Enumerate all entries at the given path on the filesystem, and return them
++as array. Each entry is a directory entry (without the path).
++The list is unsorted (in whatever order the operating system returns it).
++.sp
++If the \fBfilter\fP argument is given, it must be one of the following
++strings:
++.INDENT 7.0
++.INDENT 3.5
++.INDENT 0.0
++.TP
++.B \fBfiles\fP
++List regular files only. This excludes directories, special files
++(like UNIX device files or FIFOs), and dead symlinks. It includes
++UNIX symlinks to regular files.
++.TP
++.B \fBdirs\fP
++List directories only, or symlinks to directories. \fB\&.\fP and \fB\&..\fP
++are not included.
++.TP
++.B \fBnormal\fP
++Include the results of both \fBfiles\fP and \fBdirs\fP\&. (This is the
++default.)
++.TP
++.B \fBall\fP
++List all entries, even device files, dead symlinks, FIFOs, and the
++\fB\&.\fP and \fB\&..\fP entries.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++On error, \fBnil, error\fP is returned.
++.TP
++.B \fButils.split_path(path)\fP
++Split a path into directory component and filename component, and return
++them. The first return value is always the directory. The second return
++value is the trailing part of the path, the directory entry.
++.TP
++.B \fButils.join_path(p1, p2)\fP
++Return the concatenation of the 2 paths. Tries to be clever. For example,
++if \fB\(gap2\fP is an absolute path, p2 is returned without change.
++.TP
++.B \fButils.subprocess(t)\fP
++Runs an external process and waits until it exits. Returns process status
++and the captured output.
++.sp
++The parameter \fBt\fP is a table. The function reads the following entries:
++.INDENT 7.0
++.INDENT 3.5
++.INDENT 0.0
++.TP
++.B \fBargs\fP
++Array of strings. The first array entry is the executable. This
++can be either an absolute path, or a filename with no path
++components, in which case the \fBPATH\fP environment variable is
++used to resolve the executable. The other array elements are
++passed as command line arguments.
++.TP
++.B \fBcancellable\fP
++Optional. If set to \fBtrue\fP (default), then if the user stops
++playback or goes to the next file while the process is running,
++the process will be killed.
++.TP
++.B \fBmax_size\fP
++Optional. The maximum size in bytes of the data that can be captured
++from stdout. (Default: 16 MB.)
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++The function returns a table as result with the following entries:
++.INDENT 7.0
++.INDENT 3.5
++.INDENT 0.0
++.TP
++.B \fBstatus\fP
++The raw exit status of the process. It will be negative on error.
++.TP
++.B \fBstdout\fP
++Captured output stream as string, limited to \fBmax_size\fP\&.
++.TP
++.B \fBerror\fP
++\fBnil\fP on success. The string \fBkilled\fP if the process was
++terminated in an unusual way. The string \fBinit\fP if the process
++could not be started.
++.sp
++On Windows, \fBkilled\fP is only returned when the process has been
++killed by mpv as a result of \fBcancellable\fP being set to \fBtrue\fP\&.
++.TP
++.B \fBkilled_by_us\fP
++Set to \fBtrue\fP if the process has been killed by mpv as a result
++of \fBcancellable\fP being set to \fBtrue\fP\&.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++In all cases, \fBmp.resume_all()\fP is implicitly called.
++.TP
++.B \fButils.parse_json(str [, trail])\fP
++Parses the given string argument as JSON, and returns it as a Lua table. On
++error, returns \fBnil, error\fP\&. (Currently, \fBerror\fP is just a string
++reading \fBerror\fP, because there is no fine\-grained error reporting of any
++kind.)
++.sp
++The returned value uses similar conventions as \fBmp.get_property_native()\fP
++to distinguish empty objects and arrays.
++.sp
++If the \fBtrail\fP parameter is \fBtrue\fP (or any value equal to \fBtrue\fP),
++then trailing non\-whitespace text is tolerated by the function, and the
++trailing text is returned as 3rd return value. (The 3rd return value is
++always there, but with \fBtrail\fP set, no error is raised.)
++.TP
++.B \fButils.format_json(v)\fP
++Format the given Lua table (or value) as a JSON string and return it. On
++error, returns \fBnil, error\fP\&. (Errors usually only happen on value types
++incompatible with JSON.)
++.sp
++The argument value uses similar conventions as \fBmp.set_property_native()\fP
++to distinguish empty objects and arrays.
++.TP
++.B \fButils.to_string(v)\fP
++Turn the given value into a string. Formats tables and their contents. This
++doesn\(aqt do anything special; it is only needed because Lua is terrible.
++.UNINDENT
++.SS Events
++.sp
++Events are notifications from player core to scripts. You can register an
++event handler with \fBmp.register_event\fP\&.
++.sp
++Note that all scripts (and other parts of the player) receive events equally,
++and there\(aqs no such thing as blocking other scripts from receiving events.
++.sp
++Example:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++function my_fn(event)
++ print("start of playback!")
++end
++
++mp.register_event("file\-loaded", my_fn)
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.SS List of events
++.INDENT 0.0
++.TP
++.B \fBstart\-file\fP
++Happens right before a new file is loaded. When you receive this, the
++player is loading the file (or possibly already done with it).
++.TP
++.B \fBend\-file\fP
++Happens after a file was unloaded. Typically, the player will load the
++next file right away, or quit if this was the last file.
++.sp
++The event has the \fBreason\fP field, which takes one of these values:
++.INDENT 7.0
++.TP
++.B \fBeof\fP
++The file has ended. This can (but doesn\(aqt have to) include
++incomplete files or broken network connections under
++circumstances.
++.TP
++.B \fBstop\fP
++Playback was ended by a command.
++.TP
++.B \fBquit\fP
++Playback was ended by sending the quit command.
++.TP
++.B \fBerror\fP
++An error happened. In this case, an \fBerror\fP field is present with
++the error string.
++.TP
++.B \fBredirect\fP
++Happens with playlists and similar. Details see
++\fBMPV_END_FILE_REASON_REDIRECT\fP in the C API.
++.TP
++.B \fBunknown\fP
++Unknown. Normally doesn\(aqt happen, unless the Lua API is out of sync
++with the C API. (Likewise, it could happen that your script gets
++reason strings that did not exist yet at the time your script was
++written.)
++.UNINDENT
++.TP
++.B \fBfile\-loaded\fP
++Happens after a file was loaded and begins playback.
++.TP
++.B \fBseek\fP
++Happens on seeking. (This might include cases when the player seeks
++internally, even without user interaction. This includes e.g. segment
++changes when playing ordered chapters Matroska files.)
++.TP
++.B \fBplayback\-restart\fP
++Start of playback after seek or after file was loaded.
++.TP
++.B \fBidle\fP
++Idle mode is entered. This happens when playback ended, and the player was
++started with \fB\-\-idle\fP or \fB\-\-force\-window\fP\&. This mode is implicitly ended
++when the \fBstart\-file\fP or \fBshutdown\fP events happen.
++.TP
++.B \fBtick\fP
++Called after a video frame was displayed. This is a hack, and you should
++avoid using it. Use timers instead and maybe watch pausing/unpausing events
++to avoid wasting CPU when the player is paused.
++.TP
++.B \fBshutdown\fP
++Sent when the player quits, and the script should terminate. Normally
++handled automatically. See \fI\%Details on the script initialization and lifecycle\fP\&.
++.TP
++.B \fBlog\-message\fP
++Receives messages enabled with \fBmp.enable_messages\fP\&. The message data
++is contained in the table passed as first parameter to the event handler.
++The table contains, in addition to the default event fields, the following
++fields:
++.INDENT 7.0
++.TP
++.B \fBprefix\fP
++The module prefix, identifies the sender of the message. This is what
++the terminal player puts in front of the message text when using the
++\fB\-\-v\fP option, and is also what is used for \fB\-\-msg\-level\fP\&.
++.TP
++.B \fBlevel\fP
++The log level as string. See \fBmsg.log\fP for possible log level names.
++Note that later versions of mpv might add new levels or remove
++(undocumented) existing ones.
++.TP
++.B \fBtext\fP
++The log message. The text will end with a newline character. Sometimes
++it can contain multiple lines.
++.UNINDENT
++.sp
++Keep in mind that these messages are meant to be hints for humans. You
++should not parse them, and prefix/level/text of messages might change
++any time.
++.TP
++.B \fBget\-property\-reply\fP
++Undocumented (not useful for Lua scripts).
++.TP
++.B \fBset\-property\-reply\fP
++Undocumented (not useful for Lua scripts).
++.TP
++.B \fBcommand\-reply\fP
++Undocumented (not useful for Lua scripts).
++.TP
++.B \fBclient\-message\fP
++Undocumented (used internally).
++.TP
++.B \fBvideo\-reconfig\fP
++Happens on video output or filter reconfig.
++.TP
++.B \fBaudio\-reconfig\fP
++Happens on audio output or filter reconfig.
++.UNINDENT
++.sp
++The following events also happen, but are deprecated: \fBtracks\-changed\fP,
++\fBtrack\-switched\fP, \fBpause\fP, \fBunpause\fP, \fBmetadata\-update\fP,
++\fBchapter\-change\fP\&. Use \fBmp.observe_property()\fP instead.
++.SS Extras
++.sp
++This documents experimental features, or features that are "too special" to
++guarantee a stable interface.
++.INDENT 0.0
++.TP
++.B \fBmp.add_hook(type, priority, fn)\fP
++Add a hook callback for \fBtype\fP (a string identifying a certain kind of
++hook). These hooks allow the player to call script functions and wait for
++their result (normally, the Lua scripting interface is asynchronous from
++the point of view of the player core). \fBpriority\fP is an arbitrary integer
++that allows ordering among hooks of the same kind. Using the value 50 is
++recommended as neutral default value. \fBfn\fP is the function that will be
++called during execution of the hook.
++.sp
++See \fI\%Hooks\fP for currently existing hooks and what they do \- only the hook
++list is interesting; handling hook execution is done by the Lua script
++function automatically.
++.UNINDENT
++.SH JSON IPC
++.sp
++mpv can be controlled by external programs using the JSON\-based IPC protocol.
++It can be enabled by specifying the path to a unix socket or a named pipe using
++the option \fB\-\-input\-ipc\-server\fP\&. Clients can connect to this socket and send
++commands to the player or receive events from it.
++.sp
++\fBWARNING:\fP
++.INDENT 0.0
++.INDENT 3.5
++This is not intended to be a secure network protocol. It is explicitly
++insecure: there is no authentication, no encryption, and the commands
++themselves are insecure too. For example, the \fBrun\fP command is exposed,
++which can run arbitrary system commands. The use\-case is controlling the
++player locally. This is not different from the MPlayer slave protocol.
++.UNINDENT
++.UNINDENT
++.SS Socat example
++.sp
++You can use the \fBsocat\fP tool to send commands (and receive replies) from the
++shell. Assuming mpv was started with:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv file.mkv \-\-input\-ipc\-server=/tmp/mpvsocket
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Then you can control it using socat:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++> echo \(aq{ "command": ["get_property", "playback\-time"] }\(aq | socat \- /tmp/mpvsocket
++{"data":190.482000,"error":"success"}
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++In this case, socat copies data between stdin/stdout and the mpv socket
++connection.
++.sp
++See the \fB\-\-idle\fP option how to make mpv start without exiting immediately or
++playing a file.
++.sp
++It\(aqs also possible to send input.conf style text\-only commands:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++> echo \(aqshow_text ${playback\-time}\(aq | socat \- /tmp/mpvsocket
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++But you won\(aqt get a reply over the socket. (This particular command shows the
++playback time on the player\(aqs OSD.)
++.SS Command Prompt example
++.sp
++Unfortunately, it\(aqs not as easy to test the IPC protocol on Windows, since
++Windows ports of socat (in Cygwin and MSYS2) don\(aqt understand named pipes. In
++the absence of a simple tool to send and receive from bidirectional pipes, the
++\fBecho\fP command can be used to send commands, but not receive replies from the
++command prompt.
++.sp
++Assuming mpv was started with:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++mpv file.mkv \-\-input\-ipc\-server=\e\e.\epipe\empvsocket
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++You can send commands from a command prompt:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++echo show_text ${playback\-time} >\e\e.\epipe\empvsocket
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++To be able to simultaneously read and write from the IPC pipe, like on Linux,
++it\(aqs necessary to write an external program that uses overlapped file I/O (or
++some wrapper like .NET\(aqs NamedPipeClientStream.)
++.SS Protocol
++.sp
++Clients can execute commands on the player by sending JSON messages of the
++following form:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["command_name", "param1", "param2", ...] }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++where \fBcommand_name\fP is the name of the command to be executed, followed by a
++list of parameters. Parameters must be formatted as native JSON values
++(integers, strings, booleans, ...). Every message \fBmust\fP be terminated with
++\fB\en\fP\&. Additionally, \fB\en\fP must not appear anywhere inside the message. In
++practice this means that messages should be minified before being sent to mpv.
++.sp
++mpv will then send back a reply indicating whether the command was run
++correctly, and an additional field holding the command\-specific return data (it
++can also be null).
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "error": "success", "data": null }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++mpv will also send events to clients with JSON messages of the following form:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "event": "event_name" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++where \fBevent_name\fP is the name of the event. Additional event\-specific fields
++can also be present. See \fI\%List of events\fP for a list of all supported events.
++.sp
++Because events can occur at any time, it may be difficult at times to determine
++which response goes with which command. Commands may optionally include a
++\fBrequest_id\fP which, if provided in the command request, will be copied
++verbatim into the response. mpv does not intrepret the \fBrequest_id\fP in any
++way; it is solely for the use of the requester.
++.sp
++For example, this request:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["get_property", "time\-pos"], "request_id": 100 }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++Would generate this response:
++.INDENT 0.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "error": "success", "data": 1.468135, "request_id": 100 }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.sp
++All commands, replies, and events are separated from each other with a line
++break character (\fB\en\fP).
++.sp
++If the first character (after skipping whitespace) is not \fB{\fP, the command
++will be interpreted as non\-JSON text command, as they are used in input.conf
++(or \fBmpv_command_string()\fP in the client API). Additionally, lines starting
++with \fB#\fP and empty lines are ignored.
++.sp
++Currently, embedded 0 bytes terminate the current line, but you should not
++rely on this.
++.SS Commands
++.sp
++In addition to the commands described in \fI\%List of Input Commands\fP, a few
++extra commands can also be used as part of the protocol:
++.INDENT 0.0
++.TP
++.B \fBclient_name\fP
++Return the name of the client as string. This is the string \fBipc\-N\fP with
++N being an integer number.
++.TP
++.B \fBget_time_us\fP
++Return the current mpv internal time in microseconds as a number. This is
++basically the system time, with an arbitrary offset.
++.TP
++.B \fBget_property\fP
++Return the value of the given property. The value will be sent in the data
++field of the replay message.
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["get_property", "volume"] }
++{ "data": 50.0, "error": "success" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBget_property_string\fP
++Like \fBget_property\fP, but the resulting data will always be a string.
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["get_property_string", "volume"] }
++{ "data": "50.000000", "error": "success" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBset_property\fP
++Set the given property to the given value. See \fI\%Properties\fP for more
++information about properties.
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["set_property", "pause", true] }
++{ "error": "success" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBset_property_string\fP
++Like \fBset_property\fP, but the argument value must be passed as string.
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["set_property_string", "pause", "yes"] }
++{ "error": "success" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBobserve_property\fP
++Watch a property for changes. If the given property is changed, then an
++event of type \fBproperty\-change\fP will be generated
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["observe_property", 1, "volume"] }
++{ "error": "success" }
++{ "event": "property\-change", "id": 1, "data": 52.0, "name": "volume" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBobserve_property_string\fP
++Like \fBobserve_property\fP, but the resulting data will always be a string.
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["observe_property_string", 1, "volume"] }
++{ "error": "success" }
++{ "event": "property\-change", "id": 1, "data": "52.000000", "name": "volume" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBunobserve_property\fP
++Undo \fBobserve_property\fP or \fBobserve_property_string\fP\&. This requires the
++numeric id passed to the observed command as argument.
++.sp
++Example:
++.INDENT 7.0
++.INDENT 3.5
++.sp
++.nf
++.ft C
++{ "command": ["unobserve_property", 1] }
++{ "error": "success" }
++.ft P
++.fi
++.UNINDENT
++.UNINDENT
++.TP
++.B \fBrequest_log_messages\fP
++Enable output of mpv log messages. They will be received as events. The
++parameter to this command is the log\-level (see \fBmpv_request_log_messages\fP
++C API function).
++.sp
++Log message output is meant for humans only (mostly for debugging).
++Attempting to retrieve information by parsing these messages will just
++lead to breakages with future mpv releases. Instead, make a feature request,
++and ask for a proper event that returns the information you need.
++.TP
++.B \fBenable_event\fP, \fBdisable_event\fP
++Enables or disables the named event. Mirrors the \fBmpv_request_event\fP C
++API function. If the string \fBall\fP is used instead of an event name, all
++events are enabled or disabled.
++.sp
++By default, most events are enabled, and there is not much use for this
++command.
++.TP
++.B \fBsuspend\fP
++Suspend the mpv main loop. There is a long\-winded explanation of this in
++the C API function \fBmpv_suspend()\fP\&. In short, this prevents the player
++from displaying the next video frame, so that you don\(aqt get blocked when
++trying to access the player.
++.TP
++.B \fBresume\fP
++Undo one \fBsuspend\fP call. \fBsuspend\fP increments an internal counter, and
++\fBresume\fP decrements it. When 0 is reached, the player is actually resumed.
++.TP
++.B \fBget_version\fP
++Returns the client API version the C API of the remote mpv instance
++provides.
++.sp
++See also: \fBDOCS/client\-api\-changes.rst\fP\&.
++.UNINDENT
++.SS UTF\-8
++.sp
++Normally, all strings are in UTF\-8. Sometimes it can happen that strings are
++in some broken encoding (often happens with file tags and such, and filenames
++on many Unixes are not required to be in UTF\-8 either). This means that mpv
++sometimes sends invalid JSON. If that is a problem for the client application\(aqs
++parser, it should filter the raw data for invalid UTF\-8 sequences and perform
++the desired replacement, before feeding the data to its JSON parser.
++.sp
++mpv will not attempt to construct invalid UTF\-8 with broken escape sequences.
++.SH CHANGELOG
++.sp
++There is no real changelog, but you can look at the following things:
++.INDENT 0.0
++.IP \(bu 2
++The release changelog, which should contain most user\-visible changes,
++including new features and bug fixes:
++.sp
++\fI\%https://github.com/mpv\-player/mpv/releases\fP
++.IP \(bu 2
++The git log, which is the "real" changelog
++.IP \(bu 2
++The file \fBmplayer\-changes.rst\fP in the \fBDOCS\fP sub directory on the git
++repository, which used to be in place of this section. It documents some
++changes that happened since mplayer2 forked off MPlayer.
++.UNINDENT
++.SH EMBEDDING INTO OTHER PROGRAMS (LIBMPV)
++.sp
++mpv can be embedded into other programs as video/audio playback backend. The
++recommended way to do so is using libmpv. See \fBlibmpv/client.h\fP in the mpv
++source code repository. This provides a C API. Bindings for other languages
++might be available (see wiki).
++.SH ENVIRONMENT VARIABLES
++.sp
++There are a number of environment variables that can be used to control the
++behavior of mpv.
++.INDENT 0.0
++.TP
++.B \fBHOME\fP, \fBXDG_CONFIG_HOME\fP
++Used to determine mpv config directory. If \fBXDG_CONFIG_HOME\fP is not set,
++\fB$HOME/.config/mpv\fP is used.
++.sp
++\fB$HOME/.mpv\fP is always added to the list of config search paths with a
++lower priority.
++.TP
++.B \fBXDG_CONFIG_DIRS\fP
++If set, XDG\-style system configuration directories are used. Otherwise,
++the UNIX convention (\fBPREFIX/etc/mpv/\fP) is used.
++.TP
++.B \fBMPV_HOME\fP
++Directory where mpv looks for user settings. Overrides \fBHOME\fP, and mpv
++will try to load the config file as \fB$MPV_HOME/mpv.conf\fP\&.
++.TP
++.B \fBMPV_VERBOSE\fP (see also \fB\-v\fP and \fB\-\-msg\-level\fP)
++Set the initial verbosity level across all message modules (default: 0).
++This is an integer, and the resulting verbosity corresponds to the number
++of \fB\-\-v\fP options passed to the command line.
++.TP
++.B \fBMPV_LEAK_REPORT\fP
++If set to \fB1\fP, enable internal talloc leak reporting.
++.TP
++.B \fBLADSPA_PATH\fP
++Specifies the search path for LADSPA plugins. If it is unset, fully
++qualified path names must be used.
++.TP
++.B \fBDISPLAY\fP
++Standard X11 display name to use.
++.TP
++.B FFmpeg/Libav:
++This library accesses various environment variables. However, they are not
++centrally documented, and documenting them is not our job. Therefore, this
++list is incomplete.
++.sp
++Notable environment variables:
++.INDENT 7.0
++.TP
++.B \fBhttp_proxy\fP
++URL to proxy for \fBhttp://\fP and \fBhttps://\fP URLs.
++.TP
++.B \fBno_proxy\fP
++List of domain patterns for which no proxy should be used.
++List entries are separated by \fB,\fP\&. Patterns can include \fB*\fP\&.
++.UNINDENT
++.TP
++.B libdvdcss:
++.INDENT 7.0
++.TP
++.B \fBDVDCSS_CACHE\fP
++Specify a directory in which to store title key values. This will
++speed up descrambling of DVDs which are in the cache. The
++\fBDVDCSS_CACHE\fP directory is created if it does not exist, and a
++subdirectory is created named after the DVD\(aqs title or manufacturing
++date. If \fBDVDCSS_CACHE\fP is not set or is empty, libdvdcss will use
++the default value which is \fB${HOME}/.dvdcss/\fP under Unix and
++the roaming application data directory (\fB%APPDATA%\fP) under
++Windows. The special value "off" disables caching.
++.TP
++.B \fBDVDCSS_METHOD\fP
++Sets the authentication and decryption method that libdvdcss will use
++to read scrambled discs. Can be one of \fBtitle\fP, \fBkey\fP or \fBdisc\fP\&.
++.INDENT 7.0
++.TP
++.B key
++is the default method. libdvdcss will use a set of calculated
++player keys to try to get the disc key. This can fail if the drive
++does not recognize any of the player keys.
++.TP
++.B disc
++is a fallback method when key has failed. Instead of using player
++keys, libdvdcss will crack the disc key using a brute force
++algorithm. This process is CPU intensive and requires 64 MB of
++memory to store temporary data.
++.TP
++.B title
++is the fallback when all other methods have failed. It does not
++rely on a key exchange with the DVD drive, but rather uses a crypto
++attack to guess the title key. On rare cases this may fail because
++there is not enough encrypted data on the disc to perform a
++statistical attack, but on the other hand it is the only way to
++decrypt a DVD stored on a hard disc, or a DVD with the wrong region
++on an RPC2 drive.
++.UNINDENT
++.TP
++.B \fBDVDCSS_RAW_DEVICE\fP
++Specify the raw device to use. Exact usage will depend on your
++operating system, the Linux utility to set up raw devices is raw(8)
++for instance. Please note that on most operating systems, using a raw
++device requires highly aligned buffers: Linux requires a 2048 bytes
++alignment (which is the size of a DVD sector).
++.TP
++.B \fBDVDCSS_VERBOSE\fP
++Sets the libdvdcss verbosity level.
++.INDENT 7.0
++.TP
++.B 0
++Outputs no messages at all.
++.TP
++.B 1
++Outputs error messages to stderr.
++.TP
++.B 2
++Outputs error messages and debug messages to stderr.
++.UNINDENT
++.TP
++.B \fBDVDREAD_NOKEYS\fP
++Skip retrieving all keys on startup. Currently disabled.
++.TP
++.B \fBHOME\fP
++FIXME: Document this.
++.UNINDENT
++.UNINDENT
++.SH EXIT CODES
++.sp
++Normally \fBmpv\fP returns 0 as exit code after finishing playback successfully.
++If errors happen, the following exit codes can be returned:
++.INDENT 0.0
++.INDENT 3.5
++.INDENT 0.0
++.TP
++.B 1
++Error initializing mpv. This is also returned if unknown options are
++passed to mpv.
++.TP
++.B 2
++The file passed to mpv couldn\(aqt be played. This is somewhat fuzzy:
++currently, playback of a file is considered to be successful if
++initialization was mostly successful, even if playback fails
++immediately after initialization.
++.TP
++.B 3
++There were some files that could be played, and some files which
++couldn\(aqt (using the definition of success from above).
++.TP
++.B 4
++Quit due to a signal, Ctrl+c in a VO window (by default), or from the
++default quit key bindings in encoding mode.
++.UNINDENT
++.UNINDENT
++.UNINDENT
++.sp
++Note that quitting the player manually will always lead to exit code 0,
++overriding the exit code that would be returned normally. Also, the \fBquit\fP
++input command can take an exit code: in this case, that exit code is returned.
++.SH FILES
++.sp
++For Windows\-specifics, see \fI\%FILES ON WINDOWS\fP section.
++.INDENT 0.0
++.TP
++.B \fB/usr/local/etc/mpv/mpv.conf\fP
++mpv system\-wide settings (depends on \fB\-\-prefix\fP passed to configure \- mpv
++in default configuration will use \fB/usr/local/etc/mpv/\fP as config
++directory, while most Linux distributions will set it to \fB/etc/mpv/\fP).
++.TP
++.B \fB~/.config/mpv/mpv.conf\fP
++mpv user settings (see \fI\%CONFIGURATION FILES\fP section)
++.TP
++.B \fB~/.config/mpv/input.conf\fP
++key bindings (see \fI\%INPUT.CONF\fP section)
++.TP
++.B \fB~/.config/mpv/scripts/\fP
++All files in this directory are loaded as if they were passed to the
++\fB\-\-script\fP option. They are loaded in alphabetical order, and sub\-directories
++and files with no \fB\&.lua\fP extension are ignored. The \fB\-\-load\-scripts=no\fP
++option disables loading these files.
++.TP
++.B \fB~/.config/mpv/watch_later/\fP
++Contains temporary config files needed for resuming playback of files with
++the watch later feature. See for example the \fBQ\fP key binding, or the
++\fBquit_watch_later\fP input command.
++.sp
++Each file is a small config file which is loaded if the corresponding media
++file is loaded. It contains the playback position and some (not necessarily
++all) settings that were changed during playback. The filenames are hashed
++from the full paths of the media files. It\(aqs in general not possible to
++extract the media filename from this hash. However, you can set the
++\fB\-\-write\-filename\-in\-watch\-later\-config\fP option, and the player will
++add the media filename to the contents of the resume config file.
++.TP
++.B \fB~/.config/mpv/lua\-settings/osc.conf\fP
++This is loaded by the OSC script. See the \fI\%ON SCREEN CONTROLLER\fP docs
++for details.
++.sp
++Other files in this directory are specific to the corresponding scripts
++as well, and the mpv core doesn\(aqt touch them.
++.UNINDENT
++.sp
++Note that the environment variables \fB$XDG_CONFIG_HOME\fP and \fB$MPV_HOME\fP can
++override the standard directory \fB~/.config/mpv/\fP\&.
++.sp
++Also, the old config location at \fB~/.mpv/\fP is still read, and if the XDG
++variant does not exist, will still be preferred.
++.SH FILES ON WINDOWS
++.sp
++On win32 (if compiled with MinGW, but not Cygwin), the default config file
++locations are different. They are generally located under \fB%APPDATA%/mpv/\fP\&.
++For example, the path to mpv.conf is \fB%APPDATA%/mpv/mpv.conf\fP, which maps to
++a system and user\-specific path, for example
++.INDENT 0.0
++.INDENT 3.5
++\fBC:\eusers\eUSERNAME\eAppData\eRoaming\empv\empv.conf\fP
++.UNINDENT
++.UNINDENT
++.sp
++You can find the exact path by running \fBecho %APPDATA%\empv\empv.conf\fP in cmd.exe.
++.sp
++Other config files (such as \fBinput.conf\fP) are in the same directory. See the
++\fI\%FILES\fP section above.
++.sp
++The environment variable \fB$MPV_HOME\fP completely overrides these, like on
++UNIX.
++.sp
++If a directory named \fBportable_config\fP next to the mpv.exe exists, all
++config will be loaded from this directory only. Watch later config files are
++written to this directory as well. (This exists on Windows only and is redundant
++with \fB$MPV_HOME\fP\&. However, since Windows is very scripting unfriendly, a
++wrapper script just setting \fB$MPV_HOME\fP, like you could do it on other
++systems, won\(aqt work. \fBportable_config\fP is provided for convenience to get
++around this restriction.)
++.sp
++Config files located in the same directory as \fBmpv.exe\fP are loaded with
++lower priority. Some config files are loaded only once, which means that
++e.g. of 2 \fBinput.conf\fP files located in two config directories, only the
++one from the directory with higher priority will be loaded.
++.sp
++A third config directory with the lowest priority is the directory named \fBmpv\fP
++in the same directory as \fBmpv.exe\fP\&. This used to be the directory with the
++highest priority, but is now discouraged to use and might be removed in the
++future.
++.sp
++Note that mpv likes to mix \fB/\fP and \fB\e\fP path separators for simplicity.
++kernel32.dll accepts this, but cmd.exe does not.
++.SH COPYRIGHT
++GPLv2+
++.\" Generated by docutils manpage writer.
++.
+--
+2.9.0
+
diff --git a/media/mpv/sources.awk b/media/mpv/sources.awk
new file mode 100644
index 00000000..622d74b3
--- /dev/null
+++ b/media/mpv/sources.awk
@@ -0,0 +1,19 @@
+# usage: awk -f sources.awk sources=sources.txt config.h
+
+$1 == "#define" && $3 ~ /[01]/ {
+ cfg[$2] = $3
+}
+
+END {
+ while (getline < sources) {
+ if (NF == 2) {
+ var = toupper($2)
+ gsub("-", "_", var)
+ if (neg = var ~ /^!/)
+ var = substr(var, 2)
+ if (cfg["HAVE_" var] == neg)
+ continue
+ }
+ print $1
+ }
+}
diff --git a/media/mpv/sources.txt b/media/mpv/sources.txt
new file mode 100644
index 00000000..d891eee7
--- /dev/null
+++ b/media/mpv/sources.txt
@@ -0,0 +1,286 @@
+audio/audio.c
+audio/audio_buffer.c
+audio/chmap.c
+audio/chmap_sel.c
+audio/fmt-conversion.c
+audio/format.c
+audio/mixer.c
+audio/decode/ad_lavc.c
+audio/decode/ad_spdif.c
+audio/decode/dec_audio.c
+audio/filter/af.c
+audio/filter/af_channels.c
+audio/filter/af_delay.c
+audio/filter/af_drc.c
+audio/filter/af_equalizer.c
+audio/filter/af_format.c
+audio/filter/af_lavcac3enc.c
+audio/filter/af_lavfi.c
+audio/filter/af_lavrresample.c
+audio/filter/af_pan.c
+audio/filter/af_rubberband.c rubberband
+audio/filter/af_scaletempo.c
+audio/filter/af_volume.c
+audio/filter/tools.c
+audio/out/ao.c
+audio/out/ao_alsa.c alsa
+audio/out/ao_coreaudio.c coreaudio
+audio/out/ao_coreaudio_chmap.c coreaudio
+audio/out/ao_coreaudio_exclusive.c coreaudio
+audio/out/ao_coreaudio_properties.c coreaudio
+audio/out/ao_coreaudio_utils.c coreaudio
+audio/out/ao_jack.c jack
+audio/out/ao_lavc.c encoding
+audio/out/ao_null.c
+audio/out/ao_openal.c openal
+audio/out/ao_opensles.c opensles
+audio/out/ao_oss.c oss-audio
+audio/out/ao_pcm.c
+audio/out/ao_pulse.c pulse
+audio/out/ao_rsound.c rsound
+audio/out/ao_sdl.c sdl1
+audio/out/ao_sdl.c sdl2
+audio/out/ao_sndio.c sndio
+audio/out/ao_wasapi.c wasapi
+audio/out/ao_wasapi_utils.c wasapi
+audio/out/ao_wasapi_changenotify.c wasapi
+audio/out/pull.c
+audio/out/push.c
+common/av_common.c
+common/av_log.c
+common/codecs.c
+common/encode_lavc.c encoding
+common/common.c
+common/tags.c
+common/msg.c
+common/playlist.c
+common/version.c
+demux/codec_tags.c
+demux/cue.c
+demux/demux.c
+demux/demux_cue.c
+demux/demux_disc.c
+demux/demux_edl.c
+demux/demux_lavf.c
+demux/demux_libarchive.c libarchive
+demux/demux_mf.c
+demux/demux_mkv.c
+demux/demux_mkv_timeline.c
+demux/demux_null.c
+demux/demux_playlist.c
+demux/demux_raw.c
+demux/demux_rar.c
+demux/demux_timeline.c
+demux/demux_tv.c tv
+demux/ebml.c
+demux/packet.c
+demux/timeline.c
+input/cmd_list.c
+input/cmd_parse.c
+input/event.c
+input/input.c
+input/ipc.c
+input/ipc-unix.c !mingw
+input/ipc-win.c mingw
+input/keycodes.c
+input/pipe-win32.c mingw
+misc/bstr.c
+misc/charset_conv.c
+misc/dispatch.c
+misc/json.c
+misc/ring.c
+misc/rendezvous.c
+options/m_config.c
+options/m_option.c
+options/m_property.c
+options/options.c
+options/parse_commandline.c
+options/parse_configfile.c
+options/path.c
+player/audio.c
+player/client.c
+player/command.c
+player/configfiles.c
+player/external_files.c
+player/loadfile.c
+player/main.c
+player/misc.c
+player/lavfi.c
+player/lua.c lua
+player/osd.c
+player/playloop.c
+player/screenshot.c
+player/scripting.c
+player/sub.c
+player/video.c
+stream/ai_alsa1x.c alsa
+stream/ai_oss.c oss-audio
+stream/ai_sndio.c sndio
+stream/audio_in.c audio-input
+stream/cache.c
+stream/cache_file.c
+stream/cookies.c
+stream/dvb_tune.c dvbin
+stream/frequencies.c tv
+stream/rar.c
+stream/stream.c
+stream/stream_avdevice.c
+stream/stream_bluray.c libbluray
+stream/stream_cdda.c cdda
+stream/stream_dvb.c dvbin
+stream/stream_dvd.c dvdread
+stream/stream_dvd_common.c dvdread
+stream/stream_dvdnav.c dvdnav
+stream/stream_edl.c
+stream/stream_file.c
+stream/stream_lavf.c
+stream/stream_libarchive.c libarchive
+stream/stream_memory.c
+stream/stream_mf.c
+stream/stream_null.c
+stream/stream_rar.c
+stream/stream_smb.c libsmbclient
+stream/stream_tv.c tv
+stream/tv.c tv
+stream/tvi_dummy.c tv
+stream/tvi_v4l2.c tv-v4l2
+sub/ass_mp.c libass
+sub/dec_sub.c
+sub/draw_bmp.c
+sub/img_convert.c
+sub/lavc_conv.c
+sub/osd.c
+sub/osd_dummy.c dummy-osd
+sub/osd_libass.c libass-osd
+sub/sd_ass.c libass
+sub/sd_lavc.c
+video/csputils.c
+video/fmt-conversion.c
+video/gpu_memcpy.c sse4-intrinsics
+video/image_writer.c
+video/img_format.c
+video/hwdec.c
+video/mp_image.c
+video/mp_image_pool.c
+video/sws_utils.c
+video/vaapi.c vaapi
+video/vdpau.c vdpau
+video/vdpau_mixer.c vdpau
+video/decode/dec_video.c
+video/decode/dxva2.c d3d-hwaccel
+video/decode/d3d11va.c d3d-hwaccel
+video/decode/d3d.c d3d-hwaccel
+video/decode/vaapi.c vaapi-hwaccel
+video/decode/vd_lavc.c
+video/decode/videotoolbox.c videotoolbox-hwaccel
+video/decode/vdpau.c vdpau-hwaccel
+video/filter/refqueue.c
+video/filter/vf.c
+video/filter/vf_buffer.c
+video/filter/vf_crop.c
+video/filter/vf_d3d11vpp.c d3d-hwaccel
+video/filter/vf_dlopen.c dlopen
+video/filter/vf_dsize.c
+video/filter/vf_eq.c
+video/filter/vf_expand.c
+video/filter/vf_flip.c
+video/filter/vf_format.c
+video/filter/vf_gradfun.c
+video/filter/vf_lavfi.c
+video/filter/vf_mirror.c
+video/filter/vf_noformat.c
+video/filter/vf_pullup.c
+video/filter/vf_rotate.c
+video/filter/vf_scale.c
+video/filter/vf_stereo3d.c
+video/filter/vf_sub.c
+video/filter/vf_vapoursynth.c vapoursynth-core
+video/filter/vf_vavpp.c vaapi
+video/filter/vf_vdpaupp.c vdpau
+video/filter/vf_vdpaurb.c vdpau
+video/filter/vf_yadif.c
+video/out/aspect.c
+video/out/bitmap_packer.c
+video/out/cocoa/video_view.m cocoa
+video/out/cocoa/events_view.m cocoa
+video/out/cocoa/window.m cocoa
+video/out/cocoa_common.m cocoa
+video/out/dither.c
+video/out/filter_kernels.c
+video/out/opengl/angle_dynamic.c egl-angle
+video/out/opengl/angle_common.c egl-angle
+video/out/opengl/common.c gl
+video/out/opengl/context.c gl
+video/out/opengl/context_angle.c egl-angle
+video/out/opengl/context_cocoa.c gl-cocoa
+video/out/opengl/context_drm_egl.c egl-drm
+video/out/opengl/context_dxinterop.c gl-dxinterop
+video/out/opengl/context_rpi.c rpi
+video/out/opengl/context_wayland.c gl-wayland
+video/out/opengl/context_w32.c gl-win32
+video/out/opengl/context_x11.c gl-x11
+video/out/opengl/context_x11egl.c egl-x11
+video/out/opengl/egl_helpers.c egl-helpers
+video/out/opengl/formats.c gl
+video/out/opengl/hwdec.c gl
+video/out/opengl/hwdec_d3d11egl.c egl-angle
+video/out/opengl/hwdec_d3d11eglrgb.c egl-angle
+video/out/opengl/hwdec_dxva2.c gl-win32
+video/out/opengl/hwdec_dxva2gldx.c gl-dxinterop
+video/out/opengl/hwdec_dxva2egl.c egl-angle
+video/out/opengl/hwdec_vaegl.c vaapi-egl
+video/out/opengl/hwdec_vaglx.c vaapi-glx
+video/out/opengl/hwdec_osx.c videotoolbox-gl
+video/out/opengl/hwdec_vdpau.c vdpau-gl-x11
+video/out/opengl/lcms.c gl
+video/out/opengl/osd.c gl
+video/out/opengl/user_shaders.c gl
+video/out/opengl/utils.c gl
+video/out/opengl/video.c gl
+video/out/opengl/video_shaders.c gl
+video/out/vo.c
+video/out/vo_caca.c caca
+video/out/vo_drm.c drm
+video/out/vo_direct3d.c direct3d
+video/out/vo_image.c
+video/out/vo_lavc.c encoding
+video/out/vo_rpi.c rpi
+video/out/vo_null.c
+video/out/vo_opengl.c gl
+video/out/vo_opengl_cb.c gl
+video/out/vo_sdl.c sdl2
+video/out/vo_vaapi.c vaapi-x11
+video/out/vo_vdpau.c vdpau
+video/out/vo_wayland.c wayland
+video/out/vo_x11.c x11
+video/out/vo_xv.c xv
+video/out/w32_common.c win32
+video/out/win32/displayconfig.c win32
+video/out/win32/exclusive_hack.c gl-win32
+video/out/wayland_common.c wayland
+video/out/wayland/buffer.c wayland
+video/out/wayland/memfile.c wayland
+video/out/win_state.c
+video/out/x11_common.c x11
+video/out/drm_common.c drm
+osdep/io.c
+osdep/timer.c
+osdep/threads.c
+osdep/ar/HIDRemote.m apple-remote
+osdep/macosx_application.m cocoa
+osdep/macosx_events.m cocoa
+osdep/semaphore_osx.c
+osdep/subprocess.c
+osdep/subprocess-posix.c posix-spawn
+osdep/subprocess-win.c os-win32
+osdep/path-macosx.m cocoa
+osdep/path-unix.c
+osdep/path-win.c os-win32
+osdep/path-win.c os-cygwin
+osdep/glob-win.c glob-win32-replacement
+osdep/w32_keyboard.c os-win32
+osdep/w32_keyboard.c os-cygwin
+osdep/windows_utils.c win32
+osdep/mpv.rc win32-executable
+osdep/win32/pthread.c win32-internal-pthreads
+osdep/android/strnlen.c android
diff --git a/media/mpv/src b/media/mpv/src
new file mode 160000
+Subproject 69e7b0d3ea4b75a8040ede5b9b7e6fa93ec6805