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:
@@ -24,7 +24,7 @@ Configuration is done through environment variables.
|
|||||||
By default, this project will build a static `ffmpeg` binary in `./gitignore/sysroot/bin/ffmpeg`.
|
By default, this project will build a static `ffmpeg` binary in `./gitignore/sysroot/bin/ffmpeg`.
|
||||||
|
|
||||||
The user-overridable compile options are:
|
The user-overridable compile options are:
|
||||||
- `ENABLE`: configure what ffmpeg enables (default: libaom libass libvpx libxml2 libvmaf libx264 libx265 libwebp libopus librav1e libdav1d libvorbis libmp3lame libfribidi libfreetype libharfbuzz libopenjpeg libsvtav1_psy libfontconfig )
|
- `ENABLE`: configure what ffmpeg enables (default: libaom libass libvpx libxml2 libvmaf libx264 libx265 libwebp libopus librav1e libdav1d libvorbis libmp3lame libfribidi libfreetype libharfbuzz libopenjpeg libsvtav1_hdr libfontconfig )
|
||||||
- `PREFIX`: prefix to install to, default is local install in ./gitignore/sysroot (default: local)
|
- `PREFIX`: prefix to install to, default is local install in ./gitignore/sysroot (default: local)
|
||||||
- `STATIC`: static or shared build (default: ON)
|
- `STATIC`: static or shared build (default: ON)
|
||||||
- `LTO`: enable link time optimization (default: ON)
|
- `LTO`: enable link time optimization (default: ON)
|
||||||
|
|||||||
58
lib/build.sh
58
lib/build.sh
@@ -324,6 +324,7 @@ fi' >"${compilerDir}/which"
|
|||||||
|
|
||||||
get_build_conf() {
|
get_build_conf() {
|
||||||
local getBuild="${1}"
|
local getBuild="${1}"
|
||||||
|
local getBuildValue="${2:-}"
|
||||||
|
|
||||||
local longestBuild=0
|
local longestBuild=0
|
||||||
local longestVer=0
|
local longestVer=0
|
||||||
@@ -335,12 +336,13 @@ get_build_conf() {
|
|||||||
local BUILDS_CONF='
|
local BUILDS_CONF='
|
||||||
ffmpeg 8.0.1 tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${ver}.${ext}
|
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
|
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}
|
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}
|
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/
|
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}
|
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}
|
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}
|
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}"
|
extractedDir="${BUILD_DIR}/${build}-v${ver}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n ${getBuildValue} ]]; then
|
||||||
|
declare -n value=${getBuildValue}
|
||||||
|
echo "${value}"
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -514,7 +521,7 @@ download_release() {
|
|||||||
else
|
else
|
||||||
# for git downloads
|
# for git downloads
|
||||||
test -d "${download}" ||
|
test -d "${download}" ||
|
||||||
git clone --recursive "${url}" "${download}" || return 1
|
git clone --depth 1 --recursive "${url}" "${download}" || return 1
|
||||||
(
|
(
|
||||||
cd "${download}" || exit 1
|
cd "${download}" || exit 1
|
||||||
local localHEAD remoteHEAD
|
local localHEAD remoteHEAD
|
||||||
@@ -605,7 +612,7 @@ do_build() {
|
|||||||
echo "LOCAL_PREFIX: ${LOCAL_PREFIX}"
|
echo "LOCAL_PREFIX: ${LOCAL_PREFIX}"
|
||||||
for patch in "${PATCHES_DIR}/${build}"/*.patch; do
|
for patch in "${PATCHES_DIR}/${build}"/*.patch; do
|
||||||
test -f "${patch}" || continue
|
test -f "${patch}" || continue
|
||||||
echo -e "patch:${patch}\n$(<"${patch}")" >>"${newMetadataFile}"
|
echo -e "patch:${patch}\n$(<"${patch}")"
|
||||||
done
|
done
|
||||||
COLOR=OFF SHOW_SINGLE=true dump_arr "${BUILD_ENV_NAMES[@]}"
|
COLOR=OFF SHOW_SINGLE=true dump_arr "${BUILD_ENV_NAMES[@]}"
|
||||||
} >"${newMetadataFile}"
|
} >"${newMetadataFile}"
|
||||||
@@ -839,19 +846,21 @@ build_cpuinfo() {
|
|||||||
sanitize_sysroot_libs libcpuinfo || return 1
|
sanitize_sysroot_libs libcpuinfo || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
build_libsvtav1() {
|
build_libsvtav1_hdr() {
|
||||||
meta_cmake_build \
|
build_libsvtav1_psy
|
||||||
-DENABLE_AVX512=ON \
|
|
||||||
-DCOVERAGE=OFF || return 1
|
|
||||||
sanitize_sysroot_libs libSvtAv1Enc || return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_libsvtav1_psy() {
|
build_libsvtav1_psy() {
|
||||||
meta_cmake_build \
|
build_libsvtav1 \
|
||||||
-DENABLE_AVX512=ON \
|
|
||||||
-DCOVERAGE=OFF \
|
|
||||||
-DLIBDOVI_FOUND=1 \
|
-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
|
sanitize_sysroot_libs libSvtAv1Enc || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -985,6 +994,13 @@ build_cmake3() (
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_android; then
|
||||||
|
CMAKE_FLAGS+=(
|
||||||
|
"-DCMAKE_USE_SYSTEM_LIBUV=ON"
|
||||||
|
"-DCMAKE_USE_SYSTEM_LIBARCHIVE=ON"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
CMAKE_FLAGS+=(
|
CMAKE_FLAGS+=(
|
||||||
"-DCMAKE_PREFIX_PATH=${LOCAL_PREFIX}"
|
"-DCMAKE_PREFIX_PATH=${LOCAL_PREFIX}"
|
||||||
"-DCMAKE_INSTALL_PREFIX=${LOCAL_PREFIX}"
|
"-DCMAKE_INSTALL_PREFIX=${LOCAL_PREFIX}"
|
||||||
@@ -1261,14 +1277,11 @@ add_project_versioning_to_ffmpeg() {
|
|||||||
'' # pad with empty line
|
'' # pad with empty line
|
||||||
"ffmpeg-builder=$(git -C "${REPO_DIR}" rev-parse HEAD)"
|
"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
|
get_build_conf "${build}" || return 1
|
||||||
# add build configuration info
|
# add build configuration info
|
||||||
FFMPEG_BUILDER_INFO+=("${build}=${ver}")
|
FFMPEG_BUILDER_INFO+=("${build}=${ver}")
|
||||||
done
|
done
|
||||||
# and finally for ffmpeg itself
|
|
||||||
get_build_conf ffmpeg || return 1
|
|
||||||
FFMPEG_BUILDER_INFO+=("${build}=${ver}")
|
|
||||||
|
|
||||||
local fname='opt_common.c'
|
local fname='opt_common.c'
|
||||||
local optFile="fftools/${fname}"
|
local optFile="fftools/${fname}"
|
||||||
@@ -1286,9 +1299,18 @@ add_project_versioning_to_ffmpeg() {
|
|||||||
build_ffmpeg() {
|
build_ffmpeg() {
|
||||||
add_project_versioning_to_ffmpeg || return 1
|
add_project_versioning_to_ffmpeg || return 1
|
||||||
|
|
||||||
# libsvtav1_psy real name is libsvtav1
|
# libsvtav1_* patch and enable name change
|
||||||
for enable in ${ENABLE}; do
|
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}")
|
CONFIGURE_FLAGS+=("--enable-${enable}")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ libfribidi \
|
|||||||
libfreetype \
|
libfreetype \
|
||||||
libharfbuzz \
|
libharfbuzz \
|
||||||
libopenjpeg \
|
libopenjpeg \
|
||||||
libsvtav1_psy \
|
libsvtav1_hdr \
|
||||||
libfontconfig \
|
libfontconfig \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ set_encode_opts() {
|
|||||||
encode_usage
|
encode_usage
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
GRAIN="film-grain=${OPTARG}:film-grain-denoise=1:"
|
GRAIN="film-grain=${OPTARG}:film-grain-denoise=1:adaptive-film-grain=1:"
|
||||||
optsUsed=$((optsUsed + 2))
|
optsUsed=$((optsUsed + 2))
|
||||||
;;
|
;;
|
||||||
P)
|
P)
|
||||||
@@ -551,7 +551,7 @@ gen_encode_script() {
|
|||||||
local "${arrays[@]}"
|
local "${arrays[@]}"
|
||||||
|
|
||||||
local videoParams=(
|
local videoParams=(
|
||||||
"-crf" '${CRF}' "-preset" '${PRESET}' "-g" "240"
|
"-crf" '${CRF}' "-preset" '${PRESET}'
|
||||||
)
|
)
|
||||||
local ffmpegParams=(
|
local ffmpegParams=(
|
||||||
'-hide_banner'
|
'-hide_banner'
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ print_req_pkgs() {
|
|||||||
libandroid-posix-semaphore-static
|
libandroid-posix-semaphore-static
|
||||||
libandroid-shmem
|
libandroid-shmem
|
||||||
libandroid-shmem-static
|
libandroid-shmem-static
|
||||||
|
cargo-c
|
||||||
)
|
)
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
local msys_ucrt_pkgs=(
|
local msys_ucrt_pkgs=(
|
||||||
|
|||||||
Reference in New Issue
Block a user