Skip to content

Commit

Permalink
macos: Switch to git for FFmpeg
Browse files Browse the repository at this point in the history
Allows cherry picking in the future and aligns implementation with
Windows.

Co-authored-by: PatTheMav <[email protected]>
Co-authored-by: pkv <[email protected]>
  • Loading branch information
2 people authored and RytoEX committed Jan 1, 2022
1 parent 24cd40e commit 15072cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
LIBRIST_VERSION: '0.2.7'
LIBRIST_HASH: '0b1aaf995c4cad83d562ec7887180cc6ee132c84'
FFMPEG_VERSION: '4.4.1'
FFMPEG_HASH: 'eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02'
FFMPEG_HASH: 'cc33e73618a981de7fd96385ecb34719de031f16'
SPEEXDSP_VERSION: '1.2.0'
SPEEXDSP_HASH: 'd7032f607e8913c019b190c2bccc36ea73fc36718ee38b5cdfc4e4c0a04ce9a4'
LIBJANSSON_VERSION: '2.13.1'
Expand Down
2 changes: 1 addition & 1 deletion CI/build-deps-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ REQUIRED_DEPS=(
"mbedtls 2.26.0 35d8d87509cd0d002bddbd5508b9d2b931c5e83747d087234cc7ad551d53fe05"
"libsrt 1.4.1 e80ca1cd0711b9c70882c12ec365cda1ba852e1ce8acd43161a21a04de0cbf14"
"librist 0.2.7 0b1aaf995c4cad83d562ec7887180cc6ee132c84"
"ffmpeg 4.4.1 eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02"
"ffmpeg 4.4.1 cc33e73618a981de7fd96385ecb34719de031f16"
"speexdsp 1.2.0 d7032f607e8913c019b190c2bccc36ea73fc36718ee38b5cdfc4e4c0a04ce9a4"
"libjansson 2.13.1 f4f377da17b10201a60c1108613e78ee15df6b12016b116b6de42209f47a474f"
"libluajit 2.1 ec6edc5c39c25e4eb3fca51b753f9995e97215da"
Expand Down
22 changes: 14 additions & 8 deletions CI/macos/build_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,23 @@ _patch_product() {
cd "${PRODUCT_FOLDER}"

step "Apply patches..."
# apply flv, hls, aom patch
apply_patch "${CHECKOUT_DIR}/CI/patches/FFmpeg-9010.patch" "97ac6385c2b7a682360c0cfb3e311ef4f3a48041d3f097d6b64f8c13653b6450"
apply_patch "${CHECKOUT_DIR}/CI/patches/FFmpeg-4.4.1-OBS.patch" "710fb5a381f7b68c95dcdf865af4f3c63a9405c305abef55d24c7ab54e90b182"
# The librist patch consists in these 2 commits which haven't been backported to FFmpeg 4.1 :
# [1] avformat/librist: replace deprecated functions
# The librist patch consists in these 3 commits which haven't been backported to FFmpeg 4.4 :
# [1] avformat/internal: Move ff_read_line_to_bprint_overwrite to avio_internal.h
# https://github.com/FFmpeg/FFmpeg/commit/fd101c9c3bcdeb2d74274aaeaa968fe8ead3622d#diff-bc82665cda5e82b13bcd3e1ee74d820952d80acba839ac46ffed3f0785644200
# [2] avformat/librist: replace deprecated functions
# https://github.com/FFmpeg/FFmpeg/commit/5274f2f7f8c5e40d18b84055fbb232752bd24f2f#diff-bc82665cda5e82b13bcd3e1ee74d820952d80acba839ac46ffed3f0785644200
# [2] avformat/librist: correctly initialize logging_settings
# [3] avformat/librist: correctly initialize logging_settings
# https://github.com/FFmpeg/FFmpeg/commit/9b15f43cf8c7976fba115da686a990377f7b5ab9
# The following is an important patch submitted by librist devs, but not yet merged into FFmpeg master
# [3] avformat/librist: allow setting fifo size and fail on overflow.
# [4] avformat/librist: allow setting fifo size and fail on overflow.
# http://ffmpeg.org/pipermail/ffmpeg-devel/2021-November/287914.html
apply_patch "${CHECKOUT_DIR}/CI/patches/FFmpeg-4.4.1-libaomenc.patch" "AEDBA40CEA296D73CBF8BFC6365C0D93237F9177986B96B07C1D2C4C5CFB896C"
apply_patch "${CHECKOUT_DIR}/CI/patches/FFmpeg-4.4.1-librist.patch" "1B95F21375421830263A73C74B80852E60EFE10991513CFCC8FB7CBE066887F5"
git add .
git commit -m "OBS patches for flvenc, hlsenc, aomenc & librist"
}

_fixup_ffmpeg_libs() {
Expand Down Expand Up @@ -155,14 +161,14 @@ build-ffmpeg-main() {
_build_checks
fi

PRODUCT_URL="https://ffmpeg.org/releases/ffmpeg-${PRODUCT_VERSION:-${CI_PRODUCT_VERSION}}.tar.xz"
PRODUCT_FILENAME="$(basename "${PRODUCT_URL}")"
PRODUCT_FOLDER="${PRODUCT_FILENAME%.*.*}"
PRODUCT_PROJECT="FFmpeg"
PRODUCT_REPO="ffmpeg"
PRODUCT_FOLDER="${PRODUCT_REPO}-${PRODUCT_VERSION:-${CI_PRODUCT_VERSION}}"

if [ -z "${INSTALL}" ]; then
_add_ccache_to_path

_build_setup
_build_setup_git
_build
else
_install_product
Expand Down

0 comments on commit 15072cd

Please sign in to comment.