Skip to content

Commit

Permalink
fix vaapi args (#128)
Browse files Browse the repository at this point in the history
* fix vaapi args
  • Loading branch information
AlexPresso committed May 19, 2024
1 parent b5c791b commit aac3214
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions wrappers/ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ handle_error() {
fix_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
-ss)
shift
args+=("-ss" "$1" "-noaccurate_seek")
;;

-acodec)
shift
if [[ "$1" = "libfaac" ]]; then
Expand All @@ -78,9 +83,9 @@ fix_args() {
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"
arg="format=nv12|vaapi,hwupload,scale_vaapi=w=$scale_w:h=$scale_h:format=nv12,setsar=sar=1"
else
arg="scale_vaapi=format=nv12,hwupload,setsar=sar=1"
arg="format=nv12|vaapi,hwupload,scale_vaapi=format=nv12,setsar=sar=1"
fi
fi

Expand Down

0 comments on commit aac3214

Please sign in to comment.