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. --- README.md | 3 +++ 1 file changed, 3 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index bc9945d..95ffb9b 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,9 @@ 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 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 | +| `input_frame_rate` | Raw frame rate fraction of the input file as reported by `ffprobe` (e.g. `30000/1001`, `25/1`) | +| `input_fps` | `input_frame_rate` rounded to the nearest integer (e.g. `30`, `25`, `60`) | +| `output_gop_size` | Recommended GOP size derived from `input_fps` (≈ 5 s of video, capped at 300 frames) | Before the preset's `ffargs` are appended, the script always passes these base arguments to `ffmpeg`: -- cgit v1.3.1