dotfiles/local/bin/convert-libaom.sh: import latest

This commit is contained in:
Alan Orth 2024-12-31 10:37:57 +03:00
parent f386c25a22
commit 276bb1c239
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -11,6 +11,7 @@
# - https://trac.ffmpeg.org/wiki/Encode/AV1
#
# Changes:
# 2024-01-21: minor improvement to handling of output file name
# 2022-06-13: use _max_crf in mkvpropedit if we don't find an acceptable vmaf
# 2022-04-05: update VMAF log parsing
# 2021-10-21: I tested 2-pass and found it doesn't do anything for constant
@ -53,15 +54,16 @@ elif [[ ! -r "$1" ]]; then
exit 1
fi
INPUT_FILE_BASENAME=$(basename "$1")
INPUT_FILE_BASENAME=$(basename -- "$1")
INPUT_FILE_EXTENSION=${INPUT_FILE_BASENAME##*.}
INPUT_FILE_DIRNAME=$(dirname "$1")
INPUT_FILE_DIRNAME=$(dirname -- "$1")
# Check if an output file name was specified (like if we are calling from the
# benchmarking script, in which case we want to exit as soon as possible). If
# not then we can continue with a simple filename based on the input file's.
if [[ -z $_output_file ]]; then
_output_file="${INPUT_FILE_BASENAME/.*/}.webm";
# Strip file extension from end of string and replace with webm
_output_file="${INPUT_FILE_BASENAME%$INPUT_FILE_EXTENSION}webm";
_benchmark_mode="false"
else
_benchmark_mode="true"