From 4b5967b1fde15f0d7d677274f1ae353915e6854b Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 8 May 2026 22:16:51 +0200 Subject: feat(core): expose frame-rate variables to presets Add input_frame_rate, input_fps, and output_gop_size to the set of variables available to preset files at source time. input_frame_rate is the raw ffprobe fraction (e.g. 30000/1001). input_fps rounds that fraction to the nearest integer via awk. output_gop_size is derived as roughly five seconds of video (input_fps * 5), capped at 300 frames. The ffprobe invocation is extended to request r_frame_rate alongside the existing codec_name and pix_fmt entries; a missing frame rate is now treated as a hard error. Dry-run and verbose output are updated to display the new values. Documentation (header comment, --help text, man page, README) is updated accordingly. --- transcode.sh.1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'transcode.sh.1') diff --git a/transcode.sh.1 b/transcode.sh.1 index 8fe1e90..9a4c894 100644 --- a/transcode.sh.1 +++ b/transcode.sh.1 @@ -195,6 +195,32 @@ normalisation (e.g.\& 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). +.TP +.B input_frame_rate +The raw frame rate of the input video stream as reported by +.BR ffprobe (1), +expressed as a fraction (e.g.\& +.IR 30000/1001 , +.IR 25/1 , +.IR 60/1 ). +.TP +.B input_fps +The input frame rate rounded to the nearest integer (e.g.\& +.IR 30 , +.IR 25 , +.IR 60 ). +Derived from +.B input_frame_rate +and provided as a convenience for encoder heuristics that require a whole +number. +.TP +.B output_gop_size +The recommended GOP (Group of Pictures) size for the output, derived from +.B input_fps +as approximately five seconds of video (capped at 300 frames). +Use this in presets to set +.B \-g +for encoders that accept an explicit GOP size. .RE .IP Before the preset's -- cgit v1.3.1