From 919d3a483e6fe8d2932f20f67a7f877e8c1910d3 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 14 May 2026 23:15:20 +0200 Subject: refactor(probe): read ffprobe fields without sed Replace three separate `printf | sed` pipelines with a single grouped `read` block fed from the existing ffprobe output. This keeps codec, pixel format, and frame-rate parsing together, avoids extra subprocesses, and makes the field order easier to see at the call site. No runtime behavior is intended to change. --- transcode.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/transcode.sh b/transcode.sh index e333200..ea61fda 100755 --- a/transcode.sh +++ b/transcode.sh @@ -1251,12 +1251,13 @@ encode_one() { local input_codec input_pixel_format input_frame_rate input_fps - input_codec=$(printf '%s\n' "$probe_out" | sed -n '1p') + { + IFS= read -r input_codec + IFS= read -r input_pixel_format + IFS= read -r input_frame_rate + } <<<"$probe_out" debug "Input codec:" "$input_codec" - input_pixel_format=$(printf '%s\n' "$probe_out" | sed -n '2p') - input_frame_rate=$(printf "%s\n" "$probe_out" | sed -n '3p') - if [[ -z "$input_codec" ]]; then ((_REPORT_ENCODING_FAILED++)) append_size_report_row "failed" "$filename" "$(filesize "$input_file")" -- cgit v1.3.1