From 491d17850ab894954c04c0dacf0e2e86ab35cc9d Mon Sep 17 00:00:00 2001 From: Alex <15526962+AlexPresso@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:01:04 +0200 Subject: [PATCH] Fix scale vaapi (#96) * Fix scale_vaapi --- wrappers/ffmpeg.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wrappers/ffmpeg.sh b/wrappers/ffmpeg.sh index 5b989c7..c9a1aad 100644 --- a/wrappers/ffmpeg.sh +++ b/wrappers/ffmpeg.sh @@ -70,9 +70,9 @@ fix_args() { arg="$1" if [[ "$arg" =~ "scale_vaapi" ]]; then - scale_w=$(echo "$arg" | sed -e 's/.*=w=//g' | sed -e 's/:h=.*//g') - # shellcheck disable=SC2001 - scale_h=$(echo "$arg" | sed -e 's/.*:h=//g') + scale_w=$(echo "$arg" | sed -n 's/.*w=\([0-9]\+\):h=\([0-9]\+\).*/\1/p') + scale_h=$(echo "$arg" | sed -n 's/.*w=\([0-9]\+\):h=\([0-9]\+\).*/\2/p') + if (( scale_w && scale_h )); then arg="scale_vaapi=w=$scale_w:h=$scale_h:format=nv12,hwupload,setsar=sar=1" else