From 3e8c51b898eb9cc888a156cb9678ec4c1478cc8d Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 22 May 2026 06:40:27 +0200 Subject: 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. --- transcode.sh.bash-completion | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'transcode.sh.bash-completion') 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 '=' -- cgit v1.3.1