mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 09:03:37 +08:00
Add FFmpeg completions (#5922)
* Add FFmpeg completions * Fix to use builtin command
This commit is contained in:
parent
e921bd60c3
commit
e7b42615c8
130
share/completions/ffmpeg.fish
Normal file
130
share/completions/ffmpeg.fish
Normal file
|
@ -0,0 +1,130 @@
|
|||
function __fish_ffmpeg_help_type
|
||||
printf '%s\t%s\n' long "Print more options"
|
||||
printf '%s\t%s\n' full "Print all options"
|
||||
|
||||
for help_type in decoder encoder demuxer muxer filter
|
||||
set -l regex
|
||||
|
||||
if test $help_type = "filter"
|
||||
set regex '\S+\s+(\S+)\s+\S+\s+(\S+)'
|
||||
else
|
||||
set regex '\S+\s+(\S+)\s+(\S+)'
|
||||
end
|
||||
|
||||
printf '%s\n' $help_type=(ffmpeg -loglevel quiet -"$help_type"s | string trim | string match -rv '=|:$|^-' | string replace -rf "$regex" '$1\t$2')
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_ffmpeg_codec_list
|
||||
printf '%s\t%s\n' copy "Stream copy"
|
||||
|
||||
set -l identifier
|
||||
|
||||
switch $argv[1]
|
||||
case video
|
||||
set identifier '^V.*'
|
||||
case audio
|
||||
set identifier '^A.*'
|
||||
case subtitle
|
||||
set identifier '^S.*'
|
||||
case '*'
|
||||
return 1
|
||||
end
|
||||
|
||||
printf '%s\n' (ffmpeg -loglevel quiet -decoders | string trim | string match -rv '=|:$|^-' | string match -r "$identifier" | string replace -rf '\S+\s+(\S+)\s+(\S+)' '$1\t$2')
|
||||
end
|
||||
|
||||
complete -c ffmpeg -s i -d "Specify input file"
|
||||
|
||||
# Print help / information / capabilities
|
||||
complete -c ffmpeg -s L -d "Show license"
|
||||
complete -x -c ffmpeg -s h -s "?" -o help -l help -a "(__fish_ffmpeg_help_type)" -d "Show help"
|
||||
complete -c ffmpeg -o version -d "Show version"
|
||||
complete -c ffmpeg -o buildconf -d "Show build configuration"
|
||||
complete -c ffmpeg -o formats -d "Show available formats"
|
||||
complete -c ffmpeg -o muxers -d "Show available muxers"
|
||||
complete -c ffmpeg -o demuxers -d "Show available demuxers"
|
||||
complete -c ffmpeg -o devices -d "Show available devices"
|
||||
complete -c ffmpeg -o codecs -d "Show available codecs"
|
||||
complete -c ffmpeg -o decoders -d "Show available decoders"
|
||||
complete -c ffmpeg -o encoders -d "Show available encoders"
|
||||
complete -c ffmpeg -o bsfs -d "Show available bit stream filters"
|
||||
complete -c ffmpeg -o protocols -d "Show available protocols"
|
||||
complete -c ffmpeg -o filters -d "Show available filters"
|
||||
complete -c ffmpeg -o pix_fmts -d "Show available pixel formats"
|
||||
complete -c ffmpeg -o layouts -d "Show standard channel layouts"
|
||||
complete -c ffmpeg -o sample_fmts -d "Show available audio sample formats"
|
||||
complete -c ffmpeg -o colors -d "Show available color names"
|
||||
complete -c ffmpeg -o sources -d "List sources of the input device"
|
||||
complete -c ffmpeg -o sinks -d "List sinks of the output device"
|
||||
complete -c ffmpeg -o hwaccels -d "Show available HW acceleration methods"
|
||||
|
||||
# Global options
|
||||
complete -x -c ffmpeg -o loglevel -s v -a "quiet panic fatal error warning info verbose debug trace" -d "Set logging level"
|
||||
complete -c ffmpeg -o report -d "Generate a report"
|
||||
complete -c ffmpeg -o max_alloc -d "Set maximum size of a single allocated block"
|
||||
complete -c ffmpeg -s y -d "Overwrite output files"
|
||||
complete -c ffmpeg -s n -d "Never overwrite output files"
|
||||
complete -c ffmpeg -o ignore_unknown -d "Ignore unknown stream types"
|
||||
complete -c ffmpeg -o filter_threads -d "Number of non-complex filter threads"
|
||||
complete -c ffmpeg -o filter_complex_threads -d "Number of threads for -filter_complex"
|
||||
complete -c ffmpeg -o stats -d "Print progress report during encoding"
|
||||
complete -c ffmpeg -o max_error_rate -d "Ratio of errors"
|
||||
complete -c ffmpeg -o bits_per_raw_sample -d "Set the number of bits per raw sample"
|
||||
complete -c ffmpeg -o vol -d "Change audio volume"
|
||||
|
||||
# Per-file main options
|
||||
complete -c ffmpeg -s f -d "Force format"
|
||||
complete -c ffmpeg -s c -o codec -d "Codec name"
|
||||
complete -c ffmpeg -o pre -d "Preset name"
|
||||
complete -c ffmpeg -o map_metadata -d "Set metadata information of outfile from infile"
|
||||
complete -c ffmpeg -s t -d "Record or transcode \"duration\" seconds of audio/video"
|
||||
complete -c ffmpeg -o to -d "Record or transcode stop time"
|
||||
complete -c ffmpeg -o fs -d "Set the limit file size in bytes"
|
||||
complete -c ffmpeg -o ss -d "Set the start time offset"
|
||||
complete -c ffmpeg -o seek_timestamp -d "Enable/disable seeking by timestamp with -ss"
|
||||
complete -c ffmpeg -o timestamp -d "Set the recording timestamp"
|
||||
complete -c ffmpeg -o metadata -d "Add metadata"
|
||||
complete -c ffmpeg -o program -d "Add program with specified streams"
|
||||
complete -x -c ffmpeg -o target -a '(for target in vcd svcd dvd dv dv50 ; echo "$target" ; echo pal-"$target" ; echo ntsc-"$target" ; echo film-"$target" ; end)' -d "Specify target file type"
|
||||
complete -c ffmpeg -o apad -d "Audio pad"
|
||||
complete -c ffmpeg -o frames -d "Set the number of frames to output"
|
||||
complete -c ffmpeg -o filter -d "Set stream filtergraph"
|
||||
complete -c ffmpeg -o filter_script -d "Read stream filtergraph description from a file"
|
||||
complete -c ffmpeg -o reinit_filter -d "Reinit filtergraph on input parameter changes"
|
||||
complete -c ffmpeg -o discard -d "Discard"
|
||||
complete -c ffmpeg -o disposition -d "Disposition"
|
||||
|
||||
# Video options
|
||||
complete -c ffmpeg -o vframes -d "Set the number of video frames to output"
|
||||
complete -c ffmpeg -s r -d "Set frame rate"
|
||||
complete -c ffmpeg -s s -d "Set frame size"
|
||||
complete -c ffmpeg -o aspect -d "Set aspect ratio"
|
||||
complete -c ffmpeg -o bits_per_raw_sample -d "Set the number of bits per raw sample"
|
||||
complete -c ffmpeg -o vn -d "Disable video"
|
||||
complete -x -c ffmpeg -o vcodec -o "codec:v" -o "c:v" -a "(__fish_ffmpeg_codec_list video)" -d "Set video codec"
|
||||
complete -c ffmpeg -o timecode -d "Set initial TimeCode value"
|
||||
complete -x -c ffmpeg -o pass -a "1 2 3" -d "Select the pass number"
|
||||
complete -c ffmpeg -o vf -d "Set video filters"
|
||||
complete -c ffmpeg -o ab -o "b:a" -d "Audio bitrate"
|
||||
complete -c ffmpeg -s b -o "b:v" -d "Video bitrate"
|
||||
complete -c ffmpeg -o dn -d "Disable data"
|
||||
|
||||
# Audio options
|
||||
complete -c ffmpeg -o aframes -d "Set the number of audio frames to output"
|
||||
complete -c ffmpeg -o aq -d "Set audio quality"
|
||||
complete -c ffmpeg -o ar -d "Set audio sampling rate"
|
||||
complete -c ffmpeg -o ac -d "Set number of audio channels"
|
||||
complete -c ffmpeg -o an -d "Disable audio"
|
||||
complete -x -c ffmpeg -o acodec -o "codec:a" -o "c:a" -a "(__fish_ffmpeg_codec_list audio)" -d "Set audio codec"
|
||||
complete -c ffmpeg -o vol -d "Change audio volume"
|
||||
complete -c ffmpeg -o af -d "Set audio filters"
|
||||
|
||||
# Subtitle options
|
||||
complete -c ffmpeg -s s -d "Set frame size"
|
||||
complete -c ffmpeg -o sn -d "Disable subtitle"
|
||||
complete -x -c ffmpeg -o scodec -o "codec:s" -o "c:s" -a "(__fish_ffmpeg_codec_list subtitle)" -d "Set subtitle codec"
|
||||
complete -c ffmpeg -o stag -d "Force subtitle tag/fourcc"
|
||||
complete -c ffmpeg -o fix_sub_duration -d "Fix subtitles duration"
|
||||
complete -c ffmpeg -o canvas_size -d "Set canvas size"
|
||||
complete -c ffmpeg -o spre -d "Set the subtitle options to the indicated preset"
|
66
share/completions/ffplay.fish
Normal file
66
share/completions/ffplay.fish
Normal file
|
@ -0,0 +1,66 @@
|
|||
function __fish_ffplay_help_type
|
||||
printf '%s\t%s\n' long "Print more options"
|
||||
printf '%s\t%s\n' full "Print all options"
|
||||
|
||||
for help_type in decoder encoder demuxer muxer filter
|
||||
set -l regex
|
||||
|
||||
if test $help_type = "filter"
|
||||
set regex '\S+\s+(\S+)\s+\S+\s+(\S+)'
|
||||
else
|
||||
set regex '\S+\s+(\S+)\s+(\S+)'
|
||||
end
|
||||
|
||||
printf '%s\n' $help_type=(ffplay -loglevel quiet -"$help_type"s | string trim | string match -rv '=|:$|^-' | string replace -rf "$regex" '$1\t$2')
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_ffplay_codec_list
|
||||
printf '%s\t%s\n' copy "Stream copy"
|
||||
printf '%s\n' (ffplay -loglevel quiet -decoders | string trim | string match -rv '=|:$|^-' | string replace -rf '\S+\s+(\S+)\s+(\S+)' '$1\t$2')
|
||||
end
|
||||
|
||||
# Main options
|
||||
complete -c ffplay -s L -d "Show license"
|
||||
complete -x -c ffplay -s h -s "?" -o help -l help -a "(__fish_ffplay_help_type)" -d "Show help"
|
||||
complete -c ffplay -o version -d "Show version"
|
||||
complete -c ffplay -o buildconf -d "Show build configuration"
|
||||
complete -c ffplay -o formats -d "Show available formats"
|
||||
complete -c ffplay -o muxers -d "Show available muxers"
|
||||
complete -c ffplay -o demuxers -d "Show available demuxers"
|
||||
complete -c ffplay -o devices -d "Show available devices"
|
||||
complete -c ffplay -o codecs -d "Show available codecs"
|
||||
complete -c ffplay -o decoders -d "Show available decoders"
|
||||
complete -c ffplay -o encoders -d "Show available encoders"
|
||||
complete -c ffplay -o bsfs -d "Show available bit stream filters"
|
||||
complete -c ffplay -o protocols -d "Show available protocols"
|
||||
complete -c ffplay -o filters -d "Show available filters"
|
||||
complete -c ffplay -o pix_fmts -d "Show available pixel formats"
|
||||
complete -c ffplay -o layouts -d "Show standard channel layouts"
|
||||
complete -c ffplay -o sample_fmts -d "Show available audio sample formats"
|
||||
complete -c ffplay -o colors -d "Show available color names"
|
||||
complete -x -c ffplay -o loglevel -s v -a "quiet panic fatal error warning info verbose debug trace" -d "Set logging level"
|
||||
complete -c ffplay -o report -d "Generate a report"
|
||||
complete -c ffplay -o max_alloc -d "Set maximum size of a single allocated block"
|
||||
complete -c ffplay -o sources -d "List sources of the input device"
|
||||
complete -c ffplay -o sinks -d "List sinks of the output device"
|
||||
complete -c ffplay -s x -d "Force displayed width"
|
||||
complete -c ffplay -s y -d "Force displayed height"
|
||||
complete -c ffplay -s s -d "Set frame size"
|
||||
complete -c ffplay -o fs -d "Force full screen"
|
||||
complete -c ffplay -o an -d "Disable audio"
|
||||
complete -c ffplay -o vn -d "Disable video"
|
||||
complete -c ffplay -o sn -d "Disable subtitle"
|
||||
complete -c ffplay -o ss -d "Seek to a given position in seconds"
|
||||
complete -c ffplay -s t -d "Play "duration" seconds of audio/video"
|
||||
complete -x -c ffplay -o bytes -a "(printf '%s\t%s\n' 0 off ; printf '%s\t%s\n' 1 on ; printf '%s\t%s\n' -1 auto)" -d "Seek by bytes"
|
||||
complete -c ffplay -o nodisp -d "Disable graphical display"
|
||||
complete -c ffplay -o noborder -d "Borderless window"
|
||||
complete -c ffplay -o volume -d "Set startup volume"
|
||||
complete -c ffplay -s f -d "Force format"
|
||||
complete -c ffplay -o window_title -d "Set window title"
|
||||
complete -c ffplay -o af -d "Set audio filters"
|
||||
complete -x -c ffplay -o showmode -a "(printf '%s\t%s\n' 0 video ; printf '%s\t%s\n' 1 waves ; printf '%s\t%s\n' 2 RDFT)" -d "Select show mode"
|
||||
complete -c ffplay -s i -d "Read specified file"
|
||||
complete -x -c ffplay -o codec -a "(__fish_ffplay_codec_list)" -d "Force decoder"
|
||||
complete -c ffplay -o autorotate -d "Automatically rotate video"
|
78
share/completions/ffprobe.fish
Normal file
78
share/completions/ffprobe.fish
Normal file
|
@ -0,0 +1,78 @@
|
|||
function __fish_ffprobe_help_type
|
||||
printf '%s\t%s\n' long "Print more options"
|
||||
printf '%s\t%s\n' full "Print all options"
|
||||
|
||||
for help_type in decoder encoder demuxer muxer filter
|
||||
set -l regex
|
||||
|
||||
if test $help_type = "filter"
|
||||
set regex '\S+\s+(\S+)\s+\S+\s+(\S+)'
|
||||
else
|
||||
set regex '\S+\s+(\S+)\s+(\S+)'
|
||||
end
|
||||
|
||||
printf '%s\n' $help_type=(ffprobe -loglevel quiet -"$help_type"s | string trim | string match -rv '=|:$|^-' | string replace -rf "$regex" '$1\t$2')
|
||||
end
|
||||
end
|
||||
|
||||
# Main options
|
||||
complete -c ffprobe -s L -d "Show license"
|
||||
complete -x -c ffprobe -s h -s "?" -o help -l help -a "(__fish_ffprobe_help_type)" -d "Show help"
|
||||
complete -c ffprobe -o version -d "Show version"
|
||||
complete -c ffprobe -o buildconf -d "Show build configuration"
|
||||
complete -c ffprobe -o formats -d "Show available formats"
|
||||
complete -c ffprobe -o muxers -d "Show available muxers"
|
||||
complete -c ffprobe -o demuxers -d "Show available demuxers"
|
||||
complete -c ffprobe -o devices -d "Show available devices"
|
||||
complete -c ffprobe -o codecs -d "Show available codecs"
|
||||
complete -c ffprobe -o decoders -d "Show available decoders"
|
||||
complete -c ffprobe -o encoders -d "Show available encoders"
|
||||
complete -c ffprobe -o bsfs -d "Show available bit stream filters"
|
||||
complete -c ffprobe -o protocols -d "Show available protocols"
|
||||
complete -c ffprobe -o filters -d "Show available filters"
|
||||
complete -c ffprobe -o pix_fmts -d "Show available pixel formats"
|
||||
complete -c ffprobe -o layouts -d "Show standard channel layouts"
|
||||
complete -c ffprobe -o sample_fmts -d "Show available audio sample formats"
|
||||
complete -c ffprobe -o colors -d "Show available color names"
|
||||
complete -x -c ffprobe -o loglevel -s v -a "quiet panic fatal error warning info verbose debug trace" -d "Set logging level"
|
||||
complete -c ffprobe -o report -d "Generate a report"
|
||||
complete -c ffprobe -o max_alloc -d "Set maximum size of a single allocated block"
|
||||
complete -c ffprobe -o cpuflags -d "Force specific cpu flags"
|
||||
complete -c ffprobe -o hide_banner -d "Do not show program banner"
|
||||
complete -c ffprobe -o sources -d "List sources of the input device"
|
||||
complete -c ffprobe -o sinks -d "List sinks of the output device"
|
||||
complete -c ffprobe -s f -d "Force format"
|
||||
complete -c ffprobe -o unit -d "Show unit of the displayed values"
|
||||
complete -c ffprobe -o prefix -d "Use SI prefixes for the displayed values"
|
||||
complete -c ffprobe -o byte_binary_prefix -d "Use binary prefixes for byte units"
|
||||
complete -c ffprobe -o sexagesimal -d "Use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units"
|
||||
complete -c ffprobe -o pretty -d "Prettify the format of displayed values, make it more human readable"
|
||||
complete -x -c ffprobe -o print_format -a "default compact csv flat ini json xml" -d "Set the output printing format"
|
||||
complete -x -c ffprobe -o of -a "default compact csv flat ini json xml" -d "Alias for -print_format"
|
||||
complete -c ffprobe -o select_streams -d "Select the specified streams"
|
||||
complete -c ffprobe -o sections -d "Print sections structure and section information, and exit"
|
||||
complete -c ffprobe -o show_data -d "Show packets data"
|
||||
complete -c ffprobe -o show_data_hash -d "Show packets data hash"
|
||||
complete -c ffprobe -o show_error -d "Show probing error"
|
||||
complete -c ffprobe -o show_format -d "Show format/container info"
|
||||
complete -c ffprobe -o show_frames -d "Show frames info"
|
||||
complete -c ffprobe -o show_format_entry -d "Show a particular entry from the format/container info"
|
||||
complete -c ffprobe -o show_entries -d "Show a set of specified entries"
|
||||
complete -c ffprobe -o show_log -d "Show log"
|
||||
complete -c ffprobe -o show_packets -d "Show packets info"
|
||||
complete -c ffprobe -o show_programs -d "Show programs info"
|
||||
complete -c ffprobe -o show_stream -d "Show streams info"
|
||||
complete -c ffprobe -o show_chapters -d "Show chapters info"
|
||||
complete -c ffprobe -o count_frames -d "Count the number of frames per stream"
|
||||
complete -c ffprobe -o count_packets -d "Count the number of packets per stream"
|
||||
complete -c ffprobe -o show_program_version -d "Show ffprobe version"
|
||||
complete -c ffprobe -o show_library_versions -d "Show library versions"
|
||||
complete -c ffprobe -o show_versions -d "Show program and library versions"
|
||||
complete -c ffprobe -o show_pixel_formats -d "Show pixel format descriptions"
|
||||
complete -c ffprobe -o show_private_data -d "Show private data"
|
||||
complete -c ffprobe -o private -d "Same as show_private_data"
|
||||
complete -c ffprobe -o bitexact -d "Force bitexact output"
|
||||
complete -c ffprobe -o read_intervals -d "Set read intervals"
|
||||
complete -c ffprobe -o default -d "Generic catch all option"
|
||||
complete -c ffprobe -s i -d "Read specified file"
|
||||
complete -c ffprobe -o find_stream_info -d "Read and decode the streams to fill missing information with heuristics"
|
Loading…
Reference in New Issue
Block a user