From fe6fb23f43e0cec36f0a30912e9fefe8543c6908 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Fri, 4 Sep 2020 13:43:26 -0500 Subject: [PATCH] [ffmpeg] Add -f formats completions [ci skip] --- share/completions/ffmpeg.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/completions/ffmpeg.fish b/share/completions/ffmpeg.fish index 33d1e491a..f5b7721d1 100644 --- a/share/completions/ffmpeg.fish +++ b/share/completions/ffmpeg.fish @@ -118,6 +118,11 @@ function __fish_ffmpeg_profile end end +function __fish_ffmpeg_formats + # TODO: Use heuristic to determine input vs output format and filter accordingly + ffmpeg -hide_banner -loglevel quiet -formats | string replace -rf '^ [DE.]{2} ([a-z0-9_]+) +(\S.+)$' '$1\t$2' +end + complete -c ffmpeg -s i -d "Specify input file" # Print help / information / capabilities @@ -159,7 +164,7 @@ complete -c ffmpeg -o bits_per_raw_sample -d "Set the number of bits per raw sam 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 f -d "Force format" -xa "(__fish_ffmpeg_formats)" complete -c ffmpeg -s c -o codec -d "Codec 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"