aboutsummaryrefslogtreecommitdiff
path: root/transcode.sh.bash-completion
diff options
context:
space:
mode:
authorDennis Fink2026-05-22 06:40:27 +0200
committerDennis Fink2026-05-22 06:40:27 +0200
commit3e8c51b898eb9cc888a156cb9678ec4c1478cc8d (patch)
tree1b4dad703aa8016e8a7bd593ae9003224607f709 /transcode.sh.bash-completion
parent7ad58bb0a120c56563f333bce142f9772ed00168 (diff)
downloadtranscode.sh-3e8c51b898eb9cc888a156cb9678ec4c1478cc8d.tar.gz
transcode.sh-3e8c51b898eb9cc888a156cb9678ec4c1478cc8d.zip
feat(streams): allow selecting video probe stream
Add --video-stream and [encoding].video_stream so users can choose which input video stream is probed for preset helper variables. Use the selected stream for codec, pixel format, frame rate, output pixel format, and GOP size metadata while leaving preset stream mapping unchanged. Validate CLI stream selectors strictly and ignore invalid config values with a warning so bad configuration falls back to the default v:0 stream. Document the new option in the README and man page, add verbose dry-run output, and provide bash completion for common video stream selectors. Closes #6.
Diffstat (limited to '')
-rw-r--r--transcode.sh.bash-completion12
1 files changed, 12 insertions, 0 deletions
diff --git a/transcode.sh.bash-completion b/transcode.sh.bash-completion
index 716995e..c980081 100644
--- a/transcode.sh.bash-completion
+++ b/transcode.sh.bash-completion
@@ -39,6 +39,7 @@ _transcode_sh() {
local nice_vals='0 5 10 15 19'
local hwaccel_methods='auto cuda vaapi dxva2 d3d11va videotoolbox qsv'
local ffmpeg_loglevels='quiet panic fatal error warning info verbose debug trace'
+ local video_streams='v:0 v:1 v:2 v:3'
# ---------------------------------------------------------------------------
# Handle --option=VALUE: cur contains the entire "--opt=val" token.
@@ -91,6 +92,11 @@ _transcode_sh() {
COMPREPLY=($(compgen -W "$ffmpeg_loglevels" -- "$cur"))
return
;;
+ --video-stream=*)
+ cur="${cur#*=}"
+ COMPREPLY=($(compgen -W "$video_streams" -- "$cur"))
+ return
+ ;;
esac
# ---------------------------------------------------------------------------
@@ -135,6 +141,10 @@ _transcode_sh() {
COMPREPLY=($(compgen -W "$ffmpeg_loglevels" -- "$cur"))
return
;;
+ --video-stream)
+ COMPREPLY=($(compgen -W "$video_streams" -- "$cur"))
+ return
+ ;;
esac
# ---------------------------------------------------------------------------
@@ -183,6 +193,8 @@ _transcode_sh() {
--verbose
--verify-output
--version
+ --video-stream
+ --video-stream=
'
COMPREPLY=($(compgen -W "$longopts" -- "$cur"))
# Suppress the trailing space when the only completion ends with '='