aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2026-02-24 21:08:38 +0100
committerDennis Fink2026-02-24 21:08:38 +0100
commit7c302ecee9bdb7a53b2fc03d9d63693996566010 (patch)
treeb37a58d3af98945bb503b5b7334a5e40a7727a5f
parent92d0073aede629aae79bf34aab0011d55eba34ec (diff)
downloadtranscode.sh-7c302ecee9bdb7a53b2fc03d9d63693996566010.tar.gz
transcode.sh-7c302ecee9bdb7a53b2fc03d9d63693996566010.zip
docs: document all variables available to presets
Previously only output_pixel_format was mentioned. All three variables (input_codec, input_pixel_format, output_pixel_format) are now listed with descriptions in the script header comment, the README, and the man page.
-rw-r--r--README.md9
-rwxr-xr-xtranscode.sh6
-rw-r--r--transcode.sh.124
3 files changed, 34 insertions, 5 deletions
diff --git a/README.md b/README.md
index 4001672..64dd6c0 100644
--- a/README.md
+++ b/README.md
@@ -77,8 +77,13 @@ ${XDG_CONFIG_HOME:-$HOME/.config}/transcode.sh/presets/<name>.sh
```
Each preset is sourced as Bash and must define an array named `ffargs`.
-The variable `output_pixel_format` is available and contains the
-automatically selected pixel format (derived from the input file).
+The following variables are available to presets at source time:
+
+| Variable | Description |
+|----------|-------------|
+| `input_codec` | Video codec of the input file (e.g. `h264`, `hevc`) |
+| `input_pixel_format` | Pixel format of the input after `yuvj*` normalisation (e.g. `yuv420p`) |
+| `output_pixel_format` | Recommended output pixel format, derived from the input to preserve chroma subsampling and bit depth |
Before the preset's `ffargs` are appended, the script always passes
these base arguments to `ffmpeg`:
diff --git a/transcode.sh b/transcode.sh
index 0d2e841..1067bc0 100755
--- a/transcode.sh
+++ b/transcode.sh
@@ -15,6 +15,12 @@
# for example:
# ffargs=( -c:v:0 libsvtav1 -crf 30 -preset 6 -pix_fmt "$output_pixel_format" )
#
+# The following variables are available to presets at source time:
+# input_codec - video codec of the input file (e.g. h264, hevc)
+# input_pixel_format - pixel format after yuvj* normalisation (e.g. yuv420p)
+# output_pixel_format - recommended output pixel format, derived from the
+# input to preserve chroma subsampling and bit depth
+#
# Note: Presets are sourced as shell code. Only use trusted presets.
#
# A per-user list of video-codecs to skip can be provided in:
diff --git a/transcode.sh.1 b/transcode.sh.1
index fe38c21..a22b802 100644
--- a/transcode.sh.1
+++ b/transcode.sh.1
@@ -153,10 +153,28 @@ array variable named
.B ffargs
containing additional arguments for
.BR ffmpeg (1).
-The variable
+The following variables are available to presets at source time:
+.RS
+.TP
+.B input_codec
+The video codec of the input file as reported by
+.BR ffprobe (1)
+(e.g.\&
+.IR h264 ,
+.IR hevc ).
+.TP
+.B input_pixel_format
+The pixel format of the input file after
+.I yuvj*
+normalisation (e.g.\&
+.IR yuv420p ,
+.IR yuv444p10le ).
+.TP
.B output_pixel_format
-is available to presets and contains the automatically selected output
-pixel format string.
+The recommended output pixel format, automatically derived from the
+input to preserve chroma subsampling (4:2:0, 4:2:2, 4:4:4) and bit
+depth (8, 10, 12, 16\-bit).
+.RE
.IP
Before the preset's
.B ffargs