-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update FFmpeg with AV1 and rist support
Adds libaom for AV1 encoding support as well as librist as additional streaming protocol. Also adds FFmpeg patches for HLS streaming and additional CPU levels for libaom. Meson was added to list of build-time dependencies as librist requires it.
- Loading branch information
Showing
36 changed files
with
1,581 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
env: | ||
MACOSX_DEPLOYMENT_TARGET_X86_64: '10.13' | ||
MACOSX_DEPLOYMENT_TARGET_ARM64: '11.0' | ||
CACHE_REVISION: '05' | ||
CACHE_REVISION: '09' | ||
LIBPNG_VERSION: '1.6.37' | ||
LIBPNG_HASH: '505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca' | ||
LIBOPUS_VERSION: '1.3.1-93-gdfd6c88a' | ||
|
@@ -33,6 +33,8 @@ jobs: | |
LIBVORBIS_HASH: 'b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b' | ||
LIBVPX_VERSION: '1.10.0' | ||
LIBVPX_HASH: '85803ccbdbdd7a3b03d930187cb055f1353596969c1f92ebec2db839fa4f834a' | ||
LIBAOM_VERSION: '3.2.0' | ||
LIBAOM_HASH: '287164de79516c25c8c84fd544f67752c170082a' | ||
LIBX264_VERSION: 'r3059' | ||
LIBX264_HASH: 'b684ebe04a6f80f8207a57940a1fa00e25274f81' | ||
LIBTHEORA_VERSION: '1.1.1' | ||
|
@@ -43,8 +45,10 @@ jobs: | |
MBEDTLS_HASH: '35d8d87509cd0d002bddbd5508b9d2b931c5e83747d087234cc7ad551d53fe05' | ||
LIBSRT_VERSION: '1.4.1' | ||
LIBSRT_HASH: 'e80ca1cd0711b9c70882c12ec365cda1ba852e1ce8acd43161a21a04de0cbf14' | ||
FFMPEG_VERSION: '4.2.3' | ||
FFMPEG_HASH: '9df6c90aed1337634c1fb026fb01c154c29c82a64ea71291ff2da9aacb9aad31' | ||
LIBRIST_VERSION: '0.2.6' | ||
LIBRIST_HASH: '88b35b86af1ef3d306f33674f2d9511a27d3ff4ec76f20d3a3b3273b79a4521d' | ||
FFMPEG_VERSION: '4.4.1' | ||
FFMPEG_HASH: 'eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02' | ||
SPEEXDSP_VERSION: '1.2.0' | ||
SPEEXDSP_HASH: 'd7032f607e8913c019b190c2bccc36ea73fc36718ee38b5cdfc4e4c0a04ce9a4' | ||
LIBJANSSON_VERSION: '2.13.1' | ||
|
@@ -104,7 +108,22 @@ jobs: | |
brew bundle --file "CI/include/Brewfile" | ||
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH | ||
FFMPEG_DEP_HASH="$(echo "${{ env.LIBPNG_VERSION }}-${{ env.LIBLAME_VERSION }}-${{ env.LIBOGG_VERSION }}-${{ env.LIBVORBIS_VERSION }}-${{ env.LIBVPX_VERSION }}-${{ env.LIBOPUS_VERSION }}-${{ env.LIBX264_VERSION }}-${{ env.LIBSRT_VERSION }}-${{ env.LIBMBEDTLS_VERSION }}-${{ env.LIBTHEORA_VERSION }}" | sha256sum | cut -d " " -f 1)" | ||
FFMPEG_DEPS=(\ | ||
"${{ env.LIBPNG_VERSION }}" \ | ||
"${{ env.LIBLAME_VERSION }}" \ | ||
"${{ env.LIBOGG_VERSION }}" \ | ||
"${{ env.LIBVORBIS_VERSION }}" \ | ||
"${{ env.LIBVPX_VERSION }}" \ | ||
"${{ env.LIBOPUS_VERSION }}" \ | ||
"${{ env.LIBAOM_VERSION }}" \ | ||
"${{ env.LIBX264_VERSION }}" \ | ||
"${{ env.LIBSRT_VERSION }}" \ | ||
"${{ env.LIBRIST_VERSION }}" \ | ||
"${{ env.MBEDTLS_VERSION }}" \ | ||
"${{ env.LIBTHEORA_VERSION }}" | ||
) | ||
FFMPEG_DEP_HASH="$(echo "${FFMPEG_DEPS}" | sha256sum | cut -d " " -f 1)" | ||
echo "FFMPEG_DEP_HASH=$FFMPEG_DEP_HASH" >> $GITHUB_ENV | ||
- name: 'Restore ffmpeg dependencies from cache' | ||
|
@@ -119,20 +138,22 @@ jobs: | |
${{ github.workspace }}/macos_build_temp/libogg-${{ env.LIBOGG_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/libvorbis-${{ env.LIBVORBIS_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/libvpx-${{ env.LIBVPX_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/aom-${{ env.LIBAOM_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/x264-${{ env.LIBX264_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/libtheora-${{ env.LIBTHEORA_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/lame-${{ env.LIBLAME_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/mbedtls-mbedtls-${{ env.MBEDTLS_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/librist-v${{ env.LIBRIST_VERSION }} | ||
${{ github.workspace }}/macos_build_temp/srt-${{ env.LIBSRT_VERSION }} | ||
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.FFMPEG_DEP_HASH }} | ||
|
||
- name: 'Build dependency libpng' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit != 'true' | ||
run: CI/macos/build_libpng.sh -a ${{ matrix.arch }} | ||
run: CI/macos/build_libpng.sh -s -a ${{ matrix.arch }} | ||
|
||
- name: 'Install dependency libpng' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit == 'true' | ||
run: CI/macos/build_libpng.sh -a ${{ matrix.arch }} --install | ||
run: CI/macos/build_libpng.sh -s -a ${{ matrix.arch }} --install | ||
|
||
- name: 'Build dependency libopus' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit != 'true' | ||
|
@@ -174,6 +195,14 @@ jobs: | |
if: steps.ffmpeg-deps-cache.outputs.cache-hit == 'true' | ||
run: CI/macos/build_libx264.sh -s -a ${{ matrix.arch }} --install | ||
|
||
- name: 'Build dependency libaom' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit != 'true' | ||
run: CI/macos/build_libaom.sh -s -a ${{ matrix.arch }} | ||
|
||
- name: 'Install dependency libaom' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit == 'true' | ||
run: CI/macos/build_libaom.sh -s -a ${{ matrix.arch }} --install | ||
|
||
- name: 'Build dependency libtheora' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit != 'true' | ||
run: CI/macos/build_libtheora.sh -s -a ${{ matrix.arch }} | ||
|
@@ -206,6 +235,14 @@ jobs: | |
if: steps.ffmpeg-deps-cache.outputs.cache-hit == 'true' | ||
run: CI/macos/build_libsrt.sh -s -a ${{ matrix.arch }} --install | ||
|
||
- name: 'Build dependency librist' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit != 'true' | ||
run: CI/macos/build_librist.sh -s -a ${{ matrix.arch }} | ||
|
||
- name: 'Install dependency librist' | ||
if: steps.ffmpeg-deps-cache.outputs.cache-hit == 'true' | ||
run: CI/macos/build_librist.sh -s -a ${{ matrix.arch }} --install | ||
|
||
- name: 'Restore ffmpeg from cache' | ||
id: ffmpeg-cache | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#!/bin/bash | ||
|
||
############################################################################## | ||
# macOS libaom build script | ||
############################################################################## | ||
# | ||
# This script file can be included in build scripts for macOS or run directly | ||
# | ||
############################################################################## | ||
|
||
# Halt on errors | ||
set -eE | ||
|
||
_build_product() { | ||
cd "${PRODUCT_FOLDER}" | ||
|
||
step "Configure ("${ARCH}")..." | ||
if [ "${CURRENT_ARCH}" = "arm64" ]; then | ||
_DISABLE_CPU_DETECT="-DCONFIG_RUNTIME_CPU_DETECT=0" | ||
fi | ||
|
||
cmake -S . -B build_${ARCH} -G Ninja ${CMAKE_CCACHE_OPTIONS} \ | ||
-DCMAKE_INSTALL_PREFIX="${BUILD_DIR}" \ | ||
-DCMAKE_PREFIX_PATH="${BUILD_DIR}" \ | ||
-DCMAKE_OSX_ARCHITECTURES="${CMAKE_ARCHS}" \ | ||
-DAOM_TARGET_CPU="${ARCH}" \ | ||
-DENABLE_DOCS=OFF \ | ||
-DENABLE_EXAMPLES=OFF \ | ||
-DENABLE_TESTDATA=OFF \ | ||
-DENABLE_TESTS=OFF \ | ||
-DENABLE_TOOLS=OFF \ | ||
-DBUILD_SHARED_LIBS=OFF \ | ||
${_DISABLE_CPU_DETECT} \ | ||
${QUIET:+-Wno-deprecated -Wno-dev --log-level=ERROR} | ||
|
||
step "Compile ("${ARCH}")..." | ||
cmake --build build_${ARCH} --config "Release" | ||
} | ||
|
||
_install_product() { | ||
cd "${PRODUCT_FOLDER}" | ||
|
||
step "Install ("${ARCH}").." | ||
cmake --install build_${ARCH} --config "Release" | ||
} | ||
|
||
_build_setup_aom() { | ||
trap "caught_error 'build-libaom'" ERR | ||
|
||
ensure_dir "${CHECKOUT_DIR}/macos_build_temp" | ||
|
||
step "Git checkout..." | ||
mkdir -p "${PRODUCT_REPO}-${PRODUCT_VERSION:-${CI_PRODUCT_VERSION}}" | ||
cd "${PRODUCT_REPO}-${PRODUCT_VERSION:-${CI_PRODUCT_VERSION}}" | ||
|
||
if [ -d "./.git" ]; then | ||
info "Repository ${PRODUCT_REPO} already exists, updating..." | ||
git config advice.detachedHead false | ||
git config remote.origin.url "https://aomedia.googlesource.com/${PRODUCT_REPO}.git" | ||
git config remote.origin.fetch "+refs/heads/master:refs/remotes/origin/master" | ||
git config remote.origin.tapOpt --no-tags | ||
|
||
if ! git rev-parse -q --verify "${PRODUCT_HASH:-${CI_PRODUCT_HASH}}^{commit}"; then | ||
git fetch origin | ||
fi | ||
|
||
git checkout -f "${PRODUCT_HASH:-${CI_PRODUCT_HASH}}" -- | ||
git reset --hard "${PRODUCT_HASH:-${CI_PRODUCT_HASH}}" -- | ||
if [ -d "./.gitmodules" ]; then | ||
git submodule foreach --recursive git submodule sync | ||
git submodule update --init --recursive | ||
fi | ||
else | ||
git clone "https://aomedia.googlesource.com/${PRODUCT_REPO}.git" "$(pwd)" | ||
git config advice.detachedHead false | ||
info "Checking out commit ${PRODUCT_HASH:-${CI_PRODUCT_HASH}}..." | ||
git checkout -f "${PRODUCT_HASH:-${CI_PRODUCT_HASH}}" -- | ||
|
||
if [ -d "./.gitmodules" ]; then | ||
git submodule foreach --recursive git submodule sync | ||
git submodule update --init --recursive | ||
fi | ||
fi | ||
} | ||
|
||
build-libaom-main() { | ||
PRODUCT_NAME="${PRODUCT_NAME:-libaom}" | ||
|
||
if [ -z "${_RUN_OBS_BUILD_SCRIPT}" ]; then | ||
CHECKOUT_DIR="$(/usr/bin/git rev-parse --show-toplevel)" | ||
source "${CHECKOUT_DIR}/CI/include/build_support.sh" | ||
source "${CHECKOUT_DIR}/CI/include/build_support_macos.sh" | ||
|
||
_check_parameters $* | ||
_build_checks | ||
fi | ||
|
||
PRODUCT_REPO="aom" | ||
PRODUCT_PROJECT="libaom" | ||
PRODUCT_FOLDER="${PRODUCT_REPO}-${PRODUCT_VERSION:-${CI_PRODUCT_VERSION}}" | ||
|
||
if [ -z "${INSTALL}" ]; then | ||
_add_ccache_to_path | ||
_build_setup_aom | ||
_build | ||
else | ||
_install_product | ||
fi | ||
} | ||
|
||
build-libaom-main $* |
Oops, something went wrong.