From c2bf84027c441a4365bd2bf6167ac88799523620 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 15:42:14 +0100 Subject: [PATCH 1/8] _mpv initial version --- src/_mpv | 362 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 362 insertions(+) create mode 100644 src/_mpv diff --git a/src/_mpv b/src/_mpv new file mode 100644 index 0000000..63f41ae --- /dev/null +++ b/src/_mpv @@ -0,0 +1,362 @@ +#compdef mpv + +local suf ret=1 curcontext="$curcontext" +local -a vals state line expl +typeset -A opt_args + +if [[ -prefix --ass-* ]]; then + + _arguments -C \ + '--ass-force-style=[Override some style or script info parameters.]:' \ + '--ass-hinting=[Set font hinting type. ]:' \ + '--ass-line-spacing=[Set line spacing value for SSA/ASS renderer.]:' \ + '--ass-shaper=[Set the text layout engine used by libass.]:' \ + '--ass-styles=[Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles. ]:' \ + '--ass-style-override=[Control whether user style overrides should be applied.]:' \ + '--ass-use-margins[Enables placing toptitles and subtitles in black borders when they are available.]' \ + '--ass-vsfilter-aspect-compat=[Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility with traditional VSFilter behavior. ]:' \ + '--ass-vsfilter-blur-compat=[Scale blur tags by video resolution instead of script resolution (enabled by default). ]:' \ + '--ass-vsfilter-color-compat=[Mangle colors like (xy-)vsfilter do (default: basic). ]:' && ret=0 + +elif [[ -prefix --osd-* ]]; then + + _arguments -C \ + '--osd-bar-align-x=[Position of the OSD bar (x)]:' \ + '--osd-bar-align-y=[Position of the OSD bar (y)]:' \ + '--osd-bar-w=[Width of the OSD bar, in percentage of the screen width (default: 75)]:' \ + '--osd-bar-h=[Height of the OSD bar, in percentage of the screen height (default: 3]:' \ + '--osd-back-color=[set osd background color]:' \ + '--osd-blur=[Gaussian blur factor]:' \ + '--osd-border-color=[set osd border color]:' \ + '--osd-border-size[=[Size of the OSD/sub font border in scaled pixels (see --osd-font-size for details)]:' \ + '--osd-color=[Specify the color used for OSD/unstyled text subtitles]:' \ + '--osd-duration=[Set the duration of the OSD messages in ms (default: 1000)]:' \ + '--osd-font=[Specify font to use for OSD and for subtitles that do not themselves specify a particular font]:' \ + '--osd-font-size=[Specify the OSD/sub font size]:' \ + '--osd-fractions[Show OSD times with fractions of seconds]' \ + '--osd-level=[Specifies which mode the OSD should start in]:' \ + '--osd-margin-x=[Left and right screen margin for the OSD/subs in scaled pixels]:' \ + '--osd-margin-y=[Top and bottom screen margin for the OSD/subs in scaled pixels]:' \ + '--osd-scale=[OSD font size multiplicator, multiplied with --osd-font-size value]:' \ + '--osd-shadow-color=[set osd shadow color]:' \ + '--osd-shadow-offset[=[Displacement of the OSD/sub text shadow in scaled pixels (see --osd-font-size for details)]:' \ + '--osd-spacing=[Horizontal OSD/sub font spacing in scaled pixels (see --osd-font-size for details)]:' \ + '--osd-status-msg=[Show a custom string during playback instead of the standard status text]:' && ret=0 + +elif [[ -prefix --sub-* ]]; then + + _arguments -C \ + '--sub-fix-timing[TODO]' \ + '--sub-demuxer=[Force subtitle demuxer type for --sub]:' \ + '--sub-paths=[Specify extra directories to search for subtitles matching the video]:' \ + '--sub-delay=[Delays subtitles by seconds]:' \ + '--sub-gauss=[Apply gaussian blur to image subtitles (default: 0)]:' \ + '--sub-gray[Convert image subtitles to grayscale]' \ + '--sub-pos=[Specify the position of subtitles on the screen]:' \ + '--sub-scale=[Factor for the text subtitle font size (default: 1)]:' \ + '--sub-speed=[Multiply the subtitle event timestamps with the given value]:' && ret=0 + +elif [[ -prefix --no-* ]]; then + + _arguments -C \ + '--no-fixed-vo[--no-fixed-vo enforces closing and reopening the video window for multiple files (one (un)initialization for each file)]' \ + '--no-input-default-bindings[Disable mpv default (builtin) key bindings]' \ + '--no-keepaspect[--no-keepaspect will always stretch the video to window size, and will disable the window manager hints that force the window aspect ratio]' \ + '--no-msgcolor[Disable colorful console output on terminals]' \ + '--no-aspect[Ignore aspect ratio information from video file and assume the video has square pixels]' \ + '--no-cache[Turn off input stream caching]' \ + '--no-config[Do not load default configuration files]' \ + '--no-idx[Do not use index present in the file even if one is present]' \ + '--no-audio[Do not play sound]' \ + '--no-resume-playback[Do not restore playback position from ~/.mpv/watch_later/]' \ + '--no-sub[Do not select any subtitle when the file is loaded]' \ + '--no-video[Do not play video]' \ + '--no-osd-bar[Disable display of the OSD bar]' && ret=0 + +else + + typeset -A demuxer_opts + demuxer_opts=( + lavf + '--demuxer-lavf-analyzeduration=[Maximum length in seconds to analyze the stream properties.]:' \ + '--demuxer-lavf-probescore=[Minimum required libavformat probe score. ]:' \ + '--demuxer-lavf-allow-mimetype=[Allow deriving the format from the HTTP MIME type (default: yes). ]:' \ + '--demuxer-lavf-format=[Force a specific libavformat demuxer.]:' \ + '--demuxer-lavf-genpts-mode=[Mode for deriving missing packet PTS values from packet DTS. ]:' \ + '--demuxer-lavf-o=[Pass AVOptions to libavformat demuxer.]:' \ + '--demuxer-lavf-probesize=[Maximum amount of data to probe during the detection phase. ]:' \ + '--demuxer-lavf-buffersize=[Size of the stream read buffer allocated for libavformat in bytes (default: 32768). ]:' \ + '--demuxer-lavf-cryptokey=[Encryption key the demuxer should use. ]:' \ + rawaudio + '--demuxer-rawaudio-channels=[Number of channels (or channel layout) if --demuxer=rawaudio is used (default: stereo).]:' \ + '--demuxer-rawaudio-format=[Sample format for --demuxer=rawaudio (default: s16le).]:' \ + '--demuxer-rawaudio-rate=[Sample rate for --demuxer=rawaudio (default: 44KHz).]:' \ + rawvideo + '--demuxer-rawvideo-fps=[Rate in frames per second for --demuxer=rawvideo (default: 25.0).]:' \ + '--demuxer-rawvideo-w=[Image width in pixels for --demuxer=rawvideo.]:' \ + '--demuxer-rawvideo-h=[Image height in pixels for --demuxer=rawvideo.]:' \ + '--demuxer-rawvideo-format=[Colorspace (fourcc) in hex or string for --demuxer=rawvideo (default: YV12)]:' \ + '--demuxer-rawvideo-mp-format=[Colorspace by internal video format for --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-codec=[Set the video codec instead of selecting the rawvideo codec when using --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-size=[Frame size in bytes when using --demuxer=rawvideo]:' \ + ) + + _arguments -C \ + '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name. ]:audio decoders' \ + '--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams. ]:compression level' \ + '--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default: yes). ]:downmixing:(yes no)' \ + '--ad-lavc-o=[Pass AVOptions to libavcodec decoder]:libavcodec decoder options' \ + '--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is.]:' \ + '--af=[Specify a list of audio filters to apply to the audio stream.]:audio filters' \ + '--aid=[Select audio channel]:audio channel' \ + '--alang=[Specify a priority list of audio languages to use.]:audio language list' \ + '--ao=[Specify a priority list of audio output drivers to be used]:' \ + '--ar[Enable/disable AppleIR remote support. ]' \ + '--aspect=[Override movie aspect ratio, in case aspect information is incorrect or missing in the file being played. ]:' \ + '--ass[Render ASS subtitles natively (enabled by default).]' \ + '--audio-demuxer=[Use this audio demuxer type when using --audiofile. ]:' \ + '--audio-display=[Setting this option to attachment (default) will display image attachments when playing audio files. ]:' \ + '--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie.]:' \ + '--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory.]:' \ + "--autofit=[Set the initial window size to a maximum size specified by WxH, without changing the window:'s aspect ratio. ]" \ + '--autofit-larger=[This option behaves exactly like --autofit, except the window size is only changed if the window would be larger than the specified size.]:' \ + '--autosub[Load additional subtitle files matching the video filename. ]' \ + '--autosub-match=[Adjust matching fuzziness when searching for subtitles:]:' \ + '--autosync=[Gradually adjusts the A/V sync based on audio delay measurements. ]:' \ + '--untimed[Do not sleep when outputting video frames. ]' \ + '--bluray-angle=[Some Blu-ray discs contain scenes that can be viewed from multiple angles. ]:' \ + '--bluray-device=[(Blu-ray only) Specify the Blu-ray disc location. ]:' \ + '--border[Play movie with window border and decorations. ]' \ + '--brightness=[Adjust the brightness of the video signal (default: 0). ]:' \ + '--cache=[Set the size of the cache in kilobytes, disable it with no, or automatically enable it if needed with auto (default: auto). ]:' \ + '--cache-default=[Set the size of the cache in kilobytes (default: 320 KB). ]:' \ + '--cache-pause=[Pause if cache percentage goes below specified value]:' \ + '--cache-min=[Playback will start when the cache has been filled up to of the total (default: 20).]:' \ + '--cache-seek-min=[Wait for cache fill to set percentage on seek]:' \ + '--cdda=[This option can be used to tune the CD Audio reading feature of mpv.]:' \ + '--cdrom-device=[Specify the CD-ROM device (default: /dev/cdrom).]:' \ + '--channels=[Request the number of playback channels (default: 2). ]:' \ + '--chapter=[Specify which chapter to start playing at. ]:' \ + '--chapter-merge-threshold=[Threshold for merging almost consecutive ordered chapter parts in milliseconds (default: 100). ]:' \ + '--chapter-seek-threshold=[Distance in seconds from the beginning of a chapter within which a backward chapter seek will go to the previous chapter (default: 5.0). ]:' \ + '--colormatrix=[Controls the YUV to RGB color space conversion when playing video. ]:' \ + '--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion. ]:' \ + '--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion. ]:' \ + '--consolecontrols[--no-consolecontrols prevents the player from reading key events from standard input. ]' \ + '--contrast[=[Adjust the contrast of the video signal (default: 0). ]:' \ + '--cookies[(network only) Support cookies when making HTTP requests. ]' \ + '--cookies-file=[(network only) Read HTTP cookies from . ]:' \ + '--correct-pts[switches mpv to a mode where video timing is determined using a fixed framerate value]' \ + '--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds. ]:' \ + '--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode. ]' \ + '--audio-delay=[Audio delay in seconds (positive or negative float value). ]:' \ + '--deinterlace=[Enable or disable interlacing (default: auto, which usually means no). ]:' \ + '--demuxer=[Force demuxer type. ]:' \ + '--demuxer-mkv-subtitle-preroll[Try harder to show embedded soft subtitles when seeking somewhere. ]' \ + '--doubleclick-time=[Time in milliseconds to recognize two consecutive button presses as a double-click (default: 300).]:' \ + '--dvbin=[Pass the following parameters to the DVB input module, in order to override the default ones:]:' \ + '--dvd-device=[Specify the DVD device or .iso filename (default: /dev/dvd). You can also specify a directory that contains files previously copied directly]:' \ + '--dvd-speed=[Try to limit DVD speed (default: 0, no change)]:' \ + '--dvdangle=[Some DVDs contain scenes that can be viewed from multiple angles]:' \ + '--edition=[(Matroska files only) Specify the edition (set of chapters) to use, where 0 is the first]:' \ + '--embeddedfonts[Use fonts embedded in Matroska container files and ASS scripts (default: enabled)]' \ + '--end=[Stop at given absolute time]:' \ + '--field-dominance=[Set first field for interlaced content]:' \ + '--flip[Flip image upside-down.]' \ + '--force-rgba-osd-rendering[Change how some video outputs render the OSD and text subtitles]' \ + '--force-window[Create a video output window even if there is no video]' \ + "--force-window-position[Forcefully move mpv's video output window to default location whenever there is a change in video parameters, video stream or file]" \ + '--sub-forced-only[Display only forced subtitles for the DVD subtitle stream selected by e]' \ + '--forceidx[Force index rebuilding]' \ + '--format=[Select the sample format used for output from the audio filter layer to the sound card]:' \ + '--fps=[Override video framerate]:' \ + '--framedrop=[Skip displaying some frames to maintain A/V sync on slow systems]:' \ + '--frames=[Play/convert only first video frames, then quit]:' \ + '--fullscreen[Fullscreen playback]' \ + '--fs-screen=[In multi-monitor configurations (i]:' \ + '--fsmode-dontuse=[OBSOLETE, use the --fs option]:' \ + '--fstype=[(X11 only) Specify a priority list of fullscreen modes to be used]:' \ + "--native-fs[(OS X only) Use OS X Mission Control's fullscreen feature instead of the custom one provided by mpv]" \ + '--gamma=[Adjust the gamma of the video signal (default: 0)]:' \ + '--gapless-audio[Try to play consecutive audio files with no silence or disruption at the point of file change]' \ + '--geometry=[Adjust the initial window position or size]:' \ + '--heartbeat-cmd=[Command that is executed every 30 seconds during playback via system() - i]:' \ + '--heartbeat-interval=[Time between --heartbeat-cmd invocations in seconds (default: 30)]:' \ + '--help Show short summary of options.' \ + '--hr-seek=[Select when to use precise seeks that are not limited to keyframes]:' \ + '--hr-seek-demuxer-offset=[This option exists to work around failures to do precise seeks (as in --hr-seek) caused by bugs or limitations in the demuxers for some file formats. Some demuxers fail to seek to a keyframe before the given target position, going to a later position instead]:' \ + '--http-header-fields=[Set custom HTTP fields when accessing HTTP stream]:' \ + '--hue=[Adjust the hue of the video signal (default: 0)]:' \ + '--hwdec=[Specify the hardware video decoding API that should be used if possible]:' \ + '--hwdec-codecs=[Allow hardware decoding for a given list of codecs only]:' \ + '--identify[Deprecated]' \ + '--idle[Makes mpv wait idly instead of quitting when there is no file to play]' \ + '--idx[Rebuild index of files]' \ + '--include=[Specify configuration file to be parsed after the default ones]:' \ + '--initial-audio-sync[Sync by modifying audio stream instead of readjusting from different timestamps]' \ + '--input-conf=[Specify input configuration file other than the default ~/]:' \ + '--input-ar-delay[Delay in milliseconds before we start to autorepeat a key (0 to disable)]' \ + '--input-ar-rate[Number of key presses to generate per second on autorepeat]' \ + '--input-keylist[Prints all keys that can be bound to commands]' \ + '--input-cmdlist[Prints all commands that can be bound to keys]' \ + '--input-js-dev[Specifies the joystick device to use (default: /dev/input/js0)]' \ + '--input-file=[Read commands from the given file]:' \ + '--input-test[Input test mode]' \ + '--joystick[Enable/disable joystick support]' \ + '--keep-open[Do not terminate when playing or seeking beyond the end of the file]' \ + '--key-fifo-size=[Specify the size of the FIFO that buffers key events (default: 7)]:' \ + '--length=[Stop after a given time relative to the start time]:' \ + '--lirc[Enable/disable LIRC support]' \ + '--lircconf=[(LIRC only) Specifies a configuration file for LIRC (default: ~/]:' \ + '--list-options[Prints all available options]' \ + '--list-properties[Print a list of the available properties]' \ + '--load-unsafe-playlists[Normally, something like mpv playlist]' \ + '--loop=[Loops playback N times]:' \ + '--lua=[Load a Lua script]:' \ + '--mc=[Maximum A-V sync correction per frame (in seconds)]:' \ + '--media-keys[OSX only: Enabled by default]' \ + '--mf=[Used when decoding from multiple PNG or JPEG files with mf://]:' \ + '--monitoraspect=[Set the aspect ratio of your monitor or TV screen]:' \ + '--monitorpixelaspect=[Set the aspect of a single pixel of your monitor or TV screen (default: 1)]:' \ + '--mouse-movements[Permit mpv to receive pointer events reported by the video output driver]' \ + '--msglevel=[Control verbosity directly for each module]:' \ + '--msgmodule[Prepend module name in front of each console message]' \ + '--mute=[Set startup audio mute status]:' \ + '--name Set the window class name for X11-based video output methods.' \ + '--native-keyrepeat[Use system settings for keyrepeat delay and rate, instead of --input-ar-delay and --input-ar-rate]' \ + '--sub-visibility[Can be used to disable display of subtitles, but still select and decode them]' \ + '--ontop[Makes the player window stay on top of other windows]' \ + '--ordered-chapters[Enabled by default]' \ + '--osc[Whether to load the on-screen-controller (default: yes)]' \ + '--panscan=[Enables pan-and-scan functionality (cropping the sides of e]:' \ + '--playing-msg=[Print out a string after starting playback]:' \ + '--status-msg=[Print out a custom string during playback instead of the standard status line]:' \ + '--stream-capture=[Allows capturing the primary stream (not additional audio tracks or other kind of streams) into the given file]:' \ + '--stream-dump=[Same as --stream-capture, but do not start playback]:' \ + '--playlist=[Play files according to a playlist file (ASX, Winamp, SMIL, or one-file-per-line format)]:' \ + '--pp=[See also --vf=pp]:' \ + '--pphelp[See also --vf=pp]:' \ + '--profile=[Use the given profile(s), --profile=help displays a list of the defined profiles]:' \ + '--pts-association-mode=[Select the method used to determine which container packet timestamp corresponds to a particular output frame from the video decoder]:' \ + '--pvr=[This option tunes various encoding properties of the PVR capture module]:' \ + '--quiet[Make console output less verbose; in particular, prevents the status line (i]' \ + '--quvi-format=[Video format/quality that is directly passed to libquvi (default: best)]:' \ + '--radio=[These options set various parameters of the radio capture module]:' \ + '--really-quiet[Display even less output and status messages than with --quiet]' \ + '--referrer=[Specify a referrer path or URL for HTTP requests]:' \ + '--reset-on-next-file=[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]:' \ + '--rtsp-transport=[Select RTSP transport method (default: tcp)]:' \ + '--saturation=[Adjust the saturation of the video signal (default: 0)]:' \ + '--save-position-on-quit[Always save the current playback position on quit]' \ + '--sb=[Seek to byte position]:' \ + '--screen=[In multi-monitor configurations (i]:' \ + '--screenshot-format=[Set the image file type used for saving screenshots]:' \ + '--screenshot-jpeg-quality=[Set the JPEG quality level]:' \ + '--screenshot-png-compression=[Set the PNG compression level]:' \ + '--screenshot-png-filter=[Set the filter applied prior to PNG compression]:' \ + '--screenshot-template=[Specify the filename template used to save screenshots]:' \ + '--screenh=[Specify the screen height for video output drivers which do not know the screen resolution, like x11 and TV-out]:' \ + '--screenw=[Specify the screen width for video output drivers which do not know the screen resolution, like x11 and TV-out]:' \ + '--show-profile=[Show the description and content of a profile]:' \ + '--shuffle[Play files in random order]' \ + '--sid=[Display the subtitle stream specified by ]:' \ + '--slang=[Specify a priority list of subtitle languages to use]:' \ + '--slave-broken[Switches on the old slave mode]' \ + '--softsleep[Time frames by repeatedly checking the current time instead of asking the kernel to wake up mpv at the correct time]' \ + '--softvol=[Control whether to use the volume controls of the audio output driver or the internal mpv volume filter]:' \ + '--softvol-max=[Set the maximum amplification level in percent (default: 200)]:' \ + '--speed=[Slow down or speed up playback by the factor given as parameter]:' \ + '--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:' \ + '--start=[Seek to given time position]:' \ + '--ssf=[Specifies software scaler parameters]:' \ + '--sstep=[Skip seconds after every frame]:' \ + '--stop-screensaver[Turns off the screensaver (or screen blanker and similar mechanisms) at startup and turns it on again on exit (default: yes)]' \ + '--sub=[Use/display these subtitle files]:' \ + '--subcp=[If your system supports iconv(3), you can use this option to specify the subtitle codepage]:' \ + '--subfps=[Specify the framerate of the subtitle file (default: movie fps)]:' \ + '--sws=[Specify the software scaler algorithm to be used with --vf=scale]:' \ + '--term-osd[Display OSD messages on the console when no video output is available]' \ + '--term-osd-esc=[Specify the escape sequence to use before writing an OSD message on the console]:' \ + '--title=[Set the window title]:' \ + '--tls-ca-file=[Certificate authority database file for use with TLS]:' \ + '--tls-verify[Verify peer certificates when using TLS]' \ + '--tv=[This option tunes various properties of the TV capture module]:' \ + '--tvscan=[Tune the TV channel scanner]:' \ + '--use-filedir-conf[Look for a file-specific configuration file in the same directory as the file that is being played]' \ + '--user-agent=[Use as user agent for HTTP streaming]:' \ + '--vd=[Specify a priority list of video decoders to be used, according to their family and name]:' \ + '--vd-lavc-bitexact[Only use bit-exact algorithms in all decoding steps (for codec testing)]' \ + '--vd-lavc-fast[Enable MPEG2 optimizations which do not comply with the format specification and potentially cause problems]' \ + '--vd-lavc-o=[Skips the loop filter (AKA deblocking) during H]:' \ + '--vd-lavc-skipidct=[Skips the IDCT step]:' \ + '--vd-lavc-skipframe=[Skips decoding of frames completely]:' \ + '--vd-lavc-threads=[Number of threads to use for decoding]:' \ + '--version[Print version string and exit]' \ + '--vf=[Specify a list of video filters to apply to the video stream]:' \ + '--vid=[Select video channel]:' \ + '--video-align-x=[Move video padding on x axis]:' \ + '--video-align-y=[Move video padding on y axis]:' \ + '--video-pan-x=[Moves the displayed video rectangle by the given value in the X or Y direction]:' \ + '--video-unscaled[Disable scaling of the video]' \ + '--video-zoom=[Adjust the video display scale factor by the given value]:' \ + '--vo=[Specify a priority list of video output drivers to be used]:' \ + '--volstep=[Set the step size of mixer volume changes in percent of the full range (default: 3)]:' \ + '--volume=[Set the startup volume]:' \ + '--volume-restore-data=[Used internally for use by playback resume]:' \ + '--wid=[(X11 and Windows only) to attach existing window]:' \ + '(--use-stdin)*:video file:->mfiles:' && ret=0 + + case "$state" in + mfiles) + _tags files urls + while _tags; do + _requested files expl 'video file' _files -g \ + "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|webm|wma|wmv)(-.)" && ret=0 + if _requested urls; then + while _next_label urls expl URL; do + _urls "$expl[@]" && ret=0 + compadd -S '' "$expl[@]" {dvd,vcd,cdda,cddb,tv}:// && ret=0 + done + fi + (( ret )) || return 0 + done + ;; + audio-codecs) + vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -ac help -quiet 2>/dev/null)"}[(r)ac:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} ) + _describe -t audio-codecs 'audio codec' vals && ret=0 + ;; + audio-drivers) + vals=( help ${${${(f)"$(_call_program audio-drivers mplayer -ao help 2>/dev/null)"}[(r) *,-1]#?}/ /:} ) + _describe -t audio-drivers 'audio drivers' vals && ret=0 + ;; + audio-codec-families) + compset -P '*,' + compset -S ',*' + vals=( help ${${${(f)"$(_call_program audio-codec-families mplayer -afm help 2>/dev/null)"}[(r) [^:]#,-1]## ##}/ ##/:} ) + _describe -t audio-codec-families 'audio drivers' vals && ret=0 + ;; + audio-plugins) + _values -s : 'audio output plugin' \ + 'list[specify list of plugins]:plugin:(resample surround format volume extrastereo volnorm delay)' \ + 'format[output format]:format' \ + 'fout[output frequency]:frequency (Hz)' \ + 'volume[volume level]:volume <0-255>' \ + 'mul[stereo coefficient]:coefficient' \ + 'softclip[compressor]' && ret=0 + ;; + video-codecs) + vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -vc help -quiet 2>/dev/null)"}[(r)vc:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} ) + _describe -t video-codecs 'video codec' vals && ret=0 + ;; + video-drivers) + vals=( help ${${${(f)"$(_call_program video-drivers mplayer -vo help 2>/dev/null)"}[(r) *,-1]#?}/ /:} ) + _describe -t video-drivers 'video drivers' vals && ret=0 + ;; + video-output-plugins) + vals=( help ${${${${(f)"$(_call_program video-output-plugins mplayer -vop help 2>/dev/null)"}[(r) *,-1]}/ /}/ #: /:} ) + _describe -t video-output-plugins 'video output plugin' vals && ret=0 + ;; + esac +fi + +return ret From 062a0734c32cdab85fe2106a0a720236191c3cce Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 16:43:44 +0100 Subject: [PATCH 2/8] _mpv: add parameter types --- src/_mpv | 376 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 192 insertions(+), 184 deletions(-) diff --git a/src/_mpv b/src/_mpv index 63f41ae..88e0691 100644 --- a/src/_mpv +++ b/src/_mpv @@ -7,30 +7,42 @@ typeset -A opt_args if [[ -prefix --ass-* ]]; then _arguments -C \ - '--ass-force-style=[Override some style or script info parameters.]:' \ - '--ass-hinting=[Set font hinting type. ]:' \ - '--ass-line-spacing=[Set line spacing value for SSA/ASS renderer.]:' \ - '--ass-shaper=[Set the text layout engine used by libass.]:' \ - '--ass-styles=[Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles. ]:' \ - '--ass-style-override=[Control whether user style overrides should be applied.]:' \ + '--ass-force-style=[Override some style or script info parameters.]:style parameters' \ + '--ass-hinting=[Set font hinting type.]:font hinting style' \ + '--ass-line-spacing=[Set line spacing value for SSA/ASS renderer.]:line spacing' \ + '--ass-shaper=[Set the text layout engine used by libass.]:text layout engine' \ + '--ass-styles=[Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles.]:styles file:_files' \ + '--ass-style-override=[Control whether user style overrides should be applied.]:apply overrides:(yes no)' \ '--ass-use-margins[Enables placing toptitles and subtitles in black borders when they are available.]' \ - '--ass-vsfilter-aspect-compat=[Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility with traditional VSFilter behavior. ]:' \ - '--ass-vsfilter-blur-compat=[Scale blur tags by video resolution instead of script resolution (enabled by default). ]:' \ - '--ass-vsfilter-color-compat=[Mangle colors like (xy-)vsfilter do (default: basic). ]:' && ret=0 + '--ass-vsfilter-aspect-compat=[Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility with traditional VSFilter behavior.]:' \ + '--ass-vsfilter-blur-compat=[Scale blur tags by video resolution instead of script resolution (enabled by default).]:' \ + '--ass-vsfilter-color-compat=[Mangle colors like (xy-)vsfilter do (default\: basic).]:' && ret=0 + +elif [[ -prefix --input-* ]]; then + + _arguments -c \ + '--input-conf=[Specify input configuration file other than default]:input config file:_files' \ + '--input-ar-delay[Delay in milliseconds before we start to autorepeat a key (0 to disable)]' \ + '--input-ar-rate[Number of key presses to generate per second on autorepeat]' \ + '--input-keylist[Prints all keys that can be bound to commands]' \ + '--input-cmdlist[Prints all commands that can be bound to keys]' \ + '--input-js-dev[Specifies the joystick device to use (default\: /dev/input/js0)]' \ + '--input-file=[Read commands from the given file]:command file:_files' \ + '--input-test[Input test mode]' && ret=0 elif [[ -prefix --osd-* ]]; then _arguments -C \ - '--osd-bar-align-x=[Position of the OSD bar (x)]:' \ - '--osd-bar-align-y=[Position of the OSD bar (y)]:' \ - '--osd-bar-w=[Width of the OSD bar, in percentage of the screen width (default: 75)]:' \ - '--osd-bar-h=[Height of the OSD bar, in percentage of the screen height (default: 3]:' \ - '--osd-back-color=[set osd background color]:' \ - '--osd-blur=[Gaussian blur factor]:' \ - '--osd-border-color=[set osd border color]:' \ - '--osd-border-size[=[Size of the OSD/sub font border in scaled pixels (see --osd-font-size for details)]:' \ - '--osd-color=[Specify the color used for OSD/unstyled text subtitles]:' \ - '--osd-duration=[Set the duration of the OSD messages in ms (default: 1000)]:' \ + '--osd-bar-align-x=[Specify x or y position of the OSD bar]:osd x position (pixels)' \ + '--osd-bar-align-y=[Specify x or y position of the OSD bar]:osd y position (pixels)' \ + '--osd-bar-w=[Width or height of OSD bar, in percentage of the screen]:width percentage (default 75)' \ + '--osd-bar-h=[Width or Height of OSD bar, in percentage of the screen]:height percentage (default 3)' \ + '--osd-back-color=[Set osd background color]:background color' \ + '--osd-blur=[Gaussian blur factor]:blur factor' \ + '--osd-border-color=[Set osd border color]:border color' \ + '--osd-border-size[=[Size of the OSD/sub font border in scaled pixels]:osd font border (scaled pixels)' \ + '--osd-color=[Specify the color used for OSD/unstyled text subtitles]:osd text color' \ + '--osd-duration=[Set the duration of the OSD messages]:osd duration (ms, default 1000)' \ '--osd-font=[Specify font to use for OSD and for subtitles that do not themselves specify a particular font]:' \ '--osd-font-size=[Specify the OSD/sub font size]:' \ '--osd-fractions[Show OSD times with fractions of seconds]' \ @@ -49,12 +61,22 @@ elif [[ -prefix --sub-* ]]; then '--sub-fix-timing[TODO]' \ '--sub-demuxer=[Force subtitle demuxer type for --sub]:' \ '--sub-paths=[Specify extra directories to search for subtitles matching the video]:' \ - '--sub-delay=[Delays subtitles by seconds]:' \ - '--sub-gauss=[Apply gaussian blur to image subtitles (default: 0)]:' \ + '--sub-delay=[Delays subtitles by number of seconds]:subtitle delay (seconds)' \ + '--sub-gauss=[Apply gaussian blur to image subtitles]:subtitle image blur (-100 to 100, default 0)' \ '--sub-gray[Convert image subtitles to grayscale]' \ - '--sub-pos=[Specify the position of subtitles on the screen]:' \ - '--sub-scale=[Factor for the text subtitle font size (default: 1)]:' \ - '--sub-speed=[Multiply the subtitle event timestamps with the given value]:' && ret=0 + '--sub-pos=[Specify the position of subtitles on the screen]:subtitle position' \ + '--sub-scale=[Factor for the text subtitle font size]:subtitle size factor (default 1.0)' \ + '--sub-speed=[Multiply the subtitle event timestamps with the given value]:subtitle event timestamp factor (default 1.0)' && ret=0 + +elif [[ -prefix --vd-* ]]; then + + _arguments -C \ + '--vd-lavc-bitexact[Only use bit-exact algorithms in all decoding steps (for codec testing)]' \ + '--vd-lavc-fast[Enable MPEG2 optimizations which do not comply with the format specification and potentially cause problems]' \ + '--vd-lavc-o=[Skips the loop filter (AKA deblocking) during H]:' \ + '--vd-lavc-skipidct=[Skips the IDCT step]:' \ + '--vd-lavc-skipframe=[Skips decoding of frames completely]:' \ + '--vd-lavc-threads=[Number of threads to use for decoding]:' && ret=0 elif [[ -prefix --no-* ]]; then @@ -79,88 +101,87 @@ else demuxer_opts=( lavf '--demuxer-lavf-analyzeduration=[Maximum length in seconds to analyze the stream properties.]:' \ - '--demuxer-lavf-probescore=[Minimum required libavformat probe score. ]:' \ - '--demuxer-lavf-allow-mimetype=[Allow deriving the format from the HTTP MIME type (default: yes). ]:' \ + '--demuxer-lavf-probescore=[Minimum required libavformat probe score.]:' \ + '--demuxer-lavf-allow-mimetype=[Allow deriving the format from the HTTP MIME type (default\: yes).]:' \ '--demuxer-lavf-format=[Force a specific libavformat demuxer.]:' \ - '--demuxer-lavf-genpts-mode=[Mode for deriving missing packet PTS values from packet DTS. ]:' \ + '--demuxer-lavf-genpts-mode=[Mode for deriving missing packet PTS values from packet DTS.]:' \ '--demuxer-lavf-o=[Pass AVOptions to libavformat demuxer.]:' \ - '--demuxer-lavf-probesize=[Maximum amount of data to probe during the detection phase. ]:' \ - '--demuxer-lavf-buffersize=[Size of the stream read buffer allocated for libavformat in bytes (default: 32768). ]:' \ - '--demuxer-lavf-cryptokey=[Encryption key the demuxer should use. ]:' \ + '--demuxer-lavf-probesize=[Maximum amount of data to probe during the detection phase.]:' \ + '--demuxer-lavf-buffersize=[Size of the stream read buffer allocated for libavformat in bytes (default\: 32768).]:' \ + '--demuxer-lavf-cryptokey=[Encryption key the demuxer should use.]:' \ rawaudio - '--demuxer-rawaudio-channels=[Number of channels (or channel layout) if --demuxer=rawaudio is used (default: stereo).]:' \ - '--demuxer-rawaudio-format=[Sample format for --demuxer=rawaudio (default: s16le).]:' \ - '--demuxer-rawaudio-rate=[Sample rate for --demuxer=rawaudio (default: 44KHz).]:' \ + '--demuxer-rawaudio-channels=[Number of channels (or channel layout) if --demuxer=rawaudio is used (default\: stereo).]:' \ + '--demuxer-rawaudio-format=[Sample format for --demuxer=rawaudio (default\: s16le).]:' \ + '--demuxer-rawaudio-rate=[Sample rate for --demuxer=rawaudio (default\: 44KHz).]:' \ rawvideo - '--demuxer-rawvideo-fps=[Rate in frames per second for --demuxer=rawvideo (default: 25.0).]:' \ + '--demuxer-rawvideo-fps=[Rate in frames per second for --demuxer=rawvideo (default\: 25.0).]:' \ '--demuxer-rawvideo-w=[Image width in pixels for --demuxer=rawvideo.]:' \ '--demuxer-rawvideo-h=[Image height in pixels for --demuxer=rawvideo.]:' \ - '--demuxer-rawvideo-format=[Colorspace (fourcc) in hex or string for --demuxer=rawvideo (default: YV12)]:' \ + '--demuxer-rawvideo-format=[Colorspace (fourcc) in hex or string for --demuxer=rawvideo (default\: YV12)]:' \ '--demuxer-rawvideo-mp-format=[Colorspace by internal video format for --demuxer=rawvideo]:' \ '--demuxer-rawvideo-codec=[Set the video codec instead of selecting the rawvideo codec when using --demuxer=rawvideo]:' \ '--demuxer-rawvideo-size=[Frame size in bytes when using --demuxer=rawvideo]:' \ ) _arguments -C \ - '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name. ]:audio decoders' \ - '--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams. ]:compression level' \ - '--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default: yes). ]:downmixing:(yes no)' \ + '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name.]:audio decoders' \ + '--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams.]:compression level' \ + '--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default\: yes).]:downmixing:(yes no)' \ '--ad-lavc-o=[Pass AVOptions to libavcodec decoder]:libavcodec decoder options' \ '--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is.]:' \ '--af=[Specify a list of audio filters to apply to the audio stream.]:audio filters' \ '--aid=[Select audio channel]:audio channel' \ '--alang=[Specify a priority list of audio languages to use.]:audio language list' \ - '--ao=[Specify a priority list of audio output drivers to be used]:' \ - '--ar[Enable/disable AppleIR remote support. ]' \ - '--aspect=[Override movie aspect ratio, in case aspect information is incorrect or missing in the file being played. ]:' \ + '--ao=[Specify a priority list of audio output drivers to be used]:audio driver(s):->audio-drivers:' \ + '--ar[Enable/disable AppleIR remote support.]' \ + '--aspect=[Override movie aspect ratio, in case aspect information is incorrect or missing in the file being played.]:aspect ratio' \ '--ass[Render ASS subtitles natively (enabled by default).]' \ - '--audio-demuxer=[Use this audio demuxer type when using --audiofile. ]:' \ - '--audio-display=[Setting this option to attachment (default) will display image attachments when playing audio files. ]:' \ - '--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie.]:' \ - '--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory.]:' \ - "--autofit=[Set the initial window size to a maximum size specified by WxH, without changing the window:'s aspect ratio. ]" \ - '--autofit-larger=[This option behaves exactly like --autofit, except the window size is only changed if the window would be larger than the specified size.]:' \ + '--audio-demuxer=[Use this audio demuxer type when using --audiofile.]:audio demuxer' \ + '--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie.]:external audio file:_files -g "*.(wav|mp3|ogg)"' \ + '--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory.]:cache (bytes)' \ + "(--autofit-larger)--autofit=[Set initial window size]:initial window size (WxH)" \ + '(--autofit)--autofit-larger=[Set maximum initial window size]:initial window size(WxH)' \ '--autosub[Load additional subtitle files matching the video filename. ]' \ - '--autosub-match=[Adjust matching fuzziness when searching for subtitles:]:' \ - '--autosync=[Gradually adjusts the A/V sync based on audio delay measurements. ]:' \ + '--autosub-match=[Adjust matching fuzziness when searching for subtitles]:subtitle fuzziness' \ + '--autosync=[Gradually adjusts the A/V sync based on audio delay measurements.]:' \ '--untimed[Do not sleep when outputting video frames. ]' \ - '--bluray-angle=[Some Blu-ray discs contain scenes that can be viewed from multiple angles. ]:' \ - '--bluray-device=[(Blu-ray only) Specify the Blu-ray disc location. ]:' \ - '--border[Play movie with window border and decorations. ]' \ - '--brightness=[Adjust the brightness of the video signal (default: 0). ]:' \ - '--cache=[Set the size of the cache in kilobytes, disable it with no, or automatically enable it if needed with auto (default: auto). ]:' \ - '--cache-default=[Set the size of the cache in kilobytes (default: 320 KB). ]:' \ - '--cache-pause=[Pause if cache percentage goes below specified value]:' \ - '--cache-min=[Playback will start when the cache has been filled up to of the total (default: 20).]:' \ - '--cache-seek-min=[Wait for cache fill to set percentage on seek]:' \ - '--cdda=[This option can be used to tune the CD Audio reading feature of mpv.]:' \ - '--cdrom-device=[Specify the CD-ROM device (default: /dev/cdrom).]:' \ - '--channels=[Request the number of playback channels (default: 2). ]:' \ - '--chapter=[Specify which chapter to start playing at. ]:' \ - '--chapter-merge-threshold=[Threshold for merging almost consecutive ordered chapter parts in milliseconds (default: 100). ]:' \ - '--chapter-seek-threshold=[Distance in seconds from the beginning of a chapter within which a backward chapter seek will go to the previous chapter (default: 5.0). ]:' \ - '--colormatrix=[Controls the YUV to RGB color space conversion when playing video. ]:' \ - '--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion. ]:' \ - '--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion. ]:' \ + '--bluray-angle=[Specify Blu-ray view angle]:bluray view angle' \ + '--bluray-device=[Specify Blu-ray disc location]:bluray disc location (device, iso or directory):_files' \ + '--border[Play movie with window border and decorations]' \ + '--brightness=[Adjust the brightness of the video signal.]:additional brightness (default 0)' \ + '--cache=[Set size of the cache]:cache size (no, auto or integer in kb; default auto)' \ + '!--cache-default=[Set size of the cache]:cache size (kb, default 320)' \ + '--cache-pause=[Pause if cache percentage goes below specified value]:cache percentage' \ + '--cache-min=[Playback will start when the cache has been filled up to percentage]:cache percentage (default 20)' \ + '--cache-seek-min=[Wait for cache fill to set percentage on seek]:cache percentage' \ + '--cdda=[This option can be used to tune the CD Audio reading feature of mpv.]:cdda parameters' \ + '--cdrom-device=[Specify the CD-ROM device.]:specify cdrom source (device, iso or directory; default /dev/cdrom):_files' \ + '--channels=[Request the number of playback channels.]:playback channels' \ + '--chapter=[Specify which chapter to start playing at]:chapter' \ + '--chapter-merge-threshold=[Threshold for merging almost consecutive ordered chapter parts]:chapter merge threshold (ms, default 100)' \ + '--chapter-seek-threshold=[Threshold to go to previous chapter on backwards seek]:chapter seek threshold (seconds, default 5.0)' \ + '--colormatrix=[Controls the YUV to RGB color space conversion when playing video.]:' \ + '--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion.]:' \ + '--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion.]:' \ '--consolecontrols[--no-consolecontrols prevents the player from reading key events from standard input. ]' \ - '--contrast[=[Adjust the contrast of the video signal (default: 0). ]:' \ + '--contrast[=[Adjust the contrast of the video signal.]:contrast adjustment (-100 to 100, default 0)' \ '--cookies[(network only) Support cookies when making HTTP requests. ]' \ - '--cookies-file=[(network only) Read HTTP cookies from . ]:' \ + '--cookies-file=[File to read HTTP cookies from]:cookie file:_files' \ '--correct-pts[switches mpv to a mode where video timing is determined using a fixed framerate value]' \ - '--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds. ]:' \ - '--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode. ]' \ - '--audio-delay=[Audio delay in seconds (positive or negative float value). ]:' \ - '--deinterlace=[Enable or disable interlacing (default: auto, which usually means no). ]:' \ - '--demuxer=[Force demuxer type. ]:' \ - '--demuxer-mkv-subtitle-preroll[Try harder to show embedded soft subtitles when seeking somewhere. ]' \ - '--doubleclick-time=[Time in milliseconds to recognize two consecutive button presses as a double-click (default: 300).]:' \ - '--dvbin=[Pass the following parameters to the DVB input module, in order to override the default ones:]:' \ - '--dvd-device=[Specify the DVD device or .iso filename (default: /dev/dvd). You can also specify a directory that contains files previously copied directly]:' \ - '--dvd-speed=[Try to limit DVD speed (default: 0, no change)]:' \ - '--dvdangle=[Some DVDs contain scenes that can be viewed from multiple angles]:' \ - '--edition=[(Matroska files only) Specify the edition (set of chapters) to use, where 0 is the first]:' \ - '--embeddedfonts[Use fonts embedded in Matroska container files and ASS scripts (default: enabled)]' \ - '--end=[Stop at given absolute time]:' \ + '!--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds.]:cursor hide delay (ms)' \ + '!--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode. ]' \ + '--audio-delay=[Specify an audio delay]:audio delay (signed float in seconds, default 0)' \ + '--deinterlace=[Enable or disable interlacing (default\: auto, which usually means no).]:' \ + '--demuxer=[Force demuxer type.]:demuxer type' \ + '--demuxer-mkv-subtitle-preroll[Try harder to show embedded soft subtitles when seeking somewhere]' \ + '!--doubleclick-time=[Time in milliseconds to recognize two consecutive button presses as a double-click]:doubleclick time (ms, default 300)' \ + '--dvbin=[Pass the following parameters to the DVB input module, in order to override the default ones:]:dvb input parameters' \ + '--dvd-device=[Specify the DVD source]:dvd source (device, iso or directory):_files' \ + '--dvd-speed=[Try to limit DVD speed]:dvd speed limit (default 0, ie. no change)' \ + '--dvdangle=[Specify view angle (DVD only)]:dvd angle' \ + '--edition=[(Matroska files only) Specify the edition (set of chapters) to use, where 0 is the first]:edition' \ + '--embeddedfonts[Use fonts embedded in Matroska container files and ASS scripts (default\: enabled)]' \ + '--end=[Stop at given absolute time]:stop time' \ '--field-dominance=[Set first field for interlaced content]:' \ '--flip[Flip image upside-down.]' \ '--force-rgba-osd-rendering[Change how some video outputs render the OSD and text subtitles]' \ @@ -168,143 +189,130 @@ else "--force-window-position[Forcefully move mpv's video output window to default location whenever there is a change in video parameters, video stream or file]" \ '--sub-forced-only[Display only forced subtitles for the DVD subtitle stream selected by e]' \ '--forceidx[Force index rebuilding]' \ - '--format=[Select the sample format used for output from the audio filter layer to the sound card]:' \ - '--fps=[Override video framerate]:' \ - '--framedrop=[Skip displaying some frames to maintain A/V sync on slow systems]:' \ - '--frames=[Play/convert only first video frames, then quit]:' \ + '--format=[Select the sample format used for output from the audio filter layer to the sound card]:output sample format' \ + '--fps=[Override video framerate]:video framerate (fps)' \ + '--framedrop=[Skip displaying some frames to maintain A/V sync on slow systems]:framedrop:(no yes hard)' \ + '--frames=[Play/convert only first video frames, then quit]:number of frames' \ '--fullscreen[Fullscreen playback]' \ - '--fs-screen=[In multi-monitor configurations (i]:' \ - '--fsmode-dontuse=[OBSOLETE, use the --fs option]:' \ - '--fstype=[(X11 only) Specify a priority list of fullscreen modes to be used]:' \ + '--fs-screen=[Fullscreen mode goes to specified screen]:screen id for fullscreen' \ + '!--fsmode-dontuse=[OBSOLETE, use the --fs option]:' \ + '--fstype=[Specify a priority list of fullscreen modes to be used]:fullscreen modes (list)' \ "--native-fs[(OS X only) Use OS X Mission Control's fullscreen feature instead of the custom one provided by mpv]" \ - '--gamma=[Adjust the gamma of the video signal (default: 0)]:' \ + '--gamma=[Adjust the gamma of the video signal]:gamma value (default 0)' \ '--gapless-audio[Try to play consecutive audio files with no silence or disruption at the point of file change]' \ - '--geometry=[Adjust the initial window position or size]:' \ - '--heartbeat-cmd=[Command that is executed every 30 seconds during playback via system() - i]:' \ - '--heartbeat-interval=[Time between --heartbeat-cmd invocations in seconds (default: 30)]:' \ - '--help Show short summary of options.' \ + '--geometry=[Adjust the initial window position or size]:window geometry' \ + '--heartbeat-cmd=[Command that is executed every n seconds during playback]:command to run' \ + '--heartbeat-interval=[Time between --heartbeat-cmd invocations]:heartbeat interval (seconds, default 30)' \ + '(*)--help[Show short summary of options]' \ '--hr-seek=[Select when to use precise seeks that are not limited to keyframes]:' \ '--hr-seek-demuxer-offset=[This option exists to work around failures to do precise seeks (as in --hr-seek) caused by bugs or limitations in the demuxers for some file formats. Some demuxers fail to seek to a keyframe before the given target position, going to a later position instead]:' \ '--http-header-fields=[Set custom HTTP fields when accessing HTTP stream]:' \ - '--hue=[Adjust the hue of the video signal (default: 0)]:' \ - '--hwdec=[Specify the hardware video decoding API that should be used if possible]:' \ - '--hwdec-codecs=[Allow hardware decoding for a given list of codecs only]:' \ - '--identify[Deprecated]' \ + '--hue=[Adjust the hue of the video signal (default\: 0)]:' \ + '--hwdec=[Specify the hardware video decoding API that should be used if possible]:video decoding api' \ + '--hwdec-codecs=[Allow hardware decoding for a given list of codecs only]:codecs' \ + '!--identify[Deprecated]' \ '--idle[Makes mpv wait idly instead of quitting when there is no file to play]' \ '--idx[Rebuild index of files]' \ - '--include=[Specify configuration file to be parsed after the default ones]:' \ + '--include=[Specify configuration file to be parsed after the default ones]:additional configuration file:_files' \ '--initial-audio-sync[Sync by modifying audio stream instead of readjusting from different timestamps]' \ - '--input-conf=[Specify input configuration file other than the default ~/]:' \ - '--input-ar-delay[Delay in milliseconds before we start to autorepeat a key (0 to disable)]' \ - '--input-ar-rate[Number of key presses to generate per second on autorepeat]' \ - '--input-keylist[Prints all keys that can be bound to commands]' \ - '--input-cmdlist[Prints all commands that can be bound to keys]' \ - '--input-js-dev[Specifies the joystick device to use (default: /dev/input/js0)]' \ - '--input-file=[Read commands from the given file]:' \ - '--input-test[Input test mode]' \ '--joystick[Enable/disable joystick support]' \ '--keep-open[Do not terminate when playing or seeking beyond the end of the file]' \ - '--key-fifo-size=[Specify the size of the FIFO that buffers key events (default: 7)]:' \ - '--length=[Stop after a given time relative to the start time]:' \ + '--key-fifo-size=[Specify the size of the FIFO that buffers key events]:key fifo size (default 7)' \ + '--length=[Stop after a given time relative to the start time]:play time' \ '--lirc[Enable/disable LIRC support]' \ - '--lircconf=[(LIRC only) Specifies a configuration file for LIRC (default: ~/]:' \ - '--list-options[Prints all available options]' \ - '--list-properties[Print a list of the available properties]' \ - '--load-unsafe-playlists[Normally, something like mpv playlist]' \ - '--loop=[Loops playback N times]:' \ - '--lua=[Load a Lua script]:' \ - '--mc=[Maximum A-V sync correction per frame (in seconds)]:' \ - '--media-keys[OSX only: Enabled by default]' \ - '--mf=[Used when decoding from multiple PNG or JPEG files with mf://]:' \ - '--monitoraspect=[Set the aspect ratio of your monitor or TV screen]:' \ - '--monitorpixelaspect=[Set the aspect of a single pixel of your monitor or TV screen (default: 1)]:' \ + '--lircconf=[(LIRC only) Specify a configuration file for LIRC]:lirc config file:_files' \ + '(*)--list-options[Print all available options]' \ + '(*)--list-properties[Print a list of available properties]' \ + '--load-unsafe-playlists[allow loading of playlists from untrusted sources]' \ + '--loop=[Loops playback N times]:number of loops' \ + '--lua=[Load a Lua script]:lua script file:_files -g "*.lua"' \ + '--mc=[Maximum A-V sync correction per frame]:max sync correction (seconds)' \ + '!--media-keys[OSX only: Enabled by default]' \ + '--mf=[TODO Used when decoding from multiple PNG or JPEG files with mf://]:' \ + '--monitoraspect=[Set the aspect ratio of your monitor or TV screen]:aspect ratio' \ + '--monitorpixelaspect=[Set the aspect of a single pixel]:pixel aspect (default 1)' \ '--mouse-movements[Permit mpv to receive pointer events reported by the video output driver]' \ - '--msglevel=[Control verbosity directly for each module]:' \ + '--msglevel=[Control verbosity directly for each module]:verbosity level (-1 to 9)' \ '--msgmodule[Prepend module name in front of each console message]' \ - '--mute=[Set startup audio mute status]:' \ - '--name Set the window class name for X11-based video output methods.' \ + '--mute=[Set startup audio mute status]:status (default auto):(yes no auto)' \ + '--name[Set the window class name for X11-based video output methods]:window class name' \ '--native-keyrepeat[Use system settings for keyrepeat delay and rate, instead of --input-ar-delay and --input-ar-rate]' \ '--sub-visibility[Can be used to disable display of subtitles, but still select and decode them]' \ '--ontop[Makes the player window stay on top of other windows]' \ '--ordered-chapters[Enabled by default]' \ - '--osc[Whether to load the on-screen-controller (default: yes)]' \ - '--panscan=[Enables pan-and-scan functionality (cropping the sides of e]:' \ - '--playing-msg=[Print out a string after starting playback]:' \ - '--status-msg=[Print out a custom string during playback instead of the standard status line]:' \ - '--stream-capture=[Allows capturing the primary stream (not additional audio tracks or other kind of streams) into the given file]:' \ - '--stream-dump=[Same as --stream-capture, but do not start playback]:' \ - '--playlist=[Play files according to a playlist file (ASX, Winamp, SMIL, or one-file-per-line format)]:' \ - '--pp=[See also --vf=pp]:' \ - '--pphelp[See also --vf=pp]:' \ - '--profile=[Use the given profile(s), --profile=help displays a list of the defined profiles]:' \ + '--osc[Whether to load the on-screen-controller (default\: yes)]' \ + '--panscan=[Enables pan-and-scan functionality]:panscan (default 0):(0 1)' \ + '--playing-msg=[Print out a string after starting playback]:outpust string' \ + '--status-msg=[Print out a custom string during playback instead of the standard status line]:status line' \ + '--stream-capture=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ + '--stream-dump=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ + '--playlist=[Play files according to a playlist file (ASX, Winamp, SMIL, or one-file-per-line format)]:load playlist:_files' \ + '--pp=[Enable postprocessing with parameters]:postprocessing parameters' \ + '(*)--pphelp[Display postprocessing help]' \ + '--profile=[Use given profile(s)]:profile:->profiles' \ '--pts-association-mode=[Select the method used to determine which container packet timestamp corresponds to a particular output frame from the video decoder]:' \ '--pvr=[This option tunes various encoding properties of the PVR capture module]:' \ '--quiet[Make console output less verbose; in particular, prevents the status line (i]' \ - '--quvi-format=[Video format/quality that is directly passed to libquvi (default: best)]:' \ + '--quvi-format=[Video format/quality that is directly passed to libquvi (default\: best)]:' \ '--radio=[These options set various parameters of the radio capture module]:' \ '--really-quiet[Display even less output and status messages than with --quiet]' \ '--referrer=[Specify a referrer path or URL for HTTP requests]:' \ '--reset-on-next-file=[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]:' \ - '--rtsp-transport=[Select RTSP transport method (default: tcp)]:' \ - '--saturation=[Adjust the saturation of the video signal (default: 0)]:' \ + '--rtsp-transport=[Select RTSP transport method (default\: tcp)]:' \ + '--saturation=[Adjust the saturation of the video signal (default\: 0)]:' \ '--save-position-on-quit[Always save the current playback position on quit]' \ - '--sb=[Seek to byte position]:' \ - '--screen=[In multi-monitor configurations (i]:' \ - '--screenshot-format=[Set the image file type used for saving screenshots]:' \ - '--screenshot-jpeg-quality=[Set the JPEG quality level]:' \ - '--screenshot-png-compression=[Set the PNG compression level]:' \ - '--screenshot-png-filter=[Set the filter applied prior to PNG compression]:' \ - '--screenshot-template=[Specify the filename template used to save screenshots]:' \ - '--screenh=[Specify the screen height for video output drivers which do not know the screen resolution, like x11 and TV-out]:' \ - '--screenw=[Specify the screen width for video output drivers which do not know the screen resolution, like x11 and TV-out]:' \ - '--show-profile=[Show the description and content of a profile]:' \ + '--sb=[Seek to byte position]:position (bytes)' \ + '--screen=[Screen to use in multi-monitor config]:' \ + '--screenshot-format=[Set the image file type used for saving screenshots]:format (default jpg)' \ + '--screenshot-jpeg-quality=[Set the JPEG quality level]:jpeg quality level' \ + '--screenshot-png-compression=[Set the PNG compression level]:png compression level' \ + '--screenshot-png-filter=[Set the filter applied prior to PNG compression]:png filter' \ + '--screenshot-template=[Specify the filename template used to save screenshots]:screenshot filename template' \ + '--screenh=[Specify screen width or height]:screen height (pixels)' \ + '--screenw=[Specify screen width or height]:screen width (pixels)' \ + '(*)--show-profile=[Show the description and content of a profile]::->profiles' \ '--shuffle[Play files in random order]' \ - '--sid=[Display the subtitle stream specified by ]:' \ - '--slang=[Specify a priority list of subtitle languages to use]:' \ + '--sid=[Display the subtitle stream specified by ]:subtitle stream id' \ + '--slang=[Specify a priority list of subtitle languages to use]:subtitle languages' \ '--slave-broken[Switches on the old slave mode]' \ '--softsleep[Time frames by repeatedly checking the current time instead of asking the kernel to wake up mpv at the correct time]' \ '--softvol=[Control whether to use the volume controls of the audio output driver or the internal mpv volume filter]:' \ - '--softvol-max=[Set the maximum amplification level in percent (default: 200)]:' \ - '--speed=[Slow down or speed up playback by the factor given as parameter]:' \ - '--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:' \ - '--start=[Seek to given time position]:' \ - '--ssf=[Specifies software scaler parameters]:' \ - '--sstep=[Skip seconds after every frame]:' \ - '--stop-screensaver[Turns off the screensaver (or screen blanker and similar mechanisms) at startup and turns it on again on exit (default: yes)]' \ - '--sub=[Use/display these subtitle files]:' \ - '--subcp=[If your system supports iconv(3), you can use this option to specify the subtitle codepage]:' \ - '--subfps=[Specify the framerate of the subtitle file (default: movie fps)]:' \ - '--sws=[Specify the software scaler algorithm to be used with --vf=scale]:' \ + '--softvol-max=[Set the maximum amplification level in percent (default\: 200)]:maximum volume level (default 200)' \ + '--speed=[Slow down or speed up playback by the factor given as parameter]:speed factor (default 1.0)' \ + '--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:output sample rate' \ + '--start=[Seek to given time position]:time position' \ + '--ssf=[Specifies software scaler parameters]:software scaler parameters' \ + '--sstep=[Skip specified number of seconds after every frame]:skip step (seconds)' \ + '--stop-screensaver[Turns off the screensaver at startup and turns it on again on exit]' \ + '--sub=[Use/display these subtitle files]:subtitle file:_files' \ + '--subcp=[If your system supports iconv(3), you can use this option to specify the subtitle codepage]:subtitle codepage' \ + '--subfps=[Specify the framerate of the subtitle file (default\: movie fps)]:subtitle framerate' \ + '--sws=[Specify the software scaler algorithm to be used with --vf=scale]:software scaler algorithm' \ '--term-osd[Display OSD messages on the console when no video output is available]' \ - '--term-osd-esc=[Specify the escape sequence to use before writing an OSD message on the console]:' \ - '--title=[Set the window title]:' \ - '--tls-ca-file=[Certificate authority database file for use with TLS]:' \ + '!--term-osd-esc=[Specify the escape sequence to use before writing an OSD message on the console]:osd escape sequence' \ + '--title=[Set the window title]:window title' \ + '--tls-ca-file=[Certificate authority database file for use with TLS]:ca file:_files' \ '--tls-verify[Verify peer certificates when using TLS]' \ - '--tv=[This option tunes various properties of the TV capture module]:' \ - '--tvscan=[Tune the TV channel scanner]:' \ + '--tv=[This option tunes various properties of the TV capture module]:tv tuner options' \ + '--tvscan=[Tune the TV channel scanner]:tv channel' \ '--use-filedir-conf[Look for a file-specific configuration file in the same directory as the file that is being played]' \ - '--user-agent=[Use as user agent for HTTP streaming]:' \ + '--user-agent=[Use as user agent for HTTP streaming]:user agent (string)' \ '--vd=[Specify a priority list of video decoders to be used, according to their family and name]:' \ - '--vd-lavc-bitexact[Only use bit-exact algorithms in all decoding steps (for codec testing)]' \ - '--vd-lavc-fast[Enable MPEG2 optimizations which do not comply with the format specification and potentially cause problems]' \ - '--vd-lavc-o=[Skips the loop filter (AKA deblocking) during H]:' \ - '--vd-lavc-skipidct=[Skips the IDCT step]:' \ - '--vd-lavc-skipframe=[Skips decoding of frames completely]:' \ - '--vd-lavc-threads=[Number of threads to use for decoding]:' \ - '--version[Print version string and exit]' \ + '(*)--version[Print version string and exit]' \ '--vf=[Specify a list of video filters to apply to the video stream]:' \ - '--vid=[Select video channel]:' \ - '--video-align-x=[Move video padding on x axis]:' \ - '--video-align-y=[Move video padding on y axis]:' \ - '--video-pan-x=[Moves the displayed video rectangle by the given value in the X or Y direction]:' \ + '--vid=[Select video channel]:video channel' \ + '--video-align-x=[Move video padding on x or y axis]:x align (pixels)' \ + '--video-align-y=[Move video padding on x or y axis]:y align (pixels)' \ + '--video-pan-x=[Moves the displayed video rectangle by the given value in the X or Y direction]:x pan (pixels)' \ + '--video-pan-y=[Moves the displayed video rectangle by the given value in the X or Y direction]:y pan (pixels)' \ '--video-unscaled[Disable scaling of the video]' \ - '--video-zoom=[Adjust the video display scale factor by the given value]:' \ - '--vo=[Specify a priority list of video output drivers to be used]:' \ - '--volstep=[Set the step size of mixer volume changes in percent of the full range (default: 3)]:' \ - '--volume=[Set the startup volume]:' \ - '--volume-restore-data=[Used internally for use by playback resume]:' \ - '--wid=[(X11 and Windows only) to attach existing window]:' \ - '(--use-stdin)*:video file:->mfiles:' && ret=0 + '--video-zoom=[Adjust the video display scale factor by the given value]:zoom factor' \ + '--vo=[Specify a priority list of video output drivers to be used]:video drivers:->video-drivers' \ + '--volstep=[Set the step size of mixer volume changes in percent of the full range]:volume step size (default 3)' \ + '--volume=[Set the startup volume]:volume' \ + '!--volume-restore-data=[Used internally for use by playback resume]:' \ + '--wid=[(X11 and Windows only) to attach existing window]:window' \ + '*:video file:->mfiles' && ret=0 case "$state" in mfiles) From 78478451bb0d8ed1fc6b4ac342bef7c218a15e47 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 17:09:04 +0100 Subject: [PATCH 3/8] _mpv: add suppressed option groups, and more work on parameter args --- src/_mpv | 168 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 93 insertions(+), 75 deletions(-) diff --git a/src/_mpv b/src/_mpv index 88e0691..b5f738a 100644 --- a/src/_mpv +++ b/src/_mpv @@ -7,16 +7,39 @@ typeset -A opt_args if [[ -prefix --ass-* ]]; then _arguments -C \ - '--ass-force-style=[Override some style or script info parameters.]:style parameters' \ - '--ass-hinting=[Set font hinting type.]:font hinting style' \ - '--ass-line-spacing=[Set line spacing value for SSA/ASS renderer.]:line spacing' \ - '--ass-shaper=[Set the text layout engine used by libass.]:text layout engine' \ - '--ass-styles=[Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles.]:styles file:_files' \ - '--ass-style-override=[Control whether user style overrides should be applied.]:apply overrides:(yes no)' \ - '--ass-use-margins[Enables placing toptitles and subtitles in black borders when they are available.]' \ - '--ass-vsfilter-aspect-compat=[Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility with traditional VSFilter behavior.]:' \ - '--ass-vsfilter-blur-compat=[Scale blur tags by video resolution instead of script resolution (enabled by default).]:' \ - '--ass-vsfilter-color-compat=[Mangle colors like (xy-)vsfilter do (default\: basic).]:' && ret=0 + '--ass-force-style=[Override some style or script info parameters]:style parameters' \ + '--ass-hinting=[Set font hinting type]:font hinting style' \ + '--ass-line-spacing=[Set line spacing value for SSA/ASS renderer]:line spacing' \ + '--ass-shaper=[Set the text layout engine used by libass]:text layout engine' \ + '--ass-styles=[Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles]:styles file:_files' \ + '--ass-style-override=[Control whether user style overrides should be applied]:apply overrides:(yes no)' \ + '--ass-use-margins[Enables placing toptitles and subtitles in black borders when they are available]' \ + '--ass-vsfilter-aspect-compat=[Stretch SSA/ASS subtitles when playing anamorphic videos for compatibility with traditional VSFilter behavior]:' \ + '!--ass-vsfilter-blur-compat=[Scale blur tags by video resolution instead of script resolution]:' \ + '--ass-vsfilter-color-compat=[Mangle colors like (xy-)vsfilter do (default\: basic)]:' && ret=0 + +elif [[ -prefix --demuxer-* ]]; then + + _arguments -C \ + '--demuxer-lavf-analyzeduration=[Maximum length in seconds to analyze the stream properties]:' \ + '--demuxer-lavf-probescore=[Minimum required libavformat probe score]:' \ + '--demuxer-lavf-allow-mimetype=[Allow deriving the format from the HTTP MIME type (default\: yes)]:' \ + '--demuxer-lavf-format=[Force a specific libavformat demuxer]:' \ + '--demuxer-lavf-genpts-mode=[Mode for deriving missing packet PTS values from packet DTS]:' \ + '--demuxer-lavf-o=[Pass AVOptions to libavformat demuxer]:' \ + '--demuxer-lavf-probesize=[Maximum amount of data to probe during the detection phase]:' \ + '--demuxer-lavf-buffersize=[Size of the stream read buffer allocated for libavformat in bytes (default\: 32768)]:' \ + '--demuxer-lavf-cryptokey=[Encryption key the demuxer should use]:' \ + '--demuxer-rawaudio-channels=[Number of channels (or channel layout) if --demuxer=rawaudio is used (default\: stereo)]:' \ + '--demuxer-rawaudio-format=[Sample format for --demuxer=rawaudio (default\: s16le)]:' \ + '--demuxer-rawaudio-rate=[Sample rate for --demuxer=rawaudio (default\: 44KHz)]:' \ + '--demuxer-rawvideo-fps=[Rate in frames per second for --demuxer=rawvideo (default\: 25.0)]:' \ + '--demuxer-rawvideo-w=[Image width in pixels for --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-h=[Image height in pixels for --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-format=[Colorspace (fourcc) in hex or string for --demuxer=rawvideo (default\: YV12)]:' \ + '--demuxer-rawvideo-mp-format=[Colorspace by internal video format for --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-codec=[Set the video codec instead of selecting the rawvideo codec when using --demuxer=rawvideo]:' \ + '--demuxer-rawvideo-size=[Frame size in bytes when using --demuxer=rawvideo]:' && ret=0 elif [[ -prefix --input-* ]]; then @@ -78,12 +101,22 @@ elif [[ -prefix --vd-* ]]; then '--vd-lavc-skipframe=[Skips decoding of frames completely]:' \ '--vd-lavc-threads=[Number of threads to use for decoding]:' && ret=0 +elif [[ -prefix --video-* ]]; then + + _arguments -C \ + '--video-align-x=[Move video padding on x or y axis]:x align (pixels)' \ + '--video-align-y=[Move video padding on x or y axis]:y align (pixels)' \ + '--video-pan-x=[Moves the displayed video rectangle by the given value in the X or Y direction]:x pan (pixels)' \ + '--video-pan-y=[Moves the displayed video rectangle by the given value in the X or Y direction]:y pan (pixels)' \ + '--video-unscaled[Disable scaling of the video]' \ + '--video-zoom=[Adjust the video display scale factor by the given value]:zoom factor' && ret=0 + elif [[ -prefix --no-* ]]; then _arguments -C \ - '--no-fixed-vo[--no-fixed-vo enforces closing and reopening the video window for multiple files (one (un)initialization for each file)]' \ + '--no-fixed-vo[Enforce closing and reopening the video window for multiple files]' \ '--no-input-default-bindings[Disable mpv default (builtin) key bindings]' \ - '--no-keepaspect[--no-keepaspect will always stretch the video to window size, and will disable the window manager hints that force the window aspect ratio]' \ + '--no-keepaspect[Always stretch the video to window size]' \ '--no-msgcolor[Disable colorful console output on terminals]' \ '--no-aspect[Ignore aspect ratio information from video file and assume the video has square pixels]' \ '--no-cache[Turn off input stream caching]' \ @@ -97,82 +130,72 @@ elif [[ -prefix --no-* ]]; then else - typeset -A demuxer_opts - demuxer_opts=( - lavf - '--demuxer-lavf-analyzeduration=[Maximum length in seconds to analyze the stream properties.]:' \ - '--demuxer-lavf-probescore=[Minimum required libavformat probe score.]:' \ - '--demuxer-lavf-allow-mimetype=[Allow deriving the format from the HTTP MIME type (default\: yes).]:' \ - '--demuxer-lavf-format=[Force a specific libavformat demuxer.]:' \ - '--demuxer-lavf-genpts-mode=[Mode for deriving missing packet PTS values from packet DTS.]:' \ - '--demuxer-lavf-o=[Pass AVOptions to libavformat demuxer.]:' \ - '--demuxer-lavf-probesize=[Maximum amount of data to probe during the detection phase.]:' \ - '--demuxer-lavf-buffersize=[Size of the stream read buffer allocated for libavformat in bytes (default\: 32768).]:' \ - '--demuxer-lavf-cryptokey=[Encryption key the demuxer should use.]:' \ - rawaudio - '--demuxer-rawaudio-channels=[Number of channels (or channel layout) if --demuxer=rawaudio is used (default\: stereo).]:' \ - '--demuxer-rawaudio-format=[Sample format for --demuxer=rawaudio (default\: s16le).]:' \ - '--demuxer-rawaudio-rate=[Sample rate for --demuxer=rawaudio (default\: 44KHz).]:' \ - rawvideo - '--demuxer-rawvideo-fps=[Rate in frames per second for --demuxer=rawvideo (default\: 25.0).]:' \ - '--demuxer-rawvideo-w=[Image width in pixels for --demuxer=rawvideo.]:' \ - '--demuxer-rawvideo-h=[Image height in pixels for --demuxer=rawvideo.]:' \ - '--demuxer-rawvideo-format=[Colorspace (fourcc) in hex or string for --demuxer=rawvideo (default\: YV12)]:' \ - '--demuxer-rawvideo-mp-format=[Colorspace by internal video format for --demuxer=rawvideo]:' \ - '--demuxer-rawvideo-codec=[Set the video codec instead of selecting the rawvideo codec when using --demuxer=rawvideo]:' \ - '--demuxer-rawvideo-size=[Frame size in bytes when using --demuxer=rawvideo]:' \ + local -a optgroups + optgroups=( + '--ass-:ass subtitles' + '--demuxer-:demuxer settings' + '--input-:input' + '--sub-:subtitles' + '--osd-:on-screen display' + '--vd-:lavc video decoding' + '--video-:video settings' + '--no-:negative flags' ) + # describe additional prefix-groups of options + _describe -o "Option groups" optgroups -S '' && ret=0 + _arguments -C \ - '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name.]:audio decoders' \ - '--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams.]:compression level' \ - '--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default\: yes).]:downmixing:(yes no)' \ + $demuxer_actualopts \ + '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name]:audio decoders' \ + '--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams]:compression level' \ + '--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default\: yes)]:downmixing:(yes no)' \ '--ad-lavc-o=[Pass AVOptions to libavcodec decoder]:libavcodec decoder options' \ - '--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is.]:' \ - '--af=[Specify a list of audio filters to apply to the audio stream.]:audio filters' \ + '--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is]:' \ + '--af=[Specify a list of audio filters to apply to the audio stream]:audio filters' \ '--aid=[Select audio channel]:audio channel' \ - '--alang=[Specify a priority list of audio languages to use.]:audio language list' \ + '--alang=[Specify a priority list of audio languages to use]:audio language list' \ '--ao=[Specify a priority list of audio output drivers to be used]:audio driver(s):->audio-drivers:' \ - '--ar[Enable/disable AppleIR remote support.]' \ - '--aspect=[Override movie aspect ratio, in case aspect information is incorrect or missing in the file being played.]:aspect ratio' \ - '--ass[Render ASS subtitles natively (enabled by default).]' \ - '--audio-demuxer=[Use this audio demuxer type when using --audiofile.]:audio demuxer' \ - '--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie.]:external audio file:_files -g "*.(wav|mp3|ogg)"' \ - '--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory.]:cache (bytes)' \ + '--ar[Enable/disable AppleIR remote support]' \ + '--aspect=[Override movie aspect ratio, in case aspect information is incorrect or missing in the file being played]:aspect ratio' \ + '!--ass[Render ASS subtitles natively (enabled by default)]' \ + '--audio-demuxer=[Use this audio demuxer type when using --audiofile]:audio demuxer' \ + '--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie]:external audio file:_files -g "*.(wav|mp3|ogg)"' \ + '--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory]:cache (bytes)' \ "(--autofit-larger)--autofit=[Set initial window size]:initial window size (WxH)" \ '(--autofit)--autofit-larger=[Set maximum initial window size]:initial window size(WxH)' \ - '--autosub[Load additional subtitle files matching the video filename. ]' \ + '--autosub[Load additional subtitle files matching the video filename]' \ '--autosub-match=[Adjust matching fuzziness when searching for subtitles]:subtitle fuzziness' \ - '--autosync=[Gradually adjusts the A/V sync based on audio delay measurements.]:' \ - '--untimed[Do not sleep when outputting video frames. ]' \ + '--autosync=[Gradually adjusts the A/V sync based on audio delay measurements]:' \ + '--untimed[Do not sleep when outputting video frames]' \ '--bluray-angle=[Specify Blu-ray view angle]:bluray view angle' \ '--bluray-device=[Specify Blu-ray disc location]:bluray disc location (device, iso or directory):_files' \ '--border[Play movie with window border and decorations]' \ - '--brightness=[Adjust the brightness of the video signal.]:additional brightness (default 0)' \ + '--brightness=[Adjust the brightness of the video signal]:additional brightness (default 0)' \ '--cache=[Set size of the cache]:cache size (no, auto or integer in kb; default auto)' \ '!--cache-default=[Set size of the cache]:cache size (kb, default 320)' \ '--cache-pause=[Pause if cache percentage goes below specified value]:cache percentage' \ '--cache-min=[Playback will start when the cache has been filled up to percentage]:cache percentage (default 20)' \ '--cache-seek-min=[Wait for cache fill to set percentage on seek]:cache percentage' \ - '--cdda=[This option can be used to tune the CD Audio reading feature of mpv.]:cdda parameters' \ - '--cdrom-device=[Specify the CD-ROM device.]:specify cdrom source (device, iso or directory; default /dev/cdrom):_files' \ - '--channels=[Request the number of playback channels.]:playback channels' \ + '--cdda=[This option can be used to tune the CD Audio reading feature of mpv]:cdda parameters' \ + '--cdrom-device=[Specify the CD-ROM device]:specify cdrom source (device, iso or directory; default /dev/cdrom):_files' \ + '--channels=[Request the number of playback channels]:playback channels' \ '--chapter=[Specify which chapter to start playing at]:chapter' \ '--chapter-merge-threshold=[Threshold for merging almost consecutive ordered chapter parts]:chapter merge threshold (ms, default 100)' \ '--chapter-seek-threshold=[Threshold to go to previous chapter on backwards seek]:chapter seek threshold (seconds, default 5.0)' \ - '--colormatrix=[Controls the YUV to RGB color space conversion when playing video.]:' \ - '--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion.]:' \ - '--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion.]:' \ - '--consolecontrols[--no-consolecontrols prevents the player from reading key events from standard input. ]' \ - '--contrast[=[Adjust the contrast of the video signal.]:contrast adjustment (-100 to 100, default 0)' \ - '--cookies[(network only) Support cookies when making HTTP requests. ]' \ + '--colormatrix=[Controls the YUV to RGB color space conversion when playing video]:' \ + '--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion]:' \ + '--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion]:' \ + '--consolecontrols[--no-consolecontrols prevents the player from reading key events from standard input]' \ + '--contrast=[Adjust the contrast of the video signal]:contrast adjustment (-100 to 100, default 0)' \ + '--cookies[(network only) Support cookies when making HTTP requests]' \ '--cookies-file=[File to read HTTP cookies from]:cookie file:_files' \ '--correct-pts[switches mpv to a mode where video timing is determined using a fixed framerate value]' \ - '!--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds.]:cursor hide delay (ms)' \ - '!--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode. ]' \ + '!--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds]:cursor hide delay (ms)' \ + '!--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode]' \ '--audio-delay=[Specify an audio delay]:audio delay (signed float in seconds, default 0)' \ - '--deinterlace=[Enable or disable interlacing (default\: auto, which usually means no).]:' \ - '--demuxer=[Force demuxer type.]:demuxer type' \ + '--deinterlace=[Enable or disable interlacing (default\: auto, which usually means no)]:' \ + '--demuxer=[Force demuxer type]:demuxer type' \ '--demuxer-mkv-subtitle-preroll[Try harder to show embedded soft subtitles when seeking somewhere]' \ '!--doubleclick-time=[Time in milliseconds to recognize two consecutive button presses as a double-click]:doubleclick time (ms, default 300)' \ '--dvbin=[Pass the following parameters to the DVB input module, in order to override the default ones:]:dvb input parameters' \ @@ -183,7 +206,7 @@ else '--embeddedfonts[Use fonts embedded in Matroska container files and ASS scripts (default\: enabled)]' \ '--end=[Stop at given absolute time]:stop time' \ '--field-dominance=[Set first field for interlaced content]:' \ - '--flip[Flip image upside-down.]' \ + '--flip[Flip image upside-down]' \ '--force-rgba-osd-rendering[Change how some video outputs render the OSD and text subtitles]' \ '--force-window[Create a video output window even if there is no video]' \ "--force-window-position[Forcefully move mpv's video output window to default location whenever there is a change in video parameters, video stream or file]" \ @@ -239,7 +262,7 @@ else '--native-keyrepeat[Use system settings for keyrepeat delay and rate, instead of --input-ar-delay and --input-ar-rate]' \ '--sub-visibility[Can be used to disable display of subtitles, but still select and decode them]' \ '--ontop[Makes the player window stay on top of other windows]' \ - '--ordered-chapters[Enabled by default]' \ + '!--ordered-chapters[Enabled by default]' \ '--osc[Whether to load the on-screen-controller (default\: yes)]' \ '--panscan=[Enables pan-and-scan functionality]:panscan (default 0):(0 1)' \ '--playing-msg=[Print out a string after starting playback]:outpust string' \ @@ -277,7 +300,7 @@ else '--slave-broken[Switches on the old slave mode]' \ '--softsleep[Time frames by repeatedly checking the current time instead of asking the kernel to wake up mpv at the correct time]' \ '--softvol=[Control whether to use the volume controls of the audio output driver or the internal mpv volume filter]:' \ - '--softvol-max=[Set the maximum amplification level in percent (default\: 200)]:maximum volume level (default 200)' \ + '--softvol-max=[Set the maximum amplification level in percent]:maximum volume level (default 200)' \ '--speed=[Slow down or speed up playback by the factor given as parameter]:speed factor (default 1.0)' \ '--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:output sample rate' \ '--start=[Seek to given time position]:time position' \ @@ -301,12 +324,6 @@ else '(*)--version[Print version string and exit]' \ '--vf=[Specify a list of video filters to apply to the video stream]:' \ '--vid=[Select video channel]:video channel' \ - '--video-align-x=[Move video padding on x or y axis]:x align (pixels)' \ - '--video-align-y=[Move video padding on x or y axis]:y align (pixels)' \ - '--video-pan-x=[Moves the displayed video rectangle by the given value in the X or Y direction]:x pan (pixels)' \ - '--video-pan-y=[Moves the displayed video rectangle by the given value in the X or Y direction]:y pan (pixels)' \ - '--video-unscaled[Disable scaling of the video]' \ - '--video-zoom=[Adjust the video display scale factor by the given value]:zoom factor' \ '--vo=[Specify a priority list of video output drivers to be used]:video drivers:->video-drivers' \ '--volstep=[Set the step size of mixer volume changes in percent of the full range]:volume step size (default 3)' \ '--volume=[Set the startup volume]:volume' \ @@ -365,6 +382,7 @@ else _describe -t video-output-plugins 'video output plugin' vals && ret=0 ;; esac + fi -return ret +return $ret From cfc4738ad94e47a2f66686f0915f467f7e4dcb36 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 17:19:09 +0100 Subject: [PATCH 4/8] _mpv: fix --ao and --vo, ditch unused $state cases --- src/_mpv | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/src/_mpv b/src/_mpv index b5f738a..087dc63 100644 --- a/src/_mpv +++ b/src/_mpv @@ -303,7 +303,7 @@ else '--softvol-max=[Set the maximum amplification level in percent]:maximum volume level (default 200)' \ '--speed=[Slow down or speed up playback by the factor given as parameter]:speed factor (default 1.0)' \ '--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:output sample rate' \ - '--start=[Seek to given time position]:time position' \ + '--start=[Seek to given time position]:time position (percent, seconds, or hh:mm:ss)' \ '--ssf=[Specifies software scaler parameters]:software scaler parameters' \ '--sstep=[Skip specified number of seconds after every frame]:skip step (seconds)' \ '--stop-screensaver[Turns off the screensaver at startup and turns it on again on exit]' \ @@ -346,41 +346,14 @@ else (( ret )) || return 0 done ;; - audio-codecs) - vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -ac help -quiet 2>/dev/null)"}[(r)ac:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} ) - _describe -t audio-codecs 'audio codec' vals && ret=0 - ;; audio-drivers) - vals=( help ${${${(f)"$(_call_program audio-drivers mplayer -ao help 2>/dev/null)"}[(r) *,-1]#?}/ /:} ) + vals=( help ${${${(f)"$(_call_program audio-drivers $words[1] --ao help 2>/dev/null)"}[(r) *,-1]# #}/ #:/:} ) _describe -t audio-drivers 'audio drivers' vals && ret=0 ;; - audio-codec-families) - compset -P '*,' - compset -S ',*' - vals=( help ${${${(f)"$(_call_program audio-codec-families mplayer -afm help 2>/dev/null)"}[(r) [^:]#,-1]## ##}/ ##/:} ) - _describe -t audio-codec-families 'audio drivers' vals && ret=0 - ;; - audio-plugins) - _values -s : 'audio output plugin' \ - 'list[specify list of plugins]:plugin:(resample surround format volume extrastereo volnorm delay)' \ - 'format[output format]:format' \ - 'fout[output frequency]:frequency (Hz)' \ - 'volume[volume level]:volume <0-255>' \ - 'mul[stereo coefficient]:coefficient' \ - 'softclip[compressor]' && ret=0 - ;; - video-codecs) - vals=( help ${${${(f)"$(_call_program audio-codecs $words[1] -vc help -quiet 2>/dev/null)"}[(r)vc:*,-1]}[2,-1]/ ##[^ ]# #[^ ]# #/:} ) - _describe -t video-codecs 'video codec' vals && ret=0 - ;; video-drivers) - vals=( help ${${${(f)"$(_call_program video-drivers mplayer -vo help 2>/dev/null)"}[(r) *,-1]#?}/ /:} ) + vals=( help ${${${(f)"$(_call_program video-drivers $words[1] --vo=help 2>/dev/null)"}[(r) *,-1]# #}/ #:/:} ) _describe -t video-drivers 'video drivers' vals && ret=0 ;; - video-output-plugins) - vals=( help ${${${${(f)"$(_call_program video-output-plugins mplayer -vop help 2>/dev/null)"}[(r) *,-1]}/ /}/ #: /:} ) - _describe -t video-output-plugins 'video output plugin' vals && ret=0 - ;; esac fi From 6384a4ea3da9c119c070b5b73375bce4a322e9c7 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 18:48:22 +0100 Subject: [PATCH 5/8] _mpv: more specialized parameter handling --- src/_mpv | 105 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 84 insertions(+), 21 deletions(-) diff --git a/src/_mpv b/src/_mpv index 087dc63..ff86795 100644 --- a/src/_mpv +++ b/src/_mpv @@ -130,29 +130,67 @@ elif [[ -prefix --no-* ]]; then else - local -a optgroups - optgroups=( - '--ass-:ass subtitles' - '--demuxer-:demuxer settings' - '--input-:input' - '--sub-:subtitles' - '--osd-:on-screen display' - '--vd-:lavc video decoding' - '--video-:video settings' - '--no-:negative flags' + # describe additional prefix-groups of options + if [[ -prefix -* ]]; then + local -a optgroups + optgroups=( + '--ass-:ass subtitles' + '--demuxer-:demuxer settings' + '--input-:input' + '--sub-:subtitles' + '--osd-:on-screen display' + '--vd-:lavc video decoding' + '--video-:video settings' + '--no-:negative flags' + ) + _describe -t option-prefixes "option groups" optgroups -S '' && ret=0 + fi + + ofopts=( + '--of=[Specify output format]:output format:->output_format' + '--ofopts=[Set output format options]:output format option' + '--ofopts-add=[Append output format option to list]' + '--ofopts-pre=[Prepend output format option to list]' + '--ofopts-del=[Delete output format option at index]:option index (zero-based)' + '--ofopts-clr[Clear output format option list]' + '--ofps=[Specify output forma time base]:time base (default 24000)' + '--oautofps[Try to guess output format time base from input video]' + '--omaxfps=[Set output format maximum fps]:maximum fps (default 0, ie no limit)' + '--oharddup[Duplicate frames instead of skipping time codes to increase frame rate]' + '--oneverdrop[Never drop frames]' + '--oac=[Specify output format audio codec]' + '--oaoffset=[Set audio data offset]:offset (seconds)' + '--oacopts=[Specify output audio codec options]:audio output format option' + '--oacopts-add=[Append audio output format option to list]:audio output format option' + '--oacopts-pre=[Prepend audio output format option to list]:audio output format option' + '--oacopts-del=[Delete audio output format option at index]:option index (zero-based)' + '--oacopts-clr[Clear audio output format option list]' + '--oafirst[Force audio stream as first output stream]' + '--ovc=[Specify output format video codec]' + '--ovoffset=[Set video offset]:offset (seconds)' + '--ovc=[Specify output format video codec]' + '--ovcopts=[Specify output video codec options]:video output format option' + '--ovcopts-add=[Append video output format option to list]:video output format option' + '--ovcopts-pre=[Prepend video output format option to list]:video output format option' + '--ovcopts-del=[Delete video output format option at index]:option index (zero-based)' + '--ovcopts-clr[Clear video output format option list]' + '--ovfirst[Force video stream as first output stream]' + '--ocopyts[Copy input pts to output video, but fix discontinuities]' + '--orawts[Copy input pts to output video, leave discontinuities as-is]' ) - # describe additional prefix-groups of options - _describe -o "Option groups" optgroups -S '' && ret=0 + # don't show these if there is no -o yet + (( $+words[(r)-o(|=*)] )) || ofopts=( !$^ofopts ) _arguments -C \ - $demuxer_actualopts \ - '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name]:audio decoders' \ + '-o[Enable encoding mode to specified output filename]:output file:_files' \ + $ofopts \ + '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name]:audio decoders:->audio-decoders' \ '--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams]:compression level' \ '--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default\: yes)]:downmixing:(yes no)' \ '--ad-lavc-o=[Pass AVOptions to libavcodec decoder]:libavcodec decoder options' \ '--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is]:' \ - '--af=[Specify a list of audio filters to apply to the audio stream]:audio filters' \ + '--af=[Specify a list of audio filters to apply to the audio stream]:audio filters:->audio-filters' \ '--aid=[Select audio channel]:audio channel' \ '--alang=[Specify a priority list of audio languages to use]:audio language list' \ '--ao=[Specify a priority list of audio output drivers to be used]:audio driver(s):->audio-drivers:' \ @@ -320,9 +358,9 @@ else '--tvscan=[Tune the TV channel scanner]:tv channel' \ '--use-filedir-conf[Look for a file-specific configuration file in the same directory as the file that is being played]' \ '--user-agent=[Use as user agent for HTTP streaming]:user agent (string)' \ - '--vd=[Specify a priority list of video decoders to be used, according to their family and name]:' \ + '--vd=[Specify a priority list of video decoders to be used]:video decoders:->video-decoders' \ '(*)--version[Print version string and exit]' \ - '--vf=[Specify a list of video filters to apply to the video stream]:' \ + '--vf=[Specify a list of video filters to apply to the video stream]:video filters:->video-filters' \ '--vid=[Select video channel]:video channel' \ '--vo=[Specify a priority list of video output drivers to be used]:video drivers:->video-drivers' \ '--volstep=[Set the step size of mixer volume changes in percent of the full range]:volume step size (default 3)' \ @@ -347,12 +385,37 @@ else done ;; audio-drivers) - vals=( help ${${${(f)"$(_call_program audio-drivers $words[1] --ao help 2>/dev/null)"}[(r) *,-1]# #}/ #:/:} ) - _describe -t audio-drivers 'audio drivers' vals && ret=0 + _message "format: " + vals=( help ${${${(f)"$(_call_program audio-drivers $words[1] --ao=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t audio-drivers 'audio drivers' vals -S '' && ret=0 ;; + + audio-decoders) + vals=( help ${${${${(f)"$(_call_program audio-decoders $words[1] --ad=help 2>/dev/null)"}[(r) *,-1]## #}/:/\\:}/ - /:} ) + _describe -t audio-decoders 'audio decoders' vals -S '' && ret=0 + ;; + + audio-filters) + _message "format: " + vals=( help ${${${(f)"$(_call_program audio-filters $words[1] --af=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t audio-filters 'audio filters' vals -S '' && ret=0 + ;; + video-drivers) - vals=( help ${${${(f)"$(_call_program video-drivers $words[1] --vo=help 2>/dev/null)"}[(r) *,-1]# #}/ #:/:} ) - _describe -t video-drivers 'video drivers' vals && ret=0 + _message "format: " + vals=( help ${${${(f)"$(_call_program video-drivers $words[1] --vo=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t video-drivers 'video drivers' vals -S '' && ret=0 + ;; + + video-decoders) + vals=( help ${${${${(f)"$(_call_program video-decoders $words[1] --vd=help 2>/dev/null)"}[(r) *,-1]## #}/:/\\:}/ - /:} ) + _describe -t video-decoders 'video decoders' vals -S '' && ret=0 + ;; + + video-filters) + _message "format: " + vals=( help ${${${(f)"$(_call_program video-filters $words[1] --vf=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) + _describe -t video-filters 'video filters' vals -S '' && ret=0 ;; esac From dba027f91ab8eae2390b0a4bc4f23498d25a4471 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 19:17:08 +0100 Subject: [PATCH 6/8] _mpv: add show-advanced option, enable by default on -- --- src/_mpv | 280 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 145 insertions(+), 135 deletions(-) diff --git a/src/_mpv b/src/_mpv index ff86795..9e9ab83 100644 --- a/src/_mpv +++ b/src/_mpv @@ -114,6 +114,9 @@ elif [[ -prefix --video-* ]]; then elif [[ -prefix --no-* ]]; then _arguments -C \ + '--no-embeddedfonts[Do not use fonts embedded in Matroska container files and ASS scripts]' \ + '--no-ass[Do not render ASS subtitles natively]' \ + '--no-consolecontrols[Prevent player from reading key events from standard input]' \ '--no-fixed-vo[Enforce closing and reopening the video window for multiple files]' \ '--no-input-default-bindings[Disable mpv default (builtin) key bindings]' \ '--no-keepaspect[Always stretch the video to window size]' \ @@ -126,12 +129,23 @@ elif [[ -prefix --no-* ]]; then '--no-resume-playback[Do not restore playback position from ~/.mpv/watch_later/]' \ '--no-sub[Do not select any subtitle when the file is loaded]' \ '--no-video[Do not play video]' \ + '--no-media-keys[OSX only: Disable media keys]' \ '--no-osd-bar[Disable display of the OSD bar]' && ret=0 else + local noadv + + # should we show advanced commands? + zstyle -s "$curcontext" show-advanced noadv + case $noadv in + 'always') noadv='' ;; + 'never') noadv='!' ;; + *) [[ -prefix --* ]] && noadv='' || noadv='!' ;; + esac + # describe additional prefix-groups of options - if [[ -prefix -* ]]; then + if [[ -prefix --* ]]; then local -a optgroups optgroups=( '--ass-:ass subtitles' @@ -185,188 +199,184 @@ else _arguments -C \ '-o[Enable encoding mode to specified output filename]:output file:_files' \ $ofopts \ - '--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name]:audio decoders:->audio-decoders' \ - '--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams]:compression level' \ - '--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default\: yes)]:downmixing:(yes no)' \ - '--ad-lavc-o=[Pass AVOptions to libavcodec decoder]:libavcodec decoder options' \ - '--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is]:' \ + $noadv'--ad=[Specify a priority list of audio decoders to be used, according to their family and decoder name]:audio decoders:->audio-decoders' \ + $noadv'--ad-lavc-ac3drc=[Select the Dynamic Range Compression level for AC-3 audio streams]:compression level' \ + $noadv'--ad-lavc-downmix=[Whether to request audio channel downmixing from the decoder (default\: yes)]:downmixing:(yes no)' \ + $noadv'--ad-lavc-o=[Pass AVOptions to libavcodec decoder]:libavcodec decoder options' \ + $noadv'--ad-spdif-dtshd=[When using DTS passthrough, output any DTS-HD track as-is]:' \ '--af=[Specify a list of audio filters to apply to the audio stream]:audio filters:->audio-filters' \ '--aid=[Select audio channel]:audio channel' \ '--alang=[Specify a priority list of audio languages to use]:audio language list' \ '--ao=[Specify a priority list of audio output drivers to be used]:audio driver(s):->audio-drivers:' \ - '--ar[Enable/disable AppleIR remote support]' \ + $noadv'--ar[Enable/disable AppleIR remote support]' \ '--aspect=[Override movie aspect ratio, in case aspect information is incorrect or missing in the file being played]:aspect ratio' \ - '!--ass[Render ASS subtitles natively (enabled by default)]' \ - '--audio-demuxer=[Use this audio demuxer type when using --audiofile]:audio demuxer' \ - '--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie]:external audio file:_files -g "*.(wav|mp3|ogg)"' \ - '--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory]:cache (bytes)' \ - "(--autofit-larger)--autofit=[Set initial window size]:initial window size (WxH)" \ - '(--autofit)--autofit-larger=[Set maximum initial window size]:initial window size(WxH)' \ + $noadv'--audio-demuxer=[Use this audio demuxer type when using --audiofile]:audio demuxer' \ + $noadv'--audiofile=[Play audio from an external file (WAV, MP3 or Ogg Vorbis) while viewing a movie]:external audio file:_files -g "*.(wav|mp3|ogg)"' \ + $noadv'--audiofile-cache=[Enables caching for the stream used by --audiofile, using the specified amount of memory]:cache (bytes)' \ + $noadv"(--autofit-larger)--autofit=[Set initial window size]:initial window size (WxH)" \ + $noadv'(--autofit)--autofit-larger=[Set maximum initial window size]:initial window size(WxH)' \ '--autosub[Load additional subtitle files matching the video filename]' \ - '--autosub-match=[Adjust matching fuzziness when searching for subtitles]:subtitle fuzziness' \ - '--autosync=[Gradually adjusts the A/V sync based on audio delay measurements]:' \ - '--untimed[Do not sleep when outputting video frames]' \ - '--bluray-angle=[Specify Blu-ray view angle]:bluray view angle' \ - '--bluray-device=[Specify Blu-ray disc location]:bluray disc location (device, iso or directory):_files' \ - '--border[Play movie with window border and decorations]' \ + $noadv'--autosub-match=[Adjust matching fuzziness when searching for subtitles]:subtitle fuzziness' \ + $noadv'--autosync=[Gradually adjusts the A/V sync based on audio delay measurements]:' \ + $noadv'--untimed[Do not sleep when outputting video frames]' \ + $noadv'--bluray-angle=[Specify Blu-ray view angle]:bluray view angle' \ + $noadv'--bluray-device=[Specify Blu-ray disc location]:bluray disc location (device, iso or directory):_files' \ + $noadv'--border[Play movie with window border and decorations]' \ '--brightness=[Adjust the brightness of the video signal]:additional brightness (default 0)' \ '--cache=[Set size of the cache]:cache size (no, auto or integer in kb; default auto)' \ '!--cache-default=[Set size of the cache]:cache size (kb, default 320)' \ - '--cache-pause=[Pause if cache percentage goes below specified value]:cache percentage' \ - '--cache-min=[Playback will start when the cache has been filled up to percentage]:cache percentage (default 20)' \ - '--cache-seek-min=[Wait for cache fill to set percentage on seek]:cache percentage' \ - '--cdda=[This option can be used to tune the CD Audio reading feature of mpv]:cdda parameters' \ - '--cdrom-device=[Specify the CD-ROM device]:specify cdrom source (device, iso or directory; default /dev/cdrom):_files' \ + $noadv'--cache-pause=[Pause if cache percentage goes below specified value]:cache percentage' \ + $noadv'--cache-min=[Playback will start when the cache has been filled up to percentage]:cache percentage (default 20)' \ + $noadv'--cache-seek-min=[Wait for cache fill to set percentage on seek]:cache percentage' \ + $noadv'--cdda=[This option can be used to tune the CD Audio reading feature of mpv]:cdda parameters' \ + $noadv'--cdrom-device=[Specify the CD-ROM device]:specify cdrom source (device, iso or directory; default /dev/cdrom):_files' \ '--channels=[Request the number of playback channels]:playback channels' \ '--chapter=[Specify which chapter to start playing at]:chapter' \ - '--chapter-merge-threshold=[Threshold for merging almost consecutive ordered chapter parts]:chapter merge threshold (ms, default 100)' \ - '--chapter-seek-threshold=[Threshold to go to previous chapter on backwards seek]:chapter seek threshold (seconds, default 5.0)' \ - '--colormatrix=[Controls the YUV to RGB color space conversion when playing video]:' \ - '--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion]:' \ - '--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion]:' \ - '--consolecontrols[--no-consolecontrols prevents the player from reading key events from standard input]' \ + $noadv'--chapter-merge-threshold=[Threshold for merging almost consecutive ordered chapter parts]:chapter merge threshold (ms, default 100)' \ + $noadv'--chapter-seek-threshold=[Threshold to go to previous chapter on backwards seek]:chapter seek threshold (seconds, default 5.0)' \ + $noadv'--colormatrix=[Controls the YUV to RGB color space conversion when playing video]:' \ + $noadv'--colormatrix-input-range=[YUV color levels used with YUV to RGB conversion]:' \ + $noadv'--colormatrix-output-range=[RGB color levels used with YUV to RGB conversion]:' \ '--contrast=[Adjust the contrast of the video signal]:contrast adjustment (-100 to 100, default 0)' \ - '--cookies[(network only) Support cookies when making HTTP requests]' \ - '--cookies-file=[File to read HTTP cookies from]:cookie file:_files' \ - '--correct-pts[switches mpv to a mode where video timing is determined using a fixed framerate value]' \ - '!--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds]:cursor hide delay (ms)' \ - '!--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode]' \ - '--audio-delay=[Specify an audio delay]:audio delay (signed float in seconds, default 0)' \ - '--deinterlace=[Enable or disable interlacing (default\: auto, which usually means no)]:' \ - '--demuxer=[Force demuxer type]:demuxer type' \ - '--demuxer-mkv-subtitle-preroll[Try harder to show embedded soft subtitles when seeking somewhere]' \ - '!--doubleclick-time=[Time in milliseconds to recognize two consecutive button presses as a double-click]:doubleclick time (ms, default 300)' \ - '--dvbin=[Pass the following parameters to the DVB input module, in order to override the default ones:]:dvb input parameters' \ - '--dvd-device=[Specify the DVD source]:dvd source (device, iso or directory):_files' \ - '--dvd-speed=[Try to limit DVD speed]:dvd speed limit (default 0, ie. no change)' \ - '--dvdangle=[Specify view angle (DVD only)]:dvd angle' \ - '--edition=[(Matroska files only) Specify the edition (set of chapters) to use, where 0 is the first]:edition' \ - '--embeddedfonts[Use fonts embedded in Matroska container files and ASS scripts (default\: enabled)]' \ + $noadv'--cookies[(network only) Support cookies when making HTTP requests]' \ + $noadv'--cookies-file=[File to read HTTP cookies from]:cookie file:_files' \ + $noadv'--correct-pts[switches mpv to a mode where video timing is determined using a fixed framerate value]' \ + $noadv'--cursor-autohide=[Make mouse cursor automatically hide after given number of milliseconds]:cursor hide delay (ms)' \ + $noadv'--cursor-autohide-fs-only[If this option is given, the cursor is always visible in windowed mode]' \ + $noadv'--audio-delay=[Specify an audio delay]:audio delay (signed float in seconds, default 0)' \ + '--deinterlace=[Enable or disable interlacing]:interlacing mode (default auto):(yes no auto)' \ + $noadv'--demuxer=[Force demuxer type]:demuxer type' \ + $noadv'--demuxer-mkv-subtitle-preroll[Try harder to show embedded soft subtitles when seeking somewhere]' \ + $noadv'--doubleclick-time=[Time in milliseconds to recognize two consecutive button presses as a double-click]:doubleclick time (ms, default 300)' \ + $noadv'--dvbin=[Pass the following parameters to the DVB input module, in order to override the default ones:]:dvb input parameters' \ + $noadv'--dvd-device=[Specify the DVD source]:dvd source (device, iso or directory):_files' \ + $noadv'--dvd-speed=[Try to limit DVD speed]:dvd speed limit (default 0, ie. no change)' \ + $noadv'--dvdangle=[Specify view angle (DVD only)]:dvd angle' \ + $noadv'--edition=[(Matroska files only) Specify the edition (set of chapters) to use, where 0 is the first]:edition' \ '--end=[Stop at given absolute time]:stop time' \ - '--field-dominance=[Set first field for interlaced content]:' \ - '--flip[Flip image upside-down]' \ - '--force-rgba-osd-rendering[Change how some video outputs render the OSD and text subtitles]' \ - '--force-window[Create a video output window even if there is no video]' \ - "--force-window-position[Forcefully move mpv's video output window to default location whenever there is a change in video parameters, video stream or file]" \ - '--sub-forced-only[Display only forced subtitles for the DVD subtitle stream selected by e]' \ - '--forceidx[Force index rebuilding]' \ - '--format=[Select the sample format used for output from the audio filter layer to the sound card]:output sample format' \ + $noadv'--field-dominance=[Set first field for interlaced content]:' \ + $noadv'--flip[Flip image upside-down]' \ + $noadv'--force-rgba-osd-rendering[Change how some video outputs render the OSD and text subtitles]' \ + $noadv'--force-window[Create a video output window even if there is no video]' \ + $noadv"--force-window-position[Forcefully move mpv's video output window to default location whenever there is a change in video parameters, video stream or file]" \ + $noadv'--sub-forced-only[Display only forced subtitles for the DVD subtitle stream selected by e]' \ + $noadv'--forceidx[Force index rebuilding]' \ + $noadv'--format=[Select the sample format used for output from the audio filter layer to the sound card]:output sample format' \ '--fps=[Override video framerate]:video framerate (fps)' \ '--framedrop=[Skip displaying some frames to maintain A/V sync on slow systems]:framedrop:(no yes hard)' \ - '--frames=[Play/convert only first video frames, then quit]:number of frames' \ + $noadv'--frames=[Play/convert only first video frames, then quit]:number of frames' \ '--fullscreen[Fullscreen playback]' \ - '--fs-screen=[Fullscreen mode goes to specified screen]:screen id for fullscreen' \ + $noadv'--fs-screen=[Fullscreen mode goes to specified screen]:screen id for fullscreen' \ '!--fsmode-dontuse=[OBSOLETE, use the --fs option]:' \ - '--fstype=[Specify a priority list of fullscreen modes to be used]:fullscreen modes (list)' \ - "--native-fs[(OS X only) Use OS X Mission Control's fullscreen feature instead of the custom one provided by mpv]" \ + $noadv'--fstype=[Specify a priority list of fullscreen modes to be used]:fullscreen modes (list)' \ + $noadv"--native-fs[(OS X only) Use OS X Mission Control's fullscreen feature instead of the custom one provided by mpv]" \ '--gamma=[Adjust the gamma of the video signal]:gamma value (default 0)' \ '--gapless-audio[Try to play consecutive audio files with no silence or disruption at the point of file change]' \ - '--geometry=[Adjust the initial window position or size]:window geometry' \ - '--heartbeat-cmd=[Command that is executed every n seconds during playback]:command to run' \ - '--heartbeat-interval=[Time between --heartbeat-cmd invocations]:heartbeat interval (seconds, default 30)' \ + $noadv'--geometry=[Adjust the initial window position or size]:window geometry' \ + $noadv'--heartbeat-cmd=[Command that is executed every n seconds during playback]:command to run' \ + $noadv'--heartbeat-interval=[Time between --heartbeat-cmd invocations]:heartbeat interval (seconds, default 30)' \ '(*)--help[Show short summary of options]' \ - '--hr-seek=[Select when to use precise seeks that are not limited to keyframes]:' \ - '--hr-seek-demuxer-offset=[This option exists to work around failures to do precise seeks (as in --hr-seek) caused by bugs or limitations in the demuxers for some file formats. Some demuxers fail to seek to a keyframe before the given target position, going to a later position instead]:' \ - '--http-header-fields=[Set custom HTTP fields when accessing HTTP stream]:' \ + $noadv'--hr-seek=[Select when to use precise seeks that are not limited to keyframes]:' \ + $noadv'--hr-seek-demuxer-offset=[This option exists to work around failures to do precise seeks (as in --hr-seek) caused by bugs or limitations in the demuxers for some file formats. Some demuxers fail to seek to a keyframe before the given target position, going to a later position instead]:' \ + $noadv'--http-header-fields=[Set custom HTTP fields when accessing HTTP stream]:' \ '--hue=[Adjust the hue of the video signal (default\: 0)]:' \ - '--hwdec=[Specify the hardware video decoding API that should be used if possible]:video decoding api' \ - '--hwdec-codecs=[Allow hardware decoding for a given list of codecs only]:codecs' \ + $noadv'--hwdec=[Specify the hardware video decoding API that should be used if possible]:video decoding api:( no auto vdpau vda crystalhd vaapi vaapi-copy )' \ + $noadv'--hwdec-codecs=[Allow hardware decoding for a given list of codecs only]:codecs:' \ '!--identify[Deprecated]' \ - '--idle[Makes mpv wait idly instead of quitting when there is no file to play]' \ - '--idx[Rebuild index of files]' \ - '--include=[Specify configuration file to be parsed after the default ones]:additional configuration file:_files' \ - '--initial-audio-sync[Sync by modifying audio stream instead of readjusting from different timestamps]' \ - '--joystick[Enable/disable joystick support]' \ - '--keep-open[Do not terminate when playing or seeking beyond the end of the file]' \ - '--key-fifo-size=[Specify the size of the FIFO that buffers key events]:key fifo size (default 7)' \ + $noadv'--idle[Makes mpv wait idly instead of quitting when there is no file to play]' \ + $noadv'--idx[Force index rebuilding]' \ + $noadv'--include=[Specify configuration file to be parsed after the default ones]:additional configuration file:_files' \ + $noadv'--initial-audio-sync[Sync by modifying audio stream instead of readjusting from different timestamps]' \ + $noadv'--joystick[Enable joystick support]' \ + $noadv'--keep-open[Do not terminate when playing or seeking beyond the end of the file]' \ + $noadv'--key-fifo-size=[Specify the size of the FIFO that buffers key events]:key fifo size (default 7)' \ '--length=[Stop after a given time relative to the start time]:play time' \ - '--lirc[Enable/disable LIRC support]' \ - '--lircconf=[(LIRC only) Specify a configuration file for LIRC]:lirc config file:_files' \ - '(*)--list-options[Print all available options]' \ - '(*)--list-properties[Print a list of available properties]' \ + $noadv'--lirc[Enable/disable LIRC support]' \ + $noadv'--lircconf=[(LIRC only) Specify a configuration file for LIRC]:lirc config file:_files' \ + $noadv'(*)--list-options[Print all available options]' \ + $noadv'(*)--list-properties[Print a list of available properties]' \ '--load-unsafe-playlists[allow loading of playlists from untrusted sources]' \ '--loop=[Loops playback N times]:number of loops' \ - '--lua=[Load a Lua script]:lua script file:_files -g "*.lua"' \ - '--mc=[Maximum A-V sync correction per frame]:max sync correction (seconds)' \ - '!--media-keys[OSX only: Enabled by default]' \ - '--mf=[TODO Used when decoding from multiple PNG or JPEG files with mf://]:' \ - '--monitoraspect=[Set the aspect ratio of your monitor or TV screen]:aspect ratio' \ - '--monitorpixelaspect=[Set the aspect of a single pixel]:pixel aspect (default 1)' \ - '--mouse-movements[Permit mpv to receive pointer events reported by the video output driver]' \ - '--msglevel=[Control verbosity directly for each module]:verbosity level (-1 to 9)' \ - '--msgmodule[Prepend module name in front of each console message]' \ + $noadv'--lua=[Load a Lua script]:lua script file:_files -g "*.lua"' \ + $noadv'--mc=[Maximum A-V sync correction per frame]:max sync correction (seconds)' \ + $noadv'--mf=[TODO Used when decoding from multiple PNG or JPEG files with mf://]:' \ + $noadv'--monitoraspect=[Set the aspect ratio of your monitor or TV screen]:aspect ratio' \ + $noadv'--monitorpixelaspect=[Set the aspect of a single pixel]:pixel aspect (default 1)' \ + $noadv'--mouse-movements[Permit mpv to receive pointer events reported by the video output driver]' \ + $noadv'--msglevel=[Control verbosity directly for each module]:verbosity level (-1 to 9)' \ + $noadv'--msgmodule[Prepend module name in front of each console message]' \ '--mute=[Set startup audio mute status]:status (default auto):(yes no auto)' \ - '--name[Set the window class name for X11-based video output methods]:window class name' \ - '--native-keyrepeat[Use system settings for keyrepeat delay and rate, instead of --input-ar-delay and --input-ar-rate]' \ - '--sub-visibility[Can be used to disable display of subtitles, but still select and decode them]' \ + $noadv'--name[Set the window class name for X11-based video output methods]:window class name' \ + $noadv'--native-keyrepeat[Use system settings for keyrepeat delay and rate, instead of --input-ar-delay and --input-ar-rate]' \ + $noadv'--sub-visibility[Can be used to disable display of subtitles, but still select and decode them]' \ '--ontop[Makes the player window stay on top of other windows]' \ '!--ordered-chapters[Enabled by default]' \ - '--osc[Whether to load the on-screen-controller (default\: yes)]' \ - '--panscan=[Enables pan-and-scan functionality]:panscan (default 0):(0 1)' \ - '--playing-msg=[Print out a string after starting playback]:outpust string' \ - '--status-msg=[Print out a custom string during playback instead of the standard status line]:status line' \ - '--stream-capture=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ - '--stream-dump=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ + '!--osc[Whether to load the on-screen-controller (default\: yes)]' \ + $noadv'--panscan=[Enables pan-and-scan functionality]:panscan (default 0):(0 1)' \ + $noadv'--playing-msg=[Print out a string after starting playback]:outpust string' \ + $noadv'--status-msg=[Print out a custom string during playback instead of the standard status line]:status line' \ + $noadv'--stream-capture=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ + $noadv'--stream-dump=[Allows capturing the primary stream (video only!) into the given file]:capture file:_files' \ '--playlist=[Play files according to a playlist file (ASX, Winamp, SMIL, or one-file-per-line format)]:load playlist:_files' \ '--pp=[Enable postprocessing with parameters]:postprocessing parameters' \ '(*)--pphelp[Display postprocessing help]' \ '--profile=[Use given profile(s)]:profile:->profiles' \ - '--pts-association-mode=[Select the method used to determine which container packet timestamp corresponds to a particular output frame from the video decoder]:' \ - '--pvr=[This option tunes various encoding properties of the PVR capture module]:' \ + $noadv'--pts-association-mode=[Select the method used to determine which container packet timestamp corresponds to a particular output frame from the video decoder]:' \ + $noadv'--pvr=[This option tunes various encoding properties of the PVR capture module]:' \ '--quiet[Make console output less verbose; in particular, prevents the status line (i]' \ - '--quvi-format=[Video format/quality that is directly passed to libquvi (default\: best)]:' \ - '--radio=[These options set various parameters of the radio capture module]:' \ - '--really-quiet[Display even less output and status messages than with --quiet]' \ - '--referrer=[Specify a referrer path or URL for HTTP requests]:' \ - '--reset-on-next-file=[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]:' \ - '--rtsp-transport=[Select RTSP transport method (default\: tcp)]:' \ + '--quvi-format=[Video format/quality that is directly passed to libquvi]:quvi quality (default "best")' \ + $noadv'--radio=[These options set various parameters of the radio capture module]:' \ + $noadv'--really-quiet[Display even less output and status messages than with --quiet]' \ + $noadv'--referrer=[Specify a referrer path or URL for HTTP requests]:' \ + $noadv'--reset-on-next-file=[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]:' \ + $noadv'--rtsp-transport=[Select RTSP transport method]:transport method (default tcp):( lavf udp tcp http )' \ '--saturation=[Adjust the saturation of the video signal (default\: 0)]:' \ - '--save-position-on-quit[Always save the current playback position on quit]' \ - '--sb=[Seek to byte position]:position (bytes)' \ + $noadv'--save-position-on-quit[Always save the current playback position on quit]' \ + $noadv'--sb=[Seek to byte position]:position (bytes)' \ '--screen=[Screen to use in multi-monitor config]:' \ - '--screenshot-format=[Set the image file type used for saving screenshots]:format (default jpg)' \ - '--screenshot-jpeg-quality=[Set the JPEG quality level]:jpeg quality level' \ - '--screenshot-png-compression=[Set the PNG compression level]:png compression level' \ - '--screenshot-png-filter=[Set the filter applied prior to PNG compression]:png filter' \ - '--screenshot-template=[Specify the filename template used to save screenshots]:screenshot filename template' \ - '--screenh=[Specify screen width or height]:screen height (pixels)' \ - '--screenw=[Specify screen width or height]:screen width (pixels)' \ + $noadv'--screenshot-format=[Set the image file type used for saving screenshots]:format (default jpg)' \ + $noadv'--screenshot-jpeg-quality=[Set the JPEG quality level]:jpeg quality level' \ + $noadv'--screenshot-png-compression=[Set the PNG compression level]:png compression level' \ + $noadv'--screenshot-png-filter=[Set the filter applied prior to PNG compression]:png filter' \ + $noadv'--screenshot-template=[Specify the filename template used to save screenshots]:screenshot filename template' \ + $noadv'--screenh=[Specify screen width or height]:screen height (pixels)' \ + $noadv'--screenw=[Specify screen width or height]:screen width (pixels)' \ '(*)--show-profile=[Show the description and content of a profile]::->profiles' \ '--shuffle[Play files in random order]' \ '--sid=[Display the subtitle stream specified by ]:subtitle stream id' \ '--slang=[Specify a priority list of subtitle languages to use]:subtitle languages' \ - '--slave-broken[Switches on the old slave mode]' \ - '--softsleep[Time frames by repeatedly checking the current time instead of asking the kernel to wake up mpv at the correct time]' \ - '--softvol=[Control whether to use the volume controls of the audio output driver or the internal mpv volume filter]:' \ - '--softvol-max=[Set the maximum amplification level in percent]:maximum volume level (default 200)' \ + $noadv'--slave-broken[Switches on the old slave mode]' \ + $noadv'--softsleep[Time frames by repeatedly checking the current time instead of asking the kernel to wake up mpv at the correct time]' \ + $noadv'--softvol=[Control whether to use the volume controls of the audio output driver or the internal mpv volume filter]:' \ + $noadv'--softvol-max=[Set the maximum amplification level in percent]:maximum volume level (default 200)' \ '--speed=[Slow down or speed up playback by the factor given as parameter]:speed factor (default 1.0)' \ - '--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:output sample rate' \ + $noadv'--srate=[Select the output sample rate to be used (of course sound cards have limits on this)]:output sample rate' \ '--start=[Seek to given time position]:time position (percent, seconds, or hh:mm:ss)' \ - '--ssf=[Specifies software scaler parameters]:software scaler parameters' \ - '--sstep=[Skip specified number of seconds after every frame]:skip step (seconds)' \ - '--stop-screensaver[Turns off the screensaver at startup and turns it on again on exit]' \ + $noadv'--ssf=[Specifies software scaler parameters]:software scaler parameters' \ + $noadv'--sstep=[Skip specified number of seconds after every frame]:skip step (seconds)' \ + $noadv'--stop-screensaver[Turns off the screensaver at startup and turns it on again on exit]' \ '--sub=[Use/display these subtitle files]:subtitle file:_files' \ - '--subcp=[If your system supports iconv(3), you can use this option to specify the subtitle codepage]:subtitle codepage' \ - '--subfps=[Specify the framerate of the subtitle file (default\: movie fps)]:subtitle framerate' \ - '--sws=[Specify the software scaler algorithm to be used with --vf=scale]:software scaler algorithm' \ - '--term-osd[Display OSD messages on the console when no video output is available]' \ - '!--term-osd-esc=[Specify the escape sequence to use before writing an OSD message on the console]:osd escape sequence' \ - '--title=[Set the window title]:window title' \ - '--tls-ca-file=[Certificate authority database file for use with TLS]:ca file:_files' \ - '--tls-verify[Verify peer certificates when using TLS]' \ - '--tv=[This option tunes various properties of the TV capture module]:tv tuner options' \ - '--tvscan=[Tune the TV channel scanner]:tv channel' \ - '--use-filedir-conf[Look for a file-specific configuration file in the same directory as the file that is being played]' \ - '--user-agent=[Use as user agent for HTTP streaming]:user agent (string)' \ - '--vd=[Specify a priority list of video decoders to be used]:video decoders:->video-decoders' \ + $noadv'--subcp=[If your system supports iconv(3), you can use this option to specify the subtitle codepage]:subtitle codepage' \ + $noadv'--subfps=[Specify the framerate of the subtitle file (default\: movie fps)]:subtitle framerate' \ + $noadv'--sws=[Specify the software scaler algorithm to be used with --vf=scale]:software scaler algorithm' \ + $noadv'--term-osd[Display OSD messages on the console when no video output is available]' \ + $noadv'--term-osd-esc=[Specify the escape sequence to use before writing an OSD message on the console]:osd escape sequence' \ + $noadv'--title=[Set the window title]:window title' \ + $noadv'--tls-ca-file=[Certificate authority database file for use with TLS]:ca file:_files' \ + $noadv'--tls-verify[Verify peer certificates when using TLS]' \ + $noadv'--tv=[This option tunes various properties of the TV capture module]:tv tuner options' \ + $noadv'--tvscan=[Tune the TV channel scanner]:tv channel' \ + $noadv'--use-filedir-conf[Look for a file-specific configuration file in the same directory as the file that is being played]' \ + $noadv'--user-agent=[Use as user agent for HTTP streaming]:user agent (string)' \ + $noadv'--vd=[Specify a priority list of video decoders to be used]:video decoders:->video-decoders' \ '(*)--version[Print version string and exit]' \ '--vf=[Specify a list of video filters to apply to the video stream]:video filters:->video-filters' \ '--vid=[Select video channel]:video channel' \ '--vo=[Specify a priority list of video output drivers to be used]:video drivers:->video-drivers' \ - '--volstep=[Set the step size of mixer volume changes in percent of the full range]:volume step size (default 3)' \ + $noadv'--volstep=[Set the step size of mixer volume changes in percent of the full range]:volume step size (default 3)' \ '--volume=[Set the startup volume]:volume' \ '!--volume-restore-data=[Used internally for use by playback resume]:' \ - '--wid=[(X11 and Windows only) to attach existing window]:window' \ + $noadv'--wid=[(X11 and Windows only) to attach existing window]:window' \ '*:video file:->mfiles' && ret=0 case "$state" in From fc1249fc78ca0354a57a75b315cf96df864d8289 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 19:29:31 +0100 Subject: [PATCH 7/8] _mpv: add credit notice --- src/_mpv | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/_mpv b/src/_mpv index 9e9ab83..5e7d2c6 100644 --- a/src/_mpv +++ b/src/_mpv @@ -1,4 +1,17 @@ #compdef mpv +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for mpv 0.2.3 (http://mpv.io) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Valodim +# +# ------------------------------------------------------------------------------ local suf ret=1 curcontext="$curcontext" local -a vals state line expl From cb059a45ae202700f55b42e7e93812f87dc3e1c8 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Thu, 14 Nov 2013 19:33:13 +0100 Subject: [PATCH 8/8] _mpv: simple parsing for complex parameters --- src/_mpv | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/_mpv b/src/_mpv index 5e7d2c6..1c5a340 100644 --- a/src/_mpv +++ b/src/_mpv @@ -408,34 +408,44 @@ else done ;; audio-drivers) + compset -P '*,' _message "format: " vals=( help ${${${(f)"$(_call_program audio-drivers $words[1] --ao=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) _describe -t audio-drivers 'audio drivers' vals -S '' && ret=0 ;; audio-decoders) + compset -P '*,' + compset -P '(+|-)' + _message "format: <[+|-]family1:(*|decoder1),[+|-]family2:(*|decoder2),...[-]>" vals=( help ${${${${(f)"$(_call_program audio-decoders $words[1] --ad=help 2>/dev/null)"}[(r) *,-1]## #}/:/\\:}/ - /:} ) _describe -t audio-decoders 'audio decoders' vals -S '' && ret=0 ;; audio-filters) + compset -P '*,' _message "format: " vals=( help ${${${(f)"$(_call_program audio-filters $words[1] --af=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) _describe -t audio-filters 'audio filters' vals -S '' && ret=0 ;; video-drivers) + compset -P '*,' _message "format: " vals=( help ${${${(f)"$(_call_program video-drivers $words[1] --vo=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) _describe -t video-drivers 'video drivers' vals -S '' && ret=0 ;; video-decoders) + compset -P '*,' + compset -P '(+|-)' + _message "format: <[+|-]family1:(*|decoder1),[+|-]family2:(*|decoder2),...[-]>" vals=( help ${${${${(f)"$(_call_program video-decoders $words[1] --vd=help 2>/dev/null)"}[(r) *,-1]## #}/:/\\:}/ - /:} ) _describe -t video-decoders 'video decoders' vals -S '' && ret=0 ;; video-filters) + compset -P '*,' _message "format: " vals=( help ${${${(f)"$(_call_program video-filters $words[1] --vf=help 2>/dev/null)"}[(r) *,-1]## #}/ #:/:} ) _describe -t video-filters 'video filters' vals -S '' && ret=0