#compdef mpv

# For customization, see:
#  https://github.com/mpv-player/mpv/wiki/Zsh-completion-customization

local curcontext="$curcontext" state state_descr line
typeset -A opt_args

local -a match mbegin mend
local MATCH MBEGIN MEND

# By default, don't complete URLs unless no files match
local -a tag_order
zstyle -a ":completion:*:*:$service:*" tag-order tag_order || 
  zstyle  ":completion:*:*:$service:*" tag-order '!urls'

local rc=1

_arguments -C -S \
  '--demuxer-mkv-subtitle-preroll-secs-index=-:Double (0 to any) (default\: 10.000):' \
  '--no-write-filename-in-watch-later-config' \
  '--no-ignore-path-in-watch-later-config' \
  '--write-filename-in-watch-later-config' \
  '--no-demuxer-mkv-probe-video-duration' \
  '--demuxer-mkv-subtitle-preroll-secs=-:Double (0 to any) (default\: 1.000):' \
  '--ignore-path-in-watch-later-config' \
  '--no-sub-ass-vsfilter-aspect-compat' \
  '--demuxer-mkv-probe-video-duration=-:Choices\: no yes full (default\: no):(no yes full)' \
  '--no-screenshot-jpeg-source-chroma' \
  '--no-stop-playback-on-init-failure' \
  '--no-sub-ass-vsfilter-color-compat' \
  '--no-demuxer-mkv-probe-start-time' \
  '--no-demuxer-mkv-subtitle-preroll' \
  '--no-stretch-image-subs-to-screen' \
  '--no-sub-ass-vsfilter-blur-compat' \
  '--audio-resample-max-output-size=-:Double (default\: 40.000):' \
  '--no-demuxer-lavf-allow-mimetype' \
  '--no-image-subs-video-resolution' \
  '--sub-ass-vsfilter-aspect-compat' \
  '--no-vo-image-jpeg-source-chroma' \
  '--screenshot-jpeg-source-chroma' \
  '--stop-playback-on-init-failure' \
  '--sub-ass-vsfilter-color-compat=-:Choices\: no basic full force-601 (default\: basic):(no basic full force-601)' \
  '--demuxer-lavf-analyzeduration=-:Float (0 to 3600) (default\: 0.000):' \
  '--demuxer-mkv-probe-start-time' \
  '--demuxer-mkv-subtitle-preroll=-:Choices\: no yes index (default\: index):(no yes index)' \
  '--no-opengl-rectangle-textures' \
  '--no-screenshot-high-bit-depth' \
  '--no-screenshot-tag-colorspace' \
  '--stretch-image-subs-to-screen' \
  '--no-sub-ass-scale-with-window' \
  '--sub-ass-vsfilter-blur-compat' \
  '--no-vd-lavc-software-fallback' \
  '--no-vo-vdpau-composite-detect' \
  '--demuxer-lavf-allow-mimetype' \
  '--no-force-rgba-osd-rendering' \
  '--image-subs-video-resolution' \
  '--no-use-embedded-icc-profile' \
  '--no-vd-lavc-check-hw-profile' \
  '--video-sync-max-audio-change=-:Double (0 to 1) (default\: 0.125):' \
  '--video-sync-max-video-change=-:Double (0 to any) (default\: 1.000):' \
  '--vo-image-jpeg-source-chroma' \
  '--vo-vdpau-queuetime-windowed=-:Integer (default\: 50):' \
  '--no-audio-normalize-downmix' \
  '--audio-resample-filter-size=-:Integer (0 to 32) (default\: 16):' \
  '--audio-resample-phase-shift=-:Integer (0 to 30) (default\: 10):' \
  '--no-cursor-autohide-fs-only' \
  '--no-demuxer-lavf-probe-info' \
  '--demuxer-rawvideo-mp-format=-:Image format (default\: no):' \
  '--screenshot-png-compression=-:Integer (0 to 9) (default\: 7):' \
  '--no-vd-lavc-assume-old-x264' \
  '--no-vo-image-high-bit-depth' \
  '--no-vo-image-tag-colorspace' \
  '--no-audio-fallback-to-null' \
  '--no-audio-pitch-correction' \
  '--demuxer-rawaudio-channels=-:Audio channels or channel map (default\: stereo):' \
  '--no-demuxer-seekable-cache' \
  '--no-dvbin-full-transponder' \
  '--no-input-default-bindings' \
  '--opengl-rectangle-textures' \
  '--screenshot-high-bit-depth' \
  '--screenshot-tag-colorspace' \
  '--sub-ass-scale-with-window' \
  '--vd-lavc-software-fallback=-:Choices\: no yes (or an integer) (1 to 2147483647) (default\: 3):(no yes)' \
  '--vo-vdpau-composite-detect' \
  '--no-audio-resample-linear' \
  '--force-rgba-osd-rendering' \
  '--no-force-window-position' \
  '--no-load-unsafe-playlists' \
  '--no-save-position-on-quit' \
  '--no-sub-ass-force-margins' \
  '--no-sub-filter-sdh-harder' \
  '--no-sub-scale-with-window' \
  '--use-embedded-icc-profile' \
  '--vd-lavc-check-hw-profile' \
  '--vo-image-png-compression=-:Integer (0 to 9) (default\: 7):' \
  '--no-vo-vdpau-chroma-deint' \
  '--vo-vdpau-output-surfaces=-:Integer (2 to 15) (default\: 3):' \
  '--no-vulkan-async-transfer' \
  '--no-x11-bypass-compositor' \
  '--no-alsa-non-interleaved' \
  '--no-ao-null-broken-delay' \
  '--ao-null-channel-layouts=-:Audio channels or channel map (default\: ):' \
  '--audio-normalize-downmix' \
  '--no-audio-stream-silence' \
  '--chapter-merge-threshold=-:Integer (0 to 10000) (default\: 100):' \
  '--cursor-autohide-fs-only' \
  '--demuxer-lavf-buffersize=-:Integer (1 to 10485760) (default\: 32768):' \
  '--demuxer-lavf-probe-info=-:Choices\: no yes auto nostreams (default\: auto):(no yes auto nostreams)' \
  '--demuxer-lavf-probescore=-:Integer (1 to 100) (default\: 26):' \
  '--demuxer-rawaudio-format=-:Choices\: u8 s8 u16le u16be s16le s16be u24le u24be s24le s24be u32le u32be s32le s32be floatle floatbe doublele doublebe u16 s16 u24 s24 u32 s32 float double (default\: s16le):(u8 s8 u16le u16be s16le s16be u24le u24be s24le s24be u32le u32be s32le s32be floatle floatbe doublele doublebe u16 s16 u24 s24 u32 s32 float double)' \
  '--demuxer-rawvideo-format=-:FourCC (default\: 30323449):' \
  '--interpolation-threshold=-:Float (default\: 0.000):' \
  '--jack-std-channel-layout=-:Choices\: waveext any (default\: waveext):(waveext any)' \
  '--screenshot-jpeg-quality=-:Integer (0 to 100) (default\: 90):' \
  '--tone-mapping-desaturate=-:Float (default\: 0.500):' \
  '--no-track-auto-selection' \
  '--vd-lavc-assume-old-x264' \
  '--vo-image-high-bit-depth' \
  '--vo-image-tag-colorspace' \
  '--no-vulkan-async-compute' \
  '--audio-fallback-to-null' \
  '--audio-pitch-correction' \
  '--no-cache-pause-initial' \
  '--chapter-seek-threshold=-:Double (default\: 5.000):' \
  '--no-correct-downscaling' \
  '--demuxer-lavf-probesize=-:Integer (32 to 2147483647) (default\: 0):' \
  '--demuxer-max-back-bytes=-:ByteSize (0 to 2147483647) (default\: 50.000 MiB):' \
  '--demuxer-rawvideo-codec=-:String (default\: ):' \
  '--demuxer-readahead-secs=-:Double (0 to any) (default\: 1.000):' \
  '--demuxer-seekable-cache=-:Choices\: auto no yes (default\: auto):(auto no yes)' \
  '--dvbin-full-transponder' \
  '--hr-seek-demuxer-offset=-:Float (default\: 0.000):' \
  '--image-display-duration=-:Double (0 to inf) (default\: 1.000):' \
  '--input-default-bindings' \
  '--input-doubleclick-time=-:Integer (0 to 1000) (default\: 300):' \
  '--ordered-chapters-files=-:String (default\: ) [file]:->files' \
  '--no-osd-scale-by-window' \
  '--no-pulse-latency-hacks' \
  '--no-scaler-resizes-only' \
  '--no-sub-create-cc-track' \
  '--no-sub-scale-by-window' \
  '--temporal-dither-period=-:Integer (1 to 128) (default\: 1):' \
  '--vd-lavc-skiploopfilter=-:Choices\: none default nonref bidir nonkey all (default\: default):(none default nonref bidir nonkey all)' \
  '--no-video-latency-hacks' \
  '--no-vo-vaapi-scaled-osd' \
  '--no-ao-null-broken-eof' \
  '--audio-resample-cutoff=-:Double (0 to 1) (default\: 0.000):' \
  '--audio-resample-linear' \
  '--no-demuxer-lavf-hacks' \
  '--demuxer-rawaudio-rate=-:Integer (1000 to 384000) (default\: 44100):' \
  '--demuxer-rawvideo-size=-:Integer (1 to 268435456) (default\: 0):' \
  '--force-window-position' \
  '--no-hidpi-window-scale' \
  '--no-initial-audio-sync' \
  '--no-input-right-alt-gr' \
  '--no-load-stats-overlay' \
  '--load-unsafe-playlists' \
  '--no-opengl-early-flush' \
  '--player-operation-mode=-:Choices\: cplayer pseudo-gui (default\: cplayer) [no runtime changes]:(cplayer pseudo-gui)' \
  '--save-position-on-quit' \
  '--screenshot-png-filter=-:Integer (0 to 5) (default\: 5):' \
  '--sub-ass-force-margins' \
  '--sub-filter-sdh-harder' \
  '--sub-scale-with-window' \
  '--video-sync-adrop-size=-:Double (0 to 1) (default\: 0.020):' \
  '--vo-image-jpeg-quality=-:Integer (0 to 100) (default\: 90):' \
  '--vo-vdpau-chroma-deint' \
  '--no-vo-vdpau-force-yuv' \
  '--vo-vdpau-queuetime-fs=-:Integer (default\: 50):' \
  '--vulkan-async-transfer' \
  '--watch-later-directory=-:String (default\: ) [file]:->files' \
  '--x11-bypass-compositor=-:Choices\: no yes fs-only never (default\: fs-only):(no yes fs-only never)' \
  '--no-access-references' \
  '--no-alsa-ignore-chmap' \
  '--alsa-non-interleaved' \
  '--ao-null-broken-delay' \
  '--no-ao-pcm-waveheader' \
  '--audio-stream-silence' \
  '--demuxer-rawvideo-fps=-:Float (0.001 to 1000) (default\: 25.000):' \
  '--gpu-shader-cache-dir=-:String (default\: ):' \
  '--no-hr-seek-framedrop' \
  '--no-input-vo-keyboard' \
  '--no-keepaspect-window' \
  '--no-on-all-workspaces' \
  '--opengl-check-pattern=-:Int[-Int] (default\: 0-0):' \
  '--no-prefetch-playlist' \
  '--no-rebase-start-time' \
  '--screenshot-directory=-:String (default\: ) [file]:->files' \
  '--no-sigmoid-upscaling' \
  '--sub-ass-line-spacing=-:Float (-1000 to 1000) (default\: 0.000):' \
  '--no-sub-clear-on-seek' \
  '--track-auto-selection' \
  '--no-tv-scan-autostart' \
  '--vulkan-async-compute' \
  '--cache-pause-initial' \
  '--correct-downscaling' \
  '--demuxer-lavf-format=-:String (default\: ):' \
  '--no-hdr-compute-peak' \
  '--no-icc-profile-auto' \
  '--input-key-fifo-size=-:Integer (2 to 65000) (default\: 7):' \
  '--no-input-media-keys' \
  '--no-native-keyrepeat' \
  '--opengl-swapinterval=-:Integer (default\: 1):' \
  '--no-opengl-waitvsync' \
  '--no-ordered-chapters' \
  '--osd-scale-by-window' \
  '--pulse-latency-hacks' \
  '--replaygain-fallback=-:Float (-200 to 60) (default\: 0.000):' \
  '--scaler-resizes-only' \
  '--screenshot-template=-:String (default\: mpv-shot%n):' \
  '--no-stop-screensaver' \
  '--no-stretch-dvd-subs' \
  '--sub-ass-force-style=-:String list (default\: ):' \
  '--no-sub-ass-override' \
  '--sub-create-cc-track' \
  '--sub-scale-by-window' \
  '--no-taskbar-progress' \
  '--no-tv-immediatemode' \
  '--no-use-filedir-conf' \
  '--no-vd-lavc-bitexact' \
  '--no-vd-lavc-show-all' \
  '--video-aspect-method=-:Choices\: bitstream container (default\: container):(bitstream container)' \
  '--video-latency-hacks' \
  '--video-output-levels=-:Choices\: auto limited full (default\: auto):(auto limited full)' \
  '--video-timing-offset=-:Double (0 to 1) (default\: 0.050):' \
  '--vo-image-png-filter=-:Integer (0 to 5) (default\: 5):' \
  '--vo-vaapi-scaled-osd' \
  '--no-ad-lavc-downmix' \
  '--ao-null-broken-eof' \
  '--no-ao-null-untimed' \
  '--no-audio-exclusive' \
  '--no-audio-file-auto' \
  '--audio-swresample-o=-:Key/value list (default\: ):' \
  '--no-blend-subtitles' \
  '--cuda-decode-device=-:Choices\: auto (or an integer) (0 to 2147483647) (default\: auto):(auto)' \
  '--no-cursor-autohide' \
  '--demuxer-lavf-hacks' \
  '--demuxer-rawvideo-h=-:Integer (1 to 8192) (default\: 720):' \
  '--demuxer-rawvideo-w=-:Integer (1 to 8192) (default\: 1280):' \
  '--drm-video-plane-id=-:Integer (default\: -1):' \
  '--hidpi-window-scale' \
  '--http-header-fields=-:String list (default\: ):' \
  '--hwdec-image-format=-:Image format (default\: no):' \
  '--initial-audio-sync' \
  '--input-right-alt-gr' \
  '--no-keep-open-pause' \
  '--no-list-properties' \
  '--load-stats-overlay' \
  '--monitorpixelaspect=-:Float (0.03125 to 32) (default\: 1.000):' \
  '--opengl-early-flush=-:Choices\: no yes auto (default\: no):(no yes auto)' \
  '--no-opengl-glfinish' \
  '--no-replaygain-clip' \
  '--reset-on-next-file=-:String list (default\: ):' \
  '--no-resume-playback' \
  '--no-sub-ass-justify' \
  '--no-sub-forced-only' \
  '--no-sub-use-margins' \
  '--no-temporal-dither' \
  '--term-osd-bar-chars=-:String (default\: [-+-]):' \
  '--tone-mapping-param=-:Float (default\: nan):' \
  '--vo-vdpau-force-yuv' \
  '--vo-vdpau-hqscaling=-:Integer (0 to 9) (default\: 0):' \
  '--no-vo-vdpau-pullup' \
  '--vulkan-queue-count=-:Integer (1 to 8) (default\: 1):' \
  '--no-window-dragging' \
  '--access-references' \
  '--alsa-ignore-chmap' \
  '--alsa-mixer-device=-:String (default\: default):' \
  '--ao-pcm-waveheader' \
  '--audio-client-name=-:String (default\: mpv):' \
  '--no-autoload-files' \
  '--deband-iterations=-:Integer (1 to 16) (default\: 1):' \
  '--demuxer-max-bytes=-:ByteSize (0 to 2147483647) (default\: 150.000 MiB):' \
  '--no-demuxer-thread' \
  '--dither-size-fruit=-:Integer (2 to 8) (default\: 6):' \
  '--force-media-title=-:String (default\: ):' \
  '--no-force-seekable' \
  '--gpu-hwdec-interop=-:String (default\: auto):' \
  '--hr-seek-framedrop' \
  '--no-input-terminal' \
  '--input-vo-keyboard' \
  '--no-jack-autostart' \
  '--keepaspect-window' \
  '--no-linear-scaling' \
  '--no-ocopy-metadata' \
  '--on-all-workspaces' \
  '--osd-shadow-offset=-:Float (default\: 0.000):' \
  '--oss-mixer-channel=-:String (default\: ):' \
  '--no-playlist-start' \
  '--prefetch-playlist' \
  '--rebase-start-time' \
  '--replaygain-preamp=-:Float (-15 to 15) (default\: 0.000):' \
  '--screenshot-format=-:Choices\: jpg jpeg png (default\: jpg):(jpg jpeg png)' \
  '--sigmoid-upscaling' \
  '--sub-clear-on-seek' \
  '--no-sub-filter-sdh' \
  '--no-sub-fix-timing' \
  '--sub-shadow-offset=-:Float (default\: 0.000):' \
  '--no-sub-visibility' \
  '--tv-scan-autostart' \
  '--tv-scan-threshold=-:Integer (1 to 100) (default\: 50):' \
  '--vd-lavc-framedrop=-:Choices\: none default nonref bidir nonkey all (default\: nonref):(none default nonref bidir nonkey all)' \
  '--vd-lavc-skipframe=-:Choices\: none default nonref bidir nonkey all (default\: default):(none default nonref bidir nonkey all)' \
  '--no-video-unscaled' \
  '--vo-vdpau-colorkey=-:Color (default\: #FF020507):' \
  '--alsa-buffer-time=-:Integer (0 to 2147483647) (default\: 100000):' \
  '--alsa-mixer-index=-:Integer (0 to 99) (default\: 0):' \
  '--no-alsa-resample' \
  '--ao-null-outburst=-:Integer (1 to 100000) (default\: 256):' \
  '--no-ao-pcm-append' \
  '--no-audio-display' \
  '--audio-file-paths=-:String list (default\: ):' \
  '--audio-samplerate=-:Integer (0 to 768000) (default\: 0):' \
  '--cache-backbuffer=-:Integer (0 to 2147483647) (default\: 10000):' \
  '--no-cache-default' \
  '--cache-pause-wait=-:Float (0 to any) (default\: 1.000):' \
  '--cdda-sector-size=-:Integer (1 to 100) (default\: 0):' \
  '--deband-threshold=-:Float (0 to 4096) (default\: 64.000):' \
  '--drm-osd-plane-id=-:Integer (default\: -1):' \
  '--no-embeddedfonts' \
  '--no-gamut-warning' \
  '--no-gapless-audio' \
  '--no-gpu-dumb-mode' \
  '--hdr-compute-peak=-:Choices\: auto yes no (default\: auto):(auto yes no)' \
  '--icc-profile-auto' \
  '--input-ipc-server=-:String (default\: ) [file]:->files' \
  '--input-media-keys' \
  '--no-interpolation' \
  '--no-loop-playlist' \
  '--native-keyrepeat' \
  '--opengl-waitvsync' \
  '--ordered-chapters' \
  '--oremove-metadata=-:String list (default\: ) [no runtime changes]:' \
  '--osd-border-color=-:Color (default\: #FF000000):' \
  '--no-osd-fractions' \
  '--osd-shadow-color=-:Color (default\: #80F0F0F0):' \
  '--oss-mixer-device=-:String (default\: /dev/mixer):' \
  '--no-secondary-sid' \
  '--stop-screensaver' \
  '--stretch-dvd-subs' \
  '--sub-ass-override=-:Choices\: no yes force scale strip (default\: yes):(no yes force scale strip)' \
  '--sub-border-color=-:Color (default\: #FF000000):' \
  '--sub-shadow-color=-:Color (default\: #80F0F0F0):' \
  '--taskbar-progress' \
  '--term-playing-msg=-:String (default\: ):' \
  '--no-tv-forceaudio' \
  '--tv-immediatemode' \
  '--use-filedir-conf' \
  '--vd-lavc-bitexact' \
  '--vd-lavc-show-all' \
  '--vd-lavc-skipidct=-:Choices\: none default nonref bidir nonkey all (default\: default):(none default nonref bidir nonkey all)' \
  '--vo-vaapi-scaling=-:Choices\: default fast hq nla (default\: default):(default fast hq nla)' \
  '--vo-vdpau-denoise=-:Float (0 to 1) (default\: 0.000):' \
  '--vo-vdpau-sharpen=-:Float (-1 to 1) (default\: 0.000):' \
  '--vulkan-swap-mode=-:Choices\: auto fifo fifo-relaxed mailbox immediate (default\: auto):(auto fifo fifo-relaxed mailbox immediate)' \
  '--ytdl-raw-options=-:Key/value list (default\: ):' \
  '--ad-lavc-downmix' \
  '--ad-lavc-threads=-:Integer (0 to 16) (default\: 1):' \
  '--alsa-mixer-name=-:String (default\: Master):' \
  '--ao-null-latency=-:Float (0 to 100) (default\: 0.000):' \
  '--ao-null-untimed' \
  '--audio-exclusive' \
  '--audio-file-auto=-:Choices\: no exact fuzzy all (default\: no):(no exact fuzzy all)' \
  '--audio-wait-open=-:Float (0 to 60) (default\: 0.000):' \
  '--autofit-smaller=-:Window size (default\: ):' \
  '--blend-subtitles=-:Choices\: no yes video (default\: no):(no yes video)' \
  '--cache-file-size=-:Integer (0 to 2147483647) (default\: 1048576):' \
  '--cdda-toc-offset=-:Integer (default\: 0):' \
  '--cscale-antiring=-:Float (0 to 1) (default\: 0.000):' \
  '--cursor-autohide=-:Choices\: no always (or an integer) (0 to 30000) (default\: 1000):(no always)' \
  '--no-dither-depth' \
  '--dscale-antiring=-:Float (0 to 1) (default\: 0.000):' \
  '--no-force-window' \
  '--no-input-cursor' \
  '--no-jack-connect' \
  '--keep-open-pause' \
  '--list-properties' \
  '--no-load-scripts' \
  '--network-timeout=-:Double (0 to any) (default\: 0.000):' \
  '--opengl-glfinish' \
  '--opengl-restrict=-:Integer (default\: 0):' \
  '--osd-bar-align-x=-:Float (-1 to 1) (default\: 0.000):' \
  '--osd-bar-align-y=-:Float (-1 to 1) (default\: 0.500):' \
  '--osd-border-size=-:Float (default\: 3.000):' \
  '--osd-playing-msg=-:String (default\: ):' \
  '--replaygain-clip' \
  '--resume-playback' \
  '--scaler-lut-size=-:Integer (4 to 10) (default\: 6):' \
  '--sub-ass-hinting=-:Choices\: none light normal native (default\: none):(none light normal native)' \
  '--sub-ass-justify' \
  '--sub-border-size=-:Float (default\: 3.000):' \
  '--sub-forced-only' \
  '--sub-use-margins' \
  '--swapchain-depth=-:Integer (1 to 8) (default\: 3):' \
  '--temporal-dither' \
  '--no-term-osd-bar' \
  '--term-status-msg=-:String (default\: ):' \
  '--tscale-antiring=-:Float (0 to 1) (default\: 0.000):' \
  '--no-vd-lavc-fast' \
  '--vd-lavc-threads=-:Integer (0 to any) (default\: 0):' \
  '--no-video-rotate' \
  '--vo-image-format=-:Choices\: jpg jpeg png (default\: jpg):(jpg jpeg png)' \
  '--vo-image-outdir=-:String (default\: ) [file]:->files' \
  '--vo-vdpau-pullup' \
  '--window-dragging' \
  '--ad-lavc-ac3drc=-:Float (0 to 6) (default\: 0.000):' \
  '--ao-null-buffer=-:Float (0 to 100) (default\: 0.200):' \
  '--ao-null-format=-:Audio format (default\: no):' \
  '--audio-channels=-:Audio channels or channel map (default\: auto-safe):' \
  '--autofit-larger=-:Window size (default\: ):' \
  '--autoload-files' \
  '--no-cache-pause' \
  '--cache-seek-min=-:Integer (0 to 2147483647) (default\: 500):' \
  '--no-cdda-cdtext' \
  '--no-correct-pts' \
  '--no-deinterlace' \
  '--demuxer-lavf-o=-:Key/value list (default\: ):' \
  '--demuxer-thread' \
  '--external-files=-:String list (default\: ):' \
  '--force-seekable' \
  '--no-hls-bitrate' \
  '--icc-3dlut-size=-:String (default\: 64x64x64):' \
  '--input-ar-delay=-:Integer (default\: 200):' \
  '--input-terminal' \
  '--jack-autostart' \
  '--linear-scaling' \
  '--list-protocols' \
  '--no-merge-files' \
  '--ocopy-metadata' \
  '--osd-back-color=-:Color (default\: #00000000):' \
  '--no-osd-on-seek' \
  '--osd-status-msg=-:String (default\: ):' \
  '--playlist-start=-:Choices\: auto no (or an integer) (0 to 2147483647) (default\: auto):(auto no)' \
  '--rtsp-transport=-:Choices\: lavf udp tcp http (default\: tcp):(lavf udp tcp http)' \
  '--scale-antiring=-:Float (0 to 1) (default\: 0.000):' \
  '--sigmoid-center=-:Float (0 to 1) (default\: 0.750):' \
  '--no-snap-window' \
  '--spirv-compiler=-:Choices\: auto shaderc nvidia (default\: auto):(auto shaderc nvidia)' \
  '--sub-ass-shaper=-:Choices\: simple complex (default\: complex):(simple complex)' \
  '--sub-ass-styles=-:String (default\: ) [file]:->files' \
  '--sub-back-color=-:Color (default\: #00000000):' \
  '--sub-file-paths=-:String list (default\: ):' \
  '--sub-filter-sdh' \
  '--sub-fix-timing' \
  '--sub-visibility' \
  '--tv-scan-period=-:Float (0.1 to 2) (default\: 0.500):' \
  '--video-unscaled=-:Choices\: no yes downscale-big (default\: no):(no yes downscale-big)' \
  '--vo-vdpau-deint=-:Integer (-4 to 4) (default\: 0):' \
  '--alsa-resample' \
  '--ao-null-speed=-:Float (0 to 10000) (default\: 1.000):' \
  '--ao-pcm-append' \
  '--audio-demuxer=-:String (default\: ):' \
  '--audio-display=-:Choices\: no attachment (default\: attachment):(no attachment)' \
  '--bluray-device=-:String (default\: ) [file]:->files' \
  '--cache-default=-:Choices\: no (or an integer) (32 to 2147483647) (default\: 10000):(no)' \
  '--cache-initial=-:Integer (0 to 2147483647) (default\: 0):' \
  '--cdda-paranoia=-:Integer (0 to 2) (default\: 0):' \
  '--cdda-toc-bias=-:Integer (default\: 0):' \
  '--chapters-file=-:String (default\: ) [file]:->files' \
  '--cscale-cutoff=-:Float (0 to 1) (default\: 0.001):' \
  '--cscale-param1=-:Float (default\: nan):' \
  '--cscale-param2=-:Float (default\: nan):' \
  '--cscale-radius=-:Float (0.5 to 16) (default\: 0.000):' \
  '--cscale-window=-:String (default\: ):' \
  '--cscale-wparam=-:Float (default\: nan):' \
  '--cscale-wtaper=-:Float (0 to 1) (default\: 0.000):' \
  '--drm-connector=-:String (default\: ):' \
  '--dscale-cutoff=-:Float (0 to 1) (default\: 0.001):' \
  '--dscale-param1=-:Float (default\: nan):' \
  '--dscale-param2=-:Float (default\: nan):' \
  '--dscale-radius=-:Float (0.5 to 16) (default\: 0.000):' \
  '--dscale-window=-:String (default\: ):' \
  '--dscale-wparam=-:Float (default\: nan):' \
  '--dscale-wtaper=-:Float (0 to 1) (default\: 0.000):' \
  '--dvbin-timeout=-:Integer (1 to 30) (default\: 30):' \
  '--embeddedfonts' \
  '--external-file=-:alias for --external-files-append (CLI/config files only):' \
  '--no-fit-border' \
  '--no-fullscreen' \
  '--no-gamma-auto' \
  '--gamut-warning' \
  '--gapless-audio=-:Choices\: no yes weak (default\: weak):(no yes weak)' \
  '--gpu-dumb-mode=-:Choices\: auto yes no (default\: auto):(auto yes no)' \
  '--gpu-tex-pad-x=-:Integer (0 to 4096) (default\: 0):' \
  '--gpu-tex-pad-y=-:Integer (0 to 4096) (default\: 0):' \
  '--icc-cache-dir=-:String (default\: ) [file]:->files' \
  '--input-ar-rate=-:Integer (default\: 40):' \
  '--input-cmdlist' \
  '--input-keylist' \
  '--no-input-test' \
  '--interpolation' \
  '--no-keepaspect' \
  '--lavfi-complex=-:String (default\: ):' \
  '--loop-playlist=-:Choices\: no inf yes force (or an integer) (1 to 10000) (default\: no):(no inf yes force)' \
  '--monitoraspect=-:Float (0 to 9) (default\: 0.000):' \
  '--no-msg-module' \
  '--no-opengl-pbo' \
  '--osd-font-size=-:Float (1 to 9000) (default\: 55.000):' \
  '--osd-fractions' \
  '--no-osd-italic' \
  '--oset-metadata=-:Key/value list (default\: ) [no runtime changes]:' \
  '--no-replaygain' \
  '--secondary-sid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: no):(no auto)' \
  '--sigmoid-slope=-:Float (1 to 20) (default\: 6.500):' \
  '--stream-lavf-o=-:Key/value list (default\: ):' \
  '--sub-font-size=-:Float (1 to 9000) (default\: 55.000):' \
  '--no-sub-italic' \
  '--teletext-page=-:Integer (1 to 999) (default\: 100):' \
  '--tls-cert-file=-:String (default\: ) [file]:->files' \
  '--no-tls-verify' \
  '--tscale-cutoff=-:Float (0 to 1) (default\: 0.000):' \
  '--tscale-param1=-:Float (default\: nan):' \
  '--tscale-param2=-:Float (default\: nan):' \
  '--tscale-radius=-:Float (0.5 to 16) (default\: 0.000):' \
  '--tscale-window=-:String (default\: ):' \
  '--tscale-wparam=-:Float (default\: nan):' \
  '--tscale-wtaper=-:Float (0 to 1) (default\: 0.000):' \
  '--tv-brightness=-:Integer (-100 to 100) (default\: 0):' \
  '--tv-buffersize=-:Integer (16 to 1024) (default\: -1):' \
  '--tv-decimation=-:Integer (1 to 4) (default\: 2):' \
  '--tv-forceaudio' \
  '--tv-saturation=-:Integer (-100 to 100) (default\: 0):' \
  '--no-vd-lavc-dr' \
  '--video-align-x=-:Float (-1 to 1) (default\: 0.000):' \
  '--video-align-y=-:Float (-1 to 1) (default\: 0.000):' \
  '--no-vo-tct-256' \
  '--vo-tct-height=-:Integer (default\: 0):' \
  '--vulkan-device=-:String (default\: ):' \
  '--alsa-periods=-:Integer (0 to 2147483647) (default\: 4):' \
  '--audio-buffer=-:Double (0 to 10) (default\: 0.200):' \
  '--audio-device=-:String (default\: auto):->audio-device' \
  '--audio-format=-:Audio format (default\: no):' \
  '--cdda-overlap=-:Integer (0 to 75) (default\: -1):' \
  '--no-cdda-skip' \
  '--cdrom-device=-:String (default\: ) [file]:->files' \
  '--cookies-file=-:String (default\: ) [file]:->files' \
  '--cscale-clamp=-:Float (0 to 1) (default\: 0.000):' \
  '--cscale-taper=-:Float (0 to 1) (default\: 0.000):' \
  '--cscale-wblur=-:Float (default\: 0.000):' \
  '--deband-grain=-:Float (0 to 4096) (default\: 48.000):' \
  '--deband-range=-:Float (1 to 64) (default\: 16.000):' \
  '--display-tags=-:String list (default\: Artist,Album,Album_Artist,Comment,Composer,Date,Description,Genre,Performer,Rating,Series,Title,Track,icy-title,service_name):' \
  '--dither-depth=-:Choices\: no auto (or an integer) (-1 to 16) (default\: no):(no auto)' \
  '--drm-osd-size=-:Window size (default\: ):' \
  '--dscale-clamp=-:Float (0 to 1) (default\: 0.000):' \
  '--dscale-taper=-:Float (0 to 1) (default\: 0.000):' \
  '--dscale-wblur=-:Float (default\: 0.000):' \
  '--force-window=-:Choices\: no yes immediate (default\: no):(no yes immediate)' \
  '--no-framedrop' \
  '--gamma-factor=-:Float (0.1 to 2) (default\: 1.000):' \
  '--glsl-shaders=-:String list (default\: ):' \
  '--no-gpu-debug' \
  '--hwdec-codecs=-:String (default\: h264,vc1,wmv3,hevc,mpeg2video,vp9):' \
  '--icc-contrast=-:Integer (0 to 1000000) (default\: 0):' \
  '--input-cursor' \
  '--jack-connect' \
  '--no-keep-open' \
  '--list-options' \
  '--load-scripts' \
  '--no-loop-file' \
  '--no-msg-color' \
  '--no-native-fs' \
  '--no-opengl-es' \
  '--osd-duration=-:Integer (0 to 3600000) (default\: 1000):' \
  '--osd-margin-x=-:Integer (0 to 300) (default\: 25):' \
  '--osd-margin-y=-:Integer (0 to 600) (default\: 22):' \
  '--pulse-buffer=-:Choices\: native (or an integer) (1 to 2000) (default\: 100):(native)' \
  '--really-quiet' \
  '--scale-cutoff=-:Float (0 to 1) (default\: 0.001):' \
  '--scale-param1=-:Float (default\: nan):' \
  '--scale-param2=-:Float (default\: nan):' \
  '--scale-radius=-:Float (0.5 to 16) (default\: 0.000):' \
  '--scale-window=-:String (default\: ):' \
  '--scale-wparam=-:Float (default\: nan):' \
  '--scale-wtaper=-:Float (0 to 1) (default\: 0.000):' \
  '--show-profile=-:String (default\: ) [not in config files] [no runtime changes]:->show-profile' \
  '--sub-codepage=-:String (default\: auto):' \
  '--sub-margin-x=-:Integer (0 to 300) (default\: 25):' \
  '--sub-margin-y=-:Integer (0 to 600) (default\: 22):' \
  '--term-osd-bar' \
  '--tls-key-file=-:String (default\: ) [file]:->files' \
  '--tone-mapping=-:Choices\: clip mobius reinhard hable gamma linear (default\: hable):(clip mobius reinhard hable gamma linear)' \
  '--tscale-clamp=-:Float (0 to 1) (default\: 1.000):' \
  '--tscale-taper=-:Float (0 to 1) (default\: 0.000):' \
  '--tscale-wblur=-:Float (default\: 0.000):' \
  '--tv-audiorate=-:Integer (default\: 44100):' \
  '--tv-forcechan=-:Integer (1 to 2) (default\: -1):' \
  '--vaapi-device=-:String (default\: /dev/dri/renderD128):' \
  '--vd-lavc-fast' \
  '--video-aspect=-:Aspect (default\: -1.000):' \
  '--no-video-osd' \
  '--video-rotate=-:Choices\: no (or an integer) (0 to 359) (default\: 0):(no)' \
  '--vo-tct-width=-:Integer (default\: 0):' \
  '--vo-vdpau-fps=-:Float (default\: 0.000):' \
  '--window-scale=-:Double (0.001 to 100) (default\: 1.000):' \
  '--no-x11-netwm' \
  '--xv-ck-method=-:Choices\: none bg man auto (default\: man):(none bg man auto)' \
  '--ao-pcm-file=-:String (default\: ) [file]:->files' \
  '--audio-delay=-:Float (default\: 0.000):' \
  '--audio-files=-:String list (default\: ):' \
  '--audio-spdif=-:String (default\: ):' \
  '--no-autosync' \
  '--cache-pause' \
  '--cdda-cdtext' \
  '--correct-pts' \
  '--cscale-blur=-:Float (default\: 0.000):' \
  '--deinterlace' \
  '--display-fps=-:Double (0 to any) (default\: 0.000):' \
  '--dscale-blur=-:Float (default\: 0.000):' \
  '--glsl-shader=-:alias for --glsl-shaders-append (CLI/config files only):' \
  '--gpu-context=-:String (default\: ):' \
  '--hls-bitrate=-:Choices\: no min max (or an integer) (0 to 2147483647) (default\: max):(no min max)' \
  '--icc-profile=-:String (default\: ) [file]:->files' \
  '--merge-files' \
  '--no-msg-time' \
  '--ontop-level=-:Choices\: window system (or an integer) (0 to 2147483647) (default\: window):(window system)' \
  '--osd-align-x=-:Choices\: left center right (default\: left):(left center right)' \
  '--osd-align-y=-:Choices\: top center bottom (default\: top):(top center bottom)' \
  '--no-osd-bold' \
  '--osd-justify=-:Choices\: auto left center right (default\: auto):(auto left center right)' \
  '--osd-on-seek=-:Choices\: no bar msg msg-bar (default\: bar):(no bar msg msg-bar)' \
  '--osd-spacing=-:Float (-10 to 10) (default\: 0.000):' \
  '--record-file=-:String (default\: ) [file]:->files' \
  '--scale-clamp=-:Float (0 to 1) (default\: 0.000):' \
  '--scale-taper=-:Float (0 to 1) (default\: 0.000):' \
  '--scale-wblur=-:Float (default\: 0.000):' \
  '--script-opts=-:Key/value list (default\: ):' \
  '--snap-window' \
  '--stream-dump=-:String (default\: ) [file]:->files' \
  '--sub-align-x=-:Choices\: left center right (default\: center):(left center right)' \
  '--sub-align-y=-:Choices\: top center bottom (default\: bottom):(top center bottom)' \
  '--no-sub-auto' \
  '--no-sub-bold' \
  '--sub-demuxer=-:String (default\: ):' \
  '--no-sub-gray' \
  '--sub-justify=-:Choices\: auto left center right (default\: auto):(auto left center right)' \
  '--sub-spacing=-:Float (-10 to 10) (default\: 0.000):' \
  '--target-peak=-:Integer (10 to 10000) (default\: 0):' \
  '--target-prim=-:Choices\: auto bt.601-525 bt.601-625 bt.709 bt.2020 bt.470m apple adobe prophoto cie1931 dci-p3 display-p3 v-gamut s-gamut (default\: auto):(auto bt.601-525 bt.601-625 bt.709 bt.2020 bt.470m apple adobe prophoto cie1931 dci-p3 display-p3 v-gamut s-gamut)' \
  '--no-term-osd' \
  '--no-terminal' \
  '--tls-ca-file=-:String (default\: ) [file]:->files' \
  '--tscale-blur=-:Float (default\: 0.000):' \
  '--no-tv-audio' \
  '--tv-automute=-:Integer (0 to 255) (default\: 0):' \
  '--tv-chanlist=-:String (default\: europe-east):' \
  '--tv-channels=-:String list (default\: ):' \
  '--tv-contrast=-:Integer (-100 to 100) (default\: 0):' \
  '--no-tv-mjpeg' \
  '--video-pan-x=-:Float (-3 to 3) (default\: 0.000):' \
  '--video-pan-y=-:Float (-3 to 3) (default\: 0.000):' \
  '--vo-null-fps=-:Double (0 to 10000) (default\: 0.000):' \
  '--vo-tct-algo=-:Choices\: plain half-blocks (default\: half-blocks):(plain half-blocks)' \
  '--xv-colorkey=-:Integer (default\: 65280):' \
  '--ytdl-format=-:String (default\: ):' \
  '--audio-file=-:alias for --audio-files-append (CLI/config files only):' \
  '--background=-:Color (default\: #FF000000):' \
  '--brightness=-:Integer (-100 to 100) (default\: 0):' \
  '--cache-file=-:String (default\: ) [file]:->files' \
  '--cache-secs=-:Double (0 to any) (default\: 36000.000):' \
  '--cdda-speed=-:Integer (1 to 100) (default\: 0):' \
  '--config-dir=-:String (default\: ) [not in config files] [file] [no runtime changes]:->files' \
  '--no-cookies' \
  '--drm-format=-:Choices\: xrgb8888 xrgb2101010 (default\: xrgb8888):(xrgb8888 xrgb2101010)' \
  '--dump-stats=-:String (default\: ):' \
  '--dvbin-card=-:Integer (1 to 4) (default\: 0):' \
  '--dvbin-file=-:String (default\: ) [file]:->files' \
  '--dvbin-prog=-:String (default\: ):' \
  '--dvd-device=-:String (default\: ) [file]:->files' \
  '--fbo-format=-:String (default\: auto):' \
  '--fit-border' \
  '--fullscreen' \
  '--gamma-auto' \
  '--no-hr-seek' \
  '--http-proxy=-:String (default\: ):' \
  '--icc-intent=-:Integer (default\: 1):' \
  '--input-conf=-:String (default\: ) [file] [no runtime changes]:->files' \
  '--input-file=-:String (default\: ) [file]:->files' \
  '--input-test' \
  '--keepaspect' \
  '--msg-module' \
  '--opengl-pbo' \
  '--no-osd-bar' \
  '--osd-italic' \
  '--pulse-host=-:String (default\: ):' \
  '--replaygain=-:Choices\: no track album (default\: no):(no track album)' \
  '--saturation=-:Integer (-100 to 100) (default\: 0):' \
  '--scale-blur=-:Float (default\: 0.000):' \
  '--no-shuffle' \
  '--no-sub-ass' \
  '--sub-italic' \
  '--sws-scaler=-:Choices\: fast-bilinear bilinear bicubic x point area bicublin gauss sinc lanczos spline (default\: bicubic):(fast-bilinear bilinear bicubic x point area bicublin gauss sinc lanczos spline)' \
  '--target-trc=-:Choices\: auto bt.1886 srgb linear gamma1.8 gamma2.2 gamma2.8 prophoto pq hlg v-log s-log1 s-log2 (default\: auto):(auto bt.1886 srgb linear gamma1.8 gamma2.2 gamma2.8 prophoto pq hlg v-log s-log1 s-log2)' \
  '--tls-verify' \
  '--tv-adevice=-:String (default\: ):' \
  '--no-tv-alsa' \
  '--tv-audioid=-:Integer (0 to 9) (default\: 0):' \
  '--tv-balance=-:Integer (0 to 65535) (default\: -1):' \
  '--tv-channel=-:String (default\: ):' \
  '--tv-quality=-:Integer (0 to 100) (default\: 90):' \
  '--no-untimed' \
  '--user-agent=-:String (default\: mpv 0.29.1):' \
  '--vd-lavc-dr' \
  '--video-sync=-:Choices\: audio display-resample display-resample-vdrop display-resample-desync display-adrop display-vdrop display-desync desync (default\: audio):(audio display-resample display-resample-vdrop display-resample-desync display-adrop display-vdrop display-desync desync)' \
  '--video-zoom=-:Float (-20 to 20) (default\: 0.000):' \
  '--vo-tct-256' \
  '--volume-max=-:Float (100 to 1000) (default\: 130.000):' \
  '--xv-adaptor=-:Integer (-1 to any) (default\: -1):' \
  '--xv-buffers=-:Integer (1 to 10) (default\: 2):' \
  '--ab-loop-a=-:Time (default\: no):' \
  '--ab-loop-b=-:Time (default\: no):' \
  '--ad-lavc-o=-:Key/value list (default\: ):' \
  '--no-border' \
  '--cdda-skip' \
  '--cdda-span=-:Int[-Int] (default\: 0-0):' \
  '--no-config' \
  '--no-deband' \
  '--no-dither' \
  '--dvd-angle=-:Integer (1 to 99) (default\: 1):' \
  '--dvd-speed=-:Integer (default\: 0):' \
  '--framedrop=-:Choices\: no vo decoder decoder+vo (default\: vo):(no vo decoder decoder+vo)' \
  '--fs-screen=-:Choices\: all current (or an integer) (0 to 32) (default\: current):(all current)' \
  '--gpu-debug' \
  '--no-gpu-sw' \
  '--jack-name=-:String (default\: mpv):' \
  '--jack-port=-:String (default\: ):' \
  '--keep-open=-:Choices\: no yes always (default\: no):(no yes always)' \
  '--loop-file=-:Choices\: no yes inf (or an integer) (0 to 10000) (default\: no):(no yes inf)' \
  '--msg-color' \
  '--msg-level=-:Output verbosity levels (default\: ):' \
  '--native-fs' \
  '--opengl-es=-:Choices\: auto yes no (default\: auto):(auto yes no)' \
  '--no-orawts' \
  '--osd-bar-h=-:Float (0.1 to 50) (default\: 3.125):' \
  '--osd-bar-w=-:Float (1 to 100) (default\: 75.000):' \
  '--osd-color=-:Color (default\: #FFFFFFFF):' \
  '--osd-level=-:Choices\: 0 1 2 3 (default\: 1):(0 1 2 3)' \
  '--osd-scale=-:Float (0 to 100) (default\: 1.000):' \
  '--sub-color=-:Color (default\: #FFFFFFFF):' \
  '--sub-delay=-:Float (default\: 0.000):' \
  '--sub-files=-:String list (default\: ):' \
  '--sub-gauss=-:Float (0 to 3) (default\: 0.000):' \
  '--sub-scale=-:Float (0 to 100) (default\: 1.000):' \
  '--sub-speed=-:Float (default\: 1.000):' \
  '--tv-device=-:String (default\: ):' \
  '--tv-driver=-:String (default\: ):' \
  '--tv-height=-:Integer (0 to 4096) (default\: -1):' \
  '--tv-normid=-:Integer (default\: -1):' \
  '--tv-outfmt=-:FourCC (default\: ffffffff):' \
  '--tv-treble=-:Integer (0 to 65535) (default\: -1):' \
  '--tv-volume=-:Integer (0 to 65535) (default\: -1):' \
  '--vd-lavc-o=-:Key/value list (default\: ):' \
  '--video-osd' \
  '--x11-netwm=-:Choices\: auto no yes (default\: auto):(auto no yes)' \
  '--no-alpha' \
  '--autosync=-:Choices\: no (or an integer) (0 to 10000) (default\: 0):(no)' \
  '--no-cache' \
  '--contrast=-:Integer (-100 to 100) (default\: 0):' \
  '--drm-mode=-:Integer (default\: 0):' \
  '--geometry=-:Window geometry (default\: ):' \
  '--log-file=-:String (default\: ) [file]:->files' \
  '--msg-time' \
  '--no-ontop' \
  '--osd-blur=-:Float (0 to 20) (default\: 0.000):' \
  '--osd-bold' \
  '--osd-font=-:String (default\: sans-serif):' \
  '--osd-msg1=-:String (default\: ):' \
  '--osd-msg2=-:String (default\: ):' \
  '--osd-msg3=-:String (default\: ):' \
  '--no-pause' \
  '--playlist=-:String (1 to any) (default\: ) [not in config files] [file] [no runtime changes]:->files' \
  '--no-quiet' \
  '--referrer=-:String (default\: ):' \
  '--sub-auto=-:Choices\: no exact fuzzy all (default\: exact):(no exact fuzzy all)' \
  '--sub-blur=-:Float (0 to 20) (default\: 0.000):' \
  '--sub-bold' \
  '--sub-file=-:alias for --sub-files-append (CLI/config files only):' \
  '--sub-font=-:String (default\: sans-serif):' \
  '--sub-gray' \
  '--term-osd=-:Choices\: force auto no (default\: auto):(force auto no)' \
  '--terminal' \
  '--tv-amode=-:Integer (0 to 3) (default\: -1):' \
  '--tv-audio' \
  '--tv-input=-:Integer (default\: 0):' \
  '--tv-mjpeg' \
  '--tv-width=-:Integer (0 to 4096) (default\: -1):' \
  '--x11-name=-:String (default\: ):' \
  '--autofit=-:Window size (default\: ):' \
  '--cookies' \
  '--demuxer=-:String (default\: ):' \
  '--edition=-:Choices\: auto (or an integer) (0 to 8190) (default\: auto):(auto)' \
  '--gpu-api=-:String (default\: ):' \
  '--hr-seek=-:Choices\: no absolute yes always (default\: absolute):(no absolute yes always)' \
  '--no-idle' \
  '--include=-:String (default\: ) [file]:->files' \
  '--mf-type=-:String (default\: ):' \
  '--no-mute' \
  '--oacopts=-:Key/value list (default\: ) [no runtime changes]:' \
  '--osd-bar' \
  '--ovcopts=-:Key/value list (default\: ) [no runtime changes]:' \
  '--panscan=-:Float (0 to 1) (default\: 0.000):' \
  '--profile=-:String list (default\: ):->profile' \
  '--scripts=-:String list (default\: ) [no runtime changes]:' \
  '--sharpen=-:Float (default\: 0.000):' \
  '--shuffle' \
  '--sub-ass' \
  '--sub-fps=-:Float (default\: 0.000):' \
  '--sub-pos=-:Integer (0 to 100) (default\: 100):' \
  '--sws-cgb=-:Float (0 to 100) (default\: 0.000):' \
  '--sws-chs=-:Integer (default\: 0):' \
  '--sws-cvs=-:Integer (default\: 0):' \
  '--sws-lgb=-:Float (0 to 100) (default\: 0.000):' \
  '--tv-alsa' \
  '--tv-bass=-:Integer (0 to 65535) (default\: -1):' \
  '--tv-freq=-:Float (default\: 0.000):' \
  '--tv-gain=-:Integer (-1 to 100) (default\: -1):' \
  '--tv-norm=-:String (default\: pal):' \
  '--untimed' \
  '--version' \
  '--xv-port=-:Integer (0 to any) (default\: 0):' \
  '--no-ytdl' \
  '--no-aid' \
  '--border' \
  '--config' \
  '--cscale=-:String (default\: bilinear):' \
  '--deband' \
  '--dither=-:Choices\: fruit ordered no (default\: fruit):(fruit ordered no)' \
  '--dscale=-:String (default\: ):' \
  '--frames=-:Choices\: all (or an integer) (0 to 2147483647) (default\: all):(all)' \
  '--gpu-sw' \
  '--length=-:Relative time or percent position (default\: none):' \
  '--mf-fps=-:Double (default\: 1.000):' \
  '--ofopts=-:Key/value list (default\: ) [no runtime changes]:' \
  '--orawts' \
  '--no-osc' \
  '--screen=-:Choices\: default (or an integer) (0 to 32) (default\: default):(default)' \
  '--script=-:alias for --scripts-append (CLI/config files only):' \
  '--no-sid' \
  '--sws-cs=-:Float (-100 to 100) (default\: 0.000):' \
  '--sws-ls=-:Float (-100 to 100) (default\: 0.000):' \
  '--tscale=-:String (default\: mitchell):' \
  '--tv-fps=-:Float (default\: -1.000):' \
  '--tv-hue=-:Integer (-100 to 100) (default\: 0):' \
  '--no-vid' \
  '--volume=-:Float (-1 to 1000) (default\: 100.000):' \
  '--alang=-:String list (default\: ):' \
  '--alpha=-:Choices\: no yes blend blend-tiles (default\: blend-tiles):(no yes blend blend-tiles)' \
  '--audio=-:alias for aid:' \
  '--cache=-:Choices\: no auto yes (or an integer) (32 to 2147483647) (default\: auto):(no auto yes)' \
  '--gamma=-:Integer (-100 to 100) (default\: 0):' \
  '--hwdec=-:String (default\: no):' \
  '--index=-:Choices\: default recreate (default\: default):(default recreate)' \
  '--ontop' \
  '--pause' \
  '--quiet' \
  '--scale=-:String (default\: bilinear):' \
  '--slang=-:String list (default\: ):' \
  '--speed=-:Double (0.01 to 100) (default\: 1.000):' \
  '--sstep=-:Double (0 to any) (default\: 0.000):' \
  '--start=-:Relative time or percent position (default\: none):' \
  '--title=-:String (default\: ${?media-title\:${media-title}}${!media-title\:No file} - mpv):' \
  '--video=-:alias for vid:' \
  '--vlang=-:String list (default\: ):' \
  '--xv-ck=-:Choices\: use set cur (default\: cur):(use set cur)' \
  '--help=-:String (default\: ) [not in config files] [no runtime changes]:' \
  '--idle=-:Choices\: no once yes (default\: no):(no once yes)' \
  '--loop=-:alias for loop-file:' \
  '--mute=-:Choices\: no auto yes (default\: no):(no auto yes)' \
  '--ytdl' \
  '--aid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--end=-:Relative time or percent position (default\: none):' \
  '--fps=-:Double (0 to any) (default\: 0.000):' \
  '--hue=-:Integer (-100 to 100) (default\: 0):' \
  '--oac=-:String (default\: ) [no runtime changes]:' \
  '--osc' \
  '--ovc=-:String (default\: ) [no runtime changes]:' \
  '--sid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--sub=-:alias for sid:' \
  '--vid=-:Choices\: no auto (or an integer) (0 to 8190) (default\: auto):(no auto)' \
  '--wid=-:Integer64 (default\: -1):' \
  '--ad=-:String (default\: ):' \
  '--af=-:Object settings list (default\: ):->af' \
  '--ao=-:Object settings list (default\: ):->ao' \
  '--fs=-:alias for fullscreen:' \
  '--mc=-:Float (0 to 100) (default\: -1.000):' \
  '--of=-:String (default\: ) [no runtime changes]:' \
  '--vd=-:String (default\: ):' \
  '--vf=-:Object settings list (default\: ):->vf' \
  '--vo=-:Object settings list (default\: ):->vo' \
  '--h=-:String (default\: ) [not in config files] [no runtime changes]:' \
  '--o=-:String (default\: ) [not in config files] [file] [no runtime changes]:->files' \
  '--v' \
  '--V' \
  '--{' \
  '--}' \
  '*:files:->mfiles' && rc=0

