Skip to content

Commit 16ffc4b

Browse files
committed
build: Introduce applying patches to the build system
This is ususual, but this is one of the easiest way to build and distribute ffmpeg.
1 parent 4e332fd commit 16ffc4b

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ cat <<EOF >"$BUILD_SCRIPT"
6666
git clone --filter=blob:none --branch='$GIT_BRANCH' '$FFMPEG_REPO' ffmpeg
6767
cd ffmpeg
6868
69+
# Apply FFmpeg patches
70+
find /ffbuild/patches/ffmpeg/ -name '*.patch' -exec git am {} +
71+
6972
./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS $FF_CONFIGURE \
7073
--extra-cflags='$FF_CFLAGS' --extra-cxxflags='$FF_CXXFLAGS' \
7174
--extra-ldflags='$FF_LDFLAGS' --extra-ldexeflags='$FF_LDEXEFLAGS' --extra-libs='$FF_LIBS' \
@@ -76,7 +79,7 @@ EOF
7679

7780
[[ -t 1 ]] && TTY_ARG="-t" || TTY_ARG=""
7881

79-
docker run --rm -i $TTY_ARG "${UIDARGS[@]}" -v $PWD/ffbuild:/ffbuild -v "$BUILD_SCRIPT":/build.sh "$IMAGE" bash /build.sh
82+
docker run --rm -i $TTY_ARG "${UIDARGS[@]}" -v $PWD/ffbuild:/ffbuild -v "$BUILD_SCRIPT":/build.sh -v $PWD/patches/:/ffbuild/patches "$IMAGE" bash /build.sh
8083

8184
mkdir -p artifacts
8285
ARTIFACTS_PATH="$PWD/artifacts"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
From 2611a9a0e3d96ba7d63549c6b57a821046ddd6bd Mon Sep 17 00:00:00 2001
2+
From: Christopher Degawa <ccom@randomderp.com>
3+
Date: Mon, 6 Dec 2021 22:48:22 -0600
4+
Subject: [PATCH] libvmaf: add aom_ctc option
5+
6+
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
7+
---
8+
libavfilter/vf_libvmaf.c | 11 +++++++++++
9+
1 file changed, 11 insertions(+)
10+
11+
diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
12+
index 2586f37d99..ad52bd2a51 100644
13+
--- a/libavfilter/vf_libvmaf.c
14+
+++ b/libavfilter/vf_libvmaf.c
15+
@@ -58,6 +58,7 @@ typedef struct LIBVMAFContext {
16+
unsigned model_cnt;
17+
unsigned frame_cnt;
18+
unsigned bpc;
19+
+ int aom_ctc;
20+
} LIBVMAFContext;
21+
22+
#define OFFSET(x) offsetof(LIBVMAFContext, x)
23+
@@ -78,6 +79,7 @@ static const AVOption libvmaf_options[] = {
24+
{"enable_conf_interval", "model='enable_conf_interval=true'.", OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS|AV_OPT_FLAG_DEPRECATED},
25+
{"model", "Set the model to be used for computing vmaf.", OFFSET(model_cfg), AV_OPT_TYPE_STRING, {.str="version=vmaf_v0.6.1"}, 0, 1, FLAGS},
26+
{"feature", "Set the feature to be used for computing vmaf.", OFFSET(feature_cfg), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS},
27+
+ {"aom_ctc", "Set the options for aom_ctc v1.0", OFFSET(aom_ctc), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
28+
{ NULL }
29+
};
30+
31+
@@ -526,6 +528,15 @@ static av_cold int init(AVFilterContext *ctx)
32+
if (err)
33+
return err;
34+
35+
+ if (s->aom_ctc) {
36+
+ av_free(s->model_cfg);
37+
+ av_free(s->feature_cfg);
38+
+ s->model_cfg = av_strdup(
39+
+ "version=vmaf_v0.6.1:name=vmaf|version=vmaf_v0.6.1neg:name=vmaf_neg");
40+
+ s->feature_cfg = av_strdup(
41+
+ "name=psnr:reduced_hbd_peak=true:enable_apsnr=true:min_sse=0.5|"
42+
+ "name=float_ssim:enable_db=true:clip_db=true");
43+
+ }
44+
err = parse_models(ctx);
45+
if (err)
46+
return err;
47+
--
48+
2.39.2
49+

0 commit comments

Comments
 (0)