From 23b4cea876be181626367013a3762e14c55bd733 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Mon, 10 Mar 2025 19:20:27 -0400 Subject: [PATCH] patch ffmpeg for svt-av1 3.0.0 --- Dockerfile | 7 ++++++- Dockerfile.aarch64 | 13 +++++++++---- ffmpeg_n7_fix.patch | 13 +++++++++++++ 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 ffmpeg_n7_fix.patch diff --git a/Dockerfile b/Dockerfile index 527fcf9..7b5826a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -898,10 +898,15 @@ RUN \ curl -Lf \ https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2 | \ tar -jx --strip-components=1 -C /tmp/ffmpeg + +# Apply patch for svt-av1: https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2249#note_2361478864 +COPY /ffmpeg_n7_fix.patch /tmp/ffmpeg/ + RUN \ echo "**** compiling ffmpeg ****" && \ cd /tmp/ffmpeg && \ - ./configure \ + patch -p1 < ffmpeg_n7_fix.patch && \ + ./configure \ --disable-debug \ --disable-doc \ --disable-ffplay \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 3bdacde..fcbf58e 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -615,10 +615,15 @@ RUN \ curl -Lf \ https://ffmpeg.org/releases/ffmpeg-${FFMPEG}.tar.bz2 | \ tar -jx --strip-components=1 -C /tmp/ffmpeg -RUN \ - echo "**** compiling ffmpeg ****" && \ - cd /tmp/ffmpeg && \ - ./configure \ + + # Apply patch for svt-av1: https://gitlab.com/AOMediaCodec/SVT-AV1/-/issues/2249#note_2361478864 + COPY /ffmpeg_n7_fix.patch /tmp/ffmpeg/ + + RUN \ + echo "**** compiling ffmpeg ****" && \ + cd /tmp/ffmpeg && \ + patch -p1 < ffmpeg_n7_fix.patch && \ + ./configure \ --disable-debug \ --disable-doc \ --disable-ffplay \ diff --git a/ffmpeg_n7_fix.patch b/ffmpeg_n7_fix.patch new file mode 100644 index 0000000..1c876a5 --- /dev/null +++ b/ffmpeg_n7_fix.patch @@ -0,0 +1,13 @@ +diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c +index 8fa42d590b..e99c656c5d 100644 +--- a/libavcodec/libsvtav1.c ++++ b/libavcodec/libsvtav1.c +@@ -430,7 +430,7 @@ static av_cold int eb_enc_init(AVCodecContext *avctx) + + svt_enc->eos_flag = EOS_NOT_REACHED; + +- svt_ret = svt_av1_enc_init_handle(&svt_enc->svt_handle, svt_enc, &svt_enc->enc_params); ++ svt_ret = svt_av1_enc_init_handle(&svt_enc->svt_handle, &svt_enc->enc_params); + if (svt_ret != EB_ErrorNone) { + return svt_print_error(avctx, svt_ret, "Error initializing encoder handle"); + }