Skip to content

Commit

Permalink
Fix scale vaapi (#96)
Browse files Browse the repository at this point in the history
* Fix scale_vaapi
  • Loading branch information
AlexPresso authored Oct 2, 2023
1 parent ade41bc commit 491d178
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wrappers/ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 491d178

Please sign in to comment.