case $state in
  ao)
    _values -s , 'audio outputs' \
      'pulse[PulseAudio audio output]' \
      'alsa[ALSA audio output]' \
      'oss[OSS/ioctl audio output]' \
      'jack[JACK audio output]' \
      'null[Null audio output]' \
      'pcm[RAW PCM/WAVE file writer audio output]' \
    && rc=0
  ;;

  vo)
    _values -s , 'video outputs' \
      'libmpv[render API for libmpv]' \
      'gpu[Shader-based GPU Renderer]' \
      'vdpau[VDPAU with X11]' \
      'xv[X11/Xv]' \
      'vaapi[VA API with X11]' \
      'x11[X11 (slow, old crap)]' \
      'null[Null video output]' \
      'image[Write video frames to image files]' \
      'tct[true-color terminals]' \
      'caca[libcaca]' \
      'drm[Direct Rendering Manager]' \
    && rc=0
  ;;

  af)
    _values -s , 'audio filters' \
      'lavfi[libavfilter bridge]' \
      'lavfi-bridge[libavfilter bridge (explicit options)]' \
      'scaletempo[Scale audio tempo while maintaining pitch]' \
      'format[Force audio format]' \
      'rubberband[Pitch conversion with librubberband]' \
      'lavcac3enc[runtime encode to ac3 using libavcodec]' \
      'abench[Benchmark part of a filtergraph.]' \
      'acompressor[Audio compressor.]' \
      'acontrast[Simple audio dynamic range compression/expansion filter.]' \
      'acopy[Copy the input audio unchanged to the output.]' \
      'acue[Delay filtering to match a cue.]' \
      'acrusher[Reduce audio bit resolution.]' \
      'adeclick[Remove impulsive noise from input audio.]' \
      'adeclip[Remove clipping from input audio.]' \
      'adelay[Delay one or more audio channels.]' \
      'aderivative[Compute derivative of input audio.]' \
      'aecho[Add echoing to the audio.]' \
      'aemphasis[Audio emphasis.]' \
      'aeval[Filter audio signal according to a specified expression.]' \
      'afade[Fade in/out input audio.]' \
      'afftdn[Denoise audio samples using FFT.]' \
      'afftfilt[Apply arbitrary expressions to samples in frequency domain.]' \
      'aformat[Convert the input audio to one of the specified formats.]' \
      'agate[Audio gate.]' \
      'aintegral[Compute integral of input audio.]' \
      'alimiter[Audio lookahead limiter.]' \
      'allpass[Apply a two-pole all-pass filter.]' \
      'aloop[Loop audio samples.]' \
      'ametadata[Manipulate audio frame metadata.]' \
      'anull[Pass the source unchanged to the output.]' \
      'apad[Pad audio with silence.]' \
      'aperms[Set permissions for the output audio frame.]' \
      'aphaser[Add a phasing effect to the audio.]' \
      'apulsator[Audio pulsator.]' \
      'arealtime[Slow down filtering to match realtime.]' \
      'aresample[Resample audio data.]' \
      'areverse[Reverse an audio clip.]' \
      'asendcmd[Send commands to filters.]' \
      'asetnsamples[Set the number of samples for each output audio frames.]' \
      'asetpts[Set PTS for the output audio frame.]' \
      'asetrate[Change the sample rate without altering the data.]' \
      'asettb[Set timebase for the audio output link.]' \
      'ashowinfo[Show textual information for each audio frame.]' \
      'asidedata[Manipulate audio frame side data.]' \
      'astats[Show time domain statistics about audio frames.]' \
      'atempo[Adjust audio tempo.]' \
      'atrim[Pick one continuous section from the input, drop the rest.]' \
      'bandpass[Apply a two-pole Butterworth band-pass filter.]' \
      'bandreject[Apply a two-pole Butterworth band-reject filter.]' \
      'bass[Boost or cut lower frequencies.]' \
      'biquad[Apply a biquad IIR filter with the given coefficients.]' \
      'channelmap[Remap audio channels.]' \
      'chorus[Add a chorus effect to the audio.]' \
      'compand[Compress or expand audio dynamic range.]' \
      'compensationdelay[Audio Compensation Delay Line.]' \
      'crossfeed[Apply headphone crossfeed filter.]' \
      'crystalizer[Simple expand audio dynamic range filter.]' \
      'dcshift[Apply a DC shift to the audio.]' \
      'drmeter[Measure audio dynamic range.]' \
      'dynaudnorm[Dynamic Audio Normalizer.]' \
      'earwax[Widen the stereo image.]' \
      'equalizer[Apply two-pole peaking equalization (EQ) filter.]' \
      'extrastereo[Increase difference between stereo audio channels.]' \
      'firequalizer[Finite Impulse Response Equalizer.]' \
      'flanger[Apply a flanging effect to the audio.]' \
      'haas[Apply Haas Stereo Enhancer.]' \
      'hdcd[Apply High Definition Compatible Digital (HDCD) decoding.]' \
      'highpass[Apply a high-pass filter with 3dB point frequency.]' \
      'highshelf[Apply a high shelf filter.]' \
      'loudnorm[EBU R128 loudness normalization]' \
      'lowpass[Apply a low-pass filter with 3dB point frequency.]' \
      'lowshelf[Apply a low shelf filter.]' \
      'mcompand[Multiband Compress or expand audio dynamic range.]' \
      'pan[Remix channels with coefficients (panning).]' \
      'replaygain[ReplayGain scanner.]' \
      'silencedetect[Detect silence.]' \
      'silenceremove[Remove silence.]' \
      'stereotools[Apply various stereo tools.]' \
      'stereowiden[Apply stereo widening effect.]' \
      'superequalizer[Apply 18 band equalization filter.]' \
      'surround[Apply audio surround upmix filter.]' \
      'treble[Boost or cut upper frequencies.]' \
      'tremolo[Apply tremolo effect.]' \
      'vibrato[Apply vibrato effect.]' \
      'volume[Change input volume.]' \
      'volumedetect[Detect audio volume.]' \
      'afifo[Buffer input frames and send them when they are requested.]' \
    && rc=0
  ;;

  vf)
    _values -s , 'video filters' \
      'format[force output format]' \
      'lavfi[libavfilter bridge]' \
      'lavfi-bridge[libavfilter bridge (explicit options)]' \
      'sub[Render subtitles]' \
      'vdpaupp[vdpau postprocessing]' \
      'vavpp[VA-API Video Post-Process Filter]' \
      'amplify[Amplify changes between successive video frames.]' \
      'ass[Render ASS subtitles onto input video using the libass library.]' \
      'atadenoise[Apply an Adaptive Temporal Averaging Denoiser.]' \
      'avgblur[Apply Average Blur filter.]' \
      'bbox[Compute bounding box for each frame.]' \
      'bench[Benchmark part of a filtergraph.]' \
      'bitplanenoise[Measure bit plane noise.]' \
      'blackdetect[Detect video intervals that are (almost) black.]' \
      'blackframe[Detect frames that are (almost) black.]' \
      'boxblur[Blur the input.]' \
      'bwdif[Deinterlace the input image.]' \
      'chromahold[Turns a certain color range into gray.]' \
      'chromakey[Turns a certain color into transparency. Operates on YUV colors.]' \
      'ciescope[Video CIE scope.]' \
      'codecview[Visualize information about some codecs.]' \
      'colorbalance[Adjust the color balance.]' \
      'colorchannelmixer[Adjust colors by mixing color channels.]' \
      'colorkey[Turns a certain color into transparency. Operates on RGB colors.]' \
      'colorlevels[Adjust the color levels.]' \
      'colormatrix[Convert color matrix.]' \
      'colorspace[Convert between colorspaces.]' \
      'convolution[Apply convolution filter.]' \
      'copy[Copy the input video unchanged to the output.]' \
      'cover_rect[Find and cover a user specified object.]' \
      'crop[Crop the input video.]' \
      'cropdetect[Auto-detect crop size.]' \
      'cue[Delay filtering to match a cue.]' \
      'curves[Adjust components curves.]' \
      'datascope[Video data analysis.]' \
      'dctdnoiz[Denoise frames using 2D DCT.]' \
      'deband[Debands video.]' \
      'deblock[Deblock video.]' \
      'deflate[Apply deflate effect.]' \
      'deflicker[Remove temporal frame luminance variations.]' \
      'deinterlace_vaapi[Deinterlacing of VAAPI surfaces]' \
      'dejudder[Remove judder produced by pullup.]' \
      'delogo[Remove logo from input video.]' \
      'denoise_vaapi[VAAPI VPP for de-noise]' \
      'deshake[Stabilize shaky video.]' \
      'despill[Despill video.]' \
      'detelecine[Apply an inverse telecine pattern.]' \
      'dilation[Apply dilation effect.]' \
      'doubleweave[Weave input video fields into double number of frames.]' \
      'drawbox[Draw a colored box on the input video.]' \
      'drawgraph[Draw a graph using input video metadata.]' \
      'drawgrid[Draw a colored grid on the input video.]' \
      'drawtext[Draw text on top of video frames using libfreetype library.]' \
      'edgedetect[Detect and draw edge.]' \
      'elbg[Apply posterize effect, using the ELBG algorithm.]' \
      'entropy[Measure video frames entropy.]' \
      'eq[Adjust brightness, contrast, gamma, and saturation.]' \
      'erosion[Apply erosion effect.]' \
      'fade[Fade in/out input video.]' \
      'fftdnoiz[Denoise frames using 3D FFT.]' \
      'fftfilt[Apply arbitrary expressions to pixels in frequency domain.]' \
      'field[Extract a field from the input video.]' \
      'fieldhint[Field matching using hints.]' \
      'fieldorder[Set the field order.]' \
      'fillborders[Fill borders of the input video.]' \
      'find_rect[Find a user specified object.]' \
      'floodfill[Fill area with same color with another color.]' \
      'format[Convert the input video to one of the specified pixel formats.]' \
      'fps[Force constant framerate.]' \
      'framerate[Upsamples or downsamples progressive source between specified frame rates.]' \
      'framestep[Select one frame every N frames.]' \
      'fspp[Apply Fast Simple Post-processing filter.]' \
      'gblur[Apply Gaussian Blur filter.]' \
      'geq[Apply generic equation to each pixel.]' \
      'gradfun[Debands video quickly using gradients.]' \
      'graphmonitor[Show various filtergraph stats.]' \
      'greyedge[Estimates scene illumination by grey edge assumption.]' \
      'hflip[Horizontally flip the input video.]' \
      'histeq[Apply global color histogram equalization.]' \
      'histogram[Compute and draw a histogram.]' \
      'hqdn3d[Apply a High Quality 3D Denoiser.]' \
      'hqx[Scale the input by 2, 3 or 4 using the hq*x magnification algorithm.]' \
      'hue[Adjust the hue and saturation of the input video.]' \
      'hwdownload[Download a hardware frame to a normal frame]' \
      'hwmap[Map hardware frames]' \
      'hwupload[Upload a normal frame to a hardware frame]' \
      'idet[Interlace detect Filter.]' \
      'il[Deinterleave or interleave fields.]' \
      'inflate[Apply inflate effect.]' \
      'interlace[Convert progressive video into interlaced.]' \
      'kerndeint[Apply kernel deinterlacing to the input.]' \
      'lenscorrection[Rectify the image by correcting for lens distortion.]' \
      'limiter[Limit pixels components to the specified range.]' \
      'loop[Loop video frames.]' \
      'lumakey[Turns a certain luma into transparency.]' \
      'lut[Compute and apply a lookup table to the RGB/YUV input video.]' \
      'lut1d[Adjust colors using a 1D LUT.]' \
      'lut3d[Adjust colors using a 3D LUT.]' \
      'lutrgb[Compute and apply a lookup table to the RGB input video.]' \
      'lutyuv[Compute and apply a lookup table to the YUV input video.]' \
      'mcdeint[Apply motion compensating deinterlacing.]' \
      'mestimate[Generate motion vectors.]' \
      'metadata[Manipulate video frame metadata.]' \
      'minterpolate[Frame rate conversion using Motion Interpolation.]' \
      'mpdecimate[Remove near-duplicate frames.]' \
      'negate[Negate input video.]' \
      'nlmeans[Non-local means denoiser.]' \
      'nnedi[Apply neural network edge directed interpolation intra-only deinterlacer.]' \
      'noformat[Force libavfilter not to use any of the specified pixel formats for the input to the next filter.]' \
      'noise[Add noise.]' \
      'normalize[Normalize RGB video.]' \
      'null[Pass the source unchanged to the output.]' \
      'oscilloscope[2D Video Oscilloscope.]' \
      'owdenoise[Denoise using wavelets.]' \
      'pad[Pad the input video.]' \
      'palettegen[Find the optimal palette for a given stream.]' \
      'perms[Set permissions for the output video frame.]' \
      'perspective[Correct the perspective of video.]' \
      'phase[Phase shift fields.]' \
      'pixdesctest[Test pixel format definitions.]' \
      'pixscope[Pixel data analysis.]' \
      'pp[Filter video using libpostproc.]' \
      'pp7[Apply Postprocessing 7 filter.]' \
      'prewitt[Apply prewitt operator.]' \
      'procamp_vaapi[ProcAmp (color balance) adjustments for hue, saturation, brightness, contrast]' \
      'pseudocolor[Make pseudocolored video frames.]' \
      'pullup[Pullup from field sequence to frames.]' \
      'qp[Change video quantization parameters.]' \
      'random[Return random frames.]' \
      'readeia608[Read EIA-608 Closed Caption codes from input video and write them to frame metadata.]' \
      'readvitc[Read vertical interval timecode and write it to frame metadata.]' \
      'realtime[Slow down filtering to match realtime.]' \
      'removegrain[Remove grain.]' \
      'removelogo[Remove a TV logo based on a mask image.]' \
      'repeatfields[Hard repeat fields based on MPEG repeat field flag.]' \
      'reverse[Reverse a clip.]' \
      'roberts[Apply roberts cross operator.]' \
      'rotate[Rotate the input image.]' \
      'sab[Apply shape adaptive blur.]' \
      'scale[Scale the input video size and/or convert the image format.]' \
      'scale_vaapi[Scale to/from VAAPI surfaces.]' \
      'selectivecolor[Apply CMYK adjustments to specific color ranges.]' \
      'sendcmd[Send commands to filters.]' \
      'separatefields[Split input video frames into fields.]' \
      'setdar[Set the frame display aspect ratio.]' \
      'setfield[Force field for the output video frame.]' \
      'setparams[Force field, or color property for the output video frame.]' \
      'setpts[Set PTS for the output video frame.]' \
      'setrange[Force color range for the output video frame.]' \
      'setsar[Set the pixel sample aspect ratio.]' \
      'settb[Set timebase for the video output link.]' \
      'sharpness_vaapi[VAAPI VPP for sharpness]' \
      'showinfo[Show textual information for each video frame.]' \
      'showpalette[Display frame palette.]' \
      'shuffleframes[Shuffle video frames.]' \
      'shuffleplanes[Shuffle video planes.]' \
      'sidedata[Manipulate video frame side data.]' \
      'signalstats[Generate statistics from video analysis.]' \
      'smartblur[Blur the input video without impacting the outlines.]' \
      'sobel[Apply sobel operator.]' \
      'spp[Apply a simple post processing filter.]' \
      'sr[Apply DNN-based image super resolution to the input.]' \
      'stereo3d[Convert video stereoscopic 3D view.]' \
      'subtitles[Render text subtitles onto input video using the libass library.]' \
      'super2xsai[Scale the input by 2x using the Super2xSaI pixel art algorithm.]' \
      'swaprect[Swap 2 rectangular objects in video.]' \
      'swapuv[Swap U and V components.]' \
      'tblend[Blend successive frames.]' \
      'telecine[Apply a telecine pattern.]' \
      'thumbnail[Select the most representative frame in a given sequence of consecutive frames.]' \
      'tile[Tile several successive frames together.]' \
      'tinterlace[Perform temporal field interlacing.]' \
      'tlut2[Compute and apply a lookup table from two successive frames.]' \
      'tmix[Mix successive video frames.]' \
      'tonemap[Conversion to/from different dynamic ranges.]' \
      'transpose[Transpose input video.]' \
      'trim[Pick one continuous section from the input, drop the rest.]' \
      'unsharp[Sharpen or blur the input video.]' \
      'uspp[Apply Ultra Simple / Slow Post-processing filter.]' \
      'vaguedenoiser[Apply a Wavelet based Denoiser.]' \
      'vectorscope[Video vectorscope.]' \
      'vflip[Flip the input video vertically.]' \
      'vfrdet[Variable frame rate detect filter.]' \
      'vibrance[Boost or alter saturation.]' \
      'vidstabdetect[Extract relative transformations, pass 1 of 2 for stabilization (see vidstabtransform for pass 2).]' \
      'vidstabtransform[Transform the frames, pass 2 of 2 for stabilization (see vidstabdetect for pass 1).]' \
      'vignette[Make or reverse a vignette effect.]' \
      'vmafmotion[Calculate the VMAF Motion score.]' \
      'w3fdif[Apply Martin Weston three field deinterlace.]' \
      'waveform[Video waveform monitor.]' \
      'weave[Weave input video fields into frames.]' \
      'xbr[Scale the input using xBR algorithm.]' \
      'yadif[Deinterlace the input image.]' \
      'zoompan[Apply Zoom & Pan effect.]' \
      'fifo[Buffer input images and send them when they are requested.]' \
    && rc=0
  ;;

  profile|show-profile)
    local -a profiles
    local current
    for current in "${(@f)$($words[1] --profile=help)}"; do
      current=${current//\*/\\\*}
      current=${current//\:/\\\:}
      current=${current//\[/\\\[}
      current=${current//\]/\\\]}
      if [[ $current =~ $'\t'([^$'\t']*)$'\t'(.*) ]]; then
        if [[ -n $match[2] ]]; then
          current="$match[1][$match[2]]"
        else
          current="$match[1]"
        fi
        profiles=($profiles $current)
      fi
    done
    if [[ $state == show-profile ]]; then
      # For --show-profile, only one allowed
      if (( ${#profiles} > 0 )); then
        _values 'profile' $profiles && rc=0
      fi
    else
      # For --profile, multiple allowed
      profiles=($profiles 'help[list profiles]')
      _values -s , 'profile(s)' $profiles && rc=0
    fi
  ;;

  audio-device)
    local -a audio_devices
    local current
    for current in "${(@f)$($words[1] --audio-device=help)}"; do
      current=${current//\*/\\\*}
      current=${current//\:/\\\:}
      current=${current//\[/\\\[}
      current=${current//\]/\\\]}
      if [[ $current =~ '  '\'([^\']*)\'' \('(.*)'\)' ]]; then
        audio_devices=($audio_devices "$match[1][$match[2]]")
      fi
    done
    audio_devices=($audio_devices 'help[list audio devices]')
    _values 'audio device' $audio_devices && rc=0
  ;;

  files)
    compset -P '*,'
    compset -S ',*'
    _files -r ',/ \t\n\-' && rc=0
  ;;

  mfiles)
    local expl
    _tags files urls
    while _tags; do
      _requested files expl 'media file' _files && rc=0
      if _requested urls; then
        while _next_label urls expl URL; do
          _urls "$expl[@]" && rc=0
          compadd -S '' "$expl[@]" cdda:// rtmp:// rtsp:// http:// https:// mms:// mmst:// mmsh:// mmshttp:// rtp:// httpproxy:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// srtp:// data:// lavf:// ffmpeg:// udp:// ftp:// tcp:// tls:// unix:// sftp:// md5:// concat:// avdevice:// av:// dvb:// tv:// smb:// file:// dvdread:// file:// dvd:// dvdnav:// file:// bd:// br:// bluray:// bdnav:// brnav:// bluraynav:// archive:// memory:// hex:// null:// mf:// edl:// rar:// file:// fd:// fdclose:// appending:// && rc=0
        done
      fi
      (( rc )) || return 0
    done
  ;;
esac

return rc
