mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-07-21 21:45:21 +00:00
Compare commits
19
Commits
852d7e3795
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c49901597c | ||
|
|
b1afb83db4 | ||
|
|
4e1aac1284 | ||
|
|
14249e814b | ||
|
|
ddf2fa103c | ||
|
|
9962071250 | ||
|
|
0e436efc3f | ||
|
|
63f674e95a | ||
|
|
e2441ea693 | ||
|
|
7db4289f0e | ||
|
|
8597ca6088 | ||
|
|
4092e0f215 | ||
|
|
fc61040607 | ||
|
|
9338ec4039 | ||
|
|
cd9e42cd4d | ||
|
|
bd2f457181 | ||
|
|
d001965e71 | ||
|
|
2705245670 | ||
|
|
89c7704a0e |
@@ -0,0 +1,12 @@
|
|||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
insert_final_newline = false
|
||||||
Vendored
+3
-3
@@ -14,7 +14,7 @@ def withDockerCreds(body) {
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent none
|
agent none
|
||||||
environment {
|
environment {
|
||||||
DEBUG = "1"
|
DEBUG = "0"
|
||||||
HEADLESS = "1"
|
HEADLESS = "1"
|
||||||
}
|
}
|
||||||
options { buildDiscarder logRotator(numToKeepStr: '4') }
|
options { buildDiscarder logRotator(numToKeepStr: '4') }
|
||||||
@@ -41,7 +41,7 @@ pipeline {
|
|||||||
axes {
|
axes {
|
||||||
axis {
|
axis {
|
||||||
name 'COMP_OPTS';
|
name 'COMP_OPTS';
|
||||||
values 'OPT=0 LTO=OFF STATIC=OFF', 'OPT=2 LTO=OFF', 'PGO=ON'
|
values 'OPT=0 LTO=OFF STATIC=OFF', 'OPT=2 LTO=OFF', 'PGO=ON PACKAGE=ON'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
@@ -62,7 +62,7 @@ pipeline {
|
|||||||
axis { name 'DISTRO'; values 'ubuntu', 'fedora', 'debian', 'archlinux' }
|
axis { name 'DISTRO'; values 'ubuntu', 'fedora', 'debian', 'archlinux' }
|
||||||
axis {
|
axis {
|
||||||
name 'COMP_OPTS';
|
name 'COMP_OPTS';
|
||||||
values 'OPT=0 LTO=OFF STATIC=OFF', 'OPT=2 LTO=OFF', 'PGO=ON'
|
values 'OPT=0 LTO=OFF STATIC=OFF', 'OPT=2 LTO=OFF', 'PGO=ON PACKAGE=ON'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
|
|||||||
@@ -24,14 +24,39 @@ 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_hdr libfontconfig )
|
- `ENABLE`: configure what ffmpeg enables. default:
|
||||||
- `PREFIX`: prefix to install to, default is local install in ./gitignore/sysroot (default: local)
|
lcms2
|
||||||
- `STATIC`: static or shared build (default: ON)
|
libaom
|
||||||
- `LTO`: enable link time optimization (default: ON)
|
libass
|
||||||
- `CLEAN`: clean build directories before building (default: ON)
|
libvpx
|
||||||
- `PGO`: enable profile guided optimization (default: OFF)
|
libjxl
|
||||||
- `ARCH`: architecture type (x86-64-v{1,2,3,4}, armv8-a, etc) (default: native)
|
libxml2
|
||||||
- `OPT`: optimization level (0-3) (default: 3)
|
libvmaf
|
||||||
|
libx264
|
||||||
|
libx265
|
||||||
|
libwebp
|
||||||
|
libopus
|
||||||
|
librav1e
|
||||||
|
libdav1d
|
||||||
|
libbluray
|
||||||
|
libsnappy
|
||||||
|
libvorbis
|
||||||
|
libmp3lame
|
||||||
|
libfribidi
|
||||||
|
libfreetype
|
||||||
|
libharfbuzz
|
||||||
|
libopenjpeg
|
||||||
|
libsvtav1_hdr
|
||||||
|
libfontconfig
|
||||||
|
|
||||||
|
- `PREFIX`: path to install to, local install is in ./gitignore/sysroot. default: local
|
||||||
|
- `STATIC`: static (ON) or shared (OFF) build. default: ON
|
||||||
|
- `LTO`: enable link time optimization (ON/OFF). default: ON
|
||||||
|
- `CLEAN`: clean build directories before building (ON/OFF). default: ON
|
||||||
|
- `PGO`: enable profile guided optimization (ON/OFF). default: OFF
|
||||||
|
- `PACKAGE`: package ffmpeg binaries to tarball in ./gitignore/package (ON/OFF). default: OFF
|
||||||
|
- `ARCH`: architecture type (x86-64-v{1,2,3,4}, armv8-a, etc). default: native
|
||||||
|
- `OPT`: optimization level (0-3). default: 3
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
- only build libsvtav1_psy and libopus: `ENABLE='libsvtav1_psy libopus' ./scripts/build.sh`
|
- only build libsvtav1_psy and libopus: `ENABLE='libsvtav1_psy libopus' ./scripts/build.sh`
|
||||||
@@ -55,7 +80,7 @@ ENABLE='libdav1d' ./scripts/docker_run_image.sh ubuntu ./scripts/build.sh
|
|||||||
# Encoding scripts
|
# Encoding scripts
|
||||||
The encoding scripts are designed to be installed to system paths for re-use via symbolic links back to this repo using the `-I` flag.
|
The encoding scripts are designed to be installed to system paths for re-use via symbolic links back to this repo using the `-I` flag.
|
||||||
|
|
||||||
## Encoding with svtav1-psy and opus
|
## Encoding with svtav1 and opus
|
||||||
```bash
|
```bash
|
||||||
encode -i input [options] output
|
encode -i input [options] output
|
||||||
[-P NUM] set preset (default: 3)
|
[-P NUM] set preset (default: 3)
|
||||||
@@ -73,7 +98,7 @@ encode -i input [options] output
|
|||||||
[-I] system install at /usr/local/bin/encode
|
[-I] system install at /usr/local/bin/encode
|
||||||
[-U] uninstall from /usr/local/bin/encode
|
[-U] uninstall from /usr/local/bin/encode
|
||||||
```
|
```
|
||||||
- Uses svtav1-psy for the video encoder.
|
- Uses svtav1 for the video encoder.
|
||||||
- Uses libopus for the audio encoder.
|
- Uses libopus for the audio encoder.
|
||||||
- Skips re-encoding av1/opus streams.
|
- Skips re-encoding av1/opus streams.
|
||||||
- Only maps audio streams that match the video stream language if the video stream has a defined language.
|
- Only maps audio streams that match the video stream language if the video stream has a defined language.
|
||||||
|
|||||||
+117
-5
@@ -27,7 +27,7 @@ echo_wrapper() {
|
|||||||
|
|
||||||
echo -e "${args[@]}" "${color}${word:-''}${endColor}" "$@"
|
echo -e "${args[@]}" "${color}${word:-''}${endColor}" "$@"
|
||||||
}
|
}
|
||||||
echo_fail() { color="${RED}" word="FAIL" echo_wrapper "$@"; }
|
echo_fail() { color="${RED}" word="FAIL" echo_wrapper "$@" 1>&2; }
|
||||||
echo_info() { color="${CYAN}" word="INFO" echo_wrapper "$@"; }
|
echo_info() { color="${CYAN}" word="INFO" echo_wrapper "$@"; }
|
||||||
echo_pass() { color="${GREEN}" word="PASS" echo_wrapper "$@"; }
|
echo_pass() { color="${GREEN}" word="PASS" echo_wrapper "$@"; }
|
||||||
echo_warn() { color="${YELLOW}" word="WARN" echo_wrapper "$@"; }
|
echo_warn() { color="${YELLOW}" word="WARN" echo_wrapper "$@"; }
|
||||||
@@ -301,6 +301,14 @@ print_os() {
|
|||||||
echo "${FB_OS}"
|
echo "${FB_OS}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_sudo() {
|
||||||
|
if is_windows || test "$(id -u)" -eq 0; then
|
||||||
|
SUDO=''
|
||||||
|
else
|
||||||
|
SUDO='sudo '
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
is_positive_integer() {
|
is_positive_integer() {
|
||||||
local input="$1"
|
local input="$1"
|
||||||
if [[ ${input} != ?(-)+([[:digit:]]) || ${input} -lt 0 ]]; then
|
if [[ ${input} != ?(-)+([[:digit:]]) || ${input} -lt 0 ]]; then
|
||||||
@@ -412,6 +420,25 @@ using_cmake3() {
|
|||||||
line_starts_with "${cmakeVersion}" 3
|
line_starts_with "${cmakeVersion}" 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_cmake_flag() {
|
||||||
|
local findFlag="$1"
|
||||||
|
shift
|
||||||
|
local flags=("$@")
|
||||||
|
local flagOption
|
||||||
|
for flag in "${flags[@]}"; do
|
||||||
|
if line_starts_with "${flag}" "-D${findFlag}="; then
|
||||||
|
IFS='=' read -r _ flagOption <<<"${flag}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -z ${flagOption} ]]; then
|
||||||
|
echo_fail "could not find ${findFlag} from ${flags[*]}"
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
echo "${flagOption}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
have_req_meson_version() {
|
have_req_meson_version() {
|
||||||
local min=1.6.1
|
local min=1.6.1
|
||||||
have_required_version "$(meson --version)" "${min}"
|
have_required_version "$(meson --version)" "${min}"
|
||||||
@@ -431,7 +458,7 @@ have_required_version() {
|
|||||||
recreate_dir() {
|
recreate_dir() {
|
||||||
local dirs=("$@")
|
local dirs=("$@")
|
||||||
for dir in "${dirs[@]}"; do
|
for dir in "${dirs[@]}"; do
|
||||||
test -d "${dir}" && rm -rf "${dir}"
|
test -d "${dir}" && ${SUDO_MODIFY} rm -rf "${dir}"
|
||||||
mkdir -p "${dir}" || return 1
|
mkdir -p "${dir}" || return 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -439,7 +466,7 @@ recreate_dir() {
|
|||||||
ensure_dir() {
|
ensure_dir() {
|
||||||
local dirs=("$@")
|
local dirs=("$@")
|
||||||
for dir in "${dirs[@]}"; do
|
for dir in "${dirs[@]}"; do
|
||||||
test -d "${dir}" || mkdir -p "${dir}" || return 1
|
test -d "${dir}" || ${SUDO_MODIFY} mkdir -p "${dir}" || return 1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,7 +476,8 @@ get_date() {
|
|||||||
|
|
||||||
get_remote_head() {
|
get_remote_head() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
# ${build} is magically populated from get_build_conf
|
local build="$2"
|
||||||
|
local ver="$3"
|
||||||
local remoteCommitFile="${TMP_DIR}/${build}-remote-head.txt"
|
local remoteCommitFile="${TMP_DIR}/${build}-remote-head.txt"
|
||||||
local date="$(get_date)"
|
local date="$(get_date)"
|
||||||
# want to cache the remote head for faster retrieval
|
# want to cache the remote head for faster retrieval
|
||||||
@@ -463,7 +491,7 @@ get_remote_head() {
|
|||||||
remoteHEAD="${prevCommit}"
|
remoteHEAD="${prevCommit}"
|
||||||
else
|
else
|
||||||
IFS=$' \t' read -r remoteHEAD _ <<< \
|
IFS=$' \t' read -r remoteHEAD _ <<< \
|
||||||
"$(git ls-remote "${url}" HEAD)"
|
"$(git ls-remote "${url}" "${ver}")"
|
||||||
echo "${date} ${build} ${remoteHEAD}" >"${remoteCommitFile}"
|
echo "${date} ${build} ${remoteHEAD}" >"${remoteCommitFile}"
|
||||||
fi
|
fi
|
||||||
echo "${remoteHEAD}"
|
echo "${remoteHEAD}"
|
||||||
@@ -540,3 +568,87 @@ check_for_supmover() {
|
|||||||
SUPMOVER="${LOCAL_PREFIX}/bin/supmover"
|
SUPMOVER="${LOCAL_PREFIX}/bin/supmover"
|
||||||
test -f "${SUPMOVER}" || do_build supmover || return 1
|
test -f "${SUPMOVER}" || do_build supmover || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
repeat_character() {
|
||||||
|
local char="$1"
|
||||||
|
local count="$2"
|
||||||
|
local spaces
|
||||||
|
printf -v spaces "%${count}s" ''
|
||||||
|
echo "${spaces// /${char}}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# read given varnames to set:
|
||||||
|
# - index array
|
||||||
|
# - short option array
|
||||||
|
# - long option array
|
||||||
|
# - option description array with
|
||||||
|
# padding based off of longest option
|
||||||
|
parse_opt_map() {
|
||||||
|
local optIndexVarname="$1"
|
||||||
|
local shortOptVarname="$2"
|
||||||
|
local longOptVarname="$3"
|
||||||
|
local descOptVarname="$4"
|
||||||
|
shift 4
|
||||||
|
local optMap=("$@")
|
||||||
|
|
||||||
|
declare -n optIndex="${optIndexVarname}"
|
||||||
|
declare -n shortOpt="${shortOptVarname}"
|
||||||
|
declare -n longOpt="${longOptVarname}"
|
||||||
|
declare -n descOpt="${descOptVarname}"
|
||||||
|
|
||||||
|
local opt index short long desc
|
||||||
|
local longestOpt=0
|
||||||
|
for opt in "${optMap[@]}"; do
|
||||||
|
read -r short long desc <<<"${opt}"
|
||||||
|
|
||||||
|
# check for duplicate/overwrites
|
||||||
|
if line_contains "${shortOpt[*]}" "${short}"; then
|
||||||
|
echo_fail "${short} already defined"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if line_contains "${longOpt[*]}" "${long}"; then
|
||||||
|
echo_fail "${long} already defined"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --flag -> flag
|
||||||
|
index="${long//--/}"
|
||||||
|
optIndex+=("${index}")
|
||||||
|
shortOpt["${index}"]="${short}"
|
||||||
|
longOpt["${index}"]="${long}"
|
||||||
|
descOpt["${index}"]="${desc}"
|
||||||
|
|
||||||
|
# track longest longOpt to pad the description
|
||||||
|
if [[ ${longestOpt} -lt ${#long} ]]; then
|
||||||
|
longestOpt=${#long}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
local longLen
|
||||||
|
local tab=$'\t\t'
|
||||||
|
for ind in "${optIndex[@]}"; do
|
||||||
|
long="${longOpt[${ind}]}"
|
||||||
|
longLen=${#long}
|
||||||
|
padding="$(repeat_character ' ' $((longestOpt - longLen)))"
|
||||||
|
descOpt["${ind}"]="${padding}${tab}${descOpt[${ind}]}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
print_opt_map() {
|
||||||
|
local optionMap=("$@")
|
||||||
|
local OPT_INDS
|
||||||
|
declare -A SHORT_OPTS LONG_OPTS DESC_OPTS
|
||||||
|
parse_opt_map \
|
||||||
|
OPT_INDS \
|
||||||
|
SHORT_OPTS \
|
||||||
|
LONG_OPTS \
|
||||||
|
DESC_OPTS \
|
||||||
|
"${optionMap[@]}" || return 1
|
||||||
|
|
||||||
|
echo -e "\nOPTIONS:"
|
||||||
|
for ind in "${OPT_INDS[@]}"; do
|
||||||
|
echo -e " ${SHORT_OPTS[${ind}]}, ${LONG_OPTS[${ind}]}${DESC_OPTS[${ind}]}"
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|||||||
+175
-98
@@ -29,6 +29,11 @@ set_compile_opts() {
|
|||||||
PGO_FLAG
|
PGO_FLAG
|
||||||
LIB_SUFF
|
LIB_SUFF
|
||||||
BUILD_TYPE
|
BUILD_TYPE
|
||||||
|
NO_BUILD_TYPE
|
||||||
|
SHARED
|
||||||
|
BINDIR
|
||||||
|
LIBDIR
|
||||||
|
INCDIR
|
||||||
)
|
)
|
||||||
unset "${BUILD_ENV_NAMES[@]}"
|
unset "${BUILD_ENV_NAMES[@]}"
|
||||||
export "${EXPORTED_ENV_NAMES[@]}"
|
export "${EXPORTED_ENV_NAMES[@]}"
|
||||||
@@ -37,6 +42,10 @@ set_compile_opts() {
|
|||||||
JOBS="$(nproc)"
|
JOBS="$(nproc)"
|
||||||
# local vs system prefix
|
# local vs system prefix
|
||||||
test "${PREFIX}" == 'local' && PREFIX="${LOCAL_PREFIX}"
|
test "${PREFIX}" == 'local' && PREFIX="${LOCAL_PREFIX}"
|
||||||
|
# relevant prefix directories
|
||||||
|
BINDIR="${PREFIX}/bin"
|
||||||
|
LIBDIR="${PREFIX}/lib"
|
||||||
|
INCDIR="${PREFIX}/include"
|
||||||
|
|
||||||
# check if we need to handle PREFIX with sudo
|
# check if we need to handle PREFIX with sudo
|
||||||
local testfile=''
|
local testfile=''
|
||||||
@@ -51,14 +60,11 @@ set_compile_opts() {
|
|||||||
SUDO_MODIFY=''
|
SUDO_MODIFY=''
|
||||||
else
|
else
|
||||||
SUDO_MODIFY="${SUDO}"
|
SUDO_MODIFY="${SUDO}"
|
||||||
echo_warn "using ${SUDO}to install"
|
echo_warn "using ${SUDO}to modify PREFIX"
|
||||||
${SUDO_MODIFY} mkdir -p "${PREFIX}/bin/" || return 1
|
|
||||||
fi
|
fi
|
||||||
test -f "${testfile}" && ${SUDO_MODIFY} rm "${testfile}"
|
test -f "${testfile}" && ${SUDO_MODIFY} rm "${testfile}"
|
||||||
test -d "${PREFIX}" || { ${SUDO_MODIFY} mkdir -p "${PREFIX}" || return 1; }
|
ensure_dir "${BINDIR}" || return 1
|
||||||
|
|
||||||
# set library/pkgconfig directory
|
|
||||||
LIBDIR="${PREFIX}/lib"
|
|
||||||
LDFLAGS_ARR=("-L${LIBDIR}")
|
LDFLAGS_ARR=("-L${LIBDIR}")
|
||||||
|
|
||||||
# android has different library location/names
|
# android has different library location/names
|
||||||
@@ -165,7 +171,7 @@ fi' >"${compilerDir}/which"
|
|||||||
"-DCMAKE_C_COMPILER_LAUNCHER=ccache"
|
"-DCMAKE_C_COMPILER_LAUNCHER=ccache"
|
||||||
"-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
"-DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
||||||
"-DCMAKE_VERBOSE_MAKEFILE=ON"
|
"-DCMAKE_VERBOSE_MAKEFILE=ON"
|
||||||
"-G" "Ninja"
|
"-GNinja"
|
||||||
"-DENABLE_STATIC=${STATIC}"
|
"-DENABLE_STATIC=${STATIC}"
|
||||||
"-DBUILD_STATIC_LIBS=${STATIC}"
|
"-DBUILD_STATIC_LIBS=${STATIC}"
|
||||||
"-DBUILD_TESTING=OFF"
|
"-DBUILD_TESTING=OFF"
|
||||||
@@ -180,7 +186,7 @@ fi' >"${compilerDir}/which"
|
|||||||
|
|
||||||
# add prefix include
|
# add prefix include
|
||||||
# TODO use cygpath for windows
|
# TODO use cygpath for windows
|
||||||
CPPFLAGS_ARR+=("-I${PREFIX}/include")
|
CPPFLAGS_ARR+=("-I${INCDIR}")
|
||||||
|
|
||||||
# if PGO is enabled, first build run will be to generate
|
# if PGO is enabled, first build run will be to generate
|
||||||
# second run will be to use generated profdata
|
# second run will be to use generated profdata
|
||||||
@@ -228,15 +234,9 @@ fi' >"${compilerDir}/which"
|
|||||||
# static/shared linking
|
# static/shared linking
|
||||||
if [[ ${STATIC} == 'ON' ]]; then
|
if [[ ${STATIC} == 'ON' ]]; then
|
||||||
BUILD_TYPE=static
|
BUILD_TYPE=static
|
||||||
CONFIGURE_FLAGS+=(
|
NO_BUILD_TYPE=shared
|
||||||
'--enable-static'
|
SHARED=OFF
|
||||||
'--disable-shared'
|
|
||||||
)
|
|
||||||
MESON_FLAGS+=('--default-library=static')
|
MESON_FLAGS+=('--default-library=static')
|
||||||
CMAKE_FLAGS+=(
|
|
||||||
"-DENABLE_SHARED=OFF"
|
|
||||||
"-DBUILD_SHARED_LIBS=OFF"
|
|
||||||
)
|
|
||||||
# darwin does not support -static
|
# darwin does not support -static
|
||||||
if is_darwin; then
|
if is_darwin; then
|
||||||
FFMPEG_EXTRA_FLAGS+=("--extra-ldflags=${LDFLAGS_ARR[*]}")
|
FFMPEG_EXTRA_FLAGS+=("--extra-ldflags=${LDFLAGS_ARR[*]}")
|
||||||
@@ -244,14 +244,11 @@ fi' >"${compilerDir}/which"
|
|||||||
FFMPEG_EXTRA_FLAGS+=("--extra-ldflags=${LDFLAGS_ARR[*]} -static")
|
FFMPEG_EXTRA_FLAGS+=("--extra-ldflags=${LDFLAGS_ARR[*]} -static")
|
||||||
fi
|
fi
|
||||||
FFMPEG_EXTRA_FLAGS+=("--pkg-config-flags=--static")
|
FFMPEG_EXTRA_FLAGS+=("--pkg-config-flags=--static")
|
||||||
# remove shared libraries for static builds
|
|
||||||
USE_LIB_SUFF="${STATIC_LIB_SUFF}"
|
|
||||||
DEL_LIB_SUFF="${SHARED_LIB_SUFF}"
|
|
||||||
else
|
else
|
||||||
BUILD_TYPE=shared
|
BUILD_TYPE=shared
|
||||||
|
NO_BUILD_TYPE=static
|
||||||
|
SHARED=ON
|
||||||
CMAKE_FLAGS+=(
|
CMAKE_FLAGS+=(
|
||||||
"-DENABLE_SHARED=ON"
|
|
||||||
"-DBUILD_SHARED_LIBS=ON"
|
|
||||||
"-DCMAKE_INSTALL_RPATH=${LIBDIR}"
|
"-DCMAKE_INSTALL_RPATH=${LIBDIR}"
|
||||||
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
|
"-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
|
||||||
)
|
)
|
||||||
@@ -263,15 +260,18 @@ fi' >"${compilerDir}/which"
|
|||||||
fi
|
fi
|
||||||
FFMPEG_EXTRA_FLAGS+=("--extra-ldflags=${LDFLAGS_ARR[*]}")
|
FFMPEG_EXTRA_FLAGS+=("--extra-ldflags=${LDFLAGS_ARR[*]}")
|
||||||
LDFLAGS_ARR+=("-Wl,-rpath,${LIBDIR}")
|
LDFLAGS_ARR+=("-Wl,-rpath,${LIBDIR}")
|
||||||
CONFIGURE_FLAGS+=(
|
|
||||||
'--enable-shared'
|
|
||||||
'--disable-static'
|
|
||||||
)
|
|
||||||
FFMPEG_EXTRA_FLAGS+=('--enable-rpath')
|
FFMPEG_EXTRA_FLAGS+=('--enable-rpath')
|
||||||
# remove static libraries for shared builds
|
|
||||||
USE_LIB_SUFF="${SHARED_LIB_SUFF}"
|
|
||||||
DEL_LIB_SUFF="${STATIC_LIB_SUFF}"
|
|
||||||
fi
|
fi
|
||||||
|
CMAKE_FLAGS+=(
|
||||||
|
"-DENABLE_SHARED=${SHARED}"
|
||||||
|
"-DBUILD_SHARED_LIBS=${SHARED}"
|
||||||
|
)
|
||||||
|
CONFIGURE_FLAGS+=(
|
||||||
|
"--enable-${BUILD_TYPE}"
|
||||||
|
"--disable-${NO_BUILD_TYPE}"
|
||||||
|
)
|
||||||
|
declare -gn USE_LIB_SUFF="${BUILD_TYPE^^}_LIB_SUFF"
|
||||||
|
declare -gn DEL_LIB_SUFF="${NO_BUILD_TYPE^^}_LIB_SUFF"
|
||||||
|
|
||||||
# architecture/cpu compile flags
|
# architecture/cpu compile flags
|
||||||
# arm prefers -mcpu over -march for native builds
|
# arm prefers -mcpu over -march for native builds
|
||||||
@@ -322,6 +322,8 @@ fi' >"${compilerDir}/which"
|
|||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# BUILDS_CONF intentionally does not expand variables
|
||||||
|
# shellcheck disable=SC2016
|
||||||
get_build_conf() {
|
get_build_conf() {
|
||||||
local getBuild="${1}"
|
local getBuild="${1}"
|
||||||
local getBuildValue="${2:-}"
|
local getBuildValue="${2:-}"
|
||||||
@@ -332,63 +334,68 @@ get_build_conf() {
|
|||||||
local padding=4
|
local padding=4
|
||||||
|
|
||||||
# name version file-extension url dep1,dep2
|
# name version file-extension url dep1,dep2
|
||||||
# shellcheck disable=SC2016
|
|
||||||
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.1.2 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
|
# ffmpeg --enable packages
|
||||||
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
|
BUILDS_CONF+='
|
||||||
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 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}
|
|
||||||
libopus 1.6 tar.gz https://github.com/xiph/opus/archive/refs/tags/v${ver}.${ext}
|
|
||||||
libdav1d 1.5.3 tar.xz https://downloads.videolan.org/videolan/dav1d/${ver}/dav1d-${ver}.${ext}
|
|
||||||
libx264 latest git https://code.videolan.org/videolan/x264.git
|
|
||||||
libmp3lame 3.100 tar.gz https://pilotfiber.dl.sourceforge.net/project/lame/lame/${ver}/lame-${ver}.${ext}
|
|
||||||
libvpx 1.16.0 tar.gz https://github.com/webmproject/libvpx/archive/refs/tags/v${ver}.${ext}
|
|
||||||
|
|
||||||
libvorbis 1.3.7 tar.xz https://github.com/xiph/vorbis/releases/download/v${ver}/libvorbis-${ver}.${ext} libogg,cmake3
|
|
||||||
libogg 1.3.6 tar.xz https://github.com/xiph/ogg/releases/download/v${ver}/libogg-${ver}.${ext}
|
|
||||||
|
|
||||||
libopenjpeg 2.5.4 tar.gz https://github.com/uclouvain/openjpeg/archive/refs/tags/v${ver}.${ext} libtiff,lcms2
|
|
||||||
lcms2 2.18 tar.gz https://github.com/mm2/Little-CMS/archive/refs/tags/lcms${ver}.${ext} libtiff,libjpeg
|
lcms2 2.18 tar.gz https://github.com/mm2/Little-CMS/archive/refs/tags/lcms${ver}.${ext} libtiff,libjpeg
|
||||||
libtiff 4.7.1 tar.gz https://github.com/libsdl-org/libtiff/archive/refs/tags/v${ver}.${ext} libwebp,libdeflate,xz,zstd
|
libaom 3.13.1 tar.gz https://storage.googleapis.com/aom-releases/libaom-${ver}.${ext}
|
||||||
|
libass 0.17.4 tar.xz https://github.com/libass/libass/releases/download/${ver}/libass-${ver}.${ext} libfontconfig,libfreetype,libharfbuzz,libfribidi,libunibreak,libxml2,xz
|
||||||
|
libvpx 1.16.0 tar.gz https://github.com/webmproject/libvpx/archive/refs/tags/v${ver}.${ext}
|
||||||
|
libjxl v0.11.2 git https://github.com/libjxl/libjxl brotli,libpng,libwebp
|
||||||
|
libxml2 2.15.1 tar.gz https://github.com/GNOME/libxml2/archive/refs/tags/v${ver}.${ext}
|
||||||
|
libvmaf 3.0.0 tar.gz https://github.com/Netflix/vmaf/archive/refs/tags/v${ver}.${ext}
|
||||||
|
libx264 master git https://code.videolan.org/videolan/x264.git
|
||||||
|
libx265 4.1 tar.gz http://ftp.videolan.org/pub/videolan/x265/x265_${ver}.${ext} libnuma,cmake3
|
||||||
libwebp 1.6.0 tar.gz https://github.com/webmproject/libwebp/archive/refs/tags/v${ver}.${ext} libpng,libjpeg
|
libwebp 1.6.0 tar.gz https://github.com/webmproject/libwebp/archive/refs/tags/v${ver}.${ext} libpng,libjpeg
|
||||||
libjpeg 3.0.3 tar.gz https://github.com/winlibs/libjpeg/archive/refs/tags/libjpeg-turbo-${ver}.${ext}
|
libopus 1.6.1 tar.gz https://github.com/xiph/opus/archive/refs/tags/v${ver}.${ext}
|
||||||
libpng 1.6.53 tar.gz https://github.com/pnggroup/libpng/archive/refs/tags/v${ver}.${ext} zlib
|
librav1e 0.8.1 tar.gz https://github.com/xiph/rav1e/archive/refs/tags/v${ver}.${ext}
|
||||||
|
libdav1d 1.5.3 tar.xz https://downloads.videolan.org/videolan/dav1d/${ver}/dav1d-${ver}.${ext}
|
||||||
|
libbluray 1.4.1 tar.xz https://download.videolan.org/pub/videolan/libbluray/${ver}/libbluray-${ver}.${ext} libfontconfig,libfreetype,libxml2
|
||||||
|
libsnappy 1.2.2 tar.gz https://github.com/google/snappy/archive/refs/tags/${ver}.${ext}
|
||||||
|
libvorbis 1.3.7 tar.xz https://github.com/xiph/vorbis/releases/download/v${ver}/libvorbis-${ver}.${ext} libogg,cmake3
|
||||||
|
libmp3lame 3.100 tar.gz https://pilotfiber.dl.sourceforge.net/project/lame/lame/${ver}/lame-${ver}.${ext}
|
||||||
|
libfribidi 1.0.16 tar.xz https://github.com/fribidi/fribidi/releases/download/v${ver}/fribidi-${ver}.${ext}
|
||||||
|
libfreetype 2.14.1 tar.xz https://downloads.sourceforge.net/freetype/freetype-${ver}.${ext} bzip,libpng,zlib,brotli,libharfbuzzNFTP
|
||||||
|
libharfbuzz 12.3.0 tar.xz https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.${ext} libfreetype
|
||||||
|
libopenjpeg 2.5.4 tar.gz https://github.com/uclouvain/openjpeg/archive/refs/tags/v${ver}.${ext} libtiff,lcms2
|
||||||
|
libsvtav1 4.1.0 tar.gz https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${ver}/SVT-AV1-v${ver}.${ext}
|
||||||
|
libsvtav1_hdr 4.1.0 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
|
||||||
|
libfontconfig 2.17.1 tar.xz https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/${ver}/fontconfig-${ver}.${ext} libharfbuzz,expat,brotli
|
||||||
|
'
|
||||||
|
# dependencies
|
||||||
|
BUILDS_CONF+='
|
||||||
|
xz 5.8.2 tar.xz https://github.com/tukaani-project/xz/releases/download/v${ver}/xz-${ver}.${ext}
|
||||||
|
glad 2.0.8 tar.gz https://github.com/Dav1dde/glad/archive/refs/tags/v${ver}.${ext}
|
||||||
zlib 1.3.1 tar.gz https://github.com/madler/zlib/archive/refs/tags/v${ver}.${ext}
|
zlib 1.3.1 tar.gz https://github.com/madler/zlib/archive/refs/tags/v${ver}.${ext}
|
||||||
libdeflate 1.25 tar.gz https://github.com/ebiggers/libdeflate/archive/refs/tags/v${ver}.${ext} zlib
|
|
||||||
zstd 1.5.7 tar.gz https://github.com/facebook/zstd/archive/refs/tags/v${ver}.${ext}
|
zstd 1.5.7 tar.gz https://github.com/facebook/zstd/archive/refs/tags/v${ver}.${ext}
|
||||||
|
bzip master git https://github.com/libarchive/bzip2.git
|
||||||
libplacebo 7.351.0 tar.gz https://github.com/haasn/libplacebo/archive/refs/tags/v${ver}.${ext} glslang,vulkan_loader,glad
|
expat 2.7.3 tar.xz https://github.com/libexpat/libexpat/releases/download/R_${ver//./_}/expat-${ver}.${ext}
|
||||||
|
brotli 1.2.0 tar.gz https://github.com/google/brotli/archive/refs/tags/v${ver}.${ext}
|
||||||
|
cmake3 3.31.8 tar.gz https://github.com/Kitware/CMake/archive/refs/tags/v${ver}.${ext}
|
||||||
|
libogg 1.3.6 tar.xz https://github.com/xiph/ogg/releases/download/v${ver}/libogg-${ver}.${ext}
|
||||||
|
libpng 1.6.53 tar.gz https://github.com/pnggroup/libpng/archive/refs/tags/v${ver}.${ext} zlib
|
||||||
|
libtiff 4.7.1 tar.gz https://github.com/libsdl-org/libtiff/archive/refs/tags/v${ver}.${ext} libwebp,libdeflate,xz,zstd
|
||||||
|
cpuinfo main git https://github.com/pytorch/cpuinfo/
|
||||||
|
libjpeg 3.0.3 tar.gz https://github.com/winlibs/libjpeg/archive/refs/tags/libjpeg-turbo-${ver}.${ext}
|
||||||
glslang 16.0.0 tar.gz https://github.com/KhronosGroup/glslang/archive/refs/tags/${ver}.${ext} spirv_tools
|
glslang 16.0.0 tar.gz https://github.com/KhronosGroup/glslang/archive/refs/tags/${ver}.${ext} spirv_tools
|
||||||
|
libnuma 2.0.19 tar.gz https://github.com/numactl/numactl/archive/refs/tags/v${ver}.${ext}
|
||||||
|
supmover 2.4.3 tar.gz https://github.com/MonoS/SupMover/archive/refs/tags/v${ver}.${ext}
|
||||||
|
dovi_tool 2.3.1 tar.gz https://github.com/quietvoid/dovi_tool/archive/refs/tags/${ver}.${ext}
|
||||||
|
libcrypto 3.6.1 tar.gz https://github.com/openssl/openssl/archive/refs/tags/openssl-${ver}.${ext} brotli,zlib,zstd
|
||||||
|
libdeflate 1.25 tar.gz https://github.com/ebiggers/libdeflate/archive/refs/tags/v${ver}.${ext} zlib
|
||||||
|
libunibreak 6.1 tar.gz https://github.com/adah1972/libunibreak/releases/download/libunibreak_${ver//./_}/libunibreak-${ver}.${ext}
|
||||||
spirv_tools 2025.4 tar.gz https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/v${ver}.${ext} spirv_headers
|
spirv_tools 2025.4 tar.gz https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/v${ver}.${ext} spirv_headers
|
||||||
spirv_headers 1.4.328.1 tar.gz https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-${ver}.${ext}
|
spirv_headers 1.4.328.1 tar.gz https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/vulkan-sdk-${ver}.${ext}
|
||||||
glad 2.0.8 tar.gz https://github.com/Dav1dde/glad/archive/refs/tags/v${ver}.${ext}
|
hdr10plus_tool 1.7.2 tar.gz https://github.com/quietvoid/hdr10plus_tool/archive/refs/tags/${ver}.${ext}
|
||||||
|
|
||||||
libx265 4.1 tar.gz http://ftp.videolan.org/pub/videolan/x265/x265_${ver}.${ext} libnuma,cmake3
|
|
||||||
libnuma 2.0.19 tar.gz https://github.com/numactl/numactl/archive/refs/tags/v${ver}.${ext}
|
|
||||||
cmake3 3.31.8 tar.gz https://github.com/Kitware/CMake/archive/refs/tags/v${ver}.${ext}
|
|
||||||
|
|
||||||
libass 0.17.4 tar.xz https://github.com/libass/libass/releases/download/${ver}/libass-${ver}.${ext} libfontconfig,libfreetype,libharfbuzz,libfribidi,libunibreak,libxml2,xz
|
|
||||||
libfontconfig 2.17.1 tar.xz https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/${ver}/fontconfig-${ver}.${ext} libharfbuzz,expat,brotli
|
|
||||||
libfreetype 2.14.1 tar.xz https://downloads.sourceforge.net/freetype/freetype-${ver}.${ext} bzip,libpng,zlib,brotli,libharfbuzzNFTP
|
|
||||||
libharfbuzzNFTP 12.3.0 tar.xz https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.${ext}
|
libharfbuzzNFTP 12.3.0 tar.xz https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.${ext}
|
||||||
libharfbuzz 12.3.0 tar.xz https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.${ext} libfreetype
|
'
|
||||||
libunibreak 6.1 tar.gz https://github.com/adah1972/libunibreak/releases/download/libunibreak_${ver//./_}/libunibreak-${ver}.${ext}
|
# ffmpeg --enable that are not added to DEFAULT_ENABLE (WIP)
|
||||||
libxml2 2.15.1 tar.gz https://github.com/GNOME/libxml2/archive/refs/tags/v${ver}.${ext}
|
BUILDS_CONF+='
|
||||||
xz 5.8.2 tar.xz https://github.com/tukaani-project/xz/releases/download/v${ver}/xz-${ver}.${ext}
|
libssh 0.11.1 tar.gz https://github.com/canonical/libssh/archive/refs/tags/libssh-${ver}.${ext} libcrypto
|
||||||
libfribidi 1.0.16 tar.xz https://github.com/fribidi/fribidi/releases/download/v${ver}/fribidi-${ver}.${ext}
|
libplacebo 7.351.0 tar.gz https://github.com/haasn/libplacebo/archive/refs/tags/v${ver}.${ext} glslang,vulkan_loader,glad
|
||||||
bzip latest git https://github.com/libarchive/bzip2.git
|
|
||||||
brotli 1.2.0 tar.gz https://github.com/google/brotli/archive/refs/tags/v${ver}.${ext}
|
|
||||||
expat 2.7.3 tar.xz https://github.com/libexpat/libexpat/releases/download/R_${ver//./_}/expat-${ver}.${ext}
|
|
||||||
|
|
||||||
supmover 2.4.3 tar.gz https://github.com/MonoS/SupMover/archive/refs/tags/v${ver}.${ext}
|
|
||||||
'
|
'
|
||||||
local supported_builds=()
|
local supported_builds=()
|
||||||
unset ver ext url deps extractedDir
|
unset ver ext url deps extractedDir
|
||||||
@@ -398,9 +405,11 @@ supmover 2.4.3 tar.gz https://github.com/MonoS/SupMover/archi
|
|||||||
supported_builds+=("${build}")
|
supported_builds+=("${build}")
|
||||||
|
|
||||||
# padding support
|
# padding support
|
||||||
longestBuild="$(fb_max "${#build}" "${longestBuild}")"
|
if [[ ${getBuild} == 'formatted' ]]; then
|
||||||
longestVer="$(fb_max "${#ver}" "${longestVer}")"
|
longestBuild="$(fb_max "${#build}" "${longestBuild}")"
|
||||||
longestExt="$(fb_max "${#ext}" "${longestExt}")"
|
longestVer="$(fb_max "${#ver}" "${longestVer}")"
|
||||||
|
longestExt="$(fb_max "${#ext}" "${longestExt}")"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${getBuild} != "${build}" ]]; then
|
if [[ ${getBuild} != "${build}" ]]; then
|
||||||
build=''
|
build=''
|
||||||
@@ -447,11 +456,9 @@ supmover 2.4.3 tar.gz https://github.com/MonoS/SupMover/archi
|
|||||||
# shellcheck disable=SC2206
|
# shellcheck disable=SC2206
|
||||||
deps=(${deps//,/ })
|
deps=(${deps//,/ })
|
||||||
fi
|
fi
|
||||||
# set version based off of remote head
|
# set extracted directory
|
||||||
# and set extracted directory
|
|
||||||
if [[ ${ext} == 'git' ]]; then
|
if [[ ${ext} == 'git' ]]; then
|
||||||
ver="$(get_remote_head "${url}")"
|
extractedDir="${BUILD_DIR}/${build}-${ext}-${ver}"
|
||||||
extractedDir="${BUILD_DIR}/${build}-${ext}"
|
|
||||||
else
|
else
|
||||||
extractedDir="${BUILD_DIR}/${build}-v${ver}"
|
extractedDir="${BUILD_DIR}/${build}-v${ver}"
|
||||||
fi
|
fi
|
||||||
@@ -521,12 +528,15 @@ download_release() {
|
|||||||
else
|
else
|
||||||
# for git downloads
|
# for git downloads
|
||||||
test -d "${download}" ||
|
test -d "${download}" ||
|
||||||
git clone --depth 1 --recursive "${url}" "${download}" || return 1
|
git clone \
|
||||||
|
--branch "${ver}" \
|
||||||
|
--depth 1 \
|
||||||
|
--recursive "${url}" "${download}" || return 1
|
||||||
(
|
(
|
||||||
cd "${download}" || exit 1
|
cd "${download}" || exit 1
|
||||||
local localHEAD remoteHEAD
|
local localHEAD remoteHEAD
|
||||||
localHEAD="$(git rev-parse HEAD)"
|
localHEAD="$(git rev-parse HEAD)"
|
||||||
remoteHEAD="$(get_remote_head "${url}")"
|
remoteHEAD="$(get_remote_head "${url}" "${build}" "${ver}")"
|
||||||
if [[ ${localHEAD} != "${remoteHEAD}" ]]; then
|
if [[ ${localHEAD} != "${remoteHEAD}" ]]; then
|
||||||
git stash
|
git stash
|
||||||
git pull --ff-only
|
git pull --ff-only
|
||||||
@@ -682,11 +692,11 @@ build() {
|
|||||||
|
|
||||||
# skip packaging on PGO generate run
|
# skip packaging on PGO generate run
|
||||||
if [[ ${PGO} == 'ON' && ${PGO_RUN} == 'generate' ]]; then
|
if [[ ${PGO} == 'ON' && ${PGO_RUN} == 'generate' ]]; then
|
||||||
PATH="${PREFIX}/bin:${PATH}" gen_profdata
|
PATH="${BINDIR}:${PATH}" gen_profdata
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local ffmpegBin="${PREFIX}/bin/ffmpeg"
|
local ffmpegBin="${BINDIR}/ffmpeg"
|
||||||
# run ffmpeg to show completion
|
# run ffmpeg to show completion
|
||||||
"${ffmpegBin}" -version || return 1
|
"${ffmpegBin}" -version || return 1
|
||||||
|
|
||||||
@@ -695,9 +705,10 @@ build() {
|
|||||||
local ffmpeg="$(command -v ffmpeg 2>/dev/null)"
|
local ffmpeg="$(command -v ffmpeg 2>/dev/null)"
|
||||||
if [[ ${ffmpeg} != "${ffmpegBin}" ]]; then
|
if [[ ${ffmpeg} != "${ffmpegBin}" ]]; then
|
||||||
echo
|
echo
|
||||||
echo_warn "ffmpeg in path (${ffmpeg}) is not the built one (${ffmpegBin})"
|
echo_warn "ffmpeg in PATH (${ffmpeg}) is not the built one (${ffmpegBin})"
|
||||||
echo_info "consider adding ${PREFIX}/bin to \$PATH"
|
local homeAwareBin="${BINDIR//${HOME}/\$HOME}"
|
||||||
echo "echo 'export PATH=\"${PREFIX}/bin:\$PATH\"' >> ~/.bashrc"
|
echo_info "consider adding ${homeAwareBin} to \$PATH"
|
||||||
|
echo "echo 'export PATH=\"${homeAwareBin}:\$PATH\"' >> ~/.bashrc"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
package || return 1
|
package || return 1
|
||||||
@@ -714,6 +725,11 @@ sanitize_sysroot_libs() {
|
|||||||
|
|
||||||
local libs=("$@")
|
local libs=("$@")
|
||||||
|
|
||||||
|
if [[ -z ${USE_LIB_SUFF} || -z ${DEL_LIB_SUFF} ]]; then
|
||||||
|
echo_fail "{USE,DEL}_LIB_SUFF not defined"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
for lib in "${libs[@]}"; do
|
for lib in "${libs[@]}"; do
|
||||||
local libPath="${LIBDIR}/${lib}"
|
local libPath="${LIBDIR}/${lib}"
|
||||||
local foundLib=false
|
local foundLib=false
|
||||||
@@ -1002,7 +1018,6 @@ build_cmake3() (
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CMAKE_FLAGS+=(
|
CMAKE_FLAGS+=(
|
||||||
"-DCMAKE_PREFIX_PATH=${LOCAL_PREFIX}"
|
|
||||||
"-DCMAKE_INSTALL_PREFIX=${LOCAL_PREFIX}"
|
"-DCMAKE_INSTALL_PREFIX=${LOCAL_PREFIX}"
|
||||||
"-DCMAKE_INSTALL_LIBDIR=lib"
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
||||||
"-DCMAKE_BUILD_TYPE=Release"
|
"-DCMAKE_BUILD_TYPE=Release"
|
||||||
@@ -1052,6 +1067,46 @@ build_expat() {
|
|||||||
sanitize_sysroot_libs libexpat || return 1
|
sanitize_sysroot_libs libexpat || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_libsnappy() {
|
||||||
|
local modCxx
|
||||||
|
modCxx="$(get_cmake_flag CMAKE_CXX_FLAGS "${CMAKE_FLAGS[@]}")" || return 1
|
||||||
|
if [[ ${PGO} == 'ON' ]]; then
|
||||||
|
# libsnappy fails PGO for some reason
|
||||||
|
modCxx+=" -Wno-backend-plugin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
meta_cmake_build \
|
||||||
|
-DCMAKE_CXX_FLAGS="${modCxx}" \
|
||||||
|
-DSNAPPY_BUILD_TESTS=OFF \
|
||||||
|
-DSNAPPY_BUILD_BENCHMARKS=OFF || return 1
|
||||||
|
sanitize_sysroot_libs libsnappy || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
build_libssh() {
|
||||||
|
meta_cmake_build || return 1
|
||||||
|
sanitize_sysroot_libs libssh || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
build_libjxl() {
|
||||||
|
# jxl headers interfere with this build
|
||||||
|
recreate_dir "${INCDIR}/jxl" || return 1
|
||||||
|
|
||||||
|
meta_cmake_build \
|
||||||
|
-DJPEGXL_ENABLE_JNI=OFF \
|
||||||
|
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON \
|
||||||
|
-DJPEGXL_BUNDLE_LIBPNG=OFF || return 1
|
||||||
|
|
||||||
|
local libs=(
|
||||||
|
libjxl
|
||||||
|
libjxl_cms
|
||||||
|
libjxl_threads
|
||||||
|
)
|
||||||
|
if [[ ${STATIC} == ON ]]; then
|
||||||
|
libs+=(libjxl_extras_codec)
|
||||||
|
fi
|
||||||
|
sanitize_sysroot_libs "${libs[@]}" || return 1
|
||||||
|
}
|
||||||
|
|
||||||
### MESON ###
|
### MESON ###
|
||||||
meta_meson_build() {
|
meta_meson_build() {
|
||||||
local addFlags=("$@")
|
local addFlags=("$@")
|
||||||
@@ -1169,6 +1224,12 @@ build_lcms2() {
|
|||||||
sanitize_sysroot_libs liblcms2 || return 1
|
sanitize_sysroot_libs liblcms2 || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_libbluray() {
|
||||||
|
meta_meson_build \
|
||||||
|
-D enable_tools=false || return 1
|
||||||
|
sanitize_sysroot_libs libbluray || return 1
|
||||||
|
}
|
||||||
|
|
||||||
### PYTHON ###
|
### PYTHON ###
|
||||||
build_glad() {
|
build_glad() {
|
||||||
true
|
true
|
||||||
@@ -1270,6 +1331,29 @@ build_libass() {
|
|||||||
sanitize_sysroot_libs libass || return 1
|
sanitize_sysroot_libs libass || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_libcrypto() {
|
||||||
|
local cryptoFlags=()
|
||||||
|
if [[ ${STATIC} == 'OFF' ]]; then
|
||||||
|
cryptoFlags+=(no-shared)
|
||||||
|
fi
|
||||||
|
|
||||||
|
cryptoFlags+=(
|
||||||
|
enable-{brotli,zlib,zstd}
|
||||||
|
--with-{brotli,zlib,zstd}-include="${INCDIR}"
|
||||||
|
--with-{brotli,zlib,zstd}-lib="${LIBDIR}"
|
||||||
|
)
|
||||||
|
|
||||||
|
cp Configure configure
|
||||||
|
(
|
||||||
|
unset CONFIGURE_FLAGS
|
||||||
|
meta_configure_build \
|
||||||
|
--prefix="${PREFIX}" \
|
||||||
|
--libdir=lib \
|
||||||
|
"${cryptoFlags[@]}"
|
||||||
|
) || return 1
|
||||||
|
sanitize_sysroot_libs libcrypto libssl || return 1
|
||||||
|
}
|
||||||
|
|
||||||
add_project_versioning_to_ffmpeg() {
|
add_project_versioning_to_ffmpeg() {
|
||||||
# embed this project's enables/versions
|
# embed this project's enables/versions
|
||||||
# into ffmpeg with FFMPEG_BUILDER_INFO
|
# into ffmpeg with FFMPEG_BUILDER_INFO
|
||||||
@@ -1302,13 +1386,6 @@ build_ffmpeg() {
|
|||||||
# libsvtav1_* patch and enable name change
|
# libsvtav1_* patch and enable name change
|
||||||
for enable in ${ENABLE}; do
|
for enable in ${ENABLE}; do
|
||||||
if line_starts_with "${enable}" libsvtav1; then
|
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
|
enable=libsvtav1
|
||||||
fi
|
fi
|
||||||
CONFIGURE_FLAGS+=("--enable-${enable}")
|
CONFIGURE_FLAGS+=("--enable-${enable}")
|
||||||
@@ -1346,7 +1423,7 @@ build_ffmpeg() {
|
|||||||
meta_configure_build \
|
meta_configure_build \
|
||||||
"${ffmpegFlags[@]}" || return 1
|
"${ffmpegFlags[@]}" || return 1
|
||||||
LTO="${ltoBackup}"
|
LTO="${ltoBackup}"
|
||||||
${SUDO_MODIFY} cp ff*_g "${PREFIX}/bin"
|
${SUDO_MODIFY} cp ff*_g "${BINDIR}"
|
||||||
sanitize_sysroot_libs \
|
sanitize_sysroot_libs \
|
||||||
libavcodec libavdevice libavfilter libswscale \
|
libavcodec libavdevice libavfilter libswscale \
|
||||||
libavformat libavutil libswresample || return 1
|
libavformat libavutil libswresample || return 1
|
||||||
|
|||||||
+33
-26
@@ -7,49 +7,56 @@
|
|||||||
unset FB_COMP_OPTS_DESC
|
unset FB_COMP_OPTS_DESC
|
||||||
declare -Ag FB_COMP_OPTS_DESC
|
declare -Ag FB_COMP_OPTS_DESC
|
||||||
|
|
||||||
# default compile options
|
# default build options
|
||||||
FB_COMP_OPTS_DESC['CLEAN']='clean build directories before building'
|
FB_COMP_OPTS_DESC['CLEAN']='clean build directories before building (ON/OFF)'
|
||||||
DEFAULT_CLEAN=ON
|
DEFAULT_CLEAN=ON
|
||||||
|
|
||||||
FB_COMP_OPTS_DESC['LTO']='enable link time optimization'
|
FB_COMP_OPTS_DESC['LTO']='enable link time optimization (ON/OFF)'
|
||||||
DEFAULT_LTO=ON
|
DEFAULT_LTO=ON
|
||||||
|
|
||||||
FB_COMP_OPTS_DESC['PGO']='enable profile guided optimization'
|
FB_COMP_OPTS_DESC['PGO']='enable profile guided optimization (ON/OFF)'
|
||||||
DEFAULT_PGO=OFF
|
DEFAULT_PGO=OFF
|
||||||
|
|
||||||
FB_COMP_OPTS_DESC['OPT']='optimization level (0-3)'
|
FB_COMP_OPTS_DESC['OPT']='optimization level (0-3)'
|
||||||
DEFAULT_OPT=3
|
DEFAULT_OPT=3
|
||||||
|
|
||||||
FB_COMP_OPTS_DESC['STATIC']='static or shared build'
|
FB_COMP_OPTS_DESC['STATIC']='static (ON) or shared (OFF) build'
|
||||||
DEFAULT_STATIC=ON
|
DEFAULT_STATIC=ON
|
||||||
|
|
||||||
FB_COMP_OPTS_DESC['ARCH']='architecture type (x86-64-v{1,2,3,4}, armv8-a, etc)'
|
FB_COMP_OPTS_DESC['ARCH']='architecture type (x86-64-v{1,2,3,4}, armv8-a, etc)'
|
||||||
DEFAULT_ARCH=native
|
DEFAULT_ARCH=native
|
||||||
|
|
||||||
FB_COMP_OPTS_DESC['PREFIX']='prefix to install to, default is local install in ./gitignore/sysroot'
|
FB_COMP_OPTS_DESC['PREFIX']='path to install to, local install is in ./gitignore/sysroot'
|
||||||
DEFAULT_PREFIX='local'
|
DEFAULT_PREFIX='local'
|
||||||
|
|
||||||
|
FB_COMP_OPTS_DESC['PACKAGE']='package ffmpeg binaries to tarball in ./gitignore/package (ON/OFF)'
|
||||||
|
DEFAULT_PACKAGE=OFF
|
||||||
|
|
||||||
FB_COMP_OPTS_DESC['ENABLE']='configure what ffmpeg enables'
|
FB_COMP_OPTS_DESC['ENABLE']='configure what ffmpeg enables'
|
||||||
DEFAULT_ENABLE="\
|
DEFAULT_ENABLE="
|
||||||
libaom \
|
lcms2
|
||||||
libass \
|
libaom
|
||||||
libvpx \
|
libass
|
||||||
libxml2 \
|
libvpx
|
||||||
libvmaf \
|
libjxl
|
||||||
libx264 \
|
libxml2
|
||||||
libx265 \
|
libvmaf
|
||||||
libwebp \
|
libx264
|
||||||
libopus \
|
libx265
|
||||||
librav1e \
|
libwebp
|
||||||
libdav1d \
|
libopus
|
||||||
libvorbis \
|
librav1e
|
||||||
libmp3lame \
|
libdav1d
|
||||||
libfribidi \
|
libbluray
|
||||||
libfreetype \
|
libsnappy
|
||||||
libharfbuzz \
|
libvorbis
|
||||||
libopenjpeg \
|
libmp3lame
|
||||||
libsvtav1_hdr \
|
libfribidi
|
||||||
libfontconfig \
|
libfreetype
|
||||||
|
libharfbuzz
|
||||||
|
libopenjpeg
|
||||||
|
libsvtav1_hdr
|
||||||
|
libfontconfig
|
||||||
"
|
"
|
||||||
|
|
||||||
# user-overridable compile option variable names
|
# user-overridable compile option variable names
|
||||||
|
|||||||
+80
-61
@@ -2,99 +2,114 @@
|
|||||||
|
|
||||||
efg_usage() {
|
efg_usage() {
|
||||||
echo "efg -i input [options]"
|
echo "efg -i input [options]"
|
||||||
echo -e "\t[-P NUM] set preset (default: ${PRESET})"
|
print_opt_map "${EFG_OPT_MAP[@]}" || return 1
|
||||||
echo -e "\t[-l NUM] low value (default: ${LOW})"
|
|
||||||
echo -e "\t[-s NUM] step value (default: ${STEP})"
|
|
||||||
echo -e "\t[-h NUM] high value (default: ${HIGH})"
|
|
||||||
echo -e "\t[-p] plot bitrates using gnuplot"
|
|
||||||
echo -e "\n\t[-I] system install at ${EFG_INSTALL_PATH}"
|
|
||||||
echo -e "\t[-U] uninstall from ${EFG_INSTALL_PATH}"
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
set_efg_opts() {
|
set_efg_opts() {
|
||||||
local opts='P:pl:s:h:i:IU'
|
|
||||||
local numOpts=${#opts}
|
|
||||||
# default values
|
# default values
|
||||||
unset INPUT
|
|
||||||
PRESET=10
|
PRESET=10
|
||||||
LOW=0
|
LOW=0
|
||||||
STEP=1
|
STEP=1
|
||||||
HIGH=30
|
HIGH=30
|
||||||
PLOT=false
|
PLOT=false
|
||||||
|
ENCODE_SEGMENTS=5
|
||||||
EFG_INSTALL_PATH='/usr/local/bin/efg'
|
EFG_INSTALL_PATH='/usr/local/bin/efg'
|
||||||
|
|
||||||
|
local EFG_OPT_MAP=(
|
||||||
|
"-i --input input file"
|
||||||
|
"-P --preset set preset (default: ${PRESET})"
|
||||||
|
"-l --low set low end value for grain range (default: ${LOW})"
|
||||||
|
"-s --step set step value for grain range (default: ${STEP})"
|
||||||
|
"-h --high set high end value for grain range (default: ${HIGH})"
|
||||||
|
"-n --segments number of segments to analyze from input (default: ${ENCODE_SEGMENTS})"
|
||||||
|
"-p --plot plot bitrates using gnuplot"
|
||||||
|
"-I --install system install at ${EFG_INSTALL_PATH}"
|
||||||
|
"-U --uninstall uninstall from ${EFG_INSTALL_PATH}"
|
||||||
|
)
|
||||||
|
|
||||||
# only using -I or -U
|
# only using -I or -U
|
||||||
local minOpt=1
|
local minOpt=1
|
||||||
# using all
|
|
||||||
local maxOpt=${numOpts}
|
|
||||||
test $# -lt ${minOpt} && efg_usage && return 1
|
test $# -lt ${minOpt} && efg_usage && return 1
|
||||||
test $# -gt ${maxOpt} && efg_usage && return 1
|
|
||||||
local OPTARG OPTIND
|
local arg value
|
||||||
while getopts "${opts}" flag; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "${flag}" in
|
arg="$1"
|
||||||
P)
|
value="${2:-}"
|
||||||
if ! is_positive_integer "${OPTARG}"; then
|
case "${arg}" in
|
||||||
|
-i | --input)
|
||||||
|
INPUT="${value}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-P | --preset)
|
||||||
|
if ! is_positive_integer "${value}"; then
|
||||||
efg_usage
|
efg_usage
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
PRESET="${OPTARG}"
|
PRESET="${value}"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
I)
|
-l | --low)
|
||||||
|
if ! is_positive_integer "${value}"; then
|
||||||
|
efg_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
LOW="${value}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-s | --step)
|
||||||
|
if ! is_positive_integer "${value}"; then
|
||||||
|
efg_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
STEP="${value}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-h | --high)
|
||||||
|
if ! is_positive_integer "${value}"; then
|
||||||
|
efg_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
HIGH="${value}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-n | --num-segments)
|
||||||
|
if ! is_positive_integer "${value}"; then
|
||||||
|
efg_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
ENCODE_SEGMENTS="${value}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-p | --plot)
|
||||||
|
missing_cmd gnuplot && return 1
|
||||||
|
PLOT=true
|
||||||
|
;;
|
||||||
|
-I | --install)
|
||||||
echo_warn "attempting install"
|
echo_warn "attempting install"
|
||||||
sudo ln -sf "${SCRIPT_DIR}/efg.sh" \
|
sudo ln -sf "${SCRIPT_DIR}/efg.sh" \
|
||||||
"${EFG_INSTALL_PATH}" || return 1
|
"${EFG_INSTALL_PATH}" || return 1
|
||||||
echo_pass "succesfull install"
|
echo_pass "succesfull install"
|
||||||
return ${FUNC_EXIT_SUCCESS}
|
return "${FUNC_EXIT_SUCCESS}"
|
||||||
;;
|
;;
|
||||||
U)
|
-U | --uninstall)
|
||||||
echo_warn "attempting uninstall"
|
echo_warn "attempting uninstall"
|
||||||
sudo rm "${EFG_INSTALL_PATH}" || return 1
|
sudo rm "${EFG_INSTALL_PATH}" || return 1
|
||||||
echo_pass "succesfull uninstall"
|
echo_pass "succesfull uninstall"
|
||||||
return ${FUNC_EXIT_SUCCESS}
|
return "${FUNC_EXIT_SUCCESS}"
|
||||||
;;
|
|
||||||
i)
|
|
||||||
if [[ $# -lt 2 ]]; then
|
|
||||||
echo_fail "wrong arguments given"
|
|
||||||
efg_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
INPUT="${OPTARG}"
|
|
||||||
;;
|
|
||||||
p)
|
|
||||||
missing_cmd gnuplot && return 1
|
|
||||||
PLOT=true
|
|
||||||
;;
|
|
||||||
l)
|
|
||||||
if ! is_positive_integer "${OPTARG}"; then
|
|
||||||
efg_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
LOW="${OPTARG}"
|
|
||||||
;;
|
|
||||||
s)
|
|
||||||
if ! is_positive_integer "${OPTARG}"; then
|
|
||||||
efg_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
STEP="${OPTARG}"
|
|
||||||
;;
|
|
||||||
h)
|
|
||||||
if ! is_positive_integer "${OPTARG}"; then
|
|
||||||
efg_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
HIGH="${OPTARG}"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "wrong flags given"
|
echo_fail "unsupported option: [${arg}]"
|
||||||
efg_usage
|
efg_usage
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ ! -f ${INPUT} ]]; then
|
# validate input
|
||||||
echo "${INPUT} does not exist"
|
if [[ -z ${INPUT} || ! -f ${INPUT} ]]; then
|
||||||
|
echo_fail "input undefined or does not exist"
|
||||||
efg_usage
|
efg_usage
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -108,7 +123,7 @@ set_efg_opts() {
|
|||||||
EFG_DIR+="-${sanitizedInput}"
|
EFG_DIR+="-${sanitizedInput}"
|
||||||
|
|
||||||
echo_info "estimating film grain for ${INPUT}"
|
echo_info "estimating film grain for ${INPUT}"
|
||||||
echo_info "range: $LOW-$HIGH with $STEP step increments"
|
echo_info "range: ${LOW}-${HIGH} with ${STEP} step increments"
|
||||||
}
|
}
|
||||||
|
|
||||||
efg_segment() {
|
efg_segment() {
|
||||||
@@ -255,9 +270,13 @@ FB_FUNC_NAMES+=('efg')
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
FB_FUNC_DESCS['efg']='estimate the film grain of a given file'
|
FB_FUNC_DESCS['efg']='estimate the film grain of a given file'
|
||||||
efg() {
|
efg() {
|
||||||
|
# localize variables used by child functions
|
||||||
|
local PRESET LOW STEP HIGH PLOT \
|
||||||
|
EFG_INSTALL_PATH EFG_DIR ENCODE_SEGMENTS \
|
||||||
|
GRAIN_LOG
|
||||||
|
|
||||||
EFG_DIR="${TMP_DIR}/efg"
|
EFG_DIR="${TMP_DIR}/efg"
|
||||||
# encode N highest-bitrate segments
|
# encode N highest-bitrate segments
|
||||||
ENCODE_SEGMENTS=5
|
|
||||||
|
|
||||||
set_efg_opts "$@"
|
set_efg_opts "$@"
|
||||||
local ret=$?
|
local ret=$?
|
||||||
|
|||||||
+112
-108
@@ -64,7 +64,7 @@ set_subtitle_params() {
|
|||||||
local convertCodec='eia_608'
|
local convertCodec='eia_608'
|
||||||
|
|
||||||
local defaultTextCodec
|
local defaultTextCodec
|
||||||
if [[ ${SAME_CONTAINER} == false && ${FILE_EXT} == 'mkv' ]]; then
|
if [[ ${SAME_CONTAINER} == false && ${OUTPUT} == *'.mkv' ]]; then
|
||||||
defaultTextCodec='srt'
|
defaultTextCodec='srt'
|
||||||
convertCodec+='|mov_text'
|
convertCodec+='|mov_text'
|
||||||
else
|
else
|
||||||
@@ -324,19 +324,10 @@ setup_pgs_mkv() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
encode_usage() {
|
encode_usage() {
|
||||||
echo "encode -i input [options] output"
|
echo "encode -i input [options] [output]"
|
||||||
echo -e "\t[-P NUM] set preset (default: ${PRESET})"
|
print_opt_map "${ENCODE_OPT_MAP[@]}" || return 1
|
||||||
echo -e "\t[-C NUM] set CRF (default: ${CRF})"
|
echo -e "\n [output] output filename (default: \${PWD}/av1-input-file-name.mkv)\n"
|
||||||
echo -e "\t[-g NUM] set film grain for encode"
|
|
||||||
echo -e "\t[-p] print the command instead of executing it (default: ${PRINT_OUT})"
|
|
||||||
echo -e "\t[-c] use cropdetect (default: ${CROP})"
|
|
||||||
echo -e "\t[-d] enable dolby vision (default: ${DV_TOGGLE})"
|
|
||||||
echo -e "\t[-v] print relevant version info"
|
|
||||||
echo -e "\t[-s] use same container as input, default is convert to mkv"
|
|
||||||
echo -e "\n\t[output] if unset, defaults to \${PWD}/av1-input-file-name.mkv"
|
|
||||||
echo -e "\n\t[-u] update script (git pull ffmpeg-builder)"
|
|
||||||
echo -e "\t[-I] system install at ${ENCODE_INSTALL_PATH}"
|
|
||||||
echo -e "\t[-U] uninstall from ${ENCODE_INSTALL_PATH}"
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,138 +336,146 @@ encode_update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_encode_opts() {
|
set_encode_opts() {
|
||||||
local opts='vi:pcsdg:P:C:uIU'
|
|
||||||
local numOpts=${#opts}
|
|
||||||
# default values
|
# default values
|
||||||
PRESET=3
|
PRESET=3
|
||||||
CRF=25
|
CRF=25
|
||||||
GRAIN=""
|
GRAIN=''
|
||||||
CROP=false
|
CROP=false
|
||||||
PRINT_OUT=false
|
PRINT_OUT=false
|
||||||
DV_TOGGLE=false
|
DV_TOGGLE=false
|
||||||
ENCODE_INSTALL_PATH='/usr/local/bin/encode'
|
ENCODE_INSTALL_PATH='/usr/local/bin/encode'
|
||||||
SAME_CONTAINER="false"
|
SAME_CONTAINER="false"
|
||||||
|
|
||||||
|
local ENCODE_OPT_MAP=(
|
||||||
|
"-i --input input file"
|
||||||
|
"-P --preset set preset (default: ${PRESET})"
|
||||||
|
"-C --crf set CRF (default: ${CRF})"
|
||||||
|
"-g --grain set film grain (default: disabled)"
|
||||||
|
"-p --print print the script instead of executing it"
|
||||||
|
"-c --crop use crop detect to auto-crop"
|
||||||
|
"-d --dv enable dolby vision"
|
||||||
|
"-v --version print version info"
|
||||||
|
"-s --same-container use same container as input (default: mkv)"
|
||||||
|
"-u --update update script (git pull ffmpeg-builder)"
|
||||||
|
"-I --install system install at ${ENCODE_INSTALL_PATH}"
|
||||||
|
"-U --uninstall uninstall from ${ENCODE_INSTALL_PATH}"
|
||||||
|
)
|
||||||
|
|
||||||
# only using -I/U
|
# only using -I/U
|
||||||
local minOpt=1
|
local minOpt=1
|
||||||
# using all + output name
|
|
||||||
local maxOpt=$((numOpts + 1))
|
|
||||||
test $# -lt ${minOpt} && encode_usage && return 1
|
test $# -lt ${minOpt} && encode_usage && return 1
|
||||||
test $# -gt ${maxOpt} && encode_usage && return 1
|
|
||||||
local optsUsed=0
|
local arg value
|
||||||
local OPTARG OPTIND
|
while [[ $# -gt 0 ]]; do
|
||||||
while getopts "${opts}" flag; do
|
arg="$1"
|
||||||
case "${flag}" in
|
value="${2:-}"
|
||||||
u)
|
case "${arg}" in
|
||||||
encode_update || return 1
|
-i | --input)
|
||||||
return ${FUNC_EXIT_SUCCESS}
|
INPUT="${value}"
|
||||||
|
shift
|
||||||
;;
|
;;
|
||||||
I)
|
-P | --preset)
|
||||||
|
if ! is_positive_integer "${value}"; then
|
||||||
|
encode_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
PRESET="${value}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-C | --crf)
|
||||||
|
if ! is_positive_integer "${value}" || test "${value}" -gt 63; then
|
||||||
|
echo_fail "${value} is not a valid CRF value (0-63)"
|
||||||
|
encode_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
CRF="${value}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-g | --grain)
|
||||||
|
if ! is_positive_integer "${value}"; then
|
||||||
|
encode_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
GRAIN="film-grain=${value}:film-grain-denoise=1:adaptive-film-grain=1:"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-c | --crop)
|
||||||
|
CROP=true
|
||||||
|
;;
|
||||||
|
-p | --print)
|
||||||
|
PRINT_OUT=true
|
||||||
|
;;
|
||||||
|
-d | --dv)
|
||||||
|
DV_TOGGLE=true
|
||||||
|
;;
|
||||||
|
-v | --version)
|
||||||
|
get_encode_versions print || return 1
|
||||||
|
return "${FUNC_EXIT_SUCCESS}"
|
||||||
|
;;
|
||||||
|
-s | --same-container)
|
||||||
|
SAME_CONTAINER=true
|
||||||
|
;;
|
||||||
|
-u | --update)
|
||||||
|
encode_update || return 1
|
||||||
|
return "${FUNC_EXIT_SUCCESS}"
|
||||||
|
;;
|
||||||
|
-I | --install)
|
||||||
echo_warn "attempting install"
|
echo_warn "attempting install"
|
||||||
sudo ln -sf "${SCRIPT_DIR}/encode.sh" \
|
sudo ln -sf "${SCRIPT_DIR}/encode.sh" \
|
||||||
"${ENCODE_INSTALL_PATH}" || return 1
|
"${ENCODE_INSTALL_PATH}" || return 1
|
||||||
echo_pass "succesfull install"
|
echo_pass "succesfull install"
|
||||||
return ${FUNC_EXIT_SUCCESS}
|
return "${FUNC_EXIT_SUCCESS}"
|
||||||
;;
|
;;
|
||||||
U)
|
-U | --uninstall)
|
||||||
echo_warn "attempting uninstall"
|
echo_warn "attempting uninstall"
|
||||||
sudo rm "${ENCODE_INSTALL_PATH}" || return 1
|
sudo rm "${ENCODE_INSTALL_PATH}" || return 1
|
||||||
echo_pass "succesfull uninstall"
|
echo_pass "succesfull uninstall"
|
||||||
return ${FUNC_EXIT_SUCCESS}
|
return "${FUNC_EXIT_SUCCESS}"
|
||||||
;;
|
|
||||||
v)
|
|
||||||
get_encode_versions print || return 1
|
|
||||||
return ${FUNC_EXIT_SUCCESS}
|
|
||||||
;;
|
|
||||||
i)
|
|
||||||
if [[ $# -lt 2 ]]; then
|
|
||||||
echo_fail "wrong arguments given"
|
|
||||||
encode_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
INPUT="${OPTARG}"
|
|
||||||
optsUsed=$((optsUsed + 2))
|
|
||||||
;;
|
|
||||||
p)
|
|
||||||
PRINT_OUT=true
|
|
||||||
optsUsed=$((optsUsed + 1))
|
|
||||||
;;
|
|
||||||
c)
|
|
||||||
CROP=true
|
|
||||||
optsUsed=$((optsUsed + 1))
|
|
||||||
;;
|
|
||||||
d)
|
|
||||||
DV_TOGGLE=true
|
|
||||||
optsUsed=$((optsUsed + 1))
|
|
||||||
;;
|
|
||||||
s)
|
|
||||||
SAME_CONTAINER=true
|
|
||||||
optsUsed=$((optsUsed + 1))
|
|
||||||
;;
|
|
||||||
g)
|
|
||||||
if ! is_positive_integer "${OPTARG}"; then
|
|
||||||
encode_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
GRAIN="film-grain=${OPTARG}:film-grain-denoise=1:adaptive-film-grain=1:"
|
|
||||||
optsUsed=$((optsUsed + 2))
|
|
||||||
;;
|
|
||||||
P)
|
|
||||||
if ! is_positive_integer "${OPTARG}"; then
|
|
||||||
encode_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
PRESET="${OPTARG}"
|
|
||||||
optsUsed=$((optsUsed + 2))
|
|
||||||
;;
|
|
||||||
C)
|
|
||||||
if ! is_positive_integer "${OPTARG}" || test ${OPTARG} -gt 63; then
|
|
||||||
echo_fail "${OPTARG} is not a valid CRF value (0-63)"
|
|
||||||
encode_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
CRF="${OPTARG}"
|
|
||||||
OPTS_USED=$((OPTS_USED + 2))
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo_fail "wrong flags given"
|
# OUTPUT will be the last (optional) arg
|
||||||
encode_usage
|
if [[ $# -ne 1 ]]; then
|
||||||
return 1
|
echo_fail "unsupported option: [${arg}]"
|
||||||
|
encode_usage
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
OUTPUT="${arg}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
# allow optional output filename
|
# validate input
|
||||||
if [[ $(($# - optsUsed)) == 1 ]]; then
|
if [[ -z ${INPUT} || ! -f ${INPUT} ]]; then
|
||||||
OUTPUT="${*: -1}"
|
echo_fail "input undefined or does not exist"
|
||||||
else
|
encode_usage
|
||||||
local basename="$(bash_basename "${INPUT}")"
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# fallback output path
|
||||||
|
if [[ -z ${OUTPUT} ]]; then
|
||||||
|
local basename
|
||||||
|
basename="$(bash_basename "${INPUT}")" || return 1
|
||||||
OUTPUT="${PWD}/av1-${basename}"
|
OUTPUT="${PWD}/av1-${basename}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# use same container for output
|
# use same container for output
|
||||||
if [[ $SAME_CONTAINER == "true" ]]; then
|
if [[ ${SAME_CONTAINER} == true ]]; then
|
||||||
local fileFormat
|
local fileFormat outputSuffix
|
||||||
fileFormat="$(get_file_format "${INPUT}")" || return 1
|
fileFormat="$(get_file_format "${INPUT}")" || return 1
|
||||||
FILE_EXT=''
|
|
||||||
if [[ ${fileFormat} == 'MPEG-4' ]]; then
|
if [[ ${fileFormat} == 'MPEG-4' ]]; then
|
||||||
FILE_EXT='mp4'
|
outputSuffix='mp4'
|
||||||
elif [[ ${fileFormat} == 'Matroska' ]]; then
|
elif [[ ${fileFormat} == 'Matroska' ]]; then
|
||||||
FILE_EXT='mkv'
|
outputSuffix='mkv'
|
||||||
else
|
else
|
||||||
echo "unrecognized input format"
|
echo_fail "unrecognized input format"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
FILE_EXT="mkv"
|
outputSuffix='mkv'
|
||||||
fi
|
fi
|
||||||
OUTPUT="${OUTPUT%.*}"
|
OUTPUT="${OUTPUT%.*}"
|
||||||
OUTPUT+=".${FILE_EXT}"
|
OUTPUT+=".${outputSuffix}"
|
||||||
|
|
||||||
if [[ ! -f ${INPUT} ]]; then
|
|
||||||
echo "${INPUT} does not exist"
|
|
||||||
encode_usage
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ${PRINT_OUT} == false ]]; then
|
if [[ ${PRINT_OUT} == false ]]; then
|
||||||
echo
|
echo
|
||||||
@@ -658,7 +657,7 @@ gen_encode_script() {
|
|||||||
echo 'ffmpeg "${ffmpegParams[@]}" -dolbyvision 0 "${OUTPUT}" || exit 1'
|
echo 'ffmpeg "${ffmpegParams[@]}" -dolbyvision 0 "${OUTPUT}" || exit 1'
|
||||||
|
|
||||||
# track-stats and clear title
|
# track-stats and clear title
|
||||||
if [[ ${FILE_EXT} == 'mkv' ]]; then
|
if [[ ${OUTPUT} == *'.mkv' ]]; then
|
||||||
{
|
{
|
||||||
# ffmpeg does not copy PGS subtitles without breaking them
|
# ffmpeg does not copy PGS subtitles without breaking them
|
||||||
# use mkvmerge to extract and supmover to crop
|
# use mkvmerge to extract and supmover to crop
|
||||||
@@ -690,6 +689,11 @@ FB_FUNC_NAMES+=('encode')
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
FB_FUNC_DESCS['encode']='encode a file using libsvtav1 and libopus'
|
FB_FUNC_DESCS['encode']='encode a file using libsvtav1 and libopus'
|
||||||
encode() {
|
encode() {
|
||||||
|
# localize variables used by child functions
|
||||||
|
local PRESET CRF GRAIN CROP PRINT_OUT \
|
||||||
|
DV_TOGGLE ENCODE_INSTALL_PATH SAME_CONTAINER \
|
||||||
|
INPUT OUTPUT
|
||||||
|
|
||||||
set_encode_opts "$@"
|
set_encode_opts "$@"
|
||||||
local ret=$?
|
local ret=$?
|
||||||
if [[ ${ret} -eq ${FUNC_EXIT_SUCCESS} ]]; then
|
if [[ ${ret} -eq ${FUNC_EXIT_SUCCESS} ]]; then
|
||||||
|
|||||||
+2
-2
@@ -51,8 +51,8 @@ get_crop() {
|
|||||||
duration="$(get_duration "${file}")" || return 1
|
duration="$(get_duration "${file}")" || return 1
|
||||||
# don't care about decimal points
|
# don't care about decimal points
|
||||||
IFS='.' read -r duration _ <<<"${duration}"
|
IFS='.' read -r duration _ <<<"${duration}"
|
||||||
# get crop value for first half of input
|
# get crop value for first tenth of input
|
||||||
local timeEnc=$((duration / 20))
|
local timeEnc=$((duration / 10))
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
-y \
|
-y \
|
||||||
-hide_banner \
|
-hide_banner \
|
||||||
|
|||||||
+6
-13
@@ -2,14 +2,6 @@
|
|||||||
|
|
||||||
# shellcheck disable=SC2120
|
# shellcheck disable=SC2120
|
||||||
determine_pkg_mgr() {
|
determine_pkg_mgr() {
|
||||||
# sudo used externally
|
|
||||||
# shellcheck disable=SC2034
|
|
||||||
if is_windows || test "$(id -u)" -eq 0; then
|
|
||||||
SUDO=''
|
|
||||||
else
|
|
||||||
SUDO='sudo '
|
|
||||||
fi
|
|
||||||
|
|
||||||
# pkg-mgr update-cmd upgrade-cmd install-cmd check-cmd
|
# pkg-mgr update-cmd upgrade-cmd install-cmd check-cmd
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
local PKG_MGR_MAP='
|
local PKG_MGR_MAP='
|
||||||
@@ -178,15 +170,16 @@ check_for_req_pkgs() {
|
|||||||
if missing_cmd rustup; then
|
if missing_cmd rustup; then
|
||||||
echo_warn "installing rustup"
|
echo_warn "installing rustup"
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
# shellcheck disable=SC2016
|
fi
|
||||||
grep -q 'source "${HOME}/.cargo/env"' "${HOME}/.bashrc" ||
|
if missing_cmd cargo; then
|
||||||
echo 'source "${HOME}/.cargo/env"' >>"${HOME}/.bashrc"
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source "${HOME}/.bashrc"
|
source "${HOME}/.bashrc"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
has_cmd cargo-cbuild || echo_if_fail cargo install cargo-c || return 1
|
if ! has_cmd cargo-cbuild; then
|
||||||
|
echo_info "installing cargo-c"
|
||||||
|
echo_if_fail cargo install cargo-c || return 1
|
||||||
|
fi
|
||||||
echo_pass "cargo-c is installed"
|
echo_pass "cargo-c is installed"
|
||||||
echo_pass "all required packages installed"
|
echo_pass "all required packages installed"
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -1,9 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
check_for_package_cfg() {
|
check_for_package_cfg() {
|
||||||
local requiredCfg='ON:ON:ON:3'
|
if [[ ${PACKAGE} == 'ON' ]]; then
|
||||||
local currentCfg="${STATIC}:${LTO}:${PGO}:${OPT}"
|
|
||||||
if [[ ${currentCfg} == "${requiredCfg}" ]]; then
|
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
+3
-3
@@ -14,7 +14,7 @@ gen_function_info() {
|
|||||||
gen_compile_opts_info() {
|
gen_compile_opts_info() {
|
||||||
for opt in "${FB_COMP_OPTS[@]}"; do
|
for opt in "${FB_COMP_OPTS[@]}"; do
|
||||||
declare -n defOptVal="DEFAULT_${opt}"
|
declare -n defOptVal="DEFAULT_${opt}"
|
||||||
echo "- \`${opt}\`: ${FB_COMP_OPTS_DESC[${opt}]} (default: ${defOptVal})"
|
echo "- \`${opt}\`: ${FB_COMP_OPTS_DESC[${opt}]}. default: ${defOptVal}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,11 +70,11 @@ ENABLE='libdav1d' ./scripts/docker_run_image.sh ubuntu ./scripts/build.sh
|
|||||||
# Encoding scripts
|
# Encoding scripts
|
||||||
The encoding scripts are designed to be installed to system paths for re-use via symbolic links back to this repo using the \`-I\` flag.
|
The encoding scripts are designed to be installed to system paths for re-use via symbolic links back to this repo using the \`-I\` flag.
|
||||||
|
|
||||||
## Encoding with svtav1-psy and opus
|
## Encoding with svtav1 and opus
|
||||||
\`\`\`bash
|
\`\`\`bash
|
||||||
$(encode)
|
$(encode)
|
||||||
\`\`\`
|
\`\`\`
|
||||||
- Uses svtav1-psy for the video encoder.
|
- Uses svtav1 for the video encoder.
|
||||||
- Uses libopus for the audio encoder.
|
- Uses libopus for the audio encoder.
|
||||||
- Skips re-encoding av1/opus streams.
|
- Skips re-encoding av1/opus streams.
|
||||||
- Only maps audio streams that match the video stream language if the video stream has a defined language.
|
- Only maps audio streams that match the video stream language if the video stream has a defined language.
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export REPO_DIR="$(cd "$(dirname "${thisFile}")/.." && echo "$PWD")"
|
|||||||
source "${REPO_DIR}/main.sh" || exit 1
|
source "${REPO_DIR}/main.sh" || exit 1
|
||||||
scr_name="$(bash_basename $0)"
|
scr_name="$(bash_basename $0)"
|
||||||
cmd="${scr_name//.sh/}"
|
cmd="${scr_name//.sh/}"
|
||||||
if [[ $DEBUG == 1 ]]; then set -x; fi
|
[[ ${DEBUG} == 1 ]] && set -x
|
||||||
$cmd "$@"' >"${ENTRY_SCRIPT}"
|
$cmd "$@"' >"${ENTRY_SCRIPT}"
|
||||||
chmod +x "${ENTRY_SCRIPT}"
|
chmod +x "${ENTRY_SCRIPT}"
|
||||||
for funcName in "${FB_FUNC_NAMES[@]}"; do
|
for funcName in "${FB_FUNC_NAMES[@]}"; do
|
||||||
@@ -89,7 +89,7 @@ $cmd "$@"' >"${ENTRY_SCRIPT}"
|
|||||||
gen_links || return 1
|
gen_links || return 1
|
||||||
|
|
||||||
# allow calling entry.sh with arguments as execution
|
# allow calling entry.sh with arguments as execution
|
||||||
entry() { "$@" ; }
|
entry() { "$@"; }
|
||||||
|
|
||||||
set_completions() {
|
set_completions() {
|
||||||
for funcName in "${FB_FUNC_NAMES[@]}"; do
|
for funcName in "${FB_FUNC_NAMES[@]}"; do
|
||||||
@@ -97,7 +97,7 @@ set_completions() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
determine_pkg_mgr || return 1
|
set_sudo || return 1
|
||||||
check_compile_opts_override || return 1
|
check_compile_opts_override || return 1
|
||||||
|
|
||||||
# set local prefix since some functions need it
|
# set local prefix since some functions need it
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
diff --git a/src/libbluray/disc/dec.c b/src/libbluray/disc/dec.c
|
||||||
|
index feb91db..91b0b07 100644
|
||||||
|
--- a/src/libbluray/disc/dec.c
|
||||||
|
+++ b/src/libbluray/disc/dec.c
|
||||||
|
@@ -284,7 +284,7 @@ static void _dec_load(BD_DEC *dec, BD_ENC_INFO *i)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
-BD_DEC *dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info,
|
||||||
|
+BD_DEC *libbluray_dec_init(struct dec_dev *dev, BD_ENC_INFO *enc_info,
|
||||||
|
const char *keyfile_path,
|
||||||
|
void *regs, void *psr_read, void *psr_write)
|
||||||
|
{
|
||||||
|
diff --git a/src/libbluray/disc/dec.h b/src/libbluray/disc/dec.h
|
||||||
|
index d1329be..18550bf 100644
|
||||||
|
--- a/src/libbluray/disc/dec.h
|
||||||
|
+++ b/src/libbluray/disc/dec.h
|
||||||
|
@@ -45,7 +45,7 @@ struct dec_dev {
|
||||||
|
|
||||||
|
typedef struct bd_dec BD_DEC;
|
||||||
|
|
||||||
|
-BD_PRIVATE BD_DEC *dec_init(struct dec_dev *dev,
|
||||||
|
+BD_PRIVATE BD_DEC *libbluray_dec_init(struct dec_dev *dev,
|
||||||
|
struct bd_enc_info *enc_info,
|
||||||
|
const char *keyfile_path,
|
||||||
|
void *regs, void *psr_read, void *psr_write);
|
||||||
|
diff --git a/src/libbluray/disc/disc.c b/src/libbluray/disc/disc.c
|
||||||
|
index 887296b..0267814 100644
|
||||||
|
--- a/src/libbluray/disc/disc.c
|
||||||
|
+++ b/src/libbluray/disc/disc.c
|
||||||
|
@@ -348,7 +348,7 @@ BD_DISC *disc_open(const char *device_path,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct dec_dev dev = { p->fs_handle, p->pf_file_open_bdrom, p, (file_openFp)disc_open_path, p->disc_root, device_path };
|
||||||
|
- p->dec = dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write);
|
||||||
|
+ p->dec = libbluray_dec_init(&dev, enc_info, keyfile_path, regs, psr_read, psr_write);
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/lib/threads/libjxl_threads.pc.in b/lib/threads/libjxl_threads.pc.in
|
||||||
|
index dfbaa3f..2c7bfe8 100644
|
||||||
|
--- a/lib/threads/libjxl_threads.pc.in
|
||||||
|
+++ b/lib/threads/libjxl_threads.pc.in
|
||||||
|
@@ -8,6 +8,6 @@ Description: JPEG XL multi-thread runner using std::threads.
|
||||||
|
Version: @JPEGXL_LIBRARY_VERSION@
|
||||||
|
@JPEGXL_REQUIRES_TYPE@: @JPEGXL_THREADS_LIBRARY_REQUIRES@
|
||||||
|
Libs: -L${libdir} -ljxl_threads
|
||||||
|
-Libs.private: -lm
|
||||||
|
+Libs.private: -lm @PKGCONFIG_CXX_LIB@
|
||||||
|
Cflags: -I${includedir}
|
||||||
|
Cflags.private: -DJXL_THREADS_STATIC_DEFINE
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
diff --git a/libssh.pc.cmake b/libssh.pc.cmake
|
||||||
|
index f288b94..438ca38 100644
|
||||||
|
--- a/libssh.pc.cmake
|
||||||
|
+++ b/libssh.pc.cmake
|
||||||
|
@@ -6,5 +6,5 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||||
|
Name: @PROJECT_NAME@
|
||||||
|
Description: The SSH Library
|
||||||
|
Version: @PROJECT_VERSION@
|
||||||
|
-Libs: -L${libdir} -lssh
|
||||||
|
+Libs: -L${libdir} -lssh -lcrypto -lz
|
||||||
|
Cflags: -I${includedir}
|
||||||
Reference in New Issue
Block a user