mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-03-16 11:10:10 +00:00
add/default to libsvtav1_hdr
This commit is contained in:
58
lib/build.sh
58
lib/build.sh
@@ -324,6 +324,7 @@ fi' >"${compilerDir}/which"
|
||||
|
||||
get_build_conf() {
|
||||
local getBuild="${1}"
|
||||
local getBuildValue="${2:-}"
|
||||
|
||||
local longestBuild=0
|
||||
local longestVer=0
|
||||
@@ -335,12 +336,13 @@ get_build_conf() {
|
||||
local BUILDS_CONF='
|
||||
ffmpeg 8.0.1 tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${ver}.${ext}
|
||||
|
||||
libsvtav1_hdr 4.0.1 tar.gz https://github.com/juliobbv-p/svt-av1-hdr/archive/refs/tags/v${ver}.${ext} dovi_tool,hdr10plus_tool,cpuinfo
|
||||
libsvtav1_psy 3.0.2-B tar.gz https://github.com/BlueSwordM/svt-av1-psyex/archive/refs/tags/v${ver}.${ext} dovi_tool,hdr10plus_tool,cpuinfo
|
||||
hdr10plus_tool 1.7.2 tar.gz https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/${ver}.${ext}
|
||||
dovi_tool 2.3.1 tar.gz https://github.com/quietvoid/dovi_tool/archive/refs/tags/${ver}.${ext}
|
||||
cpuinfo latest git https://github.com/pytorch/cpuinfo/
|
||||
|
||||
libsvtav1 3.1.2 tar.gz https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${ver}/SVT-AV1-v${ver}.${ext}
|
||||
libsvtav1 4.0.1 tar.gz https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${ver}/SVT-AV1-v${ver}.${ext}
|
||||
librav1e 0.8.1 tar.gz https://github.com/xiph/rav1e/archive/refs/tags/v${ver}.${ext}
|
||||
libaom 3.13.1 tar.gz https://storage.googleapis.com/aom-releases/libaom-${ver}.${ext}
|
||||
libvmaf 3.0.0 tar.gz https://github.com/Netflix/vmaf/archive/refs/tags/v${ver}.${ext}
|
||||
@@ -454,6 +456,11 @@ supmover 2.4.3 tar.gz https://github.com/MonoS/SupMover/archi
|
||||
extractedDir="${BUILD_DIR}/${build}-v${ver}"
|
||||
fi
|
||||
|
||||
if [[ -n ${getBuildValue} ]]; then
|
||||
declare -n value=${getBuildValue}
|
||||
echo "${value}"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -514,7 +521,7 @@ download_release() {
|
||||
else
|
||||
# for git downloads
|
||||
test -d "${download}" ||
|
||||
git clone --recursive "${url}" "${download}" || return 1
|
||||
git clone --depth 1 --recursive "${url}" "${download}" || return 1
|
||||
(
|
||||
cd "${download}" || exit 1
|
||||
local localHEAD remoteHEAD
|
||||
@@ -605,7 +612,7 @@ do_build() {
|
||||
echo "LOCAL_PREFIX: ${LOCAL_PREFIX}"
|
||||
for patch in "${PATCHES_DIR}/${build}"/*.patch; do
|
||||
test -f "${patch}" || continue
|
||||
echo -e "patch:${patch}\n$(<"${patch}")" >>"${newMetadataFile}"
|
||||
echo -e "patch:${patch}\n$(<"${patch}")"
|
||||
done
|
||||
COLOR=OFF SHOW_SINGLE=true dump_arr "${BUILD_ENV_NAMES[@]}"
|
||||
} >"${newMetadataFile}"
|
||||
@@ -839,19 +846,21 @@ build_cpuinfo() {
|
||||
sanitize_sysroot_libs libcpuinfo || return 1
|
||||
}
|
||||
|
||||
build_libsvtav1() {
|
||||
meta_cmake_build \
|
||||
-DENABLE_AVX512=ON \
|
||||
-DCOVERAGE=OFF || return 1
|
||||
sanitize_sysroot_libs libSvtAv1Enc || return 1
|
||||
build_libsvtav1_hdr() {
|
||||
build_libsvtav1_psy
|
||||
}
|
||||
|
||||
build_libsvtav1_psy() {
|
||||
meta_cmake_build \
|
||||
-DENABLE_AVX512=ON \
|
||||
-DCOVERAGE=OFF \
|
||||
build_libsvtav1 \
|
||||
-DLIBDOVI_FOUND=1 \
|
||||
-DLIBHDR10PLUS_RS_FOUND=1 || return 1
|
||||
-DLIBHDR10PLUS_RS_FOUND=1
|
||||
}
|
||||
|
||||
build_libsvtav1() {
|
||||
meta_cmake_build \
|
||||
-DSVT_AV1_LTO=OFF \
|
||||
-DENABLE_AVX512=ON \
|
||||
-DCOVERAGE=OFF "$@" || return 1
|
||||
sanitize_sysroot_libs libSvtAv1Enc || return 1
|
||||
}
|
||||
|
||||
@@ -985,6 +994,13 @@ build_cmake3() (
|
||||
return 0
|
||||
fi
|
||||
|
||||
if is_android; then
|
||||
CMAKE_FLAGS+=(
|
||||
"-DCMAKE_USE_SYSTEM_LIBUV=ON"
|
||||
"-DCMAKE_USE_SYSTEM_LIBARCHIVE=ON"
|
||||
)
|
||||
fi
|
||||
|
||||
CMAKE_FLAGS+=(
|
||||
"-DCMAKE_PREFIX_PATH=${LOCAL_PREFIX}"
|
||||
"-DCMAKE_INSTALL_PREFIX=${LOCAL_PREFIX}"
|
||||
@@ -1261,14 +1277,11 @@ add_project_versioning_to_ffmpeg() {
|
||||
'' # pad with empty line
|
||||
"ffmpeg-builder=$(git -C "${REPO_DIR}" rev-parse HEAD)"
|
||||
)
|
||||
for build in ${ENABLE}; do
|
||||
for build in ${ENABLE} ffmpeg; do
|
||||
get_build_conf "${build}" || return 1
|
||||
# add build configuration info
|
||||
FFMPEG_BUILDER_INFO+=("${build}=${ver}")
|
||||
done
|
||||
# and finally for ffmpeg itself
|
||||
get_build_conf ffmpeg || return 1
|
||||
FFMPEG_BUILDER_INFO+=("${build}=${ver}")
|
||||
|
||||
local fname='opt_common.c'
|
||||
local optFile="fftools/${fname}"
|
||||
@@ -1286,9 +1299,18 @@ add_project_versioning_to_ffmpeg() {
|
||||
build_ffmpeg() {
|
||||
add_project_versioning_to_ffmpeg || return 1
|
||||
|
||||
# libsvtav1_psy real name is libsvtav1
|
||||
# libsvtav1_* patch and enable name change
|
||||
for enable in ${ENABLE}; do
|
||||
test "${enable}" == 'libsvtav1_psy' && enable='libsvtav1'
|
||||
if line_starts_with "${enable}" libsvtav1; then
|
||||
# libsvtav1 v4 is breaking API
|
||||
if [[ "$(get_build_conf "${enable}" ver)" == '4'* ]]; then
|
||||
replace_line \
|
||||
libavcodec/libsvtav1.c \
|
||||
'param->enable_adaptive_quantization = 0;' \
|
||||
'param->aq_mode = 0;' || return 1
|
||||
fi
|
||||
enable=libsvtav1
|
||||
fi
|
||||
CONFIGURE_FLAGS+=("--enable-${enable}")
|
||||
done
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ libfribidi \
|
||||
libfreetype \
|
||||
libharfbuzz \
|
||||
libopenjpeg \
|
||||
libsvtav1_psy \
|
||||
libsvtav1_hdr \
|
||||
libfontconfig \
|
||||
"
|
||||
|
||||
|
||||
@@ -417,7 +417,7 @@ set_encode_opts() {
|
||||
encode_usage
|
||||
return 1
|
||||
fi
|
||||
GRAIN="film-grain=${OPTARG}:film-grain-denoise=1:"
|
||||
GRAIN="film-grain=${OPTARG}:film-grain-denoise=1:adaptive-film-grain=1:"
|
||||
optsUsed=$((optsUsed + 2))
|
||||
;;
|
||||
P)
|
||||
@@ -551,7 +551,7 @@ gen_encode_script() {
|
||||
local "${arrays[@]}"
|
||||
|
||||
local videoParams=(
|
||||
"-crf" '${CRF}' "-preset" '${PRESET}' "-g" "240"
|
||||
"-crf" '${CRF}' "-preset" '${PRESET}'
|
||||
)
|
||||
local ffmpegParams=(
|
||||
'-hide_banner'
|
||||
|
||||
@@ -98,6 +98,7 @@ print_req_pkgs() {
|
||||
libandroid-posix-semaphore-static
|
||||
libandroid-shmem
|
||||
libandroid-shmem-static
|
||||
cargo-c
|
||||
)
|
||||
# shellcheck disable=SC2034
|
||||
local msys_ucrt_pkgs=(
|
||||
|
||||
Reference in New Issue
Block a user