mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-01-16 11:26:17 +00:00
Compare commits
2 Commits
21d3167feb
...
9d7c85b250
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d7c85b250 | |||
| fbfb7c224d |
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -53,9 +53,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
axis {
|
axis {
|
||||||
name 'OPT_AND_LTO'
|
name 'OPT_AND_LTO'
|
||||||
values 'OPT_LVL=0 LTO=false',
|
values 'OPT=0 LTO=false',
|
||||||
'OPT_LVL=2 LTO=false',
|
'OPT=2 LTO=false',
|
||||||
'OPT_LVL=3 LTO=true'
|
'OPT=3 LTO=true'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
|
|||||||
22
lib/build.sh
22
lib/build.sh
@@ -71,13 +71,13 @@ set_compile_opts() {
|
|||||||
CARGO_CINSTALL_FLAGS+=("--${CARGO_BUILD_TYPE}")
|
CARGO_CINSTALL_FLAGS+=("--${CARGO_BUILD_TYPE}")
|
||||||
|
|
||||||
# setting optimization level
|
# setting optimization level
|
||||||
if [[ ${OPT_LVL} == '' ]]; then
|
if [[ ${OPT} == '' ]]; then
|
||||||
OPT_LVL='0'
|
OPT='0'
|
||||||
fi
|
fi
|
||||||
C_FLAGS+=("-O${OPT_LVL}")
|
C_FLAGS+=("-O${OPT}")
|
||||||
RUSTFLAGS+=("-C opt-level=${OPT_LVL}")
|
RUSTFLAGS+=("-C opt-level=${OPT}")
|
||||||
MESON_FLAGS+=("--optimization=${OPT_LVL}")
|
MESON_FLAGS+=("--optimization=${OPT}")
|
||||||
echo_info "building with optimization: ${OPT_LVL}"
|
echo_info "building with optimization: ${OPT}"
|
||||||
|
|
||||||
# static/shared linking
|
# static/shared linking
|
||||||
unset PKG_CFG_FLAGS LIB_SUFF
|
unset PKG_CFG_FLAGS LIB_SUFF
|
||||||
@@ -184,7 +184,7 @@ int main() { puts(gnu_get_libc_version()); return 0; }' >"${srcTest}.c"
|
|||||||
# name version file-extension url dep1,dep2
|
# name version file-extension url dep1,dep2
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
local BUILDS_CONF='
|
local BUILDS_CONF='
|
||||||
ffmpeg 7cd1edeaa410d977a9f1ff8436f480cb45b80178 git https://github.com/FFmpeg/FFmpeg/
|
ffmpeg 8.0 tar.gz https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n${ver}.${ext}
|
||||||
hdr10plus_tool 1.7.1 tar.gz https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/${ver}.${ext}
|
hdr10plus_tool 1.7.1 tar.gz https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/${ver}.${ext}
|
||||||
dovi_tool 2.3.0 tar.gz https://github.com/quietvoid/dovi_tool/archive/refs/tags/${ver}.${ext}
|
dovi_tool 2.3.0 tar.gz https://github.com/quietvoid/dovi_tool/archive/refs/tags/${ver}.${ext}
|
||||||
libsvtav1 3.0.2 tar.gz https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${ver}/SVT-AV1-v${ver}.${ext}
|
libsvtav1 3.0.2 tar.gz https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${ver}/SVT-AV1-v${ver}.${ext}
|
||||||
@@ -351,10 +351,12 @@ build() {
|
|||||||
# embed this project's enables/versions
|
# embed this project's enables/versions
|
||||||
# into ffmpeg with this variable
|
# into ffmpeg with this variable
|
||||||
FFMPEG_BUILDER_INFO=("ffmpeg-builder=$(cd "${REPO_DIR}" && git rev-parse HEAD)")
|
FFMPEG_BUILDER_INFO=("ffmpeg-builder=$(cd "${REPO_DIR}" && git rev-parse HEAD)")
|
||||||
for build in ${FFMPEG_ENABLES}; do
|
for build in ${ENABLE}; do
|
||||||
do_build "${build}" || return 1
|
do_build "${build}" || return 1
|
||||||
done
|
done
|
||||||
do_build "ffmpeg" || return 1
|
do_build "ffmpeg" || return 1
|
||||||
|
# run ffmpeg to show completion
|
||||||
|
"${PREFIX}/bin/ffmpeg"
|
||||||
|
|
||||||
# suggestion for path
|
# suggestion for path
|
||||||
hash -r
|
hash -r
|
||||||
@@ -484,7 +486,7 @@ build_libopus() {
|
|||||||
build_libdav1d() {
|
build_libdav1d() {
|
||||||
local enableAsm='true'
|
local enableAsm='true'
|
||||||
# arm64 will fail the build at 0 optimization
|
# arm64 will fail the build at 0 optimization
|
||||||
if [[ "${HOSTTYPE}:${OPT_LVL}" == "aarch64:0" ]]; then
|
if [[ "${HOSTTYPE}:${OPT}" == "aarch64:0" ]]; then
|
||||||
enableAsm="false"
|
enableAsm="false"
|
||||||
fi
|
fi
|
||||||
meson \
|
meson \
|
||||||
@@ -608,7 +610,7 @@ add_project_versioning_to_ffmpeg() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
build_ffmpeg() {
|
build_ffmpeg() {
|
||||||
for enable in ${FFMPEG_ENABLES}; do
|
for enable in ${ENABLE}; do
|
||||||
test "${enable}" == 'libsvtav1_psy' && enable='libsvtav1'
|
test "${enable}" == 'libsvtav1_psy' && enable='libsvtav1'
|
||||||
CONFIGURE_FLAGS+=("--enable-${enable}")
|
CONFIGURE_FLAGS+=("--enable-${enable}")
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ DEFAULT_CLEAN=true
|
|||||||
# enable link time optimization
|
# enable link time optimization
|
||||||
DEFAULT_LTO=true
|
DEFAULT_LTO=true
|
||||||
# optimization level (0-3)
|
# optimization level (0-3)
|
||||||
DEFAULT_OPT_LVL=3
|
DEFAULT_OPT=3
|
||||||
# static or shared build
|
# static or shared build
|
||||||
DEFAULT_STATIC=true
|
DEFAULT_STATIC=true
|
||||||
# CPU type (amd64/v{1,2,3}...)
|
# CPU type (amd64/v{1,2,3}...)
|
||||||
@@ -20,7 +20,7 @@ DEFAULT_ARCH=native
|
|||||||
# prefix to install to, default is local install
|
# prefix to install to, default is local install
|
||||||
DEFAULT_PREFIX='local'
|
DEFAULT_PREFIX='local'
|
||||||
# configure what ffmpeg enables
|
# configure what ffmpeg enables
|
||||||
DEFAULT_FFMPEG_ENABLES="\
|
DEFAULT_ENABLE="\
|
||||||
libsvtav1_psy \
|
libsvtav1_psy \
|
||||||
libopus \
|
libopus \
|
||||||
libdav1d \
|
libdav1d \
|
||||||
@@ -31,7 +31,7 @@ libvmaf \
|
|||||||
|
|
||||||
# user-overridable compile option variable names
|
# user-overridable compile option variable names
|
||||||
FB_COMP_OPTS=(
|
FB_COMP_OPTS=(
|
||||||
CLEAN LTO OPT_LVL STATIC CPU ARCH PREFIX FFMPEG_ENABLES
|
CLEAN LTO OPT STATIC CPU ARCH PREFIX ENABLE
|
||||||
)
|
)
|
||||||
|
|
||||||
# sets FB_COMP_OPTS to allow for user-overriding
|
# sets FB_COMP_OPTS to allow for user-overriding
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ set_docker_run_flags() {
|
|||||||
for opt in "${FB_COMP_OPTS[@]}"; do
|
for opt in "${FB_COMP_OPTS[@]}"; do
|
||||||
declare -n defOptVal="DEFAULT_${opt}"
|
declare -n defOptVal="DEFAULT_${opt}"
|
||||||
declare -n optVal="${opt}"
|
declare -n optVal="${opt}"
|
||||||
if [[ -n ${optVal} && ${optVal} != "${defOptVal}" ]]; then
|
if [[ -v optVal && ${optVal} != "${defOptVal}" ]]; then
|
||||||
DOCKER_RUN_FLAGS+=("-e" "${opt}=${optVal}")
|
DOCKER_RUN_FLAGS+=("-e" "${opt}=${optVal}")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user