diff --git a/README.md b/README.md index f7e0d6a..9500006 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,12 @@ The default enabled libraries included in the `ffmpeg` build are: - libx265 - libwebp - libvpx +- libass - libvorbis - libmp3lame The user-overridable compile options are: -- `ENABLE`: configure what ffmpeg enables (default: libsvtav1_psy libopus libdav1d libaom librav1e libvmaf libx264 libx265 libwebp libvpx libvorbis libmp3lame) +- `ENABLE`: configure what ffmpeg enables (default: libsvtav1_psy libopus libdav1d libaom librav1e libvmaf libx264 libx265 libwebp libvpx libass libvorbis libmp3lame) - `PREFIX`: prefix to install to, default is local install in ./gitignore/sysroot (default: local) - `STATIC`: static or shared build (default: ON) - `LTO`: enable link time optimization (default: ON) @@ -80,7 +81,7 @@ encode -i input [options] output [-v] print relevant version info [-s] use same container as input, default is convert to mkv - [output] if unset, defaults to ${HOME}/av1-input-file-name.mkv + [output] if unset, defaults to ${PWD}/av1-input-file-name.mkv [-u] update script (git pull ffmpeg-builder) [-I] system install at /usr/local/bin/encode @@ -109,6 +110,7 @@ Example usage: ## Estimate film-grain ```bash efg -i input [options] + [-P NUM] set preset (default: 10) [-l NUM] low value (default: 0) [-s NUM] step value (default: 1) [-h NUM] high value (default: 30) diff --git a/lib/build.sh b/lib/build.sh index 99516d8..1dc2294 100644 --- a/lib/build.sh +++ b/lib/build.sh @@ -367,8 +367,13 @@ glad 2.0.8 tar.gz https://github.com/Dav1dde/glad/archive libx265 4.1 tar.gz https://bitbucket.org/multicoreware/x265_git/downloads/x265_${ver}.${ext} libnuma libnuma 2.0.19 tar.gz https://github.com/numactl/numactl/archive/refs/tags/v${ver}.${ext} -' +libass 0.17.4 tar.xz https://github.com/libass/libass/releases/download/${ver}/libass-${ver}.${ext} freetype,fribidi,libunibreak +freetype 2.14.1 tar.xz https://downloads.sourceforge.net/freetype/freetype-${ver}.${ext} libpng,harfbuzz +harfbuzz 12.3.0 tar.xz https://github.com/harfbuzz/harfbuzz/releases/download/${ver}/harfbuzz-${ver}.${ext} +fribidi 1.0.16 tar.xz https://github.com/fribidi/fribidi/releases/download/v${ver}/fribidi-${ver}.${ext} +libunibreak 6.1 tar.gz https://github.com/adah1972/libunibreak/releases/download/libunibreak_${ver//./_}/libunibreak-${ver}.${ext} +' local supported_builds=() unset ver ext url deps extractedDir while read -r line; do @@ -452,7 +457,7 @@ download_release() { continue fi test -d "${alreadyBuilt}" || continue - echo_warn "removing wrong version: ${extractedDir}" + echo_warn "removing wrong version: ${alreadyBuilt}" rm -rf "${alreadyBuilt}" done @@ -916,8 +921,8 @@ build_libplacebo() { # copy downloaded glad release as "submodule" ( installDir="${PWD}/3rdparty/glad" - get_build_conf glad - CLEAN=OFF download_release + get_build_conf glad || exit 1 + CLEAN=OFF download_release || exit 1 cd "${extractedDir}" || exit 1 cp -r ./* "${installDir}" ) || return 1 @@ -959,6 +964,31 @@ build_libvmaf() { fi } +build_libass() { + meta_meson_build || return 1 + sanitize_sysroot_libs libass || return 1 +} + +build_freetype() { + meta_meson_build \ + -D tests=disabled || return 1 + sanitize_sysroot_libs libfreetype || return 1 +} + +build_harfbuzz() { + meta_meson_build \ + -D tests=disabled \ + -D docs=disabled \ + -D doc_tests=false || return 1 + sanitize_sysroot_libs libharfbuzz || return 1 +} + +build_fribidi() { + meta_meson_build \ + -D tests=false || return 1 + sanitize_sysroot_libs libfribidi || return 1 +} + ### PYTHON ### build_glad() { true @@ -1047,6 +1077,11 @@ build_libnuma() { sanitize_sysroot_libs libnuma || return 1 } +build_libunibreak() { + meta_configure_build || return 1 + sanitize_sysroot_libs libunibreak || return 1 +} + add_project_versioning_to_ffmpeg() { # embed this project's enables/versions # into ffmpeg with FFMPEG_BUILDER_INFO diff --git a/lib/compile_opts.sh b/lib/compile_opts.sh index c8872d8..f74cc02 100644 --- a/lib/compile_opts.sh +++ b/lib/compile_opts.sh @@ -41,6 +41,7 @@ libx264 \ libx265 \ libwebp \ libvpx \ +libass \ libvorbis \ libmp3lame\ " diff --git a/lib/encode.sh b/lib/encode.sh index ff8983b..604ceb1 100644 --- a/lib/encode.sh +++ b/lib/encode.sh @@ -154,7 +154,7 @@ encode_usage() { 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 \${HOME}/av1-input-file-name.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}" @@ -271,7 +271,7 @@ set_encode_opts() { OUTPUT="${*: -1}" else local basename="$(bash_basename "${INPUT}")" - OUTPUT="${HOME}/av1-${basename}" + OUTPUT="${PWD}/av1-${basename}" fi # use same container for output diff --git a/lib/install_deps.sh b/lib/install_deps.sh index 3e49e90..041f959 100644 --- a/lib/install_deps.sh +++ b/lib/install_deps.sh @@ -68,11 +68,13 @@ print_req_pkgs() { build-essential libssl-dev gobjc++ mawk libc6-dev mediainfo ninja-build mkvtoolnix libgtest-dev lld + libfontconfig-dev libglib2.0-dev ) # shellcheck disable=SC2034 local pacman_pkgs=( "${common_linux_pkgs[@]}" base-devel python-pipx ninja lld mkvtoolnix-cli + glib2-devel ) # shellcheck disable=SC2034 local dnf_pkgs=( @@ -82,7 +84,7 @@ print_req_pkgs() { libstdc++-static libstdc++-devel llvm-cmake-utils llvm-devel llvm-static compiler-rt lld - mkvtoolnix + mkvtoolnix glib2-static ) # shellcheck disable=SC2034 local pkg_pkgs=(