summaryrefslogtreecommitdiff
path: root/transcode.sh.1
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.1
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 'transcode.sh.1')
-rw-r--r--transcode.sh.154
1 files changed, 47 insertions, 7 deletions
diff --git a/transcode.sh.1 b/transcode.sh.1
index bc3639c..e0b7f3c 100644
--- a/transcode.sh.1
+++ b/transcode.sh.1
@@ -24,9 +24,13 @@ containing the extra arguments passed to
.PP
The script probes every input file with
.BR ffprobe (1)
-to detect the input video codec and pixel format. Files whose codec
-appears in the skip list are silently skipped. The output pixel format
-is derived automatically so that chroma subsampling (4:2:0, 4:2:2,
+to detect the input video codec, pixel format and frame rate of the selected
+video probe stream. The selected stream defaults to
+.B v:0
+and can be changed with
+.BR \-\-video\-stream .
+Files whose codec appears in the skip list are silently skipped. The output
+pixel format is derived automatically so that chroma subsampling (4:2:0, 4:2:2,
4:4:4) and bit depth (8, 10, 12, 16\-bit) are preserved.
.PP
All streams, metadata and chapter markers from the input are retained by
@@ -84,7 +88,8 @@ Print what would be done without actually invoking
.BR ffmpeg (1).
Combine with
.B \-v
-to see the detected codec and pixel format information.
+to see the selected video stream and detected codec, pixel format and frame
+rate information.
.TP
.BR \-\-backup\-dir " \fIDIR\fR, " \-\-backup\-dir= \fIDIR\fR
Copy originals to \fIDIR\fR before replacing them after successful encoding.
@@ -123,6 +128,17 @@ to
Use this on hosts where hardware acceleration causes compatibility or
stability issues.
.TP
+.BR \-\-video\-stream " \fISTREAM_SELECTOR\fR, " \-\-video\-stream= \fISTREAM_SELECTOR\fR
+Select the input video stream that is probed for preset helper variables.
+Defaults to
+.BR v:0 .
+The selector must be a conservative video stream selector such as
+.B v:0
+or
+.BR v:1 .
+This option does not change ffmpeg stream mapping; presets remain responsible
+for selecting which stream to encode.
+.TP
.BR \-N " \fIVALUE\fR, " \-\-nice " \fIVALUE\fR, " \-\-nice= \fIVALUE\fR
Run
.BR ffmpeg (1)
@@ -195,8 +211,8 @@ Suppress all normal output. Takes precedence over
.BR \-v / \-\-verbose .
.TP
.BR \-v ", " \-\-verbose
-Emit additional informational messages (detected codec, pixel format,
-etc.).
+Emit additional informational messages, including the selected video stream and
+detected codec, pixel format and frame rate.
.TP
.B \-\-version
Print version, author and license information and exit.
@@ -294,7 +310,15 @@ array variable named
.B ffargs
containing additional arguments for
.BR ffmpeg (1).
-The following variables are available to presets at source time:
+These variables are derived from the selected video probe stream, which
+defaults to
+.B v:0
+and can be changed with
+.BR \-\-video\-stream
+or
+.B [encoding] video_stream
+in
+.BR config.toml .
.RS
.TP
.B input_codec
@@ -418,6 +442,14 @@ encoding and before replacement. Equivalent to
.BR \-\-backup\-dir .
CLI \fB--backup-dir\fR takes precedence.
.TP
+.B [encoding] video_stream
+String. Input video stream to probe for preset helper variables. Defaults to
+.BR v:0 .
+Equivalent to
+.BR \-\-video\-stream .
+Invalid configured values are ignored with a warning and the default is used.
+This setting does not change ffmpeg stream mapping in presets.
+.TP
.B [skip] codecs
Array of strings. Merged with any codecs from
.BR \-S
@@ -538,6 +570,14 @@ Load an alternative configuration file:
transcode.sh \-\-config\-file ~/profiles/fast.toml input.mp4
.fi
.RE
+.PP
+Probe the second video stream for preset helper variables:
+.PP
+.RS
+.nf
+transcode.sh \-\-video\-stream v:1 \-n \-v input.mkv
+.fi
+.RE
.SH SEE ALSO
.BR ffmpeg (1),
.BR ffprobe (1